public final class AddRequestDecorator extends SingleReplyRequestDecorator<AddRequest> implements AddRequest
| Modifier and Type | Field and Description |
|---|---|
private int |
addRequestLength
The add request length
|
private java.util.List<byte[]> |
attributeIds
The list of all attributes Id bytes
|
private java.util.List<java.lang.Integer> |
attributesLength
The list of all attributes length
|
private Attribute |
currentAttribute
The current attribute being decoded
|
private byte[] |
dnBytes
The bytes containing the Dn
|
private int |
entryLength
The Entry length
|
private java.util.List<java.lang.Integer> |
valuesLength
The list of all vals length
|
messageLength| Constructor and Description |
|---|
AddRequestDecorator(LdapApiService codec,
AddRequest decoratedMessage)
Makes a AddRequest a MessageDecorator.
|
| Modifier and Type | Method and Description |
|---|---|
AddRequest |
addAllControls(Control[] controls)
Adds an array of controls to this Message.
|
void |
addAttributeType(java.lang.String type)
Create a new attributeValue
|
void |
addAttributeValue(byte[] value)
Add a new value to the current attribute
|
void |
addAttributeValue(java.lang.String value)
Add a new value to the current attribute
|
void |
addAttributeValue(Value<?> value)
Add a new value to the current attribute
|
AddRequest |
addControl(Control control)
Adds a control to this Message.
|
int |
computeLength()
Compute the AddRequest length
AddRequest :
0x68 L1
|
+--> 0x04 L2 entry
+--> 0x30 L3 (attributes)
|
+--> 0x30 L4-1 (attribute)
| |
| +--> 0x04 L5-1 type
| +--> 0x31 L6-1 (values)
| |
| +--> 0x04 L7-1-1 value
| +--> ...
|
java.nio.ByteBuffer |
encode(java.nio.ByteBuffer buffer)
Encode the AddRequest message to a PDU.
|
java.lang.String |
getCurrentAttributeType() |
Entry |
getEntry()
Gets the entry to add.
|
Dn |
getEntryDn()
Gets the distinguished name of the entry to add.
|
AddRequest |
removeControl(Control control)
Deletes a control removing it from this Message.
|
AddRequest |
setEntry(Entry entry)
Sets the Entry to add.
|
AddRequest |
setEntryDn(Dn entry)
Sets the distinguished name of the entry to add.
|
AddRequest |
setMessageId(int messageId)
Sets the Message ID for this request
|
abandon, addAbandonListener, getResponseType, isAbandonedgetResultResponse, hasResponseget, getCodecService, getControl, getControls, getControlsLength, getCurrentControl, getDecorated, getDecorator, getMessageId, getMessageLength, getType, hasControl, put, setControlsLength, setMessageLength, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetResponseTypegetResultResponsehasResponseget, getControl, getControls, getMessageId, getType, hasControl, putabandon, addAbandonListener, isAbandonedprivate int addRequestLength
private int entryLength
private java.util.List<java.lang.Integer> attributesLength
private java.util.List<byte[]> attributeIds
private java.util.List<java.lang.Integer> valuesLength
private Attribute currentAttribute
private byte[] dnBytes
public AddRequestDecorator(LdapApiService codec, AddRequest decoratedMessage)
decoratedMessage - the decorated AddRequestpublic AddRequest setMessageId(int messageId)
setMessageId in interface AddRequestsetMessageId in interface MessagesetMessageId in class MessageDecorator<AddRequest>messageId - The message Idpublic AddRequest addControl(Control control)
addControl in interface AddRequestaddControl in interface MessageaddControl in class MessageDecorator<AddRequest>control - the control to add.public AddRequest addAllControls(Control[] controls)
addAllControls in interface AddRequestaddAllControls in interface MessageaddAllControls in class MessageDecorator<AddRequest>controls - the controls to add.public AddRequest removeControl(Control control)
removeControl in interface AddRequestremoveControl in interface MessageremoveControl in class MessageDecorator<AddRequest>control - the control to remove.public Dn getEntryDn()
getEntryDn in interface AddRequestpublic AddRequest setEntryDn(Dn entry)
setEntryDn in interface AddRequestentry - the Dn of the added entry.public Entry getEntry()
getEntry in interface AddRequestpublic AddRequest setEntry(Entry entry)
setEntry in interface AddRequestentry - the added Entrypublic void addAttributeType(java.lang.String type)
throws LdapException
type - The attribute's name (called 'type' in the grammar)LdapExceptionpublic java.lang.String getCurrentAttributeType()
public void addAttributeValue(java.lang.String value)
throws LdapException
value - The value to addLdapExceptionpublic void addAttributeValue(Value<?> value) throws LdapException
value - The value to addLdapExceptionpublic void addAttributeValue(byte[] value)
throws LdapException
value - The value to addLdapExceptionpublic int computeLength()
computeLength in interface Asn1ObjectcomputeLength in interface Decorator<AddRequest>public java.nio.ByteBuffer encode(java.nio.ByteBuffer buffer)
throws EncoderException
encode in interface Asn1Objectencode in interface Decorator<AddRequest>buffer - The buffer where to put the PDUEncoderException - if the buffer can't be encoded