use of org.opennms.features.topology.api.topo.Criteria in project opennms by OpenNMS.
the class VEProviderGraphContainer method getSemanticZoomLevelCriteriaForContainer.
public static SemanticZoomLevelCriteria getSemanticZoomLevelCriteriaForContainer(GraphContainer graphContainer) {
Criteria[] criteria = graphContainer.getCriteria();
if (criteria != null) {
for (Criteria criterium : criteria) {
try {
return (SemanticZoomLevelCriteria) criterium;
} catch (ClassCastException e) {
}
}
}
SemanticZoomLevelCriteria hopCriteria = new SemanticZoomLevelCriteria(graphContainer.getSemanticZoomLevel());
graphContainer.addCriteria(hopCriteria);
return hopCriteria;
}
use of org.opennms.features.topology.api.topo.Criteria in project opennms by OpenNMS.
the class VEProviderGraphContainer method findCriteria.
@Override
public <T extends Criteria> Set<T> findCriteria(Class<T> criteriaType) {
Objects.requireNonNull(criteriaType);
final Set<T> criteriaSet = new HashSet<>();
for (Criteria eachCriteria : getCriteria()) {
if (criteriaType.isAssignableFrom(eachCriteria.getClass())) {
criteriaSet.add((T) eachCriteria);
}
}
return criteriaSet;
}
use of org.opennms.features.topology.api.topo.Criteria in project opennms by OpenNMS.
the class LinkdEdgeStatusProvider method getLinkdEdgeDownAlarms.
protected List<OnmsAlarm> getLinkdEdgeDownAlarms() {
org.opennms.core.criteria.Criteria criteria = new org.opennms.core.criteria.Criteria(OnmsAlarm.class);
criteria.addRestriction(new EqRestriction("uei", EventConstants.TOPOLOGY_LINK_DOWN_EVENT_UEI));
criteria.addRestriction(new NeRestriction("severity", OnmsSeverity.CLEARED));
return getAlarmDao().findMatching(criteria);
}
use of org.opennms.features.topology.api.topo.Criteria in project opennms by OpenNMS.
the class GraphPainter method visitGraph.
@Override
public void visitGraph(Graph graph) throws PaintException {
m_focusVertices.clear();
Criteria[] criterias = m_graphContainer.getCriteria();
for (Criteria criteria : criterias) {
try {
VertexHopCriteria c = (VertexHopCriteria) criteria;
m_focusVertices.addAll(c.getVertices());
} catch (ClassCastException e) {
}
}
m_statusMap.clear();
m_statusMap.putAll(graph.getVertexStatus());
m_edgeStatusMap.clear();
m_edgeStatusMap.putAll(graph.getEdgeStatus());
}
use of org.opennms.features.topology.api.topo.Criteria in project opennms by OpenNMS.
the class NCSSearchProvider method removeVertexHopCriteria.
@Override
public void removeVertexHopCriteria(SearchResult searchResult, GraphContainer container) {
Criteria criteria = NCSEdgeProvider.createCriteria(Collections.singletonList(Long.parseLong(searchResult.getId())));
container.removeCriteria(new NCSHopCriteria(searchResult.getId(), new HashSet<VertexRef>(getVertexRefsForEdges(m_ncsEdgeProvider, criteria)), searchResult.getLabel()));
if (m_serviceManager.isCriteriaRegistered(NAMESPACE, container.getSessionId())) {
m_serviceManager.unregisterCriteria(NAMESPACE, container.getSessionId());
}
}
Aggregations