| | |
| | | import org.opends.messages.Message; |
| | | import static org.opends.server.util.Validator.ensureNotNull; |
| | | |
| | | import java.util.Collection; |
| | | import java.util.TreeMap; |
| | | |
| | | import org.opends.server.types.DN; |
| | |
| | | |
| | | |
| | | /** |
| | | * Performs any finalization that might be required when this |
| | | * workflow is unloaded. No action is taken in the default |
| | | * implementation. |
| | | */ |
| | | public void finalizeWorkflow() |
| | | { |
| | | // No action is required by default. |
| | | } |
| | | |
| | | |
| | | /** |
| | | * Gets the base DN of the data set being handled by the workflow. |
| | | * |
| | | * @return the workflow base DN |
| | |
| | | return workflowToDeregister; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * Deregisters all Workflows that have been registered. This should be |
| | | * called when the server is shutting down. |
| | |
| | | new TreeMap<String, Workflow>(); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * Gets a workflow that was registered with the server. |
| | | * |
| | | * @param workflowID the ID of the workflow to get |
| | | * @return the requested workflow |
| | | */ |
| | | public static Workflow getWorkflow( |
| | | String workflowID) |
| | | { |
| | | return registeredWorkflows.get(workflowID); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * Gets all the workflows that were registered with the server. |
| | | * |
| | | * @return the list of registered workflows |
| | | */ |
| | | public static Collection<Workflow> getWorkflows() |
| | | { |
| | | return registeredWorkflows.values(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * Gets the root workflow element for test purpose only. |
| | | * |
| | | * @return the root workflow element. |
| | | */ |
| | | WorkflowElement getRootWorkflowElement() |
| | | { |
| | | return rootWorkflowElement; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * Resets all the registered workflows. |
| | | */ |
| | | public static void resetConfig() |
| | | { |
| | | synchronized (registeredWorkflowsLock) |
| | | { |
| | | registeredWorkflows = new TreeMap<String, Workflow>(); |
| | | } |
| | | } |
| | | |
| | | } |