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

Jean-Noel Rouvignac
22.50.2014 977d282dbf8559470e67cfcc0b4e45c40980edfd
OPENDJ-1545 Remove Workflow, NetworkGroups and related attempts at building a proxy


Removed dead code, unused classes/methods, or classes/methods used to no effect, pushed down fields and classes to remove classes sitting in a class hierarchy with no value, etc.
11 files deleted
6 files modified
3688 ■■■■■ changed files
opendj-config-maven-plugin/src/main/resources/config/xml/org/forgerock/opendj/server/config/RequestFilteringQOSPolicyConfiguration.xml 207 ●●●●● patch | view | raw | blame | history
opendj-config-maven-plugin/src/main/resources/config/xml/org/forgerock/opendj/server/config/ResourceLimitsQOSPolicyConfiguration.xml 274 ●●●●● patch | view | raw | blame | history
opendj3-server-dev/src/admin/defn/org/opends/server/admin/std/RequestFilteringQOSPolicyConfiguration.xml 207 ●●●●● patch | view | raw | blame | history
opendj3-server-dev/src/admin/defn/org/opends/server/admin/std/ResourceLimitsQOSPolicyConfiguration.xml 274 ●●●●● patch | view | raw | blame | history
opendj3-server-dev/src/server/org/opends/server/core/networkgroups/NetworkGroup.java 51 ●●●●● patch | view | raw | blame | history
opendj3-server-dev/src/server/org/opends/server/core/networkgroups/RequestFilteringPolicy.java 13 ●●●●● patch | view | raw | blame | history
opendj3-server-dev/src/server/org/opends/server/core/networkgroups/RequestFilteringPolicyFactory.java 669 ●●●●● patch | view | raw | blame | history
opendj3-server-dev/src/server/org/opends/server/core/networkgroups/RequestFilteringPolicyStatistics.java 154 ●●●●● patch | view | raw | blame | history
opendj3-server-dev/src/server/org/opends/server/core/networkgroups/ResourceLimitsPolicy.java 11 ●●●●● patch | view | raw | blame | history
opendj3-server-dev/src/server/org/opends/server/core/networkgroups/ResourceLimitsPolicyFactory.java 544 ●●●●● patch | view | raw | blame | history
opendj3-server-dev/src/server/org/opends/server/core/networkgroups/ResourceLimitsPolicyStatistics.java 120 ●●●●● patch | view | raw | blame | history
opendj3-server-dev/src/server/org/opends/server/workflowelement/WorkflowElement.java 136 ●●●●● patch | view | raw | blame | history
opendj3-server-dev/src/server/org/opends/server/workflowelement/WorkflowElementConfigManager.java 12 ●●●● patch | view | raw | blame | history
opendj3-server-dev/src/server/org/opends/server/workflowelement/localbackend/LocalBackendWorkflowElement.java 54 ●●●●● patch | view | raw | blame | history
opendj3-server-dev/tests/unit-tests-testng/src/server/org/opends/server/core/networkgroups/MockRequestFilteringQOSPolicyCfg.java 188 ●●●●● patch | view | raw | blame | history
opendj3-server-dev/tests/unit-tests-testng/src/server/org/opends/server/core/networkgroups/RequestFilteringPolicyTest.java 525 ●●●●● patch | view | raw | blame | history
opendj3-server-dev/tests/unit-tests-testng/src/server/org/opends/server/core/networkgroups/ResourceLimitsPolicyTest.java 249 ●●●●● patch | view | raw | blame | history
opendj-config-maven-plugin/src/main/resources/config/xml/org/forgerock/opendj/server/config/RequestFilteringQOSPolicyConfiguration.xml
File was deleted
opendj-config-maven-plugin/src/main/resources/config/xml/org/forgerock/opendj/server/config/ResourceLimitsQOSPolicyConfiguration.xml
File was deleted
opendj3-server-dev/src/admin/defn/org/opends/server/admin/std/RequestFilteringQOSPolicyConfiguration.xml
File was deleted
opendj3-server-dev/src/admin/defn/org/opends/server/admin/std/ResourceLimitsQOSPolicyConfiguration.xml
File was deleted
opendj3-server-dev/src/server/org/opends/server/core/networkgroups/NetworkGroup.java
@@ -431,7 +431,7 @@
   *          The network group ID.
   * @return The network group, of <code>null</code> if no match was found.
   */
  public static NetworkGroup getNetworkGroup(String networkGroupID)
  static NetworkGroup getNetworkGroup(String networkGroupID)
  {
    return registeredNetworkGroups.get(networkGroupID);
  }
@@ -1038,7 +1038,7 @@
   * group is unloaded. No action is taken in the default
   * implementation.
   */
  public void finalizeNetworkGroup()
  void finalizeNetworkGroup()
  {
    if (configuration != null)
    {
@@ -1125,7 +1125,7 @@
   *         the specified class, or <code>null</code> if none was
   *         found.
   */
  public <T extends QOSPolicy> T getNetworkGroupQOSPolicy(Class<T> clazz)
  <T extends QOSPolicy> T getNetworkGroupQOSPolicy(Class<T> clazz)
  {
    for (QOSPolicy policy : policies.values())
    {
@@ -1134,7 +1134,6 @@
        return clazz.cast(policy);
      }
    }
    return null;
  }
@@ -1301,50 +1300,6 @@
    }
  }
  /**
   * Returns the request filtering policy statistics associated with
   * this network group.
   *
   * @return The request filtering policy statistics associated with
   *         this network group.
   */
  RequestFilteringPolicyStatistics getRequestFilteringPolicyStatistics()
  {
    if (requestFilteringPolicy != null)
    {
      return requestFilteringPolicy.getStatistics();
    }
    else
    {
      return null;
    }
  }
  /**
   * Returns the resource limits policy statistics associated with this
   * network group.
   *
   * @return The resource limits policy statistics associated with this
   *         network group.
   */
  ResourceLimitsPolicyStatistics getResourceLimitsPolicyStatistics()
  {
    if (resourceLimitsPolicy != null)
    {
      return resourceLimitsPolicy.getStatistics();
    }
    else
    {
      return null;
    }
  }
  /**
   * Registers the current network group (this) with the server.
   * <p>
opendj3-server-dev/src/server/org/opends/server/core/networkgroups/RequestFilteringPolicy.java
@@ -50,19 +50,6 @@
    // No implementation required.
  }
  /**
   * Returns the statistics associated with this request filtering
   * policy.
   *
   * @return The statistics associated with this request filtering
   *         policy.
   */
  abstract RequestFilteringPolicyStatistics getStatistics();
  /**
   * Determines if the provided operation is allowed according to this
   * request filtering policy.
opendj3-server-dev/src/server/org/opends/server/core/networkgroups/RequestFilteringPolicyFactory.java
File was deleted
opendj3-server-dev/src/server/org/opends/server/core/networkgroups/RequestFilteringPolicyStatistics.java
File was deleted
opendj3-server-dev/src/server/org/opends/server/core/networkgroups/ResourceLimitsPolicy.java
@@ -81,17 +81,6 @@
   */
  abstract int getSizeLimit();
  /**
   * Returns the statistics associated with this resource limits policy.
   *
   * @return The statistics associated with this resource limits policy.
   */
  abstract ResourceLimitsPolicyStatistics getStatistics();
  /**
   * Returns the maximum length of time in seconds permitted for a
   * search operation processed by this network group.
opendj3-server-dev/src/server/org/opends/server/core/networkgroups/ResourceLimitsPolicyFactory.java
File was deleted
opendj3-server-dev/src/server/org/opends/server/core/networkgroups/ResourceLimitsPolicyStatistics.java
File was deleted
opendj3-server-dev/src/server/org/opends/server/workflowelement/WorkflowElement.java
@@ -51,28 +51,17 @@
public abstract class WorkflowElement <T extends WorkflowElementCfg>
    implements Observer
{
  // Indicates whether the workflow element encapsulates a private local
  // backend.
  private boolean isPrivate = false;
  // An information indicating the type of the current workflow element.
  // This information is for debug and tooling purpose only.
  private String workflowElementTypeInfo = "not defined";
  // The workflow element identifier.
  private String workflowElementID = null;
  // The observable state of the workflow element.
  /** The observable state of the workflow element. */
  private ObservableWorkflowElementState observableState =
    new ObservableWorkflowElementState(this);
  // 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.
  /**
   * 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.
   */
  private static ConcurrentMap<String, List<Observer>>
    newWorkflowElementNotificationList =
      new ConcurrentHashMap<String, List<Observer>>();
@@ -85,7 +74,7 @@
   *
   * @return the observable state of the workflow element
   */
  protected ObservableWorkflowElementState getObservableState()
  protected final ObservableWorkflowElementState getObservableState()
  {
    return observableState;
  }
@@ -194,92 +183,15 @@
    }
  }
  /**
   * Notifies all the observers who want to be warn when a workflow element
   * is created.
   *
   * @param workflowElement  the newly created workflow element
   */
  public static void notifyStateUpdate(
      WorkflowElement<?> workflowElement)
  {
    // Go through the list of observers and notify them all
    String weID = workflowElement.getWorkflowElementID();
    List<Observer> observers = newWorkflowElementNotificationList.get(weID);
    if (observers != null)
    {
      for (Observer observer: observers)
      {
        // The update might fail because an observer could have been
        // terminated. In this case, just ignore the failure and remove
        // the observer from the list of objects to notify.
        try
        {
          observer.update(workflowElement.getObservableState(), null);
        }
        catch(Exception e)
        {
          observers.remove(observer);
        }
      }
    }
  }
  /**
   * Creates a new instance of the workflow element.
   */
  public WorkflowElement()
  {
    // There is nothing to do in the constructor.
  }
  /**
   * Initializes the instance of the workflow element.
   *
   * @param workflowElementID  the workflow element identifier as defined
   *                           in the configuration.
   * @param workflowElementTypeInfo  an information to indicate the type of
   *                                 the current workflow element. For example
   *                                 "Backend" if the current workflow element
   *                                 is a local backend workflow element.
   */
  public void initialize(
      String workflowElementID,
      String workflowElementTypeInfo)
  {
    this.workflowElementID = workflowElementID;
    this.workflowElementTypeInfo = workflowElementTypeInfo;
  }
  /**
   * {@inheritDoc}
   */
  /** {@inheritDoc} */
  @Override
  public void update(Observable o, Object arg)
  public final void update(Observable o, Object arg)
  {
    // By default, do nothing when notification hits the workflow element.
  }
  /**
   * Get the type of the workflow element. The type is a string information
   * indicating which type is the current workflow element. This information
   * is intended to be used by tools for trace and debug purpose.
   *
   * @return the type of the workflow element.
   */
  public String getWorkflowElementTypeInfo()
  {
    return this.workflowElementTypeInfo;
  }
  /**
   * Indicates whether the provided configuration is acceptable for
   * this workflow element.
   *
@@ -292,7 +204,7 @@
   * @return  {@code true} if the provided configuration is acceptable
   *          for this workflow element, or {@code false} if not.
   */
  public boolean isConfigurationAcceptable(
  public final boolean isConfigurationAcceptable(
      T configuration,
      List<String> unacceptableReasons)
  {
@@ -308,9 +220,7 @@
   * workflow element is unloaded.  No action is taken in the default
   * implementation.
   */
  public void finalizeWorkflowElement()
  {
  }
  public abstract void finalizeWorkflowElement();
  /**
   * Executes the workflow element for an operation.
@@ -331,32 +241,12 @@
   * @return <code>true</code> if the workflow element encapsulates a private
   *         local backend, <code>false</code> otherwise
   */
  public boolean isPrivate()
  {
    return isPrivate;
  }
  /**
   * Specifies whether the workflow element encapsulates a private local
   * backend.
   *
   * @param  isPrivate  Indicates whether the workflow element encapsulates a
   *                    private local backend.
   */
  protected void setPrivate(boolean isPrivate)
  {
    this.isPrivate = isPrivate;
  }
  public abstract boolean isPrivate();
  /**
   * Provides the workflow element identifier.
   *
   * @return the workflow element identifier
   */
  public String getWorkflowElementID()
  {
    return workflowElementID;
  }
  public abstract String getWorkflowElementID();
}
opendj3-server-dev/src/server/org/opends/server/workflowelement/WorkflowElementConfigManager.java
@@ -189,11 +189,7 @@
    {
      try
      {
        WorkflowElement<?> we = loadAndRegisterWorkflowElement(configuration);
        // Notify observers who want to be notify when new workflow elements
        // are created.
        WorkflowElement.notifyStateUpdate(we);
        loadAndRegisterWorkflowElement(configuration);
      }
      catch (InitializationException de)
      {
@@ -336,11 +332,7 @@
    {
      try
      {
        WorkflowElement<?> we = loadAndRegisterWorkflowElement(configuration);
        // Notify observers who want to be notify when new workflow elements
        // are created.
        WorkflowElement.notifyStateUpdate(we);
        loadAndRegisterWorkflowElement(configuration);
      }
      catch (InitializationException de)
      {
opendj3-server-dev/src/server/org/opends/server/workflowelement/localbackend/LocalBackendWorkflowElement.java
@@ -63,10 +63,18 @@
{
  private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass();
  /**
   * An information indicating the type of the current workflow element. This
   * information is for debug and tooling purpose only.
   */
  private String workflowElementTypeInfo = "not defined";
  /** The workflow element identifier. */
  private String workflowElementID;
  /** the backend associated with the local workflow element. */
  private Backend<?> backend;
  /** the set of local backend workflow elements registered with the server. */
  private static TreeMap<String, LocalBackendWorkflowElement>
       registeredLocalBackends =
@@ -104,16 +112,17 @@
   */
  private void initialize(String workflowElementID, Backend<?> backend)
  {
    super.initialize(workflowElementID, BACKEND_WORKFLOW_ELEMENT);
    this.workflowElementID = workflowElementID;
    this.workflowElementTypeInfo = BACKEND_WORKFLOW_ELEMENT;
    this.backend  = backend;
    if (this.backend != null)
    {
      setPrivate(this.backend.isPrivateBackend());
    }
  }
  /** {@inheritDoc} */
  @Override
  public boolean isPrivate()
  {
    return this.backend != null && this.backend.isPrivateBackend();
  }
  /**
   * Initializes a new instance of the local backend workflow element.
@@ -148,7 +157,8 @@
  public void finalizeWorkflowElement()
  {
    // null all fields so that any use of the finalized object will raise a NPE
    super.initialize(null, null);
    this.workflowElementID = null;
    this.workflowElementTypeInfo = null;
    backend = null;
  }
@@ -219,14 +229,9 @@
      // Get the new configuration
      if (applyChanges)
      {
        super.initialize(
          configuration.dn().rdn().getAttributeValue(0).toString(),
          BACKEND_WORKFLOW_ELEMENT);
        backend = newBackend;
        if (backend != null)
        {
          setPrivate(backend.isPrivateBackend());
        }
        initialize(
            configuration.dn().rdn().getAttributeValue(0).toString(),
            newBackend);
      }
    }
@@ -722,7 +727,16 @@
                                  newAttachment);
  }
  /**
   * Provides the workflow element identifier.
   *
   * @return the workflow element identifier
   */
  @Override
  public String getWorkflowElementID()
  {
    return workflowElementID;
  }
  /**
   * Gets the backend associated with this local backend workflow
@@ -799,7 +813,7 @@
  {
    return getClass().getSimpleName()
        + " backend=" + backend
        + " workflowElementID=" + getWorkflowElementID()
        + " workflowElementTypeInfo=" + getWorkflowElementTypeInfo();
        + " workflowElementID=" + this.workflowElementID
        + " workflowElementTypeInfo=" + this.workflowElementTypeInfo;
  }
}
opendj3-server-dev/tests/unit-tests-testng/src/server/org/opends/server/core/networkgroups/MockRequestFilteringQOSPolicyCfg.java
File was deleted
opendj3-server-dev/tests/unit-tests-testng/src/server/org/opends/server/core/networkgroups/RequestFilteringPolicyTest.java
File was deleted
opendj3-server-dev/tests/unit-tests-testng/src/server/org/opends/server/core/networkgroups/ResourceLimitsPolicyTest.java
File was deleted