mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Jean-Noel Rouvignac
04.00.2014 2434d746823cf70eece4fe2221ae2f3e2902bc1b
opendj3-server-dev/src/server/org/opends/server/core/WorkflowImpl.java
@@ -26,7 +26,6 @@
 */
package org.opends.server.core;
import java.util.Collection;
import java.util.Observable;
import java.util.Observer;
import java.util.TreeMap;
@@ -38,7 +37,7 @@
import org.opends.server.types.DirectoryException;
import org.opends.server.types.Operation;
import org.opends.server.workflowelement.ObservableWorkflowElementState;
import org.opends.server.workflowelement.WorkflowElement;
import org.opends.server.workflowelement.localbackend.LocalBackendWorkflowElement;
import static org.forgerock.util.Reject.*;
import static org.opends.messages.CoreMessages.*;
@@ -54,43 +53,46 @@
 */
public class WorkflowImpl implements Workflow, Observer
{
  // The workflow identifier used by the configuration.
  /** The workflow identifier used by the configuration. */
  private final String workflowID;
  // The root of the workflow task tree.
  private WorkflowElement rootWorkflowElement = null;
  /** The root of the workflow task tree. */
  private LocalBackendWorkflowElement rootWorkflowElement;
  // The root workflow element identifier.
  private String rootWorkflowElementID = null;
  /** The root workflow element identifier. */
  private final String rootWorkflowElementID;
  // The base DN of the data handled by the workflow.
  /** The base DN of the data handled by the workflow. */
  private final DN baseDN;
  // Flag indicating whether the workflow root node of the task tree is
  // handling a private local backend.
  //
  // A private local backend is used by the server to store "private data"
  // such as schemas, tasks, monitoring data, configuration data... Such
  // private data are not returned upon a subtree search on the root DSE.
  // Also it is not planned to have anything but a single node task tree
  // to handle private local backend. So workflows used for proxy and
  // virtual will always be made public (ie. not private). So, unless the
  // rootWorkflowElement is handling a private local backend, the isPrivate
  // flag will always return false.
  private boolean isPrivate = false;
  /**
   * Flag indicating whether the workflow root node of the task tree is
   * handling a private local backend.
   * A private local backend is used by the server to store "private data"
   * such as schemas, tasks, monitoring data, configuration data... Such
   * private data are not returned upon a subtree search on the root DSE.
   * Also it is not planned to have anything but a single node task tree
   * to handle private local backend. So workflows used for proxy and
   * virtual will always be made public (ie. not private). So, unless the
   * rootWorkflowElement is handling a private local backend, the isPrivate
   * flag will always return false.
   */
  private final boolean isPrivate;
  // The set of workflows registered with the server.
  /** The set of workflows registered with the server. */
  private static TreeMap<String, Workflow> registeredWorkflows =
    new TreeMap<String, Workflow>();
  // A lock to protect concurrent access to the registeredWorkflows.
  private static Object registeredWorkflowsLock = new Object();
  /** A lock to protect concurrent access to the registeredWorkflows. */
  private final static Object registeredWorkflowsLock = new Object();
  // A reference counter used to count the number of workflow nodes that
  // were registered with a network group. A workflow can be disabled or
  // deleted only when its reference counter value is 0.
  private int referenceCounter = 0;
  private Object referenceCounterLock = new Object();
  /**
   * A reference counter used to count the number of workflow nodes that
   * were registered with a network group. A workflow can be disabled or
   * deleted only when its reference counter value is 0.
   */
  private int referenceCounter;
  private final Object referenceCounterLock = new Object();
  /**
@@ -109,7 +111,7 @@
      String             workflowId,
      DN                 baseDN,
      String             rootWorkflowElementID,
      WorkflowElement rootWorkflowElement
      LocalBackendWorkflowElement rootWorkflowElement
      )
  {
    this.workflowID = workflowId;
@@ -122,31 +124,20 @@
      // The workflow wants to be notified when the workflow element state
      // is changing from enabled to disabled and vice versa.
      WorkflowElement.registereForStateUpdate(
        rootWorkflowElement, null, this);
      LocalBackendWorkflowElement.registerForStateUpdate(rootWorkflowElement, null, this);
    }
    else
    {
      this.isPrivate = false;
      this.rootWorkflowElementID = null;
      // The root workflow element has not been loaded, let's register
      // the workflow with the list of objects that want to be notify
      // when the workflow element is created.
      WorkflowElement.registereForStateUpdate(
        null, rootWorkflowElementID, this);
      LocalBackendWorkflowElement.registerForStateUpdate(null, rootWorkflowElementID, this);
    }
  }
  /**
   * 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.
   *
@@ -250,8 +241,7 @@
    // Deregister the workflow with the list of objects to notify when
    // a workflow element is created or deleted.
    WorkflowElement.deregisterForStateUpdate(
      null, rootWorkflowElementID, this);
    LocalBackendWorkflowElement.deregisterForStateUpdate(null, rootWorkflowElementID, this);
    // Deregister the workflow with the list of registered workflows.
    synchronized (registeredWorkflowsLock)
@@ -265,33 +255,6 @@
  /**
   * Deregisters a workflow with the server. The workflow to deregister
   * is identified with its identifier.
   *
   * @param workflowID  the identifier of the workflow to deregister
   *
   * @return the workflow that has been deregistered,
   *         <code>null</code> if no workflow has been found.
   */
  public WorkflowImpl deregister(String workflowID)
  {
    WorkflowImpl workflowToDeregister = null;
    synchronized (registeredWorkflowsLock)
    {
      if (registeredWorkflows.containsKey(workflowID))
      {
        workflowToDeregister =
          (WorkflowImpl) registeredWorkflows.get(workflowID);
        workflowToDeregister.deregister();
      }
    }
    return workflowToDeregister;
  }
  /**
   * Deregisters all Workflows that have been registered.  This should be
   * called when the server is shutting down.
   */
@@ -317,31 +280,17 @@
    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()
  LocalBackendWorkflowElement getRootWorkflowElement()
  {
    return rootWorkflowElement;
  }
  /**
   * {@inheritDoc}
   */
  /** {@inheritDoc} */
  @Override
  public void update(Observable observable, Object arg)
  {
@@ -387,7 +336,7 @@
  {
    // Check that the workflow element maps the root workflow element.
    // If not then ignore the workflow element.
    WorkflowElement we = weState.getObservedWorkflowElement();
    LocalBackendWorkflowElement we = weState.getObservedWorkflowElement();
    String newWorkflowElementID = we.getWorkflowElementID();
    if (! rootWorkflowElementID.equalsIgnoreCase(newWorkflowElementID))
    {
@@ -398,8 +347,8 @@
    // don't forget to register the workflow with the list of objects to notify
    // when the root workflow element is disabled...
    rootWorkflowElement = weState.getObservedWorkflowElement();
    WorkflowElement.registereForStateUpdate(rootWorkflowElement, null, this);
    WorkflowElement.deregisterForStateUpdate(null, rootWorkflowElementID, this);
    LocalBackendWorkflowElement.registerForStateUpdate(rootWorkflowElement, null, this);
    LocalBackendWorkflowElement.deregisterForStateUpdate(null, rootWorkflowElementID, this);
  }
opendj3-server-dev/src/server/org/opends/server/core/networkgroups/ANDConnectionCriteria.java
File was deleted
opendj3-server-dev/src/server/org/opends/server/core/networkgroups/BindDNConnectionCriteria.java
File was deleted
opendj3-server-dev/src/server/org/opends/server/core/networkgroups/ConnectionCriteria.java
File was deleted
opendj3-server-dev/src/server/org/opends/server/core/networkgroups/IPConnectionCriteria.java
File was deleted
opendj3-server-dev/src/server/org/opends/server/core/networkgroups/NetworkGroup.java
@@ -39,7 +39,6 @@
import org.opends.server.core.Workflow;
import org.opends.server.core.WorkflowImpl;
import org.opends.server.core.WorkflowTopologyNode;
import org.opends.server.types.AuthenticationType;
import org.opends.server.types.DN;
import org.opends.server.types.DirectoryException;
import org.opends.server.types.InitializationException;
@@ -125,29 +124,6 @@
    }
  }
  /**
   * Gets the highest priority matching network group.
   *
   * @param connection
   *          the client connection
   * @return matching network group
   */
  static NetworkGroup findMatchingNetworkGroup(
      ClientConnection connection)
  {
    for (NetworkGroup ng : orderedNetworkGroups)
    {
      if (ng.match(connection))
      {
        return ng;
      }
    }
    return defaultNetworkGroup;
  }
  /**
   * Returns the admin network group.
   *
@@ -200,9 +176,6 @@
    return registeredNetworkGroups.get(networkGroupID);
  }
  // The network group connection criteria.
  private final ConnectionCriteria criteria = ConnectionCriteria.TRUE;
  private final boolean isAdminNetworkGroup;
  private final boolean isDefaultNetworkGroup;
  private final boolean isInternalNetworkGroup;
@@ -744,60 +717,6 @@
    registeredWorkflowNodes = null;
  }
  /**
   * Checks whether the connection matches the network group criteria.
   *
   * @param connection
   *          the client connection
   * @return a boolean indicating the match
   */
  private boolean match(ClientConnection connection)
  {
    if (criteria != null)
    {
      return criteria.matches(connection);
    }
    else
    {
      return true;
    }
  }
  /**
   * Checks whether the client connection matches the criteria after
   * bind.
   *
   * @param connection
   *          the ClientConnection
   * @param bindDN
   *          the DN used to bind
   * @param authType
   *          the authentication type
   * @param isSecure
   *          a boolean indicating whether the connection is secure
   * @return a boolean indicating whether the connection matches the
   *         criteria
   */
  private boolean matchAfterBind(ClientConnection connection,
      DN bindDN, AuthenticationType authType, boolean isSecure)
  {
    if (criteria != null)
    {
      return criteria.willMatchAfterBind(connection, bindDN, authType,
          isSecure);
    }
    else
    {
      return true;
    }
  }
  /**
   * Rebuilds the list of naming contexts handled by the network group.
   * This operation should be performed whenever a workflow topology has
opendj3-server-dev/src/server/org/opends/server/core/networkgroups/SecurityConnectionCriteria.java
File was deleted
opendj3-server-dev/src/server/org/opends/server/workflowelement/ObservableWorkflowElementState.java
@@ -28,6 +28,8 @@
import java.util.Observable;
import org.opends.server.workflowelement.localbackend.LocalBackendWorkflowElement;
/**
 * This class implements an observable workflow element state.
 * The observable workflow element state notifies observers when the
@@ -36,7 +38,7 @@
 */
public class ObservableWorkflowElementState extends Observable
{
  private final WorkflowElement observedWorkflowElement;
  private final LocalBackendWorkflowElement observedWorkflowElement;
  /**
   * Creates an instance of an observable object for a given workflow
@@ -45,7 +47,7 @@
   * @param  observedWorkflowElement
   *         The workflow element to observe.
   */
  ObservableWorkflowElementState(WorkflowElement observedWorkflowElement)
  public ObservableWorkflowElementState(LocalBackendWorkflowElement observedWorkflowElement)
  {
    this.observedWorkflowElement = observedWorkflowElement;
  }
@@ -55,7 +57,7 @@
   *
   * @return the observed workflow element.
   */
  public WorkflowElement getObservedWorkflowElement()
  public LocalBackendWorkflowElement getObservedWorkflowElement()
  {
    return observedWorkflowElement;
  }
opendj3-server-dev/src/server/org/opends/server/workflowelement/WorkflowElement.java
File was deleted
opendj3-server-dev/src/server/org/opends/server/workflowelement/localbackend/LocalBackendWorkflowElement.java
@@ -29,7 +29,12 @@
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Observable;
import java.util.Observer;
import java.util.TreeMap;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.CopyOnWriteArrayList;
import org.forgerock.i18n.LocalizableMessage;
import org.forgerock.i18n.LocalizableMessageDescriptor;
@@ -42,15 +47,26 @@
import org.opends.server.controls.LDAPPreReadResponseControl;
import org.opends.server.core.*;
import org.opends.server.types.*;
import org.opends.server.workflowelement.WorkflowElement;
import org.opends.server.workflowelement.ObservableWorkflowElementState;
import static org.opends.messages.CoreMessages.*;
/**
 * This class defines a workflow element, i.e. a task in a workflow.
 *
 * [outdated]
 * 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...).
 * [/outdated]
 *
 * This class defines a local backend workflow element; e-g an entity that
 * handle the processing of an operation against a local backend.
 */
public class LocalBackendWorkflowElement extends WorkflowElement
public class LocalBackendWorkflowElement implements Observer
{
  private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass();
@@ -82,14 +98,120 @@
  private static final String BACKEND_WORKFLOW_ELEMENT = "Backend";
  /** The observable state of the workflow element. */
  private ObservableWorkflowElementState observableState = new ObservableWorkflowElementState(this);
  /**
   * Creates a new instance of the local backend workflow element.
   * The list of observers who want to be notified when a workflow element
   * required by the observer is created. The key of the map is a string that
   * identifies the newly created workflow element.
   */
  public LocalBackendWorkflowElement()
  private static ConcurrentMap<String, List<Observer>> newWorkflowElementNotificationList =
      new ConcurrentHashMap<String, List<Observer>>();
  /**
   * Registers with a specific workflow element to be notified when the workflow
   * element state has changed. This notification system is mainly used to be
   * warned when a workflow element is enabled or disabled.
   * <p>
   * If the workflow element <code>we</code> is not <code>null</code> then the
   * <code>observer</code> is registered with the list of objects to notify when
   * <code>we</code> has changed.
   * <p>
   * If the workflow element <code>we</code> is <code>null</code> then the
   * <code>observer</code> is registered with a static list of objects to notify
   * when a workflow element named <code>weid</code> is created.
   *
   * @param we
   *          the workflow element. If <code>null</code> then observer is
   *          registered with a list of workflow element identifiers.
   * @param weid
   *          the identifier of the workflow element. This parameter is useless
   *          when <code>we</code> is not <code>null</code>
   * @param observer
   *          the observer to notify when the workflow element state has been
   *          modified
   */
  // TODO JNR rename
  public static void registerForStateUpdate(LocalBackendWorkflowElement we, String weid, Observer observer)
  {
    // There is nothing to do in this constructor.
    // If the workflow element "we" exists then register the observer with "we"
    // else register the observer with a static list of workflow element
    // identifiers
    if (we != null)
    {
      we.observableState.addObserver(observer);
    }
    else
    {
      if (weid == null)
      {
        return;
      }
      List<Observer> observers = newWorkflowElementNotificationList.get(weid);
      if (observers == null)
      {
        // create the list of observers
        observers = new CopyOnWriteArrayList<Observer>();
        observers.add(observer);
        newWorkflowElementNotificationList.put(weid, observers);
      }
      else
      {
        // update the observer list
        observers.add(observer);
      }
    }
  }
  /**
   * Deregisters an observer that was registered with a specific workflow
   * element.
   * <p>
   * If the workflow element <code>we</code> is not <code>null</code> then the
   * <code>observer</code> is deregistered with the list of objects to notify
   * when <code>we</code> has changed.
   * <p>
   * If the workflow element <code>we</code> is <code>null</code> then the
   * <code>observer</code> is deregistered with a static list of objects to
   * notify when a workflow element named <code>weid</code> is created.
   *
   * @param we
   *          the workflow element. If <code>null</code> then observer is
   *          deregistered with a list of workflow element identifiers.
   * @param weid
   *          the identifier of the workflow element. This parameter is useless
   *          when <code>we</code> is not <code>null</code>
   * @param observer
   *          the observer to deregister
   */
  public static void deregisterForStateUpdate(LocalBackendWorkflowElement we, String weid, Observer observer)
  {
    // If the workflow element "we" exists then deregister the observer
    // with "we" else deregister the observer with a static list of
    // workflow element identifiers
    if (we != null)
    {
      we.observableState.deleteObserver(observer);
    }
    if (weid != null)
    {
      List<Observer> observers = newWorkflowElementNotificationList.get(weid);
      if (observers != null)
      {
        observers.remove(observer);
      }
    }
  }
  /** {@inheritDoc} */
  @Override
  public final void update(Observable o, Object arg)
  {
    // By default, do nothing when notification hits the workflow element.
  }
  /**
   * Initializes a new instance of the local backend workflow element.
@@ -108,15 +230,22 @@
    this.backend  = backend;
  }
  /** {@inheritDoc} */
  @Override
  /**
   * Indicates whether the workflow element encapsulates a private local
   * backend.
   *
   * @return <code>true</code> if the workflow element encapsulates a private
   *         local backend, <code>false</code> otherwise
   */
  public boolean isPrivate()
  {
    return this.backend != null && this.backend.isPrivateBackend();
  }
  /** {@inheritDoc} */
  @Override
  /**
   * Performs any finalization that might be required when this workflow element
   * is unloaded. No action is taken in the default implementation.
   */
  public void finalizeWorkflowElement()
  {
    // null all fields so that any use of the finalized object will raise a NPE
@@ -521,8 +650,14 @@
    }
  }
  /** {@inheritDoc} */
  @Override
  /**
   * Executes the workflow element for an operation.
   *
   * @param operation
   *          the operation to execute
   * @throws CanceledOperationException
   *           if this operation should be canceled
   */
  public void execute(Operation operation) throws CanceledOperationException {
    switch (operation.getOperationType())
    {
@@ -617,7 +752,6 @@
   *
   * @return the workflow element identifier
   */
  @Override
  public String getWorkflowElementID()
  {
    return workflowElementID;
opendj3-server-dev/tests/unit-tests-testng/src/server/org/opends/server/core/WorkflowTopologyTest.java
@@ -35,7 +35,6 @@
import org.opends.server.types.DirectoryException;
import org.opends.server.util.StaticUtils;
import org.opends.server.util.UtilTestCase;
import org.opends.server.workflowelement.WorkflowElement;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
@@ -352,7 +351,6 @@
   * result code.
   *
   * @return set of result codes to test
   * @throws Exception
   */
  @DataProvider(name = "ResultCodes_1")
  public Object[][] initResultCodes_1()
@@ -412,10 +410,7 @@
      DN dummyDN
      )
  {
    // create a DIT set with the baseDN (no workflow element in the DIT).
    WorkflowElement nullWE = null;
    WorkflowImpl workflow =
      new WorkflowImpl (baseDN.toString(), baseDN, null, nullWE);
    WorkflowImpl workflow = new WorkflowImpl(baseDN.toString(), baseDN, null, null);
    // Create a worflow with the dit, no pre/post-workflow element.
    WorkflowTopologyNode workflowNode = new WorkflowTopologyNode(workflow);
@@ -457,7 +452,7 @@
   *
   * There is no worklfow element attached to the DITs.
   *
   * @param baseDn         base DN for the parent workflow (W1)
   * @param baseDN         base DN for the parent workflow (W1)
   * @param subordinateDN  base DN for the subordinate workflow (W2)
   * @param unrelatedDN    base DN with no hierarchical relationship with any
   *                       of the two baseDNs; parameter may be null
@@ -476,14 +471,11 @@
    WorkflowImpl subWorkflow       = null;
    WorkflowImpl unrelatedWorkflow = null;
    {
      WorkflowElement nullWE = null;
      workflow = new WorkflowImpl (baseDN.toString(), baseDN, null, nullWE);
      subWorkflow = new WorkflowImpl (
        subordinateDN.toString(), subordinateDN, null, nullWE);
      workflow = new WorkflowImpl(baseDN.toString(), baseDN, null, null);
      subWorkflow = new WorkflowImpl(subordinateDN.toString(), subordinateDN, null, null);
      if (unrelatedDN != null)
      {
        unrelatedWorkflow = new WorkflowImpl (
          unrelatedDN.toString(), unrelatedDN, null, nullWE);
        unrelatedWorkflow = new WorkflowImpl(unrelatedDN.toString(), unrelatedDN, null, null);
      }
    }
@@ -594,7 +586,7 @@
   *
   * There is no worklfow element attached to the DITs.
   *
   * @param baseDn1         base DN for the top workflow (W1)
   * @param baseDN1         base DN for the top workflow (W1)
   * @param baseDN2         base DN for the first subordinate workflow (W2)
   * @param baseDN3         base DN for the second subordinate workflow (W3)
   * @param subordinateDN1  subordinate DN of baseDN1
@@ -623,10 +615,9 @@
      WorkflowImpl workflow2;
      WorkflowImpl workflow3;
      {
        WorkflowElement nullWE = null;
        workflow1 = new WorkflowImpl(baseDN1.toString(), baseDN1, null, nullWE);
        workflow2 = new WorkflowImpl(baseDN2.toString(), baseDN2, null, nullWE);
        workflow3 = new WorkflowImpl(baseDN3.toString(), baseDN3, null, nullWE);
        workflow1 = new WorkflowImpl(baseDN1.toString(), baseDN1, null, null);
        workflow2 = new WorkflowImpl(baseDN2.toString(), baseDN2, null, null);
        workflow3 = new WorkflowImpl(baseDN3.toString(), baseDN3, null, null);
      }
      w1 = new WorkflowTopologyNode(workflow1);
@@ -775,7 +766,7 @@
   *
   * There is no worklfow element attached to the DITs.
   *
   * @param baseDn1         base DN for the top workflow (W1)
   * @param baseDN1         base DN for the top workflow (W1)
   * @param baseDN2         base DN for the first subordinate workflow (W2)
   * @param baseDN3         base DN for the second subordinate workflow (W3)
   * @param subordinateDN1  subordinate DN of baseDN1
@@ -804,11 +795,9 @@
      WorkflowImpl workflow2;
      WorkflowImpl workflow3;
      {
        WorkflowElement nullWE = null;
        workflow1 = new WorkflowImpl(baseDN1.toString(), baseDN1, null, nullWE);
        workflow2 = new WorkflowImpl(baseDN2.toString(), baseDN2, null, nullWE);
        workflow3 = new WorkflowImpl(baseDN3.toString(), baseDN3, null, nullWE);
        workflow1 = new WorkflowImpl(baseDN1.toString(), baseDN1, null, null);
        workflow2 = new WorkflowImpl(baseDN2.toString(), baseDN2, null, null);
        workflow3 = new WorkflowImpl(baseDN3.toString(), baseDN3, null, null);
      }
      w1 = new WorkflowTopologyNode(workflow1);
@@ -929,11 +918,8 @@
      )
      throws DirectoryException
  {
    WorkflowElement nullWE = null;
    // Create a workflow to handle the baseDN with no workflow element
    WorkflowImpl workflow = new WorkflowImpl(
        baseDN.toString(), baseDN, null, nullWE);
    WorkflowImpl workflow = new WorkflowImpl(baseDN.toString(), baseDN, null, null);
    // Register the workflow with the server. Don't catch the
    // DirectoryException that could be thrown by the register() method.
@@ -941,17 +927,15 @@
    // Register the same workflow twice and catch the expected
    // DirectoryException.
    boolean exceptionRaised = false;
    try
    {
      workflow.register();
      fail("Expected DirectoryException to br thrown");
    }
    catch (DirectoryException e)
    {
      exceptionRaised = true;
      assertTrue(StaticUtils.hasDescriptor(e.getMessageObject(),
          ERR_REGISTER_WORKFLOW_ALREADY_EXISTS));
    }
    assertEquals(exceptionRaised, true);
  }
}
opendj3-server-dev/tests/unit-tests-testng/src/server/org/opends/server/core/networkgroups/ANDConnectionCriteriaTest.java
File was deleted
opendj3-server-dev/tests/unit-tests-testng/src/server/org/opends/server/core/networkgroups/BindDNConnectionCriteriaTest.java
File was deleted
opendj3-server-dev/tests/unit-tests-testng/src/server/org/opends/server/core/networkgroups/IPConnectionCriteriaTest.java
File was deleted
opendj3-server-dev/tests/unit-tests-testng/src/server/org/opends/server/core/networkgroups/MockClientConnection.java
File was deleted
opendj3-server-dev/tests/unit-tests-testng/src/server/org/opends/server/core/networkgroups/NetworkGroupTest.java
@@ -33,7 +33,6 @@
import org.forgerock.opendj.ldap.SearchScope;
import org.opends.server.DirectoryServerTestCase;
import org.opends.server.TestCaseUtils;
import org.opends.server.api.ClientConnection;
import org.opends.server.core.ModifyOperation;
import org.opends.server.core.SearchOperation;
import org.opends.server.core.Workflow;
@@ -47,7 +46,6 @@
import org.opends.server.types.InitializationException;
import org.opends.server.types.Modification;
import org.opends.server.util.StaticUtils;
import org.opends.server.workflowelement.WorkflowElement;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
@@ -317,9 +315,7 @@
    // Create a workflow -- the workflow ID is the string representation
    // of the workflow base DN.
    WorkflowElement nullWE = null;
    WorkflowImpl workflow = new WorkflowImpl(
        workflowBaseDN.toString(), workflowBaseDN, null, nullWE);
    WorkflowImpl workflow = new WorkflowImpl(workflowBaseDN.toString(), workflowBaseDN, null, null);
    // Register the workflow with the network group.
    networkGroup.registerWorkflow(workflow);
@@ -729,25 +725,13 @@
    // Create a workflow -- the workflow ID is the string representation
    // of the workflow base DN.
    WorkflowElement nullWE = null;
    WorkflowImpl workflow1 = new WorkflowImpl(
        dn1.toString(), dn1, null, nullWE);
    WorkflowImpl workflow2 = new WorkflowImpl(
        dn2.toString(), dn2, null, nullWE);
    WorkflowImpl workflow1 = new WorkflowImpl(dn1.toString(), dn1, null, null);
    WorkflowImpl workflow2 = new WorkflowImpl(dn2.toString(), dn2, null, null);
    // Register the workflow with the network group.
    networkGroup1.registerWorkflow(workflow1);
    networkGroup2.registerWorkflow(workflow2);
    // Create a new ClientConnection
    ClientConnection connection = new InternalClientConnection(DN.NULL_DN);
    // Find a networkGroup for this connection
    // As the network groups define no criteria, the highest priority
    // must be chosen
    NetworkGroup ng = NetworkGroup.findMatchingNetworkGroup(connection);
    assertEquals(ng, prio1 < prio2 ? networkGroup1 : networkGroup2);
    // Clean the network group
    networkGroup1.deregisterWorkflow(workflow1.getWorkflowId());
    networkGroup1.deregister();
@@ -966,10 +950,7 @@
    // Create a workflow with no task inside. The workflow identifier
    // is the a string representation of the workflow base DN.
    WorkflowElement rootWE = null;
    String workflowId = workflowBaseDN.toString();
    WorkflowImpl workflow = new WorkflowImpl(
        workflowId, workflowBaseDN, null, rootWE);
    WorkflowImpl workflow = new WorkflowImpl(workflowBaseDN.toString(), workflowBaseDN, null, null);
    assertNotNull(workflow);
    // Register the workflow with the network group.
opendj3-server-dev/tests/unit-tests-testng/src/server/org/opends/server/core/networkgroups/SecurityConnectionCriteriaTest.java
File was deleted