org.opennms.netmgt.provision.service
Class Provisioner

java.lang.Object
  extended by org.opennms.netmgt.provision.service.Provisioner
All Implemented Interfaces:
SpringServiceDaemon, org.springframework.beans.factory.InitializingBean

public class Provisioner
extends Object
implements SpringServiceDaemon


Field Summary
static String NAME
           
 
Constructor Summary
Provisioner()
           
 
Method Summary
protected  void addToScheduleQueue(NodeScanSchedule schedule)
           
 void afterPropertiesSet()
           
protected  void checkNodeListForRemovals(List<NodeScanSchedule> schedules)
           
 NodeScan createNodeScan(Integer nodeId, String foreignSource, String foreignId)
           
 void doImport()
           
 void doImport(Event event)
          Begins importing from resource specified in model-importer.properties file or in event parameter: url.
 void doNodeScan(int nodeId)
           
protected  String getEventForeignSource(Event event)
           
 EventForwarder getEventForwarder()
           
 EventSubscriptionService getEventSubscriptionService()
           
 org.springframework.core.io.Resource getImportResource()
           
 ProvisionService getProvisionService()
           
 ScheduledFuture<?> getScheduledFutureForNode(int nodeId)
           
 int getScheduleLength()
           
 String getStats()
           
 void handleForceRescan(Event e)
           
 void handleNodeAddedEvent(Event e)
           
 void handleNodeDeletedEvent(Event e)
           
 void handleNodeUpdated(Event e)
           
protected  void importModelFromResource(org.springframework.core.io.Resource resource)
           
protected  void importModelFromResource(org.springframework.core.io.Resource resource, ProvisionMonitor monitor)
           
 Category log()
           
protected  void removeFromScheduleQueue(List<Integer> nodeIds)
           
protected  void removeNodeFromScheduleQueue(Integer nodeId)
           
protected  void scheduleRescanForExistingNodes()
           
 void setEventForwarder(EventForwarder eventForwarder)
           
 void setEventSubscriptionService(EventSubscriptionService eventManager)
           
 void setImportResource(org.springframework.core.io.Resource resource)
           
 void setLifeCycleRepository(LifeCycleRepository lifeCycleRepository)
           
 void setProviders(List<Object> providers)
           
 void setProvisionService(ProvisionService provisionService)
           
 void setScheduledExecutor(ScheduledExecutorService scheduledExecutor)
           
 void start()
           
protected  void updateNodeScheduleInQueue(NodeScanSchedule schedule)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NAME

public static final String NAME
See Also:
Constant Field Values
Constructor Detail

Provisioner

public Provisioner()
Method Detail

setProvisionService

public void setProvisionService(ProvisionService provisionService)

getProvisionService

public ProvisionService getProvisionService()

setScheduledExecutor

public void setScheduledExecutor(ScheduledExecutorService scheduledExecutor)

setLifeCycleRepository

public void setLifeCycleRepository(LifeCycleRepository lifeCycleRepository)

setProviders

public void setProviders(List<Object> providers)

start

public void start()
           throws Exception
Specified by:
start in interface SpringServiceDaemon
Throws:
Exception

afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception
Specified by:
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
Throws:
Exception

scheduleRescanForExistingNodes

protected void scheduleRescanForExistingNodes()

doNodeScan

public void doNodeScan(int nodeId)
                throws InterruptedException,
                       ExecutionException
Throws:
InterruptedException
ExecutionException

createNodeScan

public NodeScan createNodeScan(Integer nodeId,
                               String foreignSource,
                               String foreignId)

addToScheduleQueue

protected void addToScheduleQueue(NodeScanSchedule schedule)

updateNodeScheduleInQueue

protected void updateNodeScheduleInQueue(NodeScanSchedule schedule)

getScheduledFutureForNode

public ScheduledFuture<?> getScheduledFutureForNode(int nodeId)

removeNodeFromScheduleQueue

protected void removeNodeFromScheduleQueue(Integer nodeId)

removeFromScheduleQueue

protected void removeFromScheduleQueue(List<Integer> nodeIds)

checkNodeListForRemovals

protected void checkNodeListForRemovals(List<NodeScanSchedule> schedules)
Parameters:
schedules -

getScheduleLength

public int getScheduleLength()

importModelFromResource

protected void importModelFromResource(org.springframework.core.io.Resource resource)
                                throws Exception
Throws:
Exception

importModelFromResource

protected void importModelFromResource(org.springframework.core.io.Resource resource,
                                       ProvisionMonitor monitor)
                                throws Exception
Throws:
Exception

log

public Category log()

setImportResource

public void setImportResource(org.springframework.core.io.Resource resource)

getImportResource

public org.springframework.core.io.Resource getImportResource()

getEventSubscriptionService

public EventSubscriptionService getEventSubscriptionService()

setEventSubscriptionService

public void setEventSubscriptionService(EventSubscriptionService eventManager)

setEventForwarder

public void setEventForwarder(EventForwarder eventForwarder)

getEventForwarder

public EventForwarder getEventForwarder()

doImport

public void doImport()

doImport

public void doImport(Event event)
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 -

handleNodeAddedEvent

public void handleNodeAddedEvent(Event e)
Parameters:
e -

handleForceRescan

public void handleForceRescan(Event e)

handleNodeUpdated

public void handleNodeUpdated(Event e)

handleNodeDeletedEvent

public void handleNodeDeletedEvent(Event e)

getStats

public String getStats()

getEventForeignSource

protected String getEventForeignSource(Event event)


Copyright © 2009. All Rights Reserved.