public abstract class MessageDecorator<E extends Message> extends Object implements Message, Decorator<E>, Asn1Object
Modifier and Type | Field and Description |
---|---|
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.
|
Object |
get(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(String oid)
Gets the control associated with the given OID.
|
Map<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(String oid)
Checks whether or not this message has the specified control.
|
Object |
put(Object key,
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) |
String |
toString()
Delegates to the toString() method of the decorated Message.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
computeLength, encode
computeLength, encode
protected int messageLength
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 Map<String,Control> getControls()
getControls
in interface Message
public Control getControl(String oid)
getControl
in interface Message
oid
- The Cntrol's OID we are looking forpublic boolean hasControl(String oid)
hasControl
in interface Message
oid
- the OID of the controlpublic Message addControl(Control control)
addControl
in interface Message
control
- the control to add.public Message addAllControls(Control[] controls)
addAllControls
in interface Message
controls
- the controls to add.public Message removeControl(Control control)
removeControl
in interface Message
control
- the control to remove.public int getMessageId()
getMessageId
in interface Message
public Object get(Object key)
public Object put(Object key, Object value)
public Message setMessageId(int messageId)
setMessageId
in interface Message
messageId
- The message Idpublic E getDecorated()
getDecorated
in interface Decorator<E extends Message>
public LdapApiService getCodecService()
getCodecService
in interface Decorator<E extends Message>
Copyright © 2003–2015 The Apache Software Foundation. All rights reserved.