Class UpdatableLDAPRequest

    • Constructor Detail

      • 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 Detail

      • 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
                                      java.util.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

        @Nullable
        public final Control removeControl​(@NotNull
                                           java.lang.String oid)
        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

        @Nullable
        public final Control replaceControl​(@NotNull
                                            Control control)
        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

        @Nullable
        public final Control replaceControl​(@NotNull
                                            java.lang.String oid,
                                            @Nullable
                                            Control control)
        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.