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

neil_a_wilson
30.50.2006 7a6f98492aaeacd4e5a795adc71b75edbc1d126a
opends/src/server/org/opends/server/api/ExtendedOperationHandler.java
@@ -28,6 +28,9 @@
import java.util.HashSet;
import java.util.Set;
import org.opends.server.config.ConfigEntry;
import org.opends.server.config.ConfigException;
import org.opends.server.core.ExtendedOperation;
@@ -53,6 +56,16 @@
  // The default set of supported control OIDs for this extended
  // operation.
  private Set<String> supportedControlOIDs = new HashSet<String>(0);
  // The default set of supported feature OIDs for this extended
  // operation.
  private Set<String> supportedFeatureOIDs = new HashSet<String>(0);
  /**
   * Initializes this extended operation handler based on the
   * information in the provided configuration entry.  It should also
@@ -98,5 +111,79 @@
   */
  public abstract void processExtendedOperation(ExtendedOperation
                                                     operation);
  /**
   * Retrieves the OIDs of the controls that may be supported by this
   * extended operation handler.  It should be overridden by any
   * extended operation handler which provides special support for one
   * or more controls.
   *
   * @return  The OIDs of the controls that may be supported by this
   *          extended operation handler.
   */
  public Set<String> getSupportedControls()
  {
    assert debugEnter(CLASS_NAME, "getSupportedControls");
    return supportedControlOIDs;
  }
  /**
   * Indicates whether this extended operation handler supports the
   * specified control.
   *
   * @param  controlOID  The OID of the control for which to make the
   *                     determination.
   *
   * @return  {@code true} if this extended operation handler does
   *          support the requested control, or {@code false} if not.
   */
  public final boolean supportsControl(String controlOID)
  {
    assert debugEnter(CLASS_NAME, "supportsControl",
                      String.valueOf(controlOID));
    return getSupportedControls().contains(controlOID);
  }
  /**
   * Retrieves the OIDs of the features that may be supported by this
   * extended operation handler.
   *
   * @return  The OIDs of the features that may be supported by this
   *          extended operation handler.
   */
  public Set<String> getSupportedFeatures()
  {
    assert debugEnter(CLASS_NAME, "getSupportedFeatures");
    return supportedFeatureOIDs;
  }
  /**
   * Indicates whether this extended operation handler supports the
   * specified feature.
   *
   * @param  featureOID  The OID of the feature for which to make the
   *                     determination.
   *
   * @return  {@code true} if this extended operation handler does
   *          support the requested feature, or {@code false} if not.
   */
  public final boolean supportsFeature(String featureOID)
  {
    assert debugEnter(CLASS_NAME, "supportsFeature",
                      String.valueOf(featureOID));
    return getSupportedFeatures().contains(featureOID);
  }
}