Class Provisioner

  • All Implemented Interfaces:
    SpringServiceDaemon, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean

    public class Provisioner
    extends Object
    implements SpringServiceDaemon
    Massively Parallel Java Provisioning ServiceDaemon for OpenNMS.
    Author:
    Mathew Brozowski
    • Constructor Detail

      • Provisioner

        public Provisioner()
    • Method Detail

      • setProvisionService

        public void setProvisionService​(ProvisionService provisionService)

        setProvisionService

        Parameters:
        provisionService - a ProvisionService object.
      • setLifeCycleRepository

        public void setLifeCycleRepository​(LifeCycleRepository lifeCycleRepository)

        setLifeCycleRepository

        Parameters:
        lifeCycleRepository - a LifeCycleRepository object.
      • setImportActivities

        public void setImportActivities​(CoreImportActivities importActivities)

        setImportActivities

        Parameters:
        importActivities - the importActivities to set
      • setTaskCoordinator

        public void setTaskCoordinator​(TaskCoordinator taskCoordinator)

        setTaskCoordinator

        Parameters:
        taskCoordinator - the taskCoordinator to set
      • setAgentConfigFactory

        public void setAgentConfigFactory​(SnmpAgentConfigFactory agentConfigFactory)

        setAgentConfigFactory

        Parameters:
        agentConfigFactory - the agentConfigFactory to set
      • setMonitoringSystemDao

        public void setMonitoringSystemDao​(MonitoringSystemDao monitoringSystemDao)
      • setTracerRegistry

        public void setTracerRegistry​(TracerRegistry tracerRegistry)
      • destroy

        public void destroy()
                     throws Exception

        destroy

        Specified by:
        destroy in interface org.springframework.beans.factory.DisposableBean
        Throws:
        Exception - if any.
      • afterPropertiesSet

        public void afterPropertiesSet()
                                throws Exception

        afterPropertiesSet

        Specified by:
        afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
        Throws:
        Exception - if any.
      • scheduleRescanForExistingNodes

        protected void scheduleRescanForExistingNodes​(String monitorKey)

        scheduleRescanForExistingNodes

      • updateNodeScheduleInQueue

        protected void updateNodeScheduleInQueue​(NodeScanSchedule schedule)

        updateNodeScheduleInQueue

        Parameters:
        schedule - a NodeScanSchedule object.
      • getScheduledFutureForNode

        public ScheduledFuture<?> getScheduledFutureForNode​(int nodeId)

        getScheduledFutureForNode

        Parameters:
        nodeId - a int.
        Returns:
        a ScheduledFuture object.
      • removeNodeFromScheduleQueue

        protected void removeNodeFromScheduleQueue​(Integer nodeId)

        removeNodeFromScheduleQueue

        Parameters:
        nodeId - a Integer object.
      • removeFromScheduleQueue

        protected void removeFromScheduleQueue​(List<Integer> nodeIds)

        removeFromScheduleQueue

        Parameters:
        nodeIds - a List object.
      • checkNodeListForRemovals

        protected void checkNodeListForRemovals​(List<NodeScanSchedule> schedules)

        checkNodeListForRemovals

        Parameters:
        schedules - a List object.
      • getScheduleLength

        public int getScheduleLength()

        getScheduleLength

        Returns:
        a int.
      • importModelFromResource

        protected void importModelFromResource​(org.springframework.core.io.Resource resource,
                                               String rescanExisting)
                                        throws Exception

        importModelFromResource

        Parameters:
        resource - a Resource object.
        rescanExisting - a String object - Valid values are "true", "false" and "dbonly".
        Throws:
        Exception - if any.
      • importModelFromResource

        protected RequisitionImport importModelFromResource​(org.springframework.core.io.Resource resource,
                                                            String rescanExisting,
                                                            ProvisionMonitor monitor)
                                                     throws Exception

        importModelFromResource

        Parameters:
        resource - a Resource object.
        rescanExisting - a String object - Valid values are "true", "false" and "dbonly".
        monitor - a ProvisionMonitor object.
        Returns:
        the imported requesition
        Throws:
        Exception - if any.
      • setEventForwarder

        public void setEventForwarder​(EventForwarder eventForwarder)

        setEventForwarder

        Parameters:
        eventForwarder - a EventForwarder object.
      • doImport

        public void doImport​(IEvent event)
                      throws ExecutionException
        Begins importing from resource specified in model-importer.properties file or in event parameter: url. Import Resources are managed with a "key" called "foreignSource" specified in the XML retrieved by the resource and can be overridden as a parameter of an event.
        Parameters:
        event - a IEvent object.
        Throws:
        ExecutionException
      • handleNodeAddedEvent

        public void handleNodeAddedEvent​(IEvent e)

        handleNodeAddedEvent

        Parameters:
        e - a IEvent object.
      • handleForceRescan

        public void handleForceRescan​(IEvent e)

        handleForceRescan

        Parameters:
        e - a IEvent object.
      • handleNewSuspectEvent

        public void handleNewSuspectEvent​(IEvent event)
      • handleNodeUpdated

        public void handleNodeUpdated​(IEvent e)

        handleNodeUpdated

        A re-import has occurred, attempt a rescan now.
        Parameters:
        e - a IEvent object.
      • handleNodeDeletedEvent

        public void handleNodeDeletedEvent​(IEvent e)

        handleNodeDeletedEvent

        Parameters:
        e - a IEvent object.
      • handleReloadConfigEvent

        public void handleReloadConfigEvent​(IEvent e)

        handleReloadConfigEvent

        Parameters:
        e - a IEvent object.
      • handleAddNode

        public void handleAddNode​(IEvent event)

        handleAddNode

        Parameters:
        event - a IEvent object.
      • handleDeleteInterface

        public void handleDeleteInterface​(IEvent event)

        handleDeleteInterface

        Parameters:
        event - a IEvent object.
      • handleDeleteNode

        public void handleDeleteNode​(IEvent event)

        handleDeleteNode

        Parameters:
        event - a IEvent object.
      • handleDeleteService

        public void handleDeleteService​(IEvent event)

        handleDeleteService

        Parameters:
        event - a IEvent object.
      • getEventForeignSource

        protected String getEventForeignSource​(Event event)

        getEventForeignSource

        Parameters:
        event - a Event object.
        Returns:
        a String object.
      • waitFor

        public void waitFor()