public abstract class MessageDecorator<E extends Message> extends java.lang.Object implements Message, Decorator<E>, Asn1Object
| Modifier and Type | Field and Description |
|---|---|
private LdapApiService |
codec
The LdapCodecService
|
private java.util.Map<java.lang.String,Control> |
controls
Map of message controls using OID Strings for keys and Control values
|
private int |
controlsLength
The length of the controls
|
private CodecControl<? extends Control> |
currentControl
The current control
|
private E |
decoratedMessage
The decorated Control
|
protected int |
messageLength
The encoded Message length
|
| Modifier | Constructor and Description |
|---|---|
protected |
MessageDecorator(LdapApiService codec,
E decoratedMessage)
Makes a Message an Decorator object.
|
| Modifier and Type | Method and Description |
|---|---|
Message |
addAllControls(Control[] controls)
Adds an array of controls to this Message.
|
Message |
addControl(Control control)
Adds a control to this Message.
|
java.lang.Object |
get(java.lang.Object key)
Gets a message scope parameter.
|
LdapApiService |
getCodecService()
Gets the codec service responsible for managing the encoding and
decoding of the decorated objects.
|
Control |
getControl(java.lang.String oid)
Gets the control associated with the given OID.
|
java.util.Map<java.lang.String,Control> |
getControls()
Gets the controls associated with this message mapped by OID.
|
int |
getControlsLength() |
CodecControl<? extends Control> |
getCurrentControl()
Get the current Control Object
|
E |
getDecorated()
Gets the object being decorated by this IDecorator.
|
static MessageDecorator<? extends Message> |
getDecorator(LdapApiService codec,
Message decoratedMessage) |
int |
getMessageId()
Gets the session unique message sequence id for this message.
|
int |
getMessageLength() |
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.
|
Message |
removeControl(Control control)
Deletes a control removing it from this Message.
|
void |
setControlsLength(int controlsLength) |
Message |
setMessageId(int messageId)
Sets the Message ID for this request
|
void |
setMessageLength(int messageLength) |
java.lang.String |
toString()
Delegates to the toString() method of the decorated Message.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcomputeLength, encodecomputeLength, encodeprivate final java.util.Map<java.lang.String,Control> controls
private CodecControl<? extends Control> currentControl
protected int messageLength
private int controlsLength
private final LdapApiService codec
protected MessageDecorator(LdapApiService codec, E decoratedMessage)
public static MessageDecorator<? extends Message> getDecorator(LdapApiService codec, Message decoratedMessage)
public void setControlsLength(int controlsLength)
controlsLength - the encoded controls lengthpublic int getControlsLength()
public void setMessageLength(int messageLength)
messageLength - The encoded message lengthpublic int getMessageLength()
public CodecControl<? extends Control> getCurrentControl()
public MessageTypeEnum getType()
public java.util.Map<java.lang.String,Control> getControls()
getControls in interface Messagepublic Control getControl(java.lang.String oid)
getControl in interface Messageoid - The Cntrol's OID we are looking forpublic boolean hasControl(java.lang.String oid)
hasControl in interface Messageoid - the OID of the controlpublic Message addControl(Control control)
addControl in interface Messagecontrol - the control to add.public Message addAllControls(Control[] controls)
addAllControls in interface Messagecontrols - the controls to add.public Message removeControl(Control control)
removeControl in interface Messagecontrol - the control to remove.public int getMessageId()
getMessageId in interface Messagepublic java.lang.Object get(java.lang.Object key)
public java.lang.Object put(java.lang.Object key,
java.lang.Object value)
public Message setMessageId(int messageId)
setMessageId in interface MessagemessageId - The message Idpublic java.lang.String toString()
toString in class java.lang.Objectpublic E getDecorated()
getDecorated in interface Decorator<E extends Message>public LdapApiService getCodecService()
getCodecService in interface Decorator<E extends Message>