Search in sources :

Example 1 with ImportOperation

use of org.opennms.netmgt.provision.service.operations.ImportOperation in project opennms by OpenNMS.

the class CoreImportActivities method scanNodes.

@Activity(lifecycle = "import", phase = "scan", schedulingHint = "import")
public static void scanNodes(final Phase currentPhase, final ImportOperationsManager opsMgr, final RequisitionImport ri) {
    if (ri.isAborted()) {
        info("The import has been aborted, skipping scan phase import.");
        return;
    }
    info("Scheduling nodes for phase {}", currentPhase);
    final Collection<ImportOperation> operations = opsMgr.getOperations();
    for (final ImportOperation op : operations) {
        final LifeCycleInstance nodeScan = currentPhase.createNestedLifeCycle("nodeImport");
        debug("Created lifecycle {} for operation {}", nodeScan, op);
        nodeScan.setAttribute("operation", op);
        nodeScan.setAttribute("requisitionImport", ri);
        nodeScan.trigger();
    }
}
Also used : LifeCycleInstance(org.opennms.netmgt.provision.service.lifecycle.LifeCycleInstance) ImportOperation(org.opennms.netmgt.provision.service.operations.ImportOperation) Activity(org.opennms.netmgt.provision.service.lifecycle.annotations.Activity)

Aggregations

LifeCycleInstance (org.opennms.netmgt.provision.service.lifecycle.LifeCycleInstance)1 Activity (org.opennms.netmgt.provision.service.lifecycle.annotations.Activity)1 ImportOperation (org.opennms.netmgt.provision.service.operations.ImportOperation)1