Class SimpleQueuedProvisioningAdapter2

  • All Implemented Interfaces:
    ProvisioningAdapter

    public abstract class SimpleQueuedProvisioningAdapter2
    extends Object
    implements ProvisioningAdapter
    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)
    Version:
    $Id: $
    Author:
    David Hustace
    • Constructor Detail

      • SimpleQueuedProvisioningAdapter2

        protected SimpleQueuedProvisioningAdapter2()

        Constructor for SimpleQueuedProvisioningAdapter2.

    • Method Detail

      • isNodeReady

        public abstract boolean isNodeReady​(int nodeId)
        This method is called when the scheduled Adapters extending this class must implement this method
        Parameters:
        nodeId - a int.
        Returns:
        a boolean.
      • processPendingOperationForNode

        public abstract void processPendingOperationForNode​(org.opennms.netmgt.provision.SimpleQueuedProvisioningAdapter2.AdapterOperation op)
                                                     throws ProvisioningAdapterException

        processPendingOperationForNode

        Parameters:
        op - a SimpleQueuedProvisioningAdapter2.AdapterOperation object.
        Throws:
        ProvisioningAdapterException - if any.
      • addNode

        public final ScheduledFuture<?> addNode​(int nodeId)
        This method is called by the Provisioner when a new node is provisioned.
        Specified by:
        addNode in interface ProvisioningAdapter
        Parameters:
        nodeId - a int.
        Returns:
      • updateNode

        public final ScheduledFuture<?> updateNode​(int nodeId)
        This method is called by the Provisioner when a node is updated through provisioning.
        Specified by:
        updateNode in interface ProvisioningAdapter
        Parameters:
        nodeId - a int.
      • deleteNode

        public final ScheduledFuture<?> deleteNode​(int nodeId)
        This method is called by the Provisioner when a node is deleted through provisioning.
        Specified by:
        deleteNode in interface ProvisioningAdapter
        Parameters:
        nodeId - a int.
      • nodeConfigChanged

        public final ScheduledFuture<?> nodeConfigChanged​(int nodeId)
        This method is called when a configuration change event has occurred from any source. Typically, Traps sent from a device are converted to an event and that event is then identified for translation and translated into a generic configuration changed event.
        Specified by:
        nodeConfigChanged in interface ProvisioningAdapter
        Parameters:
        nodeId - a int.