Class LDAPControl


  • public class LDAPControl
    extends Control
    This class defines the data structures and methods to use when interacting with a generic LDAP control.
    • Constructor Detail

      • LDAPControl

        public LDAPControl​(String oid)
        Creates a new LDAP control with the specified OID. It will not be critical, and will not have a value.
        Parameters:
        oid - The OID for this LDAP control.
      • LDAPControl

        public LDAPControl​(String oid,
                           boolean isCritical)
        Creates a new LDAP control with the specified OID and criticality. It will not have a value.
        Parameters:
        oid - The OID for this LDAP control.
        isCritical - Indicates whether this control should be considered critical.
      • LDAPControl

        public LDAPControl​(String oid,
                           boolean isCritical,
                           ByteString value)
        Creates a new LDAP control with the specified OID, criticality, and value.
        Parameters:
        oid - The OID for this LDAP control.
        isCritical - Indicates whether this control should be considered critical.
        value - The value for this LDAP control.
    • Method Detail

      • getValue

        public final ByteString getValue()
        Retrieves the value for this control.
        Returns:
        The value for this control, or null if there is no value.
      • hasValue

        public final boolean hasValue()
        Indicates whether this control has a value.
        Returns:
        true if this control has a value, or false if it does not.
      • writeValue

        public void writeValue​(ASN1Writer stream)
                        throws IOException
        Description copied from class: Control
        Writes this control's value to an ASN.1 writer. The value (if any) must be written as an ASN1OctetString.
        Specified by:
        writeValue in class Control
        Parameters:
        stream - The ASN.1 writer to use.
        Throws:
        IOException - If a problem occurs while writing to the stream.
      • toString

        public void toString​(StringBuilder buffer)
        Appends a string representation of this LDAP control to the provided buffer.
        Overrides:
        toString in class Control
        Parameters:
        buffer - The buffer to which the information should be appended.
      • toString

        public void toString​(StringBuilder buffer,
                             int indent)
        Appends a multi-line string representation of this LDAP control to the provided buffer.
        Parameters:
        buffer - The buffer to which the information should be appended.
        indent - The number of spaces to indent the information.