Package org.opennms.netmgt.provision
Class SimplerQueuedProvisioningAdapter
- java.lang.Object
-
- org.opennms.netmgt.provision.SimpleQueuedProvisioningAdapter
-
- org.opennms.netmgt.provision.SimplerQueuedProvisioningAdapter
-
- All Implemented Interfaces:
ProvisioningAdapter
- Direct Known Subclasses:
GeoIpProvisioningAdapter
,GeolocationProvisioningAdapter
,SnmpAssetProvisioningAdapter
,SnmpHardwareInventoryProvisioningAdapter
,SnmpMetadataProvisioningAdapter
,WsManAssetProvisioningAdapter
public abstract class SimplerQueuedProvisioningAdapter extends SimpleQueuedProvisioningAdapter
SimplerQueuedProvisioningAdapter- Version:
- $Id: $
- Author:
- brozow
-
-
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 protected long
m_delay
protected org.springframework.transaction.support.TransactionTemplate
m_template
protected TimeUnit
m_timeUnit
-
Constructor Summary
Constructors Constructor Description SimplerQueuedProvisioningAdapter(String name)
Constructor for SimplerQueuedProvisioningAdapter.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
doAddNode(int nodeid)
doAddNodevoid
doDeleteNode(int nodeid)
doDeleteNodevoid
doNotifyConfigChange(int nodeid)
doNotifyConfigChangevoid
doUpdateNode(int nodeid)
doUpdateNodeString
getName()
getNamevoid
init()
(non-Javadoc)boolean
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
setDelay(long delay)
setDelayvoid
setTemplate(org.springframework.transaction.support.TransactionTemplate template)
setTemplatevoid
setTimeUnit(TimeUnit timeUnit)
setTimeUnit-
Methods inherited from class org.opennms.netmgt.provision.SimpleQueuedProvisioningAdapter
addNode, deleteNode, getOperationQueue, nodeConfigChanged, updateNode
-
-
-
-
Field Detail
-
m_delay
protected long m_delay
-
m_timeUnit
protected TimeUnit m_timeUnit
-
m_template
protected org.springframework.transaction.support.TransactionTemplate m_template
-
-
Method Detail
-
setTemplate
public void setTemplate(org.springframework.transaction.support.TransactionTemplate template)
setTemplate
- Parameters:
template
- aTransactionTemplate
object.
-
setTimeUnit
public void setTimeUnit(TimeUnit timeUnit)
setTimeUnit
- Parameters:
timeUnit
- aTimeUnit
object.
-
setDelay
public void setDelay(long delay)
setDelay
- Parameters:
delay
- a long.
-
getName
public 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 final 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.
-
init
public void init()
(non-Javadoc)- Specified by:
init
in interfaceProvisioningAdapter
- Overrides:
init
in classSimpleQueuedProvisioningAdapter
- See Also:
Override this implementation if needed.
-
doAddNode
public void doAddNode(int nodeid)
doAddNode
- Parameters:
nodeid
- a int.
-
doUpdateNode
public void doUpdateNode(int nodeid)
doUpdateNode
- Parameters:
nodeid
- a int.
-
doDeleteNode
public void doDeleteNode(int nodeid)
doDeleteNode
- Parameters:
nodeid
- a int.
-
doNotifyConfigChange
public void doNotifyConfigChange(int nodeid)
doNotifyConfigChange
- Parameters:
nodeid
- a int.
-
-