Class LDAPControl

java.lang.Object
com.unboundid.ldap.sdk.migrate.ldapjdk.LDAPControl
All Implemented Interfaces:
Serializable

This class provides a data structure that holds information about an LDAP control.

This class is primarily intended to be used in the process of updating applications which use the Netscape Directory SDK for Java to switch to or coexist with the UnboundID LDAP SDK for Java. For applications not written using the Netscape Directory SDK for Java, the Control class should be used instead.
See Also:
  • Field Details

  • Constructor Details

    • LDAPControl

      public LDAPControl(@NotNull Control control)
      Creates a new LDAP control from the provided control.
      Parameters:
      control - The control to use to create this control.
    • LDAPControl

      public LDAPControl(@NotNull String id, boolean critical, @Nullable byte[] vals)
      Creates a new LDAP control with the specified information.
      Parameters:
      id - The OID for the control.
      critical - Indicates whether the control should be marked critical.
      vals - The encoded value for the control.
  • Method Details

    • getID

      @NotNull public String getID()
      Retrieves the OID for this control.
      Returns:
      The OID for this control.
    • isCritical

      public boolean isCritical()
      Indicates whether this control is marked critical.
      Returns:
      true if this control is marked critical, or false if not.
    • getValue

      @Nullable public byte[] getValue()
      Retrieves the value for this control, if available.
      Returns:
      The value for this control, or null if there is none.
    • toControl

      @NotNull public final Control toControl()
      Converts this LDAP control to a Control object.
      Returns:
      The Control object for this LDAP control.
    • toControls

      @Nullable public static Control[] toControls(@Nullable LDAPControl[] ldapControls)
      Converts the provided array of controls to an array of LDAP controls.
      Parameters:
      ldapControls - The LDAP controls to be converted.
      Returns:
      The corresponding array of controls.
    • toLDAPControls

      @Nullable public static LDAPControl[] toLDAPControls(@Nullable Control[] controls)
      Converts the provided array of LDAP controls to an array of controls.
      Parameters:
      controls - The controls to be converted.
      Returns:
      The corresponding array of LDAP controls.
    • duplicate

      Creates a duplicate of this control.
      Returns:
      A duplicate of this control.
    • toString

      Retrieves a string representation of this control.
      Overrides:
      toString in class Object
      Returns:
      A string representation of this control.