Package org.opends.server.protocols.ldap
Class LDAPControl
- java.lang.Object
-
- org.opends.server.types.Control
-
- org.opends.server.protocols.ldap.LDAPControl
-
public class LDAPControl extends Control
This class defines the data structures and methods to use when interacting with a generic LDAP control.
-
-
Constructor Summary
Constructors Constructor Description LDAPControl(String oid)Creates a new LDAP control with the specified OID.LDAPControl(String oid, boolean isCritical)Creates a new LDAP control with the specified OID and criticality.LDAPControl(String oid, boolean isCritical, ByteString value)Creates a new LDAP control with the specified OID, criticality, and value.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ByteStringgetValue()Retrieves the value for this control.booleanhasValue()Indicates whether this control has a value.voidtoString(StringBuilder buffer)Appends a string representation of this LDAP control to the provided buffer.voidtoString(StringBuilder buffer, int indent)Appends a multi-line string representation of this LDAP control to the provided buffer.voidwriteValue(ASN1Writer stream)Writes this control's value to an ASN.1 writer.-
Methods inherited from class org.opends.server.types.Control
getOID, isCritical, toString, write
-
-
-
-
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
nullif there is no value.
-
hasValue
public final boolean hasValue()
Indicates whether this control has a value.- Returns:
trueif this control has a value, orfalseif it does not.
-
writeValue
public void writeValue(ASN1Writer stream) throws IOException
Description copied from class:ControlWrites this control's value to an ASN.1 writer. The value (if any) must be written as an ASN1OctetString.- Specified by:
writeValuein classControl- 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.
-
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.
-
-