use of org.opennms.netmgt.model.ncs.NCSComponentVisitor in project opennms by OpenNMS.
the class EventMappingRulesIT method findSubcomponentsOnNode.
private Set<String> findSubcomponentsOnNode(NCSComponent svc, String nodeForeignSource, String nodeForeignId) {
final Set<String> expectedIds = new HashSet<>();
final NodeIdentification nodeIdent = new NodeIdentification(nodeForeignSource, nodeForeignId);
NCSComponentVisitor visitor = new AbstractNCSComponentVisitor() {
@Override
public void visitComponent(NCSComponent component) {
if (nodeIdent.equals(component.getNodeIdentification())) {
expectedIds.add(component.getForeignSource() + ":" + component.getForeignId());
}
}
};
svc.visit(visitor);
return expectedIds;
}
Aggregations