org.opends.server.workflowelement.localbackend
Class LocalBackendWorkflowElement

java.lang.Object
  extended by org.opends.server.workflowelement.WorkflowElement<WorkflowElementCfg>
      extended by org.opends.server.workflowelement.LeafWorkflowElement<LocalBackendWorkflowElementCfg>
          extended by org.opends.server.workflowelement.localbackend.LocalBackendWorkflowElement
All Implemented Interfaces:
ConfigurationChangeListener<LocalBackendWorkflowElementCfg>

public class LocalBackendWorkflowElement
extends LeafWorkflowElement<LocalBackendWorkflowElementCfg>
implements ConfigurationChangeListener<LocalBackendWorkflowElementCfg>

This class defines a local backend workflow element; e-g an entity that handle the processing of an operation aginst a local backend.


Constructor Summary
LocalBackendWorkflowElement()
          Creates a new instance of the local backend workflow element.
 
Method Summary
 ConfigChangeResult applyConfigurationChange(LocalBackendWorkflowElementCfg configuration)
          Applies the configuration changes to this change listener.
static
<O extends Operation,L>
void
attachLocalOperation(O globalOperation, L currentLocalOperation)
          Attaches the current local operation to the global operation so that operation runner can execute local operation post response later on.
static LocalBackendWorkflowElement createAndRegister(java.lang.String workflowElementID, Backend backend)
          Creates and registers a local backend with the server.
 void execute(Operation operation)
          Executes the workflow element for an operation.
 void finalizeWorkflowElement()
          Performs any finalization that might be required when this workflow element is unloaded.
 void initializeWorkflowElement(LocalBackendWorkflowElementCfg configuration)
          Initializes a new instance of the local backend workflow element.
 boolean isConfigurationChangeAcceptable(LocalBackendWorkflowElementCfg configuration, java.util.List<Message> unacceptableReasons)
          Indicates whether the proposed change to the configuration is acceptable to this change listener.
static void remove(java.lang.String workflowElementID)
          Removes a local backend that was registered with the server.
static void removeAll()
          Removes all the local backends that were registered with the server.
 
Methods inherited from class org.opends.server.workflowelement.WorkflowElement
deregister, getWorkflowElement, getWorkflowElementID, initialize, isConfigurationAcceptable, isPrivate, register, resetConfig, setParent, setPrivate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LocalBackendWorkflowElement

public LocalBackendWorkflowElement()
Creates a new instance of the local backend workflow element.

Method Detail

initializeWorkflowElement

public void initializeWorkflowElement(LocalBackendWorkflowElementCfg configuration)
                               throws ConfigException,
                                      InitializationException
Initializes a new instance of the local backend workflow element. This method is intended to be called by DirectoryServer when workflow configuration mode is manual as opposed to initialize(String,Backend) which is invoked when workflow configuration mode is auto.

Parameters:
configuration - The configuration for this local backend workflow element.
Throws:
ConfigException - If there is a problem with the provided configuration.
InitializationException - If an error occurs while trying to initialize this workflow element that is not related to the provided configuration.

finalizeWorkflowElement

public void finalizeWorkflowElement()
Performs any finalization that might be required when this workflow element is unloaded. No action is taken in the default implementation.

Overrides:
finalizeWorkflowElement in class WorkflowElement<WorkflowElementCfg>

isConfigurationChangeAcceptable

public boolean isConfigurationChangeAcceptable(LocalBackendWorkflowElementCfg configuration,
                                               java.util.List<Message> unacceptableReasons)
Indicates whether the proposed change to the configuration is acceptable to this change listener.

Specified by:
isConfigurationChangeAcceptable in interface ConfigurationChangeListener<LocalBackendWorkflowElementCfg>
Parameters:
configuration - The new configuration containing the changes.
unacceptableReasons - A list that can be used to hold messages about why the provided configuration is not acceptable.
Returns:
Returns true if the proposed change is acceptable, or false if it is not.

applyConfigurationChange

public ConfigChangeResult applyConfigurationChange(LocalBackendWorkflowElementCfg configuration)
Applies the configuration changes to this change listener.

Specified by:
applyConfigurationChange in interface ConfigurationChangeListener<LocalBackendWorkflowElementCfg>
Parameters:
configuration - The new configuration containing the changes.
Returns:
Returns information about the result of changing the configuration.

createAndRegister

public static LocalBackendWorkflowElement createAndRegister(java.lang.String workflowElementID,
                                                            Backend backend)
Creates and registers a local backend with the server.

Parameters:
workflowElementID - the identifier of the workflow element to create
backend - the backend to associate with the local backend workflow element
Returns:
the existing local backend workflow element if it was already created or a newly created local backend workflow element.

remove

public static void remove(java.lang.String workflowElementID)
Removes a local backend that was registered with the server.

Parameters:
workflowElementID - the identifier of the workflow element to remove

removeAll

public static void removeAll()
Removes all the local backends that were registered with the server. This function is intended to be called when the server is shutting down.


execute

public void execute(Operation operation)
             throws CanceledOperationException
Executes the workflow element for an operation.

Specified by:
execute in class WorkflowElement<WorkflowElementCfg>
Parameters:
operation - the operation to execute
Throws:
CanceledOperationException - if this operation should be cancelled

attachLocalOperation

public static final <O extends Operation,L> void attachLocalOperation(O globalOperation,
                                                                      L currentLocalOperation)
Attaches the current local operation to the global operation so that operation runner can execute local operation post response later on.

Type Parameters:
O - subtype of Operation
L - subtype of LocalBackendOperation
Parameters:
globalOperation - the global operation to which local operation should be attached to
currentLocalOperation - the local operation to attach to the global operation