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.SimpleQueuedProvisioningAdapter
SimpleQueuedProvisioningAdapter.AdapterOperationQueue, SimpleQueuedProvisioningAdapter.AdapterOperationQueueListener
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
NAME
ConstantNAME="RancidProvisioningAdapter"
-
Constructor Summary
Constructors Constructor Description RancidProvisioningAdapter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
afterPropertiesSet()
afterPropertiesSetvoid
doAdd(int nodeId, org.opennms.rancid.ConnectionProperties cp, boolean retry)
doAddvoid
doDelete(int nodeId, org.opennms.rancid.ConnectionProperties cp, boolean retry)
doDeletevoid
doNodeConfigChanged(int nodeId, org.opennms.rancid.ConnectionProperties cp, boolean retry)
doNodeConfigChangedvoid
doUpdate(int nodeId, org.opennms.rancid.ConnectionProperties cp, boolean retry)
doUpdateEventForwarder
getEventForwarder()
getEventForwarderjava.lang.String
getName()
getNameNodeDao
getNodeDao()
getNodeDaoRancidAdapterConfig
getRancidAdapterConfig()
getRancidAdapterConfigRWSConfig
getRwsConfig()
getRwsConfigvoid
handleRancidDownLoadFailure(IEvent e)
handleRancidDownLoadFailurevoid
handleRancidDownLoadSuccess(IEvent e)
handleRancidDownLoadSuccessvoid
handleRancidGroupProcessingCompleted(IEvent e)
handleRancidGroupProcessingCompletedvoid
handleReloadConfigEvent(IEvent event)
handleReloadConfigEventboolean
isNodeReady(org.opennms.netmgt.provision.SimpleQueuedProvisioningAdapter.AdapterOperation op)
Adapters extending this class must implement this method.void
processPendingOperationForNode(org.opennms.netmgt.provision.SimpleQueuedProvisioningAdapter.AdapterOperation op)
The class implements the API and therefore the concrete class implements this method to handle dequeued operations.void
setEventForwarder(EventForwarder eventForwarder)
setEventForwardervoid
setNodeDao(NodeDao dao)
setNodeDaovoid
setRancidAdapterConfig(RancidAdapterConfig rancidAdapterConfig)
setRancidAdapterConfigvoid
setRwsConfig(RWSConfig rwsConfig)
setRwsConfigvoid
setTemplate(org.springframework.transaction.support.TransactionTemplate template)
setTemplate-
Methods inherited from class org.opennms.netmgt.provision.SimpleQueuedProvisioningAdapter
addNode, deleteNode, getOperationQueue, init, nodeConfigChanged, updateNode
-
-
-
-
Field Detail
-
NAME
public static final java.lang.String NAME
ConstantNAME="RancidProvisioningAdapter"
- See Also:
- Constant Field Values
-
-
Method Detail
-
setTemplate
public void setTemplate(org.springframework.transaction.support.TransactionTemplate template)
setTemplate
- Parameters:
template
- aTransactionTemplate
object.
-
afterPropertiesSet
public void afterPropertiesSet() throws java.lang.Exception
afterPropertiesSet
- Specified by:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
- Throws:
java.lang.Exception
- if any.
-
doAdd
public void doAdd(int nodeId, org.opennms.rancid.ConnectionProperties cp, boolean retry) throws ProvisioningAdapterException
doAdd
- Parameters:
nodeId
- a int.cp
- aConnectionProperties
object.retry
- a boolean.- Throws:
ProvisioningAdapterException
- if any.
-
doUpdate
public void doUpdate(int nodeId, org.opennms.rancid.ConnectionProperties cp, boolean retry) throws ProvisioningAdapterException
doUpdate
- Parameters:
nodeId
- a int.cp
- aConnectionProperties
object.retry
- a boolean.- Throws:
ProvisioningAdapterException
- if any.
-
doDelete
public void doDelete(int nodeId, org.opennms.rancid.ConnectionProperties cp, boolean retry) throws ProvisioningAdapterException
doDelete
- Parameters:
nodeId
- a int.cp
- aConnectionProperties
object.retry
- a boolean.- Throws:
ProvisioningAdapterException
- if any.
-
doNodeConfigChanged
public void doNodeConfigChanged(int nodeId, org.opennms.rancid.ConnectionProperties cp, boolean retry) throws ProvisioningAdapterException
doNodeConfigChanged
- Parameters:
nodeId
- a int.cp
- aConnectionProperties
object.retry
- a boolean.- Throws:
ProvisioningAdapterException
- if any.
-
setEventForwarder
public void setEventForwarder(EventForwarder eventForwarder)
setEventForwarder
- Parameters:
eventForwarder
- aEventForwarder
object.
-
getEventForwarder
public EventForwarder getEventForwarder()
getEventForwarder
- Returns:
- a
EventForwarder
object.
-
setRwsConfig
public void setRwsConfig(RWSConfig rwsConfig)
setRwsConfig
- Parameters:
rwsConfig
- aRWSConfig
object.
-
getRancidAdapterConfig
public RancidAdapterConfig getRancidAdapterConfig()
getRancidAdapterConfig
- Returns:
- a
RancidAdapterConfig
object.
-
setRancidAdapterConfig
public void setRancidAdapterConfig(RancidAdapterConfig rancidAdapterConfig)
setRancidAdapterConfig
- Parameters:
rancidAdapterConfig
- aRancidAdapterConfig
object.
-
getName
public java.lang.String getName()
getName
- Specified by:
getName
in interfaceProvisioningAdapter
- Specified by:
getName
in classSimpleQueuedProvisioningAdapter
- Returns:
- a
String
object.
-
isNodeReady
public 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:
isNodeReady
in classSimpleQueuedProvisioningAdapter
- Parameters:
op
- aSimpleQueuedProvisioningAdapter.AdapterOperation
object.- Returns:
- a boolean representing the state of readiness from the underlying system integrated by the implementing adapter.
-
processPendingOperationForNode
public void processPendingOperationForNode(org.opennms.netmgt.provision.SimpleQueuedProvisioningAdapter.AdapterOperation op) throws ProvisioningAdapterException
The 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:
processPendingOperationForNode
in classSimpleQueuedProvisioningAdapter
- Parameters:
op
- aSimpleQueuedProvisioningAdapter.AdapterOperation
object.- Throws:
ProvisioningAdapterException
- if any.
-
handleReloadConfigEvent
public void handleReloadConfigEvent(IEvent event)
handleReloadConfigEvent
- Parameters:
event
- aIEvent
object.
-
handleRancidDownLoadFailure
public void handleRancidDownLoadFailure(IEvent e)
handleRancidDownLoadFailure
- Parameters:
e
- aIEvent
object.
-
handleRancidDownLoadSuccess
public void handleRancidDownLoadSuccess(IEvent e)
handleRancidDownLoadSuccess
- Parameters:
e
- aIEvent
object.
-
-