|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.directory.shared.asn1.AbstractAsn1Object
org.apache.directory.shared.ldap.codec.LdapMessageCodec
public abstract class LdapMessageCodec
The main ldapObject : every Ldap Message are encapsulated in it. It contains a message Id, a operation (protocolOp) and one ore more Controls.
Field Summary | |
---|---|
protected int |
ldapMessageLength
The LdapMessage length |
Fields inherited from class org.apache.directory.shared.asn1.AbstractAsn1Object |
---|
parent |
Constructor Summary | |
---|---|
LdapMessageCodec()
Creates a new LdapMessage object. |
Method Summary | |
---|---|
void |
addControl(Control control)
Add a control to the Controls array |
void |
addControls(java.util.List<Control> controls)
Set or add a list of controls to the Controls array. |
int |
computeLength()
Compute the LdapMessage length LdapMessage : 0x30 L1 | +--> 0x02 0x0(1-4) [0..2^31-1] (MessageId) +--> protocolOp [+--> Controls] MessageId length = Length(0x02) + length(MessageId) + MessageId.length L1 = length(ProtocolOp) LdapMessage length = Length(0x30) + Length(L1) + MessageId length + L1 |
protected abstract int |
computeLengthProtocolOp()
|
java.nio.ByteBuffer |
encode()
Generate the PDU which contains the encoded object. |
protected abstract void |
encodeProtocolOp(java.nio.ByteBuffer buffer)
|
Control |
getCodecControl(java.lang.String oid)
|
java.util.List<Control> |
getControls()
Get the Control Objects |
Control |
getControls(int i)
Get the Control Object at a specific index |
Control |
getCurrentControl()
Get the current Control Object |
int |
getMessageId()
Get the message ID |
abstract MessageTypeEnum |
getMessageType()
Get the message type |
abstract java.lang.String |
getMessageTypeName()
Get the message type Name |
void |
initControls()
Init the controls array |
void |
setMessageId(int messageId)
Set the message ID |
protected java.lang.String |
toString(java.lang.String protocolOp)
Get a String representation of a LdapMessage |
Methods inherited from class org.apache.directory.shared.asn1.AbstractAsn1Object |
---|
addLength, encode, getCurrentLength, getExpectedLength, getParent, getTlvId, setCurrentLength, setExpectedLength, setParent |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected int ldapMessageLength
Constructor Detail |
---|
public LdapMessageCodec()
Method Detail |
---|
public Control getControls(int i)
i
- The index of the Control Object to get
public java.util.List<Control> getControls()
public Control getCurrentControl()
public Control getCodecControl(java.lang.String oid)
public void addControl(Control control)
control
- The Control to addpublic void addControls(java.util.List<Control> controls)
controls
- The list of Controls to set or addpublic void initControls()
public int getMessageId()
public void setMessageId(int messageId)
messageId
- The message IDpublic abstract MessageTypeEnum getMessageType()
public abstract java.lang.String getMessageTypeName()
protected abstract int computeLengthProtocolOp()
public int computeLength()
computeLength
in interface Asn1Object
computeLength
in class AbstractAsn1Object
protected abstract void encodeProtocolOp(java.nio.ByteBuffer buffer) throws EncoderException
EncoderException
public java.nio.ByteBuffer encode() throws EncoderException
0x30 L1 | +--> 0x02 L2 MessageId +--> ProtocolOp +--> Controls L2 = Length(MessageId) L1 = Length(0x02) + Length(L2) + L2 + Length(ProtocolOp) + Length(Controls) LdapMessageLength = Length(0x30) + Length(L1) + L1
buffer
- The encoded PDU
EncoderException
- If anything goes wrong.protected java.lang.String toString(java.lang.String protocolOp)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |