public final class AddRequestDecorator extends SingleReplyRequestDecorator<AddRequest> implements AddRequest
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(String type)
Create a new attributeValue
|
void |
addAttributeValue(byte[] value)
Add a new value to the current attribute
|
void |
addAttributeValue(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 : |
ByteBuffer |
encode(ByteBuffer buffer)
Encode the AddRequest message to a PDU.
|
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, isAbandoned
getResultResponse, hasResponse
get, getCodecService, getControl, getControls, getControlsLength, getCurrentControl, getDecorated, getDecorator, getMessageId, getMessageLength, getType, hasControl, put, setControlsLength, setMessageLength, toString
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
getResponseType
getResultResponse
hasResponse
get, getControl, getControls, getMessageId, getType, hasControl, put
abandon, addAbandonListener, isAbandoned
public AddRequestDecorator(LdapApiService codec, AddRequest decoratedMessage)
codec
- The LDAP service instancedecoratedMessage
- the decorated AddRequestpublic AddRequest setMessageId(int messageId)
setMessageId
in interface AddRequest
setMessageId
in interface Message
setMessageId
in class MessageDecorator<AddRequest>
messageId
- The message Idpublic AddRequest addControl(Control control)
addControl
in interface AddRequest
addControl
in interface Message
addControl
in class MessageDecorator<AddRequest>
control
- the control to add.public AddRequest addAllControls(Control[] controls)
addAllControls
in interface AddRequest
addAllControls
in interface Message
addAllControls
in class MessageDecorator<AddRequest>
controls
- the controls to add.public AddRequest removeControl(Control control)
removeControl
in interface AddRequest
removeControl
in interface Message
removeControl
in class MessageDecorator<AddRequest>
control
- the control to remove.public Dn getEntryDn()
getEntryDn
in interface AddRequest
public AddRequest setEntryDn(Dn entry)
setEntryDn
in interface AddRequest
entry
- the Dn of the added entry.public Entry getEntry()
getEntry
in interface AddRequest
public AddRequest setEntry(Entry entry)
setEntry
in interface AddRequest
entry
- the added Entrypublic void addAttributeType(String type) throws LdapException
type
- The attribute's name (called 'type' in the grammar)LdapException
- If the value is invalidpublic String getCurrentAttributeType()
public void addAttributeValue(String value) throws LdapException
value
- The value to addLdapException
- If the value is invalidpublic void addAttributeValue(Value<?> value) throws LdapException
value
- The value to addLdapException
- If the value is invalidpublic void addAttributeValue(byte[] value) throws LdapException
value
- The value to addLdapException
- If the value is invalidpublic int computeLength()
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 | +--> ... | +--> 0x04 L7-1-n value | +--> 0x30 L4-2 (attribute) | | | +--> 0x04 L5-2 type | +--> 0x31 L6-2 (values) | | | +--> 0x04 L7-2-1 value | +--> ... | +--> 0x04 L7-2-n value | +--> ... | +--> 0x30 L4-m (attribute) | +--> 0x04 L5-m type +--> 0x31 L6-m (values) | +--> 0x04 L7-m-1 value +--> ... +--> 0x04 L7-m-n value
computeLength
in interface Asn1Object
computeLength
in interface Decorator<AddRequest>
public ByteBuffer encode(ByteBuffer buffer) throws EncoderException
0x68 LL 0x04 LL entry 0x30 LL attributesList 0x30 LL attributeList 0x04 LL attributeDescription 0x31 LL attributeValues 0x04 LL attributeValue ... 0x04 LL attributeValue ... 0x30 LL attributeList 0x04 LL attributeDescription 0x31 LL attributeValue 0x04 LL attributeValue ... 0x04 LL attributeValue
encode
in interface Asn1Object
encode
in interface Decorator<AddRequest>
buffer
- The buffer where to put the PDUEncoderException
- if the buffer can't be encodedCopyright © 2003–2018 The Apache Software Foundation. All rights reserved.