Class UpdatableLDAPRequest

java.lang.Object
com.unboundid.ldap.sdk.LDAPRequest
com.unboundid.ldap.sdk.UpdatableLDAPRequest
All Implemented Interfaces:
ReadOnlyLDAPRequest, Serializable
Direct Known Subclasses:
AddRequest, CompareRequest, DeleteRequest, ModifyDNRequest, ModifyRequest, SearchRequest

This class is the superclass of all types of LDAP requests that can be altered. It provides methods for updating the set of controls to include as part of the request and for configuring a response timeout, which is the maximum length of time that the SDK should wait for a response to the request before returning an error back to the caller.
See Also:
  • Constructor Details

    • UpdatableLDAPRequest

      protected UpdatableLDAPRequest(@Nullable Control[] controls)
      Creates a new LDAP request with the provided set of controls.
      Parameters:
      controls - The set of controls to include in this LDAP request.
  • Method Details

    • setControls

      public final void setControls(@Nullable Control... controls)
      Specifies the set of controls for this request.
      Parameters:
      controls - The set of controls for this request.
    • setControls

      public final void setControls(@Nullable List<Control> controls)
      Specifies the set of controls for this request.
      Parameters:
      controls - The set of controls for this request.
    • clearControls

      public final void clearControls()
      Removes all controls from this request.
    • addControl

      public final void addControl(@NotNull Control control)
      Adds the provided control to the set of controls for this request.
      Parameters:
      control - The control to add to the set of controls for this request. It must not be null.
    • addControls

      public final void addControls(@Nullable Control... controls)
      Adds the provided controls to the set of controls for this request.
      Parameters:
      controls - The controls to add to the set of controls for this request.
    • removeControl

      Removes the control with the specified OID from the set of controls for this request. If this request has multiple controls with the same OID, then only the first will be removed.
      Parameters:
      oid - The OID of the control to remove. It must not be null.
      Returns:
      The control that was removed, or null if this request does not have any control with the specified OID.
    • removeControl

      public final boolean removeControl(@NotNull Control control)
      Removes the provided control from the set of controls for this request. This will have no impact if the provided control is not included in the set of controls for this request.
      Parameters:
      control - The control to remove from the set of controls for this request. It must not be null.
      Returns:
      true if the control was found and removed, or false if not.
    • replaceControl

      Replaces the control with the same OID as the provided control with the provided control. If no control with the same OID exists in the request, then the control will be added to the request. If the request has multiple controls with the same OID as the new control, then only the first will be replaced.
      Parameters:
      control - The control to use in place of the existing control with the same OID. It must not be null.
      Returns:
      The control that was replaced, or null if there was no control with the same OID as the provided control.
    • replaceControl

      Replaces the control with the specified OID with the provided control. If no control with the given OID exists in the request, then a new control will be added. If this request has multiple controls with the specified OID, then only the first will be replaced.
      Parameters:
      oid - The OID of the control to replace with the provided control. It must not be null.
      control - The control to use in place of the control with the specified OID. It may be null if the control should be removed. It may have a different OID than the OID of the control being replaced.
      Returns:
      The control that was replaced, or null if there was no control with the specified OID.