org.apache.directory.shared.ldap.message
Interface Message

All Known Subinterfaces:
AbandonableRequest, AbandonRequest, AddRequest, AddResponse, BindRequest, BindResponse, CompareRequest, CompareResponse, DeleteRequest, DeleteResponse, ExtendedRequest, ExtendedResponse, ManyReplyRequest, ModifyDnRequest, ModifyDnResponse, ModifyRequest, ModifyResponse, Request, Response, ResultResponse, ResultResponseRequest, SearchRequest, SearchResponseDone, SearchResponseEntry, SearchResponseReference, SingleReplyRequest, UnbindRequest
All Known Implementing Classes:
AbandonRequestImpl, AbstractAbandonableRequest, AbstractMessage, AbstractRequest, AbstractResponse, AbstractResultResponse, AddRequestImpl, AddResponseImpl, BindRequestImpl, BindResponseImpl, CompareRequestImpl, CompareResponseImpl, DeleteRequestImpl, DeleteResponseImpl, ExtendedRequestImpl, ExtendedResponseImpl, GracefulDisconnect, GracefulShutdownRequest, GracefulShutdownResponse, LaunchDiagnosticUiRequest, LaunchDiagnosticUiResponse, ModifyDnRequestImpl, ModifyDnResponseImpl, ModifyRequestImpl, ModifyResponseImpl, NoticeOfDisconnect, SearchRequestImpl, SearchResponseDoneImpl, SearchResponseEntryImpl, SearchResponseReferenceImpl, StoredProcedureRequest, StoredProcedureResponse, UnbindRequestImpl

public interface Message

Root interface for all LDAP message type interfaces.

Version:
$Rev: 664443 $
Author:
Apache Directory Project

Method Summary
 void add(javax.naming.ldap.Control control)
          Adds a control to this Message.
 void addAll(javax.naming.ldap.Control[] controls)
          Adds an array of controls to this Message.
 java.lang.Object get(java.lang.Object key)
          Gets a message scope parameter.
 java.util.Map<java.lang.String,javax.naming.ldap.Control> getControls()
          Gets the controls associated with this message mapped by OID.
 int getMessageId()
          Gets the session unique message sequence id for this message.
 MessageTypeEnum getType()
          Gets the LDAP message type code associated with this Message.
 boolean hasControl(java.lang.String oid)
          Checks whether or not this message has the specified control.
 java.lang.Object put(java.lang.Object key, java.lang.Object value)
          Sets a message scope parameter.
 void remove(javax.naming.ldap.Control control)
          Deletes a control removing it from this Message.
 

Method Detail

getType

MessageTypeEnum getType()
Gets the LDAP message type code associated with this Message. Each request and response type has a unique message type code defined by the protocol in RFC 2251.

Returns:
the message type code.

getControls

java.util.Map<java.lang.String,javax.naming.ldap.Control> getControls()
Gets the controls associated with this message mapped by OID.

Returns:
Map of OID strings to Control object instances.
See Also:
MutableControl

hasControl

boolean hasControl(java.lang.String oid)
Checks whether or not this message has the specified control.

Parameters:
oid - the OID of the control
Returns:
true if this message has the control, false if it does not

add

void add(javax.naming.ldap.Control control)
         throws MessageException
Adds a control to this Message.

Parameters:
control - the control to add.
Throws:
MessageException - if controls cannot be added to this Message or the control is not known etc.

addAll

void addAll(javax.naming.ldap.Control[] controls)
            throws MessageException
Adds an array of controls to this Message.

Parameters:
controls - the controls to add.
Throws:
MessageException - if controls cannot be added to this Message or they are not known etc.

remove

void remove(javax.naming.ldap.Control control)
            throws MessageException
Deletes a control removing it from this Message.

Parameters:
control - the control to remove.
Throws:
MessageException - if controls cannot be added to this Message or the control is not known etc.

getMessageId

int getMessageId()
Gets the session unique message sequence id for this message. Requests and their responses if any have the same message id. Clients at the initialization of a session start with the first message's id set to 1 and increment it with each transaction.

Returns:
the session unique message id.

get

java.lang.Object get(java.lang.Object key)
Gets a message scope parameter. Message scope parameters are temporary variables associated with a message and are set locally to be used to associate housekeeping information with a request or its processing. These parameters are never transmitted nor recieved, think of them as transient data associated with the message or its processing. These transient parameters are not locked down so modifications can occur without firing LockExceptions even when this Lockable is in the locked state.

Parameters:
key - the key used to access a message parameter.
Returns:
the transient message parameter value.

put

java.lang.Object put(java.lang.Object key,
                     java.lang.Object value)
Sets a message scope parameter. These transient parameters are not locked down so modifications can occur without firing LockExceptions even when this Lockable is in the locked state.

Parameters:
key - the parameter key
value - the parameter value
Returns:
the old value or null


Copyright © 2003-2011 Apache Software Foundation. All Rights Reserved.