public class ModifyRequestCodec extends LdapMessageCodec
ldapMessageLengthparent| Constructor and Description |
|---|
ModifyRequestCodec()
Creates a new ModifyRequest object.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addAttributeTypeAndValues(String type)
Add a new attributeTypeAndValue
|
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
|
void |
addModification(int operation)
Add a new modification to the list
|
protected int |
computeLengthProtocolOp()
Compute the ModifyRequest length
ModifyRequest :
0x66 L1
|
+--> 0x04 L2 object
+--> 0x30 L3 modifications
|
+--> 0x30 L4-1 modification sequence
| |
| +--> 0x0A 0x01 (0..2) operation
| +--> 0x30 L5-1 modification
| |
| +--> 0x04 L6-1 type
| +--> 0x31 L7-1 vals
| |
| +--> 0x04 L8-1-1 attributeValue
| +--> 0x04 L8-1-2 attributeValue
| +--> ...
|
protected void |
encodeProtocolOp(ByteBuffer buffer)
Encode the ModifyRequest message to a PDU.
|
String |
getCurrentAttributeType()
Return the current attribute's type
|
int |
getCurrentOperation()
Get the current operation
|
MessageTypeEnum |
getMessageType()
Get the message type
|
String |
getMessageTypeName()
Get the message type Name
|
List<Modification> |
getModifications()
Get the entry's attributes
|
DN |
getObject()
Get the modification's DN
|
void |
initModifications()
Initialize the ArrayList for modifications.
|
void |
setCurrentOperation(int currentOperation)
Store the current operation
|
void |
setCurrentOperation(ModificationOperation currentOperation)
Store the current operation
|
void |
setModifications(List<Modification> modifications)
sets the modifications
|
void |
setObject(DN object)
Set the modification DN.
|
String |
toString()
Get a String representation of a ModifyRequest
|
addControl, addControls, computeLength, encode, getCodecControl, getControls, getControls, getCurrentControl, getMessageId, initControls, setMessageId, toStringaddLength, encode, getCurrentLength, getExpectedLength, getParent, getTlvId, setCurrentLength, setExpectedLength, setParentpublic ModifyRequestCodec()
public MessageTypeEnum getMessageType()
getMessageType in class LdapMessageCodecpublic String getMessageTypeName()
getMessageTypeName in class LdapMessageCodecpublic void initModifications()
public List<Modification> getModifications()
public void addModification(int operation)
operation - The type of operation (add, delete or replace)public void addAttributeTypeAndValues(String type)
type - The attribute's namepublic void addAttributeValue(String value)
value - The value to addpublic void addAttributeValue(Value<?> value)
value - The value to addpublic void addAttributeValue(byte[] value)
value - The value to addpublic String getCurrentAttributeType()
public DN getObject()
public void setObject(DN object)
object - The DN to set.public int getCurrentOperation()
public void setCurrentOperation(int currentOperation)
currentOperation - The currentOperation to set.public void setCurrentOperation(ModificationOperation currentOperation)
currentOperation - The currentOperation to set.public void setModifications(List<Modification> modifications)
modifications - the list of modificationsprotected int computeLengthProtocolOp()
computeLengthProtocolOp in class LdapMessageCodecprotected void encodeProtocolOp(ByteBuffer buffer) throws EncoderException
0x66 LL
0x04 LL object
0x30 LL modifiations
0x30 LL modification sequence
0x0A 0x01 operation
0x30 LL modification
0x04 LL type
0x31 LL vals
0x04 LL attributeValue
...
0x04 LL attributeValue
...
0x30 LL modification sequence
0x0A 0x01 operation
0x30 LL modification
0x04 LL type
0x31 LL vals
0x04 LL attributeValue
...
0x04 LL attributeValue
encodeProtocolOp in class LdapMessageCodecbuffer - The buffer where to put the PDUEncoderExceptionCopyright © 2003–2016 The Apache Software Foundation. All rights reserved.