private Set<OnmsCategory> getOnmsCategoriesFromViewCategories(final Collection<Category> viewCats) { final Set<OnmsCategory> categories = new HashSet<OnmsCategory>(); for (final Category viewCat : viewCats) { final OnmsCategory category = m_categoryDao.findByName(viewCat.getName()); if (category == null) throw new ObjectRetrievalFailureException(OnmsCategory.class, viewCat.getName(), "Unable to locate OnmsCategory named: "+viewCat.getName()+" as specified in the surveillance view configuration file", null); categories.add(category); } return categories; }
private Set<OnmsCategory> getOnmsCategoriesFromViewCategories(final Collection<Category> viewCats) { final Set<OnmsCategory> categories = new HashSet<OnmsCategory>(); for (final Category viewCat : viewCats) { final OnmsCategory category = m_categoryDao.findByName(viewCat.getName()); if (category == null) throw new ObjectRetrievalFailureException(OnmsCategory.class, viewCat.getName(), "Unable to locate OnmsCategory named: "+viewCat.getName()+" as specified in the surveillance view configuration file", null); categories.add(category); } return categories; }
@Override public Set<OnmsCategory> doInTransaction(TransactionStatus transactionStatus) { final Set<OnmsCategory> categories = new HashSet<OnmsCategory>(); for (final Category viewCat : viewCats) { final OnmsCategory category = m_categoryDao.findByName(viewCat.getName()); if (category == null) { throw new ObjectRetrievalFailureException(OnmsCategory.class, viewCat.getName(), "Unable to locate OnmsCategory named: " + viewCat.getName() + " as specified in the surveillance view configuration file", null); } categories.add(category); } return categories; } });
@Override public Set<OnmsCategory> doInTransaction(TransactionStatus transactionStatus) { final Set<OnmsCategory> categories = new HashSet<OnmsCategory>(); for (final Category viewCat : viewCats) { final OnmsCategory category = m_categoryDao.findByName(viewCat.getName()); if (category == null) { throw new ObjectRetrievalFailureException(OnmsCategory.class, viewCat.getName(), "Unable to locate OnmsCategory named: " + viewCat.getName() + " as specified in the surveillance view configuration file", null); } categories.add(category); } return categories; } });
@Override public Set<String> getCategoryNames() { return getCategories().stream().map(cat -> { return cat.getName(); }).collect(Collectors.toSet()); }
@Override public boolean containsCategory(final String name) { return getCategories().stream().anyMatch(cat -> { return name.equals(cat.getName()); }); }
@Override public boolean containsCategory(final String name) { return getCategories().stream().anyMatch(cat -> { return name.equals(cat.getName()); }); }
@Override public Set<String> getCategoryNames() { return getCategories().stream().map(cat -> { return cat.getName(); }).collect(Collectors.toSet()); }