Search in sources :

Example 1 with ImportOperationsManager

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

the class CoreImportActivities method auditNodes.

@Activity(lifecycle = "import", phase = "audit", schedulingHint = "import")
public ImportOperationsManager auditNodes(final RequisitionImport ri, final String rescanExisting) {
    if (ri.isAborted()) {
        info("The import has been aborted, skipping audit phase import.");
        return null;
    }
    final Requisition specFile = ri.getRequisition();
    info("Auditing nodes for requisition {}. The parameter {} was set to {} during import.", specFile, EventConstants.PARM_IMPORT_RESCAN_EXISTING, rescanExisting);
    final String foreignSource = specFile.getForeignSource();
    final Map<String, Integer> foreignIdsToNodes = m_provisionService.getForeignIdToNodeIdMap(foreignSource);
    final ImportOperationsManager opsMgr = new ImportOperationsManager(foreignIdsToNodes, m_provisionService, rescanExisting);
    opsMgr.setForeignSource(foreignSource);
    opsMgr.auditNodes(specFile);
    debug("Finished auditing nodes.");
    return opsMgr;
}
Also used : OnmsNodeRequisition(org.opennms.netmgt.provision.persist.OnmsNodeRequisition) Requisition(org.opennms.netmgt.provision.persist.requisition.Requisition) ImportOperationsManager(org.opennms.netmgt.provision.service.operations.ImportOperationsManager) Activity(org.opennms.netmgt.provision.service.lifecycle.annotations.Activity)

Aggregations

OnmsNodeRequisition (org.opennms.netmgt.provision.persist.OnmsNodeRequisition)1 Requisition (org.opennms.netmgt.provision.persist.requisition.Requisition)1 Activity (org.opennms.netmgt.provision.service.lifecycle.annotations.Activity)1 ImportOperationsManager (org.opennms.netmgt.provision.service.operations.ImportOperationsManager)1