use of org.opennms.netmgt.provision.persist.AbstractRequisitionVisitor in project opennms by OpenNMS.
the class CoreImportActivities method relateNodes.
@Activity(lifecycle = "import", phase = "relate", schedulingHint = "import")
public void relateNodes(final BatchTask currentPhase, final RequisitionImport ri) {
if (ri.isAborted()) {
info("The import has been aborted, skipping relate phase.");
return;
}
info("Running relate phase");
final Requisition requisition = ri.getRequisition();
RequisitionVisitor visitor = new AbstractRequisitionVisitor() {
@Override
public void visitNode(final OnmsNodeRequisition nodeReq) {
LOG.debug("Scheduling relate of node {}", nodeReq);
currentPhase.add(parentSetter(m_provisionService, nodeReq, requisition.getForeignSource()));
}
};
requisition.visit(visitor);
LOG.info("Finished Running relate phase");
}
Aggregations