|
||||||||||
| 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
org.apache.directory.shared.ldap.codec.modify.ModifyRequestCodec
public class ModifyRequestCodec
A ModifyRequest Message. Its syntax is : ModifyRequest ::= [APPLICATION 6] SEQUENCE { object LDAPDN, modification SEQUENCE OF SEQUENCE { operation ENUMERATED { add (0), delete (1), replace (2) }, modification AttributeTypeAndValues } } AttributeTypeAndValues ::= SEQUENCE { type AttributeDescription, vals SET OF AttributeValue } AttributeValue ::= OCTET STRING
| Field Summary |
|---|
| Fields inherited from class org.apache.directory.shared.ldap.codec.LdapMessageCodec |
|---|
ldapMessageLength |
| Fields inherited from class org.apache.directory.shared.asn1.AbstractAsn1Object |
|---|
parent |
| Constructor Summary | |
|---|---|
ModifyRequestCodec()
Creates a new ModifyRequest object. |
|
| Method Summary | |
|---|---|
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 |
| Methods inherited from class org.apache.directory.shared.ldap.codec.LdapMessageCodec |
|---|
addControl, addControls, computeLength, encode, getCodecControl, getControls, getControls, getCurrentControl, getMessageId, initControls, setMessageId, toString |
| 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, wait, wait, wait |
| Constructor Detail |
|---|
public ModifyRequestCodec()
| Method Detail |
|---|
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 LdapMessageCodec
protected 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 PDU
EncoderExceptionpublic String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||