public ColumnDef(final String label, final String... categories) { setLabel(label); for (final String category : categories) { addCategory(category); } }
public RowDef(final String label, final String... categories) { setLabel(label); for (final String category : categories) { addCategory(category); } }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); views = new Views();
@Override public SurveillanceStatus[][] doInTransaction(TransactionStatus transactionStatus) { final SurveillanceStatus[][] cellStatus = new SurveillanceStatus[view.getRows().size()][view.getColumns().size()]; for (int rowIndex = 0; rowIndex < view.getRows().size(); rowIndex++) { for (int colIndex = 0; colIndex < view.getColumns().size(); colIndex++) { final Collection<OnmsCategory> rowCategories = getOnmsCategoriesFromViewCategories(view.getRows().get(rowIndex).getCategories()); final Collection<OnmsCategory> columnCategories = getOnmsCategoriesFromViewCategories(view.getColumns().get(colIndex).getCategories()); final SurveillanceStatus status = m_nodeDao.findSurveillanceStatusByCategoryLists(rowCategories, columnCategories); cellStatus[rowIndex][colIndex] = status; } } return cellStatus; } });
/** * Returns the {@link View} for the given title. * * @param name the title to search for * @return the {@link View} instance if found, null otherwise */ public synchronized View getView(String name) { for (final View view : m_surveillanceViewConfiguration.getViews()) { if (view.getName().equals(name)) { return view; } } return null; }
@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()); }
/** {@inheritDoc} */ @Override public Integer getHeaderRefreshSeconds(final String viewName) { return m_surveillanceConfigDao.getView(viewName == null ? m_surveillanceConfigDao.getDefaultView().getName() : viewName).getRefreshSeconds(); }
private List<View> getViewList() { return m_config.getViews(); }
/** * Returns the default {@link View}. * * @return the {@link View} instance if found, null otherwise */ public synchronized View getDefaultView() { final String defaultView = m_surveillanceViewConfiguration.getDefaultView(); return getView(defaultView); }
public Category(final String name) { setName(name); }
public void addCategory(final String category) { m_categories.add(new Category(category)); }
/** * Checks whether this object contains {@link View} data concerning the given title. * * @param name the title to search for * @return true, if a {@link View} with the given name exists, false otherwise */ public synchronized boolean containsView(String name) { for (View view : m_surveillanceViewConfiguration.getViews()) { if (view.getName().equals(name)) { return true; } } return false; }
@Override public Set<String> getCategoryNames() { return getCategories().stream().map(cat -> { return cat.getName(); }).collect(Collectors.toSet()); }
/** * Checks whether this object contains a given {@link View} instance. * * @param view the {@link View} instance to search for * @return true, if the {@link View} exists, false otherwise */ public synchronized boolean containsView(View view) { return m_surveillanceViewConfiguration.getViews().contains(view); }
/** * Returns the default {@link View}. * * @return the {@link View} instance if found, null otherwise */ public synchronized View getDefaultView() { final String defaultView = m_surveillanceViewConfiguration.getDefaultView(); return getView(defaultView); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Views views = new Views();
/** * Checks whether this object contains {@link View} data concerning the given title. * * @param name the title to search for * @return true, if a {@link View} with the given name exists, false otherwise */ public synchronized boolean containsView(String name) { for (View view : m_surveillanceViewConfiguration.getViews()) { if (view.getName().equals(name)) { return true; } } return false; }
/** * Checks whether this object contains a given {@link View} instance. * * @param view the {@link View} instance to search for * @return true, if the {@link View} exists, false otherwise */ public synchronized boolean containsView(View view) { return m_surveillanceViewConfiguration.getViews().contains(view); }
/** * Returns the {@link View} for the given title. * * @param name the title to search for * @return the {@link View} instance if found, null otherwise */ public synchronized View getView(String name) { for (final View view : m_surveillanceViewConfiguration.getViews()) { if (view.getName().equals(name)) { return view; } } return null; }