Package org.opennms.netmgt.provision
Class RancidProvisioningAdapter
- java.lang.Object
- 
- org.opennms.netmgt.provision.SimpleQueuedProvisioningAdapter
- 
- org.opennms.netmgt.provision.RancidProvisioningAdapter
 
 
- 
- All Implemented Interfaces:
- ProvisioningAdapter,- org.springframework.beans.factory.InitializingBean
 
 public class RancidProvisioningAdapter extends SimpleQueuedProvisioningAdapter implements org.springframework.beans.factory.InitializingBean A Rancid provisioning adapter for integration with OpenNMS Provisioning daemon API.- Version:
- $Id: $
- Author:
- Antonio Russo
 
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from class org.opennms.netmgt.provision.SimpleQueuedProvisioningAdapterSimpleQueuedProvisioningAdapter.AdapterOperationQueue, SimpleQueuedProvisioningAdapter.AdapterOperationQueueListener
 
- 
 - 
Constructor SummaryConstructors Constructor Description RancidProvisioningAdapter()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafterPropertiesSet()afterPropertiesSetvoiddoAdd(int nodeId, org.opennms.rancid.ConnectionProperties cp, boolean retry)doAddvoiddoDelete(int nodeId, org.opennms.rancid.ConnectionProperties cp, boolean retry)doDeletevoiddoNodeConfigChanged(int nodeId, org.opennms.rancid.ConnectionProperties cp, boolean retry)doNodeConfigChangedvoiddoUpdate(int nodeId, org.opennms.rancid.ConnectionProperties cp, boolean retry)doUpdateEventForwardergetEventForwarder()getEventForwarderStringgetName()getNameNodeDaogetNodeDao()getNodeDaoRancidAdapterConfiggetRancidAdapterConfig()getRancidAdapterConfigRWSConfiggetRwsConfig()getRwsConfigvoidhandleRancidDownLoadFailure(IEvent e)handleRancidDownLoadFailurevoidhandleRancidDownLoadSuccess(IEvent e)handleRancidDownLoadSuccessvoidhandleRancidGroupProcessingCompleted(IEvent e)handleRancidGroupProcessingCompletedvoidhandleReloadConfigEvent(IEvent event)handleReloadConfigEventbooleanisNodeReady(org.opennms.netmgt.provision.SimpleQueuedProvisioningAdapter.AdapterOperation op)Adapters extending this class must implement this method.voidprocessPendingOperationForNode(org.opennms.netmgt.provision.SimpleQueuedProvisioningAdapter.AdapterOperation op)The class implements the API and therefore the concrete class implements this method to handle dequeued operations.voidsetEventForwarder(EventForwarder eventForwarder)setEventForwardervoidsetNodeDao(NodeDao dao)setNodeDaovoidsetRancidAdapterConfig(RancidAdapterConfig rancidAdapterConfig)setRancidAdapterConfigvoidsetRwsConfig(RWSConfig rwsConfig)setRwsConfigvoidsetTemplate(org.springframework.transaction.support.TransactionTemplate template)setTemplate- 
Methods inherited from class org.opennms.netmgt.provision.SimpleQueuedProvisioningAdapteraddNode, deleteNode, getOperationQueue, init, nodeConfigChanged, updateNode
 
- 
 
- 
- 
- 
Field Detail- 
NAMEpublic static final String NAME ConstantNAME="RancidProvisioningAdapter"- See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
setTemplatepublic void setTemplate(org.springframework.transaction.support.TransactionTemplate template) setTemplate - Parameters:
- template- a- TransactionTemplateobject.
 
 - 
afterPropertiesSetpublic void afterPropertiesSet() throws ExceptionafterPropertiesSet - Specified by:
- afterPropertiesSetin interface- org.springframework.beans.factory.InitializingBean
- Throws:
- Exception- if any.
 
 - 
doAddpublic void doAdd(int nodeId, org.opennms.rancid.ConnectionProperties cp, boolean retry) throws ProvisioningAdapterExceptiondoAdd - Parameters:
- nodeId- a int.
- cp- a- ConnectionPropertiesobject.
- retry- a boolean.
- Throws:
- ProvisioningAdapterException- if any.
 
 - 
doUpdatepublic void doUpdate(int nodeId, org.opennms.rancid.ConnectionProperties cp, boolean retry) throws ProvisioningAdapterExceptiondoUpdate - Parameters:
- nodeId- a int.
- cp- a- ConnectionPropertiesobject.
- retry- a boolean.
- Throws:
- ProvisioningAdapterException- if any.
 
 - 
doDeletepublic void doDelete(int nodeId, org.opennms.rancid.ConnectionProperties cp, boolean retry) throws ProvisioningAdapterExceptiondoDelete - Parameters:
- nodeId- a int.
- cp- a- ConnectionPropertiesobject.
- retry- a boolean.
- Throws:
- ProvisioningAdapterException- if any.
 
 - 
doNodeConfigChangedpublic void doNodeConfigChanged(int nodeId, org.opennms.rancid.ConnectionProperties cp, boolean retry) throws ProvisioningAdapterExceptiondoNodeConfigChanged - Parameters:
- nodeId- a int.
- cp- a- ConnectionPropertiesobject.
- retry- a boolean.
- Throws:
- ProvisioningAdapterException- if any.
 
 - 
setEventForwarderpublic void setEventForwarder(EventForwarder eventForwarder) setEventForwarder - Parameters:
- eventForwarder- a- EventForwarderobject.
 
 - 
getEventForwarderpublic EventForwarder getEventForwarder() getEventForwarder - Returns:
- a EventForwarderobject.
 
 - 
setRwsConfigpublic void setRwsConfig(RWSConfig rwsConfig) setRwsConfig - Parameters:
- rwsConfig- a- RWSConfigobject.
 
 - 
getRancidAdapterConfigpublic RancidAdapterConfig getRancidAdapterConfig() getRancidAdapterConfig - Returns:
- a RancidAdapterConfigobject.
 
 - 
setRancidAdapterConfigpublic void setRancidAdapterConfig(RancidAdapterConfig rancidAdapterConfig) setRancidAdapterConfig - Parameters:
- rancidAdapterConfig- a- RancidAdapterConfigobject.
 
 - 
getNamepublic String getName() getName - Specified by:
- getNamein interface- ProvisioningAdapter
- Specified by:
- getNamein class- SimpleQueuedProvisioningAdapter
- Returns:
- a Stringobject.
 
 - 
isNodeReadypublic boolean isNodeReady(org.opennms.netmgt.provision.SimpleQueuedProvisioningAdapter.AdapterOperation op) Adapters extending this class must implement this method. This method is called in the run method of an operation to insure that the adapter is ready for the operation to run for the associated node. The adapter is responsible for setting the schedule, however, something could have altered the state of readiness for the provisioning system in the meantime. If this method returns false, the operation is rescheduled with the and the attempts remaining on the operation are not decremented.- Specified by:
- isNodeReadyin class- SimpleQueuedProvisioningAdapter
- Parameters:
- op- a- SimpleQueuedProvisioningAdapter.AdapterOperationobject.
- Returns:
- a boolean representing the state of readiness from the underlying system integrated by the implementing adapter.
 
 - 
processPendingOperationForNodepublic void processPendingOperationForNode(org.opennms.netmgt.provision.SimpleQueuedProvisioningAdapter.AdapterOperation op) throws ProvisioningAdapterExceptionThe class implements the API and therefore the concrete class implements this method to handle dequeued operations. The concrete implementation should check the operation type to derive the its behavior.- Specified by:
- processPendingOperationForNodein class- SimpleQueuedProvisioningAdapter
- Parameters:
- op- a- SimpleQueuedProvisioningAdapter.AdapterOperationobject.
- Throws:
- ProvisioningAdapterException- if any.
 
 - 
handleReloadConfigEventpublic void handleReloadConfigEvent(IEvent event) handleReloadConfigEvent - Parameters:
- event- a- IEventobject.
 
 - 
handleRancidDownLoadFailurepublic void handleRancidDownLoadFailure(IEvent e) handleRancidDownLoadFailure - Parameters:
- e- a- IEventobject.
 
 - 
handleRancidDownLoadSuccesspublic void handleRancidDownLoadSuccess(IEvent e) handleRancidDownLoadSuccess - Parameters:
- e- a- IEventobject.
 
 
- 
 
-