|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.opennms.netmgt.provision.SimpleQueuedProvisioningAdapter2
public abstract class SimpleQueuedProvisioningAdapter2
This class takes the work out of scheduling and queuing calls from the provisioner. Each provisioning adapter can extend this class for this functionality. The interface API methods are final so that the child class can not implement them and override the queuing for what would be the point. (Unless of course we decide that it is worth while to override a subset of the API methods. To use the class, have your provisioning adapter extend this abstract class. You see that you must implement abstract methods to compile. To change the schedule, override the createScheduleForNode method and return a schedule suitable for the node. In this base class, the same schedule is used for all nodes. TODO: Add logging TODO: Verify correct Exception handling TODO: Write tests (especially the equals method of the NodeOperation for proper queue handling)
| Constructor Summary | |
|---|---|
protected |
SimpleQueuedProvisioningAdapter2()
|
protected |
SimpleQueuedProvisioningAdapter2(PausibleScheduledThreadPoolExecutor executorService)
|
| Method Summary | |
|---|---|
void |
addNode(int nodeId)
This method is called by the Provisioner when a new node is provisioned. |
void |
deleteNode(int nodeId)
This method is called by the Provisioner when a node is deleted through provisioning. |
PausibleScheduledThreadPoolExecutor |
getExecutorService()
|
abstract String |
getName()
|
abstract boolean |
isNodeReady(int nodeId)
This method is called when the scheduled Adapters extending this class must implement this method |
void |
nodeConfigChanged(int nodeId)
This method is called when a configuration change event has occurred from any source. |
abstract void |
processPendingOperationForNode(org.opennms.netmgt.provision.SimpleQueuedProvisioningAdapter2.AdapterOperation op)
|
void |
updateNode(int nodeId)
This method is called by the Provisioner when a node is updated through provisioning. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected SimpleQueuedProvisioningAdapter2(PausibleScheduledThreadPoolExecutor executorService)
protected SimpleQueuedProvisioningAdapter2()
| Method Detail |
|---|
public abstract String getName()
getName in interface ProvisioningAdapterpublic abstract boolean isNodeReady(int nodeId)
public abstract void processPendingOperationForNode(org.opennms.netmgt.provision.SimpleQueuedProvisioningAdapter2.AdapterOperation op)
throws ProvisioningAdapterException
ProvisioningAdapterExceptionpublic final void addNode(int nodeId)
ProvisioningAdapter
addNode in interface ProvisioningAdapterpublic final void updateNode(int nodeId)
ProvisioningAdapter
updateNode in interface ProvisioningAdapterpublic final void deleteNode(int nodeId)
ProvisioningAdapter
deleteNode in interface ProvisioningAdapterpublic final void nodeConfigChanged(int nodeId)
ProvisioningAdapter
nodeConfigChanged in interface ProvisioningAdapterpublic PausibleScheduledThreadPoolExecutor getExecutorService()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||