|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.unboundid.ldap.protocol.LDAPMessage
@InternalUseOnly @NotMutable @ThreadSafety(level=COMPLETELY_THREADSAFE) public final class LDAPMessage
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.
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 |
---|
public static final byte PROTOCOL_OP_TYPE_BIND_REQUEST
public static final byte PROTOCOL_OP_TYPE_BIND_RESPONSE
public static final byte PROTOCOL_OP_TYPE_UNBIND_REQUEST
public static final byte PROTOCOL_OP_TYPE_SEARCH_REQUEST
public static final byte PROTOCOL_OP_TYPE_SEARCH_RESULT_ENTRY
public static final byte PROTOCOL_OP_TYPE_SEARCH_RESULT_REFERENCE
public static final byte PROTOCOL_OP_TYPE_SEARCH_RESULT_DONE
public static final byte PROTOCOL_OP_TYPE_MODIFY_REQUEST
public static final byte PROTOCOL_OP_TYPE_MODIFY_RESPONSE
public static final byte PROTOCOL_OP_TYPE_ADD_REQUEST
public static final byte PROTOCOL_OP_TYPE_ADD_RESPONSE
public static final byte PROTOCOL_OP_TYPE_DELETE_REQUEST
public static final byte PROTOCOL_OP_TYPE_DELETE_RESPONSE
public static final byte PROTOCOL_OP_TYPE_MODIFY_DN_REQUEST
public static final byte PROTOCOL_OP_TYPE_MODIFY_DN_RESPONSE
public static final byte PROTOCOL_OP_TYPE_COMPARE_REQUEST
public static final byte PROTOCOL_OP_TYPE_COMPARE_RESPONSE
public static final byte PROTOCOL_OP_TYPE_ABANDON_REQUEST
public static final byte PROTOCOL_OP_TYPE_EXTENDED_REQUEST
public static final byte PROTOCOL_OP_TYPE_EXTENDED_RESPONSE
public static final byte PROTOCOL_OP_TYPE_INTERMEDIATE_RESPONSE
public static final byte MESSAGE_TYPE_CONTROLS
Constructor Detail |
---|
public LDAPMessage(int messageID, ProtocolOp protocolOp, Control... controls)
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.public LDAPMessage(int messageID, ProtocolOp protocolOp, java.util.List<Control> controls)
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 |
---|
public int getMessageID()
public ProtocolOp getProtocolOp()
public byte getProtocolOpType()
public AbandonRequestProtocolOp getAbandonRequestProtocolOp() throws java.lang.ClassCastException
readFrom(com.unboundid.asn1.ASN1StreamReader, boolean)
method.
java.lang.ClassCastException
- If the protocol op for this LDAP message is
not an abandon request protocol op.public AddRequestProtocolOp getAddRequestProtocolOp() throws java.lang.ClassCastException
readFrom(com.unboundid.asn1.ASN1StreamReader, boolean)
method.
java.lang.ClassCastException
- If the protocol op for this LDAP message is
not an add request protocol op.public AddResponseProtocolOp getAddResponseProtocolOp() throws java.lang.ClassCastException
readFrom(com.unboundid.asn1.ASN1StreamReader, boolean)
method.
java.lang.ClassCastException
- If the protocol op for this LDAP message is
not an add response protocol op.public BindRequestProtocolOp getBindRequestProtocolOp() throws java.lang.ClassCastException
readFrom(com.unboundid.asn1.ASN1StreamReader, boolean)
method.
java.lang.ClassCastException
- If the protocol op for this LDAP message is
not a bind request protocol op.public BindResponseProtocolOp getBindResponseProtocolOp() throws java.lang.ClassCastException
readFrom(com.unboundid.asn1.ASN1StreamReader, boolean)
method.
java.lang.ClassCastException
- If the protocol op for this LDAP message is
not a bind response protocol op.public CompareRequestProtocolOp getCompareRequestProtocolOp() throws java.lang.ClassCastException
readFrom(com.unboundid.asn1.ASN1StreamReader, boolean)
method.
java.lang.ClassCastException
- If the protocol op for this LDAP message is
not a compare request protocol op.public CompareResponseProtocolOp getCompareResponseProtocolOp() throws java.lang.ClassCastException
readFrom(com.unboundid.asn1.ASN1StreamReader, boolean)
method.
java.lang.ClassCastException
- If the protocol op for this LDAP message is
not a compare response protocol op.public DeleteRequestProtocolOp getDeleteRequestProtocolOp() throws java.lang.ClassCastException
readFrom(com.unboundid.asn1.ASN1StreamReader, boolean)
method.
java.lang.ClassCastException
- If the protocol op for this LDAP message is
not a delete request protocol op.public DeleteResponseProtocolOp getDeleteResponseProtocolOp() throws java.lang.ClassCastException
readFrom(com.unboundid.asn1.ASN1StreamReader, boolean)
method.
java.lang.ClassCastException
- If the protocol op for this LDAP message is
not a delete response protocol op.public ExtendedRequestProtocolOp getExtendedRequestProtocolOp() throws java.lang.ClassCastException
readFrom(com.unboundid.asn1.ASN1StreamReader, boolean)
method.
java.lang.ClassCastException
- If the protocol op for this LDAP message is
not an extended request protocol op.public ExtendedResponseProtocolOp getExtendedResponseProtocolOp() throws java.lang.ClassCastException
readFrom(com.unboundid.asn1.ASN1StreamReader, boolean)
method.
java.lang.ClassCastException
- If the protocol op for this LDAP message is
not an extended response protocol op.public ModifyRequestProtocolOp getModifyRequestProtocolOp() throws java.lang.ClassCastException
readFrom(com.unboundid.asn1.ASN1StreamReader, boolean)
method.
java.lang.ClassCastException
- If the protocol op for this LDAP message is
not a modify request protocol op.public ModifyResponseProtocolOp getModifyResponseProtocolOp() throws java.lang.ClassCastException
readFrom(com.unboundid.asn1.ASN1StreamReader, boolean)
method.
java.lang.ClassCastException
- If the protocol op for this LDAP message is
not a modify response protocol op.public ModifyDNRequestProtocolOp getModifyDNRequestProtocolOp() throws java.lang.ClassCastException
readFrom(com.unboundid.asn1.ASN1StreamReader, boolean)
method.
java.lang.ClassCastException
- If the protocol op for this LDAP message is
not a modify DN request protocol op.public ModifyDNResponseProtocolOp getModifyDNResponseProtocolOp() throws java.lang.ClassCastException
readFrom(com.unboundid.asn1.ASN1StreamReader, boolean)
method.
java.lang.ClassCastException
- If the protocol op for this LDAP message is
not a modify DN response protocol op.public SearchRequestProtocolOp getSearchRequestProtocolOp() throws java.lang.ClassCastException
readFrom(com.unboundid.asn1.ASN1StreamReader, boolean)
method.
java.lang.ClassCastException
- If the protocol op for this LDAP message is
not a search request protocol op.public SearchResultEntryProtocolOp getSearchResultEntryProtocolOp() throws java.lang.ClassCastException
readFrom(com.unboundid.asn1.ASN1StreamReader, boolean)
method.
java.lang.ClassCastException
- If the protocol op for this LDAP message is
not a search result entry protocol op.public SearchResultReferenceProtocolOp getSearchResultReferenceProtocolOp() throws java.lang.ClassCastException
readFrom(com.unboundid.asn1.ASN1StreamReader, boolean)
method.
java.lang.ClassCastException
- If the protocol op for this LDAP message is
not a search result reference protocol op.public SearchResultDoneProtocolOp getSearchResultDoneProtocolOp() throws java.lang.ClassCastException
readFrom(com.unboundid.asn1.ASN1StreamReader, boolean)
method.
java.lang.ClassCastException
- If the protocol op for this LDAP message is
not a search result done protocol op.public UnbindRequestProtocolOp getUnbindRequestProtocolOp() throws java.lang.ClassCastException
readFrom(com.unboundid.asn1.ASN1StreamReader, boolean)
method.
java.lang.ClassCastException
- If the protocol op for this LDAP message is
not an unbind request protocol op.public IntermediateResponseProtocolOp getIntermediateResponseProtocolOp() throws java.lang.ClassCastException
readFrom(com.unboundid.asn1.ASN1StreamReader, boolean)
method.
java.lang.ClassCastException
- If the protocol op for this LDAP message is
not an intermediate response protocol op.public java.util.List<Control> getControls()
public ASN1Element encode()
public static LDAPMessage decode(ASN1Element element) throws LDAPException
element
- The ASN.1 element to be decoded.
LDAPException
- If the provided ASN.1 element cannot be decoded as
a valid LDAP message.public void writeTo(ASN1Buffer buffer)
buffer
- The ASN.1 buffer to which the encoded representation should
be written.public static LDAPMessage readFrom(ASN1StreamReader reader, boolean ignoreSocketTimeout) throws LDAPException
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.
null
if the end of the input
stream has been reached..
LDAPException
- If an error occurs while attempting to read or
decode the LDAP message.public static LDAPResponse readLDAPResponseFrom(ASN1StreamReader reader, boolean ignoreSocketTimeout) throws LDAPException
LDAPResponse
object from the provided ASN.1 stream reader.
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.
null
if the end of the input
stream has been reached..
LDAPException
- If an error occurs while attempting to read or
decode the LDAP message.public static LDAPResponse readLDAPResponseFrom(ASN1StreamReader reader, boolean ignoreSocketTimeout, Schema schema) throws LDAPException
LDAPResponse
object from the provided ASN.1 stream reader.
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.
null
if the end of the input
stream has been reached..
LDAPException
- If an error occurs while attempting to read or
decode the LDAP message.public java.lang.String toString()
toString
in class java.lang.Object
public void toString(java.lang.StringBuilder buffer)
buffer
- The buffer to which the string representation should be
appended.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |