|
||||||||||
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(java.lang.String type)
Add a new attributeTypeAndValue |
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 |
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(java.nio.ByteBuffer buffer)
Encode the ModifyRequest message to a PDU. |
java.lang.String |
getCurrentAttributeType()
Return the current attribute's type |
int |
getCurrentOperation()
Get the current operation |
MessageTypeEnum |
getMessageType()
Get the message type |
java.lang.String |
getMessageTypeName()
Get the message type Name |
java.util.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(java.util.List<Modification> modifications)
sets the modifications |
void |
setObject(DN object)
Set the modification DN. |
java.lang.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 LdapMessageCodec
public java.lang.String getMessageTypeName()
getMessageTypeName
in class LdapMessageCodec
public void initModifications()
public java.util.List<Modification> getModifications()
public void addModification(int operation)
operation
- The type of operation (add, delete or replace)public void addAttributeTypeAndValues(java.lang.String type)
type
- The attribute's namepublic void addAttributeValue(java.lang.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 java.lang.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(java.util.List<Modification> modifications)
modifications
- the list of modificationsprotected int computeLengthProtocolOp()
computeLengthProtocolOp
in class LdapMessageCodec
protected void encodeProtocolOp(java.nio.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 LdapMessageCodec
buffer
- The buffer where to put the PDU
EncoderException
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |