use of org.opennms.features.topology.plugins.ncs.NCSSearchProvider.NCSHopCriteria in project opennms by OpenNMS.
the class NCSHopCriteriaHistoryOperation method applyHistory.
@Override
public void applyHistory(GraphContainer container, Map<String, String> settings) {
// Remove any existing {@link NCSHopCriteria}
Set<NCSHopCriteria> oldCriteria = Criteria.getCriteriaForGraphContainer(container, NCSHopCriteria.class);
for (NCSHopCriteria criterium : oldCriteria) {
container.removeCriteria(criterium);
}
String setting = settings.get(getClass().getName());
if (setting != null && setting.length() > 0) {
for (String idString : setting.split(DELIMITER)) {
Long id = Long.parseLong(idString);
Criteria criteria = NCSEdgeProvider.createCriteria(Collections.singletonList(id));
container.addCriteria(new NCSHopCriteria(idString, NCSSearchProvider.getVertexRefsForEdges(m_ncsEdgeProvider, criteria), m_ncsComponentRepository.get(id).getName()));
}
}
}
Aggregations