public class ModifyRequestDecorator extends SingleReplyRequestDecorator<ModifyRequest> implements ModifyRequest
Constructor and Description |
---|
ModifyRequestDecorator(LdapApiService codec,
ModifyRequest decoratedMessage)
Makes a ModifyRequest encodable.
|
Modifier and Type | Method and Description |
---|---|
ModifyRequest |
add(Attribute attr)
marks a given attribute for addition in the target entry.
|
ModifyRequest |
add(String attributeName,
byte[]... attributeValue) |
ModifyRequest |
add(String attributeName,
String... attributeValue)
marks a given attribute for addition in the target entry with the
given values.
|
ModifyRequest |
addAllControls(Control[] controls)
Adds an array of controls to this Message.
|
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
|
ModifyRequest |
addControl(Control control)
Adds a control to this Message.
|
ModifyRequest |
addModification(Attribute attr,
ModificationOperation modOp)
Add a modification
|
ModifyRequest |
addModification(Modification mod)
Adds a ModificationItem to the set of modifications composing this modify
request.
|
int |
computeLength()
Compute the ModifyRequest length
ModifyRequest : |
ByteBuffer |
encode(ByteBuffer buffer)
Encode the ModifyRequest message to a PDU.
|
String |
getCurrentAttributeType() |
Collection<Modification> |
getModifications()
Gets an immutable Collection of modification items representing the
atomic changes to perform on the candidate entry to modify.
|
Dn |
getName()
Gets the distinguished name of the entry to be modified by this request.
|
ModifyRequest |
remove(Attribute attr)
marks a given attribute for removal from the target entry.
|
ModifyRequest |
remove(String attributeName)
marks a given attribute name for removal from the target entry.
|
ModifyRequest |
remove(String attributeName,
byte[]... attributeValue) |
ModifyRequest |
remove(String attributeName,
String... attributeValue)
marks a given attribute for removal with the given
values from the target entry.
|
ModifyRequest |
removeControl(Control control)
Deletes a control removing it from this Message.
|
ModifyRequest |
removeModification(Modification mod)
Removes a ModificationItem to the set of modifications composing this
modify request.
|
ModifyRequest |
replace(Attribute attr)
marks a given attribute for replacement in the target entry.
|
ModifyRequest |
replace(String attributeName) |
ModifyRequest |
replace(String attributeName,
byte[]... attributeValue) |
ModifyRequest |
replace(String attributeName,
String... attributeValue)
marks a given attribute for replacement with the given
values in the target entry.
|
void |
setCurrentOperation(int currentOperation)
Store the current operation
|
ModifyRequest |
setMessageId(int messageId)
Sets the Message ID for this request
|
ModifyRequest |
setName(Dn name)
Sets the distinguished name of the entry to be modified by 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 ModifyRequestDecorator(LdapApiService codec, ModifyRequest decoratedMessage)
codec
- The LDAP service instancedecoratedMessage
- the decorated ModifyRequestpublic void setCurrentOperation(int currentOperation)
currentOperation
- The currentOperation to set.public void addAttributeTypeAndValues(String type)
type
- The attribute's namepublic String getCurrentAttributeType()
public void addAttributeValue(byte[] value) throws LdapException
value
- The value to addLdapException
- If teh value is invalidpublic void addAttributeValue(String value) throws LdapException
value
- The value to addLdapException
- If teh value is invalidpublic Dn getName()
getName
in interface ModifyRequest
public ModifyRequest setName(Dn name)
setName
in interface ModifyRequest
name
- the Dn of the modified entry.public Collection<Modification> getModifications()
getModifications
in interface ModifyRequest
public ModifyRequest addModification(Modification mod)
addModification
in interface ModifyRequest
mod
- a Modification to add.public ModifyRequest removeModification(Modification mod)
removeModification
in interface ModifyRequest
mod
- a Modification to remove.public ModifyRequest remove(String attributeName, String... attributeValue)
remove
in interface ModifyRequest
attributeName
- name of the attribute to be removedattributeValue
- values of the attributepublic ModifyRequest remove(String attributeName, byte[]... attributeValue)
remove
in interface ModifyRequest
attributeName
- name of the attribute to be addedattributeValue
- values of the attributeModifyRequest.remove(String, String...)
public ModifyRequest remove(Attribute attr)
remove
in interface ModifyRequest
attr
- the attribute to be removedpublic ModifyRequest remove(String attributeName)
remove
in interface ModifyRequest
attributeName
- the attribute to be removedpublic ModifyRequest addModification(Attribute attr, ModificationOperation modOp)
addModification
in interface ModifyRequest
attr
- The attribute to be modifiedmodOp
- The operationpublic ModifyRequest add(String attributeName, String... attributeValue)
add
in interface ModifyRequest
attributeName
- name of the attribute to be addedattributeValue
- values of the attributepublic ModifyRequest add(String attributeName, byte[]... attributeValue)
add
in interface ModifyRequest
attributeName
- name of the attribute to be addedattributeValue
- values of the attributeModifyRequest.add(String, String...)
public ModifyRequest add(Attribute attr)
add
in interface ModifyRequest
attr
- the attribute to be addedpublic ModifyRequest replace(String attributeName)
replace
in interface ModifyRequest
attributeName
- name of the attribute to be addedModifyRequest.replace(String, String...)
public ModifyRequest replace(String attributeName, String... attributeValue)
replace
in interface ModifyRequest
attributeName
- name of the attribute to be addedattributeValue
- values of the attributepublic ModifyRequest replace(String attributeName, byte[]... attributeValue)
replace
in interface ModifyRequest
attributeName
- name of the attribute to be addedattributeValue
- values of the attributeModifyRequest.replace(String, String...)
public ModifyRequest replace(Attribute attr)
replace
in interface ModifyRequest
attr
- the attribute to be addedpublic ModifyRequest setMessageId(int messageId)
setMessageId
in interface Message
setMessageId
in interface ModifyRequest
setMessageId
in class MessageDecorator<ModifyRequest>
messageId
- The message Idpublic ModifyRequest addControl(Control control)
addControl
in interface Message
addControl
in interface ModifyRequest
addControl
in class MessageDecorator<ModifyRequest>
control
- the control to add.public ModifyRequest addAllControls(Control[] controls)
addAllControls
in interface Message
addAllControls
in interface ModifyRequest
addAllControls
in class MessageDecorator<ModifyRequest>
controls
- the controls to add.public ModifyRequest removeControl(Control control)
removeControl
in interface Message
removeControl
in interface ModifyRequest
removeControl
in class MessageDecorator<ModifyRequest>
control
- the control to remove.public int computeLength()
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 | +--> ... | +--> 0x04 L8-1-i attributeValue | +--> ... | +--> 0x04 L8-1-n attributeValue | +--> 0x30 L4-2 modification sequence . | . +--> 0x0A 0x01 (0..2) operation . +--> 0x30 L5-2 modification | +--> 0x04 L6-2 type +--> 0x31 L7-2 vals | +--> 0x04 L8-2-1 attributeValue +--> 0x04 L8-2-2 attributeValue +--> ... +--> 0x04 L8-2-i attributeValue +--> ... +--> 0x04 L8-2-n attributeValue
computeLength
in interface Asn1Object
computeLength
in interface Decorator<ModifyRequest>
public ByteBuffer encode(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
encode
in interface Asn1Object
encode
in interface Decorator<ModifyRequest>
buffer
- The buffer where to put the PDUEncoderException
- if the buffer can't be encodedCopyright © 2003–2018 The Apache Software Foundation. All rights reserved.