|
All LDAP Classes Internal LDAP Classes |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.novell.ldap.LDAPMessage
public class LDAPMessage
The base class for LDAP request and response messages.
Subclassed by response messages used in asynchronous operations.
Sample Code: Searchas.java
Field Summary | |
---|---|
static int |
ABANDON_REQUEST
An abandon request operation. |
static int |
ADD_REQUEST
An add request operation. |
static int |
ADD_RESPONSE
An add response operation. |
static int |
BIND_REQUEST
A bind request operation. |
static int |
BIND_RESPONSE
A bind response operation. |
static int |
COMPARE_REQUEST
A compare result operation. |
static int |
COMPARE_RESPONSE
A compare response operation. |
static int |
DEL_REQUEST
A delete request operation. |
static int |
DEL_RESPONSE
A delete response operation. |
static int |
EXTENDED_REQUEST
An extended request operation. |
static int |
EXTENDED_RESPONSE
An extended response operation. |
private int |
imsgNum
Counters used to construct request message #'s, unique for each request Will be enabled after ASN.1 conversion |
static int |
INTERMEDIATE_RESPONSE
An extended response operation. |
protected RfcLDAPMessage |
message
A request or response message for an asynchronous LDAP operation. |
private int |
messageType
|
static int |
MODIFY_RDN_REQUEST
A modify RDN request operation. |
static int |
MODIFY_RDN_RESPONSE
A modify RDN response operation. |
static int |
MODIFY_REQUEST
A modify request operation. |
static int |
MODIFY_RESPONSE
A modify response operation. |
static int |
SEARCH_REQUEST
A search request operation. |
static int |
SEARCH_RESPONSE
A search response containing data. |
static int |
SEARCH_RESULT
A search result message - contains search status. |
static int |
SEARCH_RESULT_REFERENCE
A search result reference operation. |
private java.lang.String |
stringTag
|
static int |
UNBIND_REQUEST
An unbind request operation. |
Constructor Summary | |
---|---|
(package private) |
LDAPMessage()
Dummy constuctor |
(package private) |
LDAPMessage(int messageType)
Added for supporting XML Serialization |
(package private) |
LDAPMessage(int type,
RfcRequest op,
LDAPControl[] controls)
Creates an LDAPMessage when sending a protocol operation and sends some optional controls with the message. |
protected |
LDAPMessage(RfcLDAPMessage message)
Creates an Rfc 2251 LDAPMessage when the libraries receive a response from a command. |
Method Summary | |
---|---|
(package private) LDAPMessage |
clone(java.lang.String dn,
java.lang.String filter,
boolean reference)
Returns a mutated clone of this LDAPMessage, replacing base dn, filter. |
private LDAPControl |
controlFactory(java.lang.String oid,
boolean critical,
byte[] value)
Instantiates an LDAPControl. |
(package private) RfcLDAPMessage |
getASN1Object()
Returns the RFC 2251 LDAPMessage composed in this object. |
LDAPControl[] |
getControls()
Returns any controls in the message. |
int |
getMessageID()
Returns the message ID. |
private java.lang.String |
getName()
|
(package private) LDAPMessage |
getRequestingMessage()
Returns the LDAPMessage request associated with this response |
java.lang.String |
getTag()
Retrieves the identifier tag for this message. |
int |
getType()
Returns the LDAP operation type of the message. |
boolean |
isRequest()
Indicates whether the message is a request or a response |
static java.lang.Object |
readDSML(java.io.InputStream input)
This method is used to deserialize the DSML encoded representation of this class. |
void |
readExternal(java.io.ObjectInput in)
Reads the serialized object from the underlying input stream. |
protected void |
setDeserializedValues(LDAPMessage readObject,
RfcControls asn1Ctrls)
|
void |
setTag(java.lang.String stringTag)
Sets a string identifier tag for this message. |
java.lang.String |
toString()
Creates a String representation of this object |
void |
writeDSML(java.io.OutputStream oout)
This method does DSML serialization of the instance. |
void |
writeExternal(java.io.ObjectOutput out)
Writes the object state to a stream in XML format |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int BIND_REQUEST
BIND_REQUEST = 0
public static final int BIND_RESPONSE
BIND_RESPONSE = 1
public static final int UNBIND_REQUEST
UNBIND_REQUEST = 2
public static final int SEARCH_REQUEST
SEARCH_REQUEST = 3
public static final int SEARCH_RESPONSE
SEARCH_RESPONSE = 4
public static final int SEARCH_RESULT
SEARCH_RESULT = 5
public static final int MODIFY_REQUEST
MODIFY_REQUEST = 6
public static final int MODIFY_RESPONSE
MODIFY_RESPONSE = 7
public static final int ADD_REQUEST
ADD_REQUEST = 8
public static final int ADD_RESPONSE
ADD_RESONSE = 9
public static final int DEL_REQUEST
DEL_REQUEST = 10
public static final int DEL_RESPONSE
DEL_RESONSE = 11
public static final int MODIFY_RDN_REQUEST
MODIFY_RDN_REQUEST = 12
public static final int MODIFY_RDN_RESPONSE
MODIFY_RDN_RESPONSE = 13
public static final int COMPARE_REQUEST
COMPARE_REQUEST = 14
public static final int COMPARE_RESPONSE
COMPARE_RESPONSE = 15
public static final int ABANDON_REQUEST
ABANDON_REQUEST = 16
public static final int SEARCH_RESULT_REFERENCE
SEARCH_RESULT_REFERENCE = 19
public static final int EXTENDED_REQUEST
EXTENDED_REQUEST = 23
public static final int EXTENDED_RESPONSE
EXTENDED_RESONSE = 24
public static final int INTERMEDIATE_RESPONSE
EXTENDED_RESONSE = 24
protected RfcLDAPMessage message
private int imsgNum
private int messageType
private java.lang.String stringTag
Constructor Detail |
---|
LDAPMessage()
LDAPMessage(int messageType)
LDAPMessage(int type, RfcRequest op, LDAPControl[] controls)
op
- The operation type of message.
controls
- The controls to use with the operation.getType()
protected LDAPMessage(RfcLDAPMessage message)
message
- A response message.Method Detail |
---|
final LDAPMessage clone(java.lang.String dn, java.lang.String filter, boolean reference) throws LDAPException
dn
- the base dn
filter
- the filter
reference
- true if a search reference
LDAPException
final LDAPMessage getRequestingMessage()
public LDAPControl[] getControls()
private final LDAPControl controlFactory(java.lang.String oid, boolean critical, byte[] value)
public int getMessageID()
public int getType()
The type is one of the following:
public boolean isRequest()
RfcLDAPMessage getASN1Object()
public java.lang.String toString()
toString
in class java.lang.Object
private final java.lang.String getName()
public void setTag(java.lang.String stringTag)
This method allows an API to set a tag and later identify messages by retrieving the tag associated with the message. Tags are set by the application and not by the API or the server. Message tags are not included with any message sent to or received from the server.
Tags set on a request to the server are automatically associated with the response messages when they are received by the API and transferred to the application. The application can explicitly set a different value in a response message.
To set a value in a server request, for example an
LDAPSearchRequest
, you must create the object,
set the tag, and use the
LDAPConnection.sendRequest()
method to send it to the server.
stringTag
- the String assigned to identify this message.getTag()
,
isRequest()
public java.lang.String getTag()
An identifier can be associated with a message with the
setTag
method.
Tags are set by the application and not by the API or the server.
If a server response isRequest() == false
has no tag,
the tag associated with the corresponding server request is used.
null
if none.setTag(java.lang.String)
,
isRequest()
public void writeDSML(java.io.OutputStream oout) throws java.io.IOException
oout
- Outputstream where the serialzed data has to be written
java.io.IOException
- if write fails on OutputStreampublic static java.lang.Object readDSML(java.io.InputStream input) throws java.io.IOException
input
- InputStream for the DSML formatted data.
java.io.IOException
- when serialization fails.public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
out
- The ObjectOutput stream where the Object in XML format
is being written to
java.io.IOException
- - If I/O errors occurpublic void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
readExternal
in interface java.io.Externalizable
in
- The ObjectInput stream where the Serialized Object is being read from
java.io.IOException
- - If I/O errors occur
java.lang.ClassNotFoundException
- - If the class for an object being restored
cannot be found.protected void setDeserializedValues(LDAPMessage readObject, RfcControls asn1Ctrls) throws java.io.IOException, java.lang.ClassNotFoundException
java.io.IOException
java.lang.ClassNotFoundException
|
All LDAP Classes Internal LDAP Classes |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |