com.unboundid.ldap.protocol
Class LDAPMessage

java.lang.Object
  extended by com.unboundid.ldap.protocol.LDAPMessage
All Implemented Interfaces:
java.io.Serializable

@InternalUseOnly
@NotMutable
@ThreadSafety(level=COMPLETELY_THREADSAFE)
public final class LDAPMessage
extends java.lang.Object
implements java.io.Serializable

This class provides a data structure that may be used to represent LDAP protocol messages. Each LDAP message contains a message ID, a protocol op, and an optional set of controls.

See Also:
Serialized Form

Field Summary
static byte MESSAGE_TYPE_CONTROLS
          The BER type to use for the set of controls.
static byte PROTOCOL_OP_TYPE_ABANDON_REQUEST
          The BER type to use for the abandon request protocol op.
static byte PROTOCOL_OP_TYPE_ADD_REQUEST
          The BER type to use for the add request protocol op.
static byte PROTOCOL_OP_TYPE_ADD_RESPONSE
          The BER type to use for the add response protocol op.
static byte PROTOCOL_OP_TYPE_BIND_REQUEST
          The BER type to use for the bind request protocol op.
static byte PROTOCOL_OP_TYPE_BIND_RESPONSE
          The BER type to use for the bind response protocol op.
static byte PROTOCOL_OP_TYPE_COMPARE_REQUEST
          The BER type to use for the compare request protocol op.
static byte PROTOCOL_OP_TYPE_COMPARE_RESPONSE
          The BER type to use for the compare response protocol op.
static byte PROTOCOL_OP_TYPE_DELETE_REQUEST
          The BER type to use for the delete request protocol op.
static byte PROTOCOL_OP_TYPE_DELETE_RESPONSE
          The BER type to use for the delete response protocol op.
static byte PROTOCOL_OP_TYPE_EXTENDED_REQUEST
          The BER type to use for the extended request protocol op.
static byte PROTOCOL_OP_TYPE_EXTENDED_RESPONSE
          The BER type to use for the extended response protocol op.
static byte PROTOCOL_OP_TYPE_INTERMEDIATE_RESPONSE
          The BER type to use for the intermediate response protocol op.
static byte PROTOCOL_OP_TYPE_MODIFY_DN_REQUEST
          The BER type to use for the modify DN request protocol op.
static byte PROTOCOL_OP_TYPE_MODIFY_DN_RESPONSE
          The BER type to use for the modify DN response protocol op.
static byte PROTOCOL_OP_TYPE_MODIFY_REQUEST
          The BER type to use for the modify request protocol op.
static byte PROTOCOL_OP_TYPE_MODIFY_RESPONSE
          The BER type to use for the modify response protocol op.
static byte PROTOCOL_OP_TYPE_SEARCH_REQUEST
          The BER type to use for the search request protocol op.
static byte PROTOCOL_OP_TYPE_SEARCH_RESULT_DONE
          The BER type to use for the search result done protocol op.
static byte PROTOCOL_OP_TYPE_SEARCH_RESULT_ENTRY
          The BER type to use for the search result entry protocol op.
static byte PROTOCOL_OP_TYPE_SEARCH_RESULT_REFERENCE
          The BER type to use for the search result reference protocol op.
static byte PROTOCOL_OP_TYPE_UNBIND_REQUEST
          The BER type to use for the unbind request protocol op.
 
Constructor Summary
LDAPMessage(int messageID, ProtocolOp protocolOp, Control... controls)
          Creates a new LDAP message with the provided information.
LDAPMessage(int messageID, ProtocolOp protocolOp, java.util.List<Control> controls)
          Creates a new LDAP message with the provided information.
 
Method Summary
static LDAPMessage decode(ASN1Element element)
          Decodes the provided ASN.1 element as an LDAP message.
 ASN1Element encode()
          Encodes this LDAP message to an ASN.1 element.
 AbandonRequestProtocolOp getAbandonRequestProtocolOp()
          Retrieves the abandon request protocol op from this LDAP message.
 AddRequestProtocolOp getAddRequestProtocolOp()
          Retrieves the add request protocol op from this LDAP message.
 AddResponseProtocolOp getAddResponseProtocolOp()
          Retrieves the add response protocol op from this LDAP message.
 BindRequestProtocolOp getBindRequestProtocolOp()
          Retrieves the bind request protocol op from this LDAP message.
 BindResponseProtocolOp getBindResponseProtocolOp()
          Retrieves the bind response protocol op from this LDAP message.
 CompareRequestProtocolOp getCompareRequestProtocolOp()
          Retrieves the compare request protocol op from this LDAP message.
 CompareResponseProtocolOp getCompareResponseProtocolOp()
          Retrieves the compare response protocol op from this LDAP message.
 java.util.List<Control> getControls()
          Retrieves the set of controls for this LDAP message.
 DeleteRequestProtocolOp getDeleteRequestProtocolOp()
          Retrieves the delete request protocol op from this LDAP message.
 DeleteResponseProtocolOp getDeleteResponseProtocolOp()
          Retrieves the delete response protocol op from this LDAP message.
 ExtendedRequestProtocolOp getExtendedRequestProtocolOp()
          Retrieves the extended request protocol op from this LDAP message.
 ExtendedResponseProtocolOp getExtendedResponseProtocolOp()
          Retrieves the extended response protocol op from this LDAP message.
 IntermediateResponseProtocolOp getIntermediateResponseProtocolOp()
          Retrieves the intermediate response protocol op from this LDAP message.
 int getMessageID()
          Retrieves the message ID for this LDAP message.
 ModifyDNRequestProtocolOp getModifyDNRequestProtocolOp()
          Retrieves the modify DN request protocol op from this LDAP message.
 ModifyDNResponseProtocolOp getModifyDNResponseProtocolOp()
          Retrieves the modify DN response protocol op from this LDAP message.
 ModifyRequestProtocolOp getModifyRequestProtocolOp()
          Retrieves the modify request protocol op from this LDAP message.
 ModifyResponseProtocolOp getModifyResponseProtocolOp()
          Retrieves the modify response protocol op from this LDAP message.
 ProtocolOp getProtocolOp()
          Retrieves the protocol op for this LDAP message.
 byte getProtocolOpType()
          Retrieves the BER type for the protocol op contained in this LDAP message.
 SearchRequestProtocolOp getSearchRequestProtocolOp()
          Retrieves the search request protocol op from this LDAP message.
 SearchResultDoneProtocolOp getSearchResultDoneProtocolOp()
          Retrieves the search result done protocol op from this LDAP message.
 SearchResultEntryProtocolOp getSearchResultEntryProtocolOp()
          Retrieves the search result entry protocol op from this LDAP message.
 SearchResultReferenceProtocolOp getSearchResultReferenceProtocolOp()
          Retrieves the search result reference protocol op from this LDAP message.
 UnbindRequestProtocolOp getUnbindRequestProtocolOp()
          Retrieves the unbind request protocol op from this LDAP message.
static LDAPMessage readFrom(ASN1StreamReader reader, boolean ignoreSocketTimeout)
          Reads an LDAP message from the provided ASN.1 stream reader.
static LDAPResponse readLDAPResponseFrom(ASN1StreamReader reader, boolean ignoreSocketTimeout)
          Reads LDAPResponse object from the provided ASN.1 stream reader.
static LDAPResponse readLDAPResponseFrom(ASN1StreamReader reader, boolean ignoreSocketTimeout, Schema schema)
          Reads LDAPResponse object from the provided ASN.1 stream reader.
 java.lang.String toString()
          Retrieves a string representation of this LDAP message.
 void toString(java.lang.StringBuilder buffer)
          Appends a string representation of this LDAP message to the provided buffer.
 void writeTo(ASN1Buffer buffer)
          Writes an encoded representation of this LDAP message to the provided ASN.1 buffer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PROTOCOL_OP_TYPE_BIND_REQUEST

public static final byte PROTOCOL_OP_TYPE_BIND_REQUEST
The BER type to use for the bind request protocol op.

See Also:
Constant Field Values

PROTOCOL_OP_TYPE_BIND_RESPONSE

public static final byte PROTOCOL_OP_TYPE_BIND_RESPONSE
The BER type to use for the bind response protocol op.

See Also:
Constant Field Values

PROTOCOL_OP_TYPE_UNBIND_REQUEST

public static final byte PROTOCOL_OP_TYPE_UNBIND_REQUEST
The BER type to use for the unbind request protocol op.

See Also:
Constant Field Values

PROTOCOL_OP_TYPE_SEARCH_REQUEST

public static final byte PROTOCOL_OP_TYPE_SEARCH_REQUEST
The BER type to use for the search request protocol op.

See Also:
Constant Field Values

PROTOCOL_OP_TYPE_SEARCH_RESULT_ENTRY

public static final byte PROTOCOL_OP_TYPE_SEARCH_RESULT_ENTRY
The BER type to use for the search result entry protocol op.

See Also:
Constant Field Values

PROTOCOL_OP_TYPE_SEARCH_RESULT_REFERENCE

public static final byte PROTOCOL_OP_TYPE_SEARCH_RESULT_REFERENCE
The BER type to use for the search result reference protocol op.

See Also:
Constant Field Values

PROTOCOL_OP_TYPE_SEARCH_RESULT_DONE

public static final byte PROTOCOL_OP_TYPE_SEARCH_RESULT_DONE
The BER type to use for the search result done protocol op.

See Also:
Constant Field Values

PROTOCOL_OP_TYPE_MODIFY_REQUEST

public static final byte PROTOCOL_OP_TYPE_MODIFY_REQUEST
The BER type to use for the modify request protocol op.

See Also:
Constant Field Values

PROTOCOL_OP_TYPE_MODIFY_RESPONSE

public static final byte PROTOCOL_OP_TYPE_MODIFY_RESPONSE
The BER type to use for the modify response protocol op.

See Also:
Constant Field Values

PROTOCOL_OP_TYPE_ADD_REQUEST

public static final byte PROTOCOL_OP_TYPE_ADD_REQUEST
The BER type to use for the add request protocol op.

See Also:
Constant Field Values

PROTOCOL_OP_TYPE_ADD_RESPONSE

public static final byte PROTOCOL_OP_TYPE_ADD_RESPONSE
The BER type to use for the add response protocol op.

See Also:
Constant Field Values

PROTOCOL_OP_TYPE_DELETE_REQUEST

public static final byte PROTOCOL_OP_TYPE_DELETE_REQUEST
The BER type to use for the delete request protocol op.

See Also:
Constant Field Values

PROTOCOL_OP_TYPE_DELETE_RESPONSE

public static final byte PROTOCOL_OP_TYPE_DELETE_RESPONSE
The BER type to use for the delete response protocol op.

See Also:
Constant Field Values

PROTOCOL_OP_TYPE_MODIFY_DN_REQUEST

public static final byte PROTOCOL_OP_TYPE_MODIFY_DN_REQUEST
The BER type to use for the modify DN request protocol op.

See Also:
Constant Field Values

PROTOCOL_OP_TYPE_MODIFY_DN_RESPONSE

public static final byte PROTOCOL_OP_TYPE_MODIFY_DN_RESPONSE
The BER type to use for the modify DN response protocol op.

See Also:
Constant Field Values

PROTOCOL_OP_TYPE_COMPARE_REQUEST

public static final byte PROTOCOL_OP_TYPE_COMPARE_REQUEST
The BER type to use for the compare request protocol op.

See Also:
Constant Field Values

PROTOCOL_OP_TYPE_COMPARE_RESPONSE

public static final byte PROTOCOL_OP_TYPE_COMPARE_RESPONSE
The BER type to use for the compare response protocol op.

See Also:
Constant Field Values

PROTOCOL_OP_TYPE_ABANDON_REQUEST

public static final byte PROTOCOL_OP_TYPE_ABANDON_REQUEST
The BER type to use for the abandon request protocol op.

See Also:
Constant Field Values

PROTOCOL_OP_TYPE_EXTENDED_REQUEST

public static final byte PROTOCOL_OP_TYPE_EXTENDED_REQUEST
The BER type to use for the extended request protocol op.

See Also:
Constant Field Values

PROTOCOL_OP_TYPE_EXTENDED_RESPONSE

public static final byte PROTOCOL_OP_TYPE_EXTENDED_RESPONSE
The BER type to use for the extended response protocol op.

See Also:
Constant Field Values

PROTOCOL_OP_TYPE_INTERMEDIATE_RESPONSE

public static final byte PROTOCOL_OP_TYPE_INTERMEDIATE_RESPONSE
The BER type to use for the intermediate response protocol op.

See Also:
Constant Field Values

MESSAGE_TYPE_CONTROLS

public static final byte MESSAGE_TYPE_CONTROLS
The BER type to use for the set of controls.

See Also:
Constant Field Values
Constructor Detail

LDAPMessage

public LDAPMessage(int messageID,
                   ProtocolOp protocolOp,
                   Control... controls)
Creates a new LDAP message with the provided information.

Parameters:
messageID - The message ID for this LDAP message.
protocolOp - The protocol op for this LDAP message. It must not be null.
controls - The set of controls for this LDAP message. It may be null or empty if no controls are required.

LDAPMessage

public LDAPMessage(int messageID,
                   ProtocolOp protocolOp,
                   java.util.List<Control> controls)
Creates a new LDAP message with the provided information.

Parameters:
messageID - The message ID for this LDAP message.
protocolOp - The protocol op for this LDAP message. It must not be null.
controls - The set of controls for this LDAP message. It may be null or empty if no controls are required.
Method Detail

getMessageID

public int getMessageID()
Retrieves the message ID for this LDAP message.

Returns:
The message ID for this LDAP message.

getProtocolOp

public ProtocolOp getProtocolOp()
Retrieves the protocol op for this LDAP message.

Returns:
The protocol op for this LDAP message.

getProtocolOpType

public byte getProtocolOpType()
Retrieves the BER type for the protocol op contained in this LDAP message.

Returns:
The BER type for the protocol op contained in this LDAP message.

getAbandonRequestProtocolOp

public AbandonRequestProtocolOp getAbandonRequestProtocolOp()
                                                     throws java.lang.ClassCastException
Retrieves the abandon request protocol op from this LDAP message. This may only be used if this LDAP message was obtained using the readFrom(com.unboundid.asn1.ASN1StreamReader, boolean) method.

Returns:
The abandon request protocol op from this LDAP message.
Throws:
java.lang.ClassCastException - If the protocol op for this LDAP message is not an abandon request protocol op.

getAddRequestProtocolOp

public AddRequestProtocolOp getAddRequestProtocolOp()
                                             throws java.lang.ClassCastException
Retrieves the add request protocol op from this LDAP message. This may only be used if this LDAP message was obtained using the readFrom(com.unboundid.asn1.ASN1StreamReader, boolean) method.

Returns:
The add request protocol op from this LDAP message.
Throws:
java.lang.ClassCastException - If the protocol op for this LDAP message is not an add request protocol op.

getAddResponseProtocolOp

public AddResponseProtocolOp getAddResponseProtocolOp()
                                               throws java.lang.ClassCastException
Retrieves the add response protocol op from this LDAP message. This may only be used if this LDAP message was obtained using the readFrom(com.unboundid.asn1.ASN1StreamReader, boolean) method.

Returns:
The add response protocol op from this LDAP message.
Throws:
java.lang.ClassCastException - If the protocol op for this LDAP message is not an add response protocol op.

getBindRequestProtocolOp

public BindRequestProtocolOp getBindRequestProtocolOp()
                                               throws java.lang.ClassCastException
Retrieves the bind request protocol op from this LDAP message. This may only be used if this LDAP message was obtained using the readFrom(com.unboundid.asn1.ASN1StreamReader, boolean) method.

Returns:
The bind request protocol op from this LDAP message.
Throws:
java.lang.ClassCastException - If the protocol op for this LDAP message is not a bind request protocol op.

getBindResponseProtocolOp

public BindResponseProtocolOp getBindResponseProtocolOp()
                                                 throws java.lang.ClassCastException
Retrieves the bind response protocol op from this LDAP message. This may only be used if this LDAP message was obtained using the readFrom(com.unboundid.asn1.ASN1StreamReader, boolean) method.

Returns:
The bind response protocol op from this LDAP message.
Throws:
java.lang.ClassCastException - If the protocol op for this LDAP message is not a bind response protocol op.

getCompareRequestProtocolOp

public CompareRequestProtocolOp getCompareRequestProtocolOp()
                                                     throws java.lang.ClassCastException
Retrieves the compare request protocol op from this LDAP message. This may only be used if this LDAP message was obtained using the readFrom(com.unboundid.asn1.ASN1StreamReader, boolean) method.

Returns:
The compare request protocol op from this LDAP message.
Throws:
java.lang.ClassCastException - If the protocol op for this LDAP message is not a compare request protocol op.

getCompareResponseProtocolOp

public CompareResponseProtocolOp getCompareResponseProtocolOp()
                                                       throws java.lang.ClassCastException
Retrieves the compare response protocol op from this LDAP message. This may only be used if this LDAP message was obtained using the readFrom(com.unboundid.asn1.ASN1StreamReader, boolean) method.

Returns:
The compare response protocol op from this LDAP message.
Throws:
java.lang.ClassCastException - If the protocol op for this LDAP message is not a compare response protocol op.

getDeleteRequestProtocolOp

public DeleteRequestProtocolOp getDeleteRequestProtocolOp()
                                                   throws java.lang.ClassCastException
Retrieves the delete request protocol op from this LDAP message. This may only be used if this LDAP message was obtained using the readFrom(com.unboundid.asn1.ASN1StreamReader, boolean) method.

Returns:
The delete request protocol op from this LDAP message.
Throws:
java.lang.ClassCastException - If the protocol op for this LDAP message is not a delete request protocol op.

getDeleteResponseProtocolOp

public DeleteResponseProtocolOp getDeleteResponseProtocolOp()
                                                     throws java.lang.ClassCastException
Retrieves the delete response protocol op from this LDAP message. This may only be used if this LDAP message was obtained using the readFrom(com.unboundid.asn1.ASN1StreamReader, boolean) method.

Returns:
The delete response protocol op from this LDAP message.
Throws:
java.lang.ClassCastException - If the protocol op for this LDAP message is not a delete response protocol op.

getExtendedRequestProtocolOp

public ExtendedRequestProtocolOp getExtendedRequestProtocolOp()
                                                       throws java.lang.ClassCastException
Retrieves the extended request protocol op from this LDAP message. This may only be used if this LDAP message was obtained using the readFrom(com.unboundid.asn1.ASN1StreamReader, boolean) method.

Returns:
The extended request protocol op from this LDAP message.
Throws:
java.lang.ClassCastException - If the protocol op for this LDAP message is not an extended request protocol op.

getExtendedResponseProtocolOp

public ExtendedResponseProtocolOp getExtendedResponseProtocolOp()
                                                         throws java.lang.ClassCastException
Retrieves the extended response protocol op from this LDAP message. This may only be used if this LDAP message was obtained using the readFrom(com.unboundid.asn1.ASN1StreamReader, boolean) method.

Returns:
The extended response protocol op from this LDAP message.
Throws:
java.lang.ClassCastException - If the protocol op for this LDAP message is not an extended response protocol op.

getModifyRequestProtocolOp

public ModifyRequestProtocolOp getModifyRequestProtocolOp()
                                                   throws java.lang.ClassCastException
Retrieves the modify request protocol op from this LDAP message. This may only be used if this LDAP message was obtained using the readFrom(com.unboundid.asn1.ASN1StreamReader, boolean) method.

Returns:
The modify request protocol op from this LDAP message.
Throws:
java.lang.ClassCastException - If the protocol op for this LDAP message is not a modify request protocol op.

getModifyResponseProtocolOp

public ModifyResponseProtocolOp getModifyResponseProtocolOp()
                                                     throws java.lang.ClassCastException
Retrieves the modify response protocol op from this LDAP message. This may only be used if this LDAP message was obtained using the readFrom(com.unboundid.asn1.ASN1StreamReader, boolean) method.

Returns:
The modify response protocol op from this LDAP message.
Throws:
java.lang.ClassCastException - If the protocol op for this LDAP message is not a modify response protocol op.

getModifyDNRequestProtocolOp

public ModifyDNRequestProtocolOp getModifyDNRequestProtocolOp()
                                                       throws java.lang.ClassCastException
Retrieves the modify DN request protocol op from this LDAP message. This may only be used if this LDAP message was obtained using the readFrom(com.unboundid.asn1.ASN1StreamReader, boolean) method.

Returns:
The modify DN request protocol op from this LDAP message.
Throws:
java.lang.ClassCastException - If the protocol op for this LDAP message is not a modify DN request protocol op.

getModifyDNResponseProtocolOp

public ModifyDNResponseProtocolOp getModifyDNResponseProtocolOp()
                                                         throws java.lang.ClassCastException
Retrieves the modify DN response protocol op from this LDAP message. This may only be used if this LDAP message was obtained using the readFrom(com.unboundid.asn1.ASN1StreamReader, boolean) method.

Returns:
The modify DN response protocol op from this LDAP message.
Throws:
java.lang.ClassCastException - If the protocol op for this LDAP message is not a modify DN response protocol op.

getSearchRequestProtocolOp

public SearchRequestProtocolOp getSearchRequestProtocolOp()
                                                   throws java.lang.ClassCastException
Retrieves the search request protocol op from this LDAP message. This may only be used if this LDAP message was obtained using the readFrom(com.unboundid.asn1.ASN1StreamReader, boolean) method.

Returns:
The search request protocol op from this LDAP message.
Throws:
java.lang.ClassCastException - If the protocol op for this LDAP message is not a search request protocol op.

getSearchResultEntryProtocolOp

public SearchResultEntryProtocolOp getSearchResultEntryProtocolOp()
                                                           throws java.lang.ClassCastException
Retrieves the search result entry protocol op from this LDAP message. This may only be used if this LDAP message was obtained using the readFrom(com.unboundid.asn1.ASN1StreamReader, boolean) method.

Returns:
The search result entry protocol op from this LDAP message.
Throws:
java.lang.ClassCastException - If the protocol op for this LDAP message is not a search result entry protocol op.

getSearchResultReferenceProtocolOp

public SearchResultReferenceProtocolOp getSearchResultReferenceProtocolOp()
                                                                   throws java.lang.ClassCastException
Retrieves the search result reference protocol op from this LDAP message. This may only be used if this LDAP message was obtained using the readFrom(com.unboundid.asn1.ASN1StreamReader, boolean) method.

Returns:
The search result reference protocol op from this LDAP message.
Throws:
java.lang.ClassCastException - If the protocol op for this LDAP message is not a search result reference protocol op.

getSearchResultDoneProtocolOp

public SearchResultDoneProtocolOp getSearchResultDoneProtocolOp()
                                                         throws java.lang.ClassCastException
Retrieves the search result done protocol op from this LDAP message. This may only be used if this LDAP message was obtained using the readFrom(com.unboundid.asn1.ASN1StreamReader, boolean) method.

Returns:
The search result done protocol op from this LDAP message.
Throws:
java.lang.ClassCastException - If the protocol op for this LDAP message is not a search result done protocol op.

getUnbindRequestProtocolOp

public UnbindRequestProtocolOp getUnbindRequestProtocolOp()
                                                   throws java.lang.ClassCastException
Retrieves the unbind request protocol op from this LDAP message. This may only be used if this LDAP message was obtained using the readFrom(com.unboundid.asn1.ASN1StreamReader, boolean) method.

Returns:
The unbind request protocol op from this LDAP message.
Throws:
java.lang.ClassCastException - If the protocol op for this LDAP message is not an unbind request protocol op.

getIntermediateResponseProtocolOp

public IntermediateResponseProtocolOp getIntermediateResponseProtocolOp()
                                                                 throws java.lang.ClassCastException
Retrieves the intermediate response protocol op from this LDAP message. This may only be used if this LDAP message was obtained using the readFrom(com.unboundid.asn1.ASN1StreamReader, boolean) method.

Returns:
The intermediate response protocol op from this LDAP message.
Throws:
java.lang.ClassCastException - If the protocol op for this LDAP message is not an intermediate response protocol op.

getControls

public java.util.List<Control> getControls()
Retrieves the set of controls for this LDAP message.

Returns:
The set of controls for this LDAP message.

encode

public ASN1Element encode()
Encodes this LDAP message to an ASN.1 element.

Returns:
The ASN.1 element containing the encoded representation of this LDAP message.

decode

public static LDAPMessage decode(ASN1Element element)
                          throws LDAPException
Decodes the provided ASN.1 element as an LDAP message.

Parameters:
element - The ASN.1 element to be decoded.
Returns:
The LDAP message decoded from the provided ASN.1 element.
Throws:
LDAPException - If the provided ASN.1 element cannot be decoded as a valid LDAP message.

writeTo

public void writeTo(ASN1Buffer buffer)
Writes an encoded representation of this LDAP message to the provided ASN.1 buffer.

Parameters:
buffer - The ASN.1 buffer to which the encoded representation should be written.

readFrom

public static LDAPMessage readFrom(ASN1StreamReader reader,
                                   boolean ignoreSocketTimeout)
                            throws LDAPException
Reads an LDAP message from the provided ASN.1 stream reader.

Parameters:
reader - The ASN.1 stream reader from which the LDAP message should be read.
ignoreSocketTimeout - Indicates whether to ignore socket timeout exceptions caught during processing. This should be true when the associated connection is operating in asynchronous mode, and false when operating in synchronous mode. In either case, exceptions will not be ignored for the first read, since that will be handled by the connection reader.
Returns:
The decoded LDAP message, or null if the end of the input stream has been reached..
Throws:
LDAPException - If an error occurs while attempting to read or decode the LDAP message.

readLDAPResponseFrom

public static LDAPResponse readLDAPResponseFrom(ASN1StreamReader reader,
                                                boolean ignoreSocketTimeout)
                                         throws LDAPException
Reads LDAPResponse object from the provided ASN.1 stream reader.

Parameters:
reader - The ASN.1 stream reader from which the LDAP message should be read.
ignoreSocketTimeout - Indicates whether to ignore socket timeout exceptions caught during processing. This should be true when the associated connection is operating in asynchronous mode, and false when operating in synchronous mode. In either case, exceptions will not be ignored for the first read, since that will be handled by the connection reader.
Returns:
The decoded LDAP message, or null if the end of the input stream has been reached..
Throws:
LDAPException - If an error occurs while attempting to read or decode the LDAP message.

readLDAPResponseFrom

public static LDAPResponse readLDAPResponseFrom(ASN1StreamReader reader,
                                                boolean ignoreSocketTimeout,
                                                Schema schema)
                                         throws LDAPException
Reads LDAPResponse object from the provided ASN.1 stream reader.

Parameters:
reader - The ASN.1 stream reader from which the LDAP message should be read.
ignoreSocketTimeout - Indicates whether to ignore socket timeout exceptions caught during processing. This should be true when the associated connection is operating in asynchronous mode, and false when operating in synchronous mode. In either case, exceptions will not be ignored for the first read, since that will be handled by the connection reader.
schema - The schema to use to select the appropriate matching rule for attributes included in the response.
Returns:
The decoded LDAP message, or null if the end of the input stream has been reached..
Throws:
LDAPException - If an error occurs while attempting to read or decode the LDAP message.

toString

public java.lang.String toString()
Retrieves a string representation of this LDAP message.

Overrides:
toString in class java.lang.Object
Returns:
A string representation of this LDAP message.

toString

public void toString(java.lang.StringBuilder buffer)
Appends a string representation of this LDAP message to the provided buffer.

Parameters:
buffer - The buffer to which the string representation should be appended.