001    /*
002     * CDDL HEADER START
003     *
004     * The contents of this file are subject to the terms of the
005     * Common Development and Distribution License, Version 1.0 only
006     * (the "License").  You may not use this file except in compliance
007     * with the License.
008     *
009     * You can obtain a copy of the license at
010     * trunk/opends/resource/legal-notices/OpenDS.LICENSE
011     * or https://OpenDS.dev.java.net/OpenDS.LICENSE.
012     * See the License for the specific language governing permissions
013     * and limitations under the License.
014     *
015     * When distributing Covered Code, include this CDDL HEADER in each
016     * file and include the License file at
017     * trunk/opends/resource/legal-notices/OpenDS.LICENSE.  If applicable,
018     * add the following below this CDDL HEADER, with the fields enclosed
019     * by brackets "[]" replaced with your own identifying information:
020     *      Portions Copyright [yyyy] [name of copyright owner]
021     *
022     * CDDL HEADER END
023     *
024     *
025     *      Copyright 2008 Sun Microsystems, Inc.
026     */
027    package org.opends.server.core;
028    
029    
030    import org.opends.server.types.DN;
031    import org.opends.server.types.Operation;
032    import org.opends.server.types.CanceledOperationException;
033    
034    
035    /**
036     * This class defines the workflow interface. There can be two
037     * implementations for the workflows.
038     *
039     * In the first workflow implementation a workflow is a list of
040     * structured tasks (aka workflow element). Each task is working
041     * on a set of data being identified by a base DN. The order of the
042     * tasks and their synchronization are defined statically by a task
043     * tree.
044     *
045     * In the second workflow implementation each workflow is a node
046     * in a workflow tree (aka worflow topology). Each node in the tree
047     * is linked to a workflow object of the first implementation and the
048     * base DN of the node is the base DN of the attached workflow object.
049     * The relationship of the nodes in the tree is based on the base DNs
050     * of the nodes. A workflow node is a subordinate of another workflow
051     * node when the base DN of the former is a superior of the base DN of
052     * the latter. Workflow topology are useful, for example, in subtree
053     * searches: search is performed on a node as well as on all the
054     * subordinate nodes.
055     */
056    public interface Workflow
057    {
058      /**
059       * Gets the base DN which identifies the set of data upon which the
060       * workflow is to be executed.
061       *
062       * @return the base DN of the workflow
063       */
064      public DN getBaseDN();
065    
066    
067      /**
068       * Executes all the tasks defined by the workflow task tree for a given
069       * operation.
070       *
071       * @param operation  the operation to execute
072       *
073       * @throws CanceledOperationException if this operation should
074       * be cancelled.
075       */
076      public void execute(Operation operation)
077          throws CanceledOperationException;
078    }