org.opends.server.workflowelement
Class WorkflowElement<T extends WorkflowElementCfg>

java.lang.Object
  extended by org.opends.server.workflowelement.WorkflowElement<T>
Type Parameters:
T - The type of configuration handled by this workflow elelemnt.
Direct Known Subclasses:
LeafWorkflowElement

public abstract class WorkflowElement<T extends WorkflowElementCfg>
extends java.lang.Object

This class defines the super class for all the workflow elements. A workflow element is a task in a workflow. A workflow element can wrap a physical repository such as a local backend, a remote LDAP server or a local ldif file. A workflow element can also be used to route operations. This is the case for load balancing and distribution. And workflow element can be used in a virtual environment to transform data (DN and attribute renaming, attribute value renaming...).


Constructor Summary
WorkflowElement()
          Creates a new instance of the workflow element.
 
Method Summary
 void deregister()
          Deregisters the workflow element (this) with the server.
abstract  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.
static WorkflowElement getWorkflowElement(java.lang.String workflowElementID)
          Gets a workflow element that was registered with the server.
 java.lang.String getWorkflowElementID()
          Provides the workflow element identifier.
 void initialize(java.lang.String workflowElementID)
          Initializes the instance of the workflow element.
 boolean isConfigurationAcceptable(WorkflowElementCfg configuration, java.util.List<java.lang.String> unacceptableReasons)
          Indicates whether the provided configuration is acceptable for this workflow elelement.
 boolean isPrivate()
          Indicates whether the workflow element encapsulates a private local backend.
 void register()
          Registers the workflow element (this) with the server.
static void resetConfig()
          Resets all the registered workflows.
protected  void setParent(WorkflowElement<?> parent)
          Set the parent of the current workflow element.
protected  void setPrivate(boolean isPrivate)
          Specifies whether the workflow element encapsulates a private local backend.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WorkflowElement

public WorkflowElement()
Creates a new instance of the workflow element.

Method Detail

initialize

public void initialize(java.lang.String workflowElementID)
Initializes the instance of the workflow element.

Parameters:
workflowElementID - the workflow element identifier as defined in the configuration.

setParent

protected void setParent(WorkflowElement<?> parent)
Set the parent of the current workflow element.

Parameters:
parent - the parent of the workflow element

isConfigurationAcceptable

public boolean isConfigurationAcceptable(WorkflowElementCfg configuration,
                                         java.util.List<java.lang.String> unacceptableReasons)
Indicates whether the provided configuration is acceptable for this workflow elelement.

Parameters:
configuration - The workflow element configuration for which to make the determination.
unacceptableReasons - A list that may be used to hold the reasons that the provided configuration is not acceptable.
Returns:
true if the provided configuration is acceptable for this workflow element, or false if not.

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.


execute

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

Parameters:
operation - the operation to execute
Throws:
CanceledOperationException - if this operation should be cancelled

isPrivate

public boolean isPrivate()
Indicates whether the workflow element encapsulates a private local backend.

Returns:
true if the workflow element encapsulates a private local backend, false otherwise

setPrivate

protected void setPrivate(boolean isPrivate)
Specifies whether the workflow element encapsulates a private local backend.

Parameters:
isPrivate - Indicates whether the workflow element encapsulates a private local backend.

getWorkflowElementID

public java.lang.String getWorkflowElementID()
Provides the workflow element identifier.

Returns:
the worflow element identifier

register

public void register()
              throws ConfigException
Registers the workflow element (this) with the server.

Throws:
ConfigException - If the workflow element ID for the provided workflow element conflicts with the workflow element ID of an existing workflow element.

deregister

public void deregister()
Deregisters the workflow element (this) with the server.


getWorkflowElement

public static WorkflowElement getWorkflowElement(java.lang.String workflowElementID)
Gets a workflow element that was registered with the server.

Parameters:
workflowElementID - the ID of the workflow element to get
Returns:
the requested workflow element

resetConfig

public static void resetConfig()
Resets all the registered workflows.