Class ModifyRequestDsml
- java.lang.Object
-
- org.apache.directory.api.dsmlv2.AbstractDsmlMessageDecorator<E>
-
- org.apache.directory.api.dsmlv2.request.AbstractRequestDsml<E>
-
- org.apache.directory.api.dsmlv2.request.AbstractResultResponseRequestDsml<ModifyRequest,ModifyResponse>
-
- org.apache.directory.api.dsmlv2.request.ModifyRequestDsml
-
- All Implemented Interfaces:
DsmlDecorator<ModifyRequest>,AbandonableRequest,Message,ModifyRequest,Request,ResultResponseRequest,SingleReplyRequest
public class ModifyRequestDsml extends AbstractResultResponseRequestDsml<ModifyRequest,ModifyResponse> implements ModifyRequest
DSML Decorator for ModifyRequest- Author:
- Apache Directory Project
-
-
Constructor Summary
Constructors Constructor Description ModifyRequestDsml(LdapApiService codec)Creates a new getDecoratedMessage() of ModifyRequestDsml.ModifyRequestDsml(LdapApiService codec, ModifyRequest ldapMessage)Creates a new getDecoratedMessage() of ModifyRequestDsml.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ModifyRequestadd(String attributeName, byte[]... attributeValue)ModifyRequestadd(String attributeName, String... attributeValue)marks a given attribute for addition in the target entry with the given values.ModifyRequestadd(Attribute attr)marks a given attribute for addition in the target entry.ModifyRequestaddAllControls(Control[] controls)Adds an array of controls to this Message.voidaddAttributeTypeAndValues(String type)Add a new attributeTypeAndValuevoidaddAttributeValue(byte[] value)Add a new value to the current attributevoidaddAttributeValue(String value)Add a new value to the current attributeModifyRequestaddControl(Control control)Adds a control to this Message.ModifyRequestaddModification(Attribute attr, ModificationOperation modOp)Add a modificationModifyRequestaddModification(Modification mod)Adds a ModificationItem to the set of modifications composing this modify request.StringgetCurrentAttributeType()Collection<Modification>getModifications()Gets an immutable Collection of modification items representing the atomic changes to perform on the candidate entry to modify.DngetName()Gets the distinguished name of the entry to be modified by this request.MessageTypeEnumgetResponseType()Gets the protocol response message type for this request which produces at least one response.ModifyRequestincrement(String attr)marks a given attribute for increment by 1 in the target entry.ModifyRequestincrement(String attr, int increment)marks a given attribute for increment in the target entry.ModifyRequestincrement(Attribute attributeName)marks a given attribute for increment by 1 in the target entry.ModifyRequestincrement(Attribute attributeName, int increment)marks a given attribute for increment in the target entry.ModifyRequestremove(String attributeName)marks a given attribute name for removal from the target entry.ModifyRequestremove(String attributeName, byte[]... attributeValue)ModifyRequestremove(String attributeName, String... attributeValue)marks a given attribute for removal with the given values from the target entry.ModifyRequestremove(Attribute attr)marks a given attribute for removal from the target entry.ModifyRequestremoveControl(Control control)Deletes a control removing it from this Message.ModifyRequestremoveModification(Modification mod)Removes a ModificationItem to the set of modifications composing this modify request.ModifyRequestreplace(String attributeName)ModifyRequestreplace(String attributeName, byte[]... attributeValue)ModifyRequestreplace(String attributeName, String... attributeValue)marks a given attribute for replacement with the given values in the target entry.ModifyRequestreplace(Attribute attr)marks a given attribute for replacement in the target entry.voidsetCurrentOperation(int currentOperation)Store the current operationModifyRequestsetMessageId(int messageId)Sets the Message ID for this requestModifyRequestsetName(Dn name)Sets the distinguished name of the entry to be modified by this request.ElementtoDsml(Element root)Creates the Request Element and adds RequestID and Controls.-
Methods inherited from class org.apache.directory.api.dsmlv2.request.AbstractResultResponseRequestDsml
abandon, addAbandonListener, computeLength, encode, getResultResponse, isAbandoned
-
Methods inherited from class org.apache.directory.api.dsmlv2.request.AbstractRequestDsml
getRequestName, hasResponse
-
Methods inherited from class org.apache.directory.api.dsmlv2.AbstractDsmlMessageDecorator
get, getCodecService, getControl, getControls, getCurrentControl, getDecorated, getMessageId, getType, hasControl, put
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.directory.api.ldap.model.message.AbandonableRequest
abandon, addAbandonListener, isAbandoned
-
Methods inherited from interface org.apache.directory.api.ldap.model.message.Message
get, getControl, getControls, getMessageId, getType, hasControl, put
-
Methods inherited from interface org.apache.directory.api.ldap.model.message.Request
hasResponse
-
Methods inherited from interface org.apache.directory.api.ldap.model.message.ResultResponseRequest
getResultResponse
-
-
-
-
Constructor Detail
-
ModifyRequestDsml
public ModifyRequestDsml(LdapApiService codec)
Creates a new getDecoratedMessage() of ModifyRequestDsml.- Parameters:
codec- The LDAP Service to use
-
ModifyRequestDsml
public ModifyRequestDsml(LdapApiService codec, ModifyRequest ldapMessage)
Creates a new getDecoratedMessage() of ModifyRequestDsml.- Parameters:
codec- The LDAP Service to useldapMessage- the message to decorate
-
-
Method Detail
-
getCurrentAttributeType
public String getCurrentAttributeType()
- Returns:
- the current attribute's type
-
setCurrentOperation
public void setCurrentOperation(int currentOperation)
Store the current operation- Parameters:
currentOperation- The currentOperation to set.
-
addAttributeTypeAndValues
public void addAttributeTypeAndValues(String type)
Add a new attributeTypeAndValue- Parameters:
type- The attribute's name
-
addAttributeValue
public void addAttributeValue(byte[] value) throws LdapExceptionAdd a new value to the current attribute- Parameters:
value- The value to add- Throws:
LdapException- If we can't add a value
-
addAttributeValue
public void addAttributeValue(String value) throws LdapException
Add a new value to the current attribute- Parameters:
value- The value to add- Throws:
LdapException- If we can't add a value
-
toDsml
public Element toDsml(Element root)
Creates the Request Element and adds RequestID and Controls.- Specified by:
toDsmlin interfaceDsmlDecorator<ModifyRequest>- Overrides:
toDsmlin classAbstractResultResponseRequestDsml<ModifyRequest,ModifyResponse>- Parameters:
root- the root element- Returns:
- the Request Element of the given name containing
-
getResponseType
public MessageTypeEnum getResponseType()
Gets the protocol response message type for this request which produces at least one response.- Specified by:
getResponseTypein interfaceSingleReplyRequest- Returns:
- the message type of the response.
-
getName
public Dn getName()
Gets the distinguished name of the entry to be modified by this request. This property represents the PDU's object field.- Specified by:
getNamein interfaceModifyRequest- Returns:
- the Dn of the modified entry.
-
setName
public ModifyRequest setName(Dn name)
Sets the distinguished name of the entry to be modified by this request. This property represents the PDU's object field.- Specified by:
setNamein interfaceModifyRequest- Parameters:
name- the Dn of the modified entry.- Returns:
- The ModifyRequest instance
-
getModifications
public Collection<Modification> getModifications()
Gets an immutable Collection of modification items representing the atomic changes to perform on the candidate entry to modify.- Specified by:
getModificationsin interfaceModifyRequest- Returns:
- an immutable Collection of Modification instances.
-
addModification
public ModifyRequest addModification(Modification mod)
Adds a ModificationItem to the set of modifications composing this modify request.- Specified by:
addModificationin interfaceModifyRequest- Parameters:
mod- a Modification to add.- Returns:
- The ModifyRequest instance
-
removeModification
public ModifyRequest removeModification(Modification mod)
Removes a ModificationItem to the set of modifications composing this modify request.- Specified by:
removeModificationin interfaceModifyRequest- Parameters:
mod- a Modification to remove.- Returns:
- The ModifyRequest instance
-
remove
public ModifyRequest remove(String attributeName, String... attributeValue)
marks a given attribute for removal with the given values from the target entry.- Specified by:
removein interfaceModifyRequest- Parameters:
attributeName- name of the attribute to be removedattributeValue- values of the attribute- Returns:
- The ModifyRequest instance
-
remove
public ModifyRequest remove(String attributeName, byte[]... attributeValue)
- Specified by:
removein interfaceModifyRequest- Parameters:
attributeName- name of the attribute to be addedattributeValue- values of the attribute- Returns:
- The ModifyRequest instance
- See Also:
ModifyRequest.remove(String, String...)
-
remove
public ModifyRequest remove(Attribute attr)
marks a given attribute for removal from the target entry.- Specified by:
removein interfaceModifyRequest- Parameters:
attr- the attribute to be removed- Returns:
- The ModifyRequest instance
-
remove
public ModifyRequest remove(String attributeName)
marks a given attribute name for removal from the target entry.- Specified by:
removein interfaceModifyRequest- Parameters:
attributeName- the attribute to be removed- Returns:
- The ModifyRequest instance
-
addModification
public ModifyRequest addModification(Attribute attr, ModificationOperation modOp)
Add a modification- Specified by:
addModificationin interfaceModifyRequest- Parameters:
attr- The attribute to be modifiedmodOp- The operation- Returns:
- The ModifyRequest instance
-
add
public ModifyRequest add(String attributeName, String... attributeValue)
marks a given attribute for addition in the target entry with the given values.- Specified by:
addin interfaceModifyRequest- Parameters:
attributeName- name of the attribute to be addedattributeValue- values of the attribute- Returns:
- The ModifyRequest instance
-
add
public ModifyRequest add(String attributeName, byte[]... attributeValue)
- Specified by:
addin interfaceModifyRequest- Parameters:
attributeName- name of the attribute to be addedattributeValue- values of the attribute- Returns:
- The ModifyRequest instance
- See Also:
ModifyRequest.add(String, String...)
-
add
public ModifyRequest add(Attribute attr)
marks a given attribute for addition in the target entry.- Specified by:
addin interfaceModifyRequest- Parameters:
attr- the attribute to be added- Returns:
- The ModifyRequest instance
-
replace
public ModifyRequest replace(String attributeName)
- Specified by:
replacein interfaceModifyRequest- Parameters:
attributeName- name of the attribute to be added- Returns:
- The ModifyRequest instance
- See Also:
ModifyRequest.replace(String, String...)
-
replace
public ModifyRequest replace(String attributeName, String... attributeValue)
marks a given attribute for replacement with the given values in the target entry.- Specified by:
replacein interfaceModifyRequest- Parameters:
attributeName- name of the attribute to be addedattributeValue- values of the attribute- Returns:
- The ModifyRequest instance
-
replace
public ModifyRequest replace(String attributeName, byte[]... attributeValue)
- Specified by:
replacein interfaceModifyRequest- Parameters:
attributeName- name of the attribute to be addedattributeValue- values of the attribute- Returns:
- The ModifyRequest instance
- See Also:
ModifyRequest.replace(String, String...)
-
replace
public ModifyRequest replace(Attribute attr)
marks a given attribute for replacement in the target entry.- Specified by:
replacein interfaceModifyRequest- Parameters:
attr- the attribute to be added- Returns:
- The ModifyRequest instance
-
increment
public ModifyRequest increment(Attribute attributeName)
marks a given attribute for increment by 1 in the target entry.- Specified by:
incrementin interfaceModifyRequest- Parameters:
attributeName- the attribute to be incremented- Returns:
- The ModifyRequest instance
-
increment
public ModifyRequest increment(Attribute attributeName, int increment)
marks a given attribute for increment in the target entry.- Specified by:
incrementin interfaceModifyRequest- Parameters:
attributeName- the attribute to be incrementedincrement- The increment value (>=1)- Returns:
- The ModifyRequest instance
-
increment
public ModifyRequest increment(String attr)
marks a given attribute for increment by 1 in the target entry.- Specified by:
incrementin interfaceModifyRequest- Parameters:
attr- the attribute to be incremented- Returns:
- The ModifyRequest instance
-
increment
public ModifyRequest increment(String attr, int increment)
marks a given attribute for increment in the target entry.- Specified by:
incrementin interfaceModifyRequest- Parameters:
attr- the attribute to be incrementedincrement- The increment value (>=1)- Returns:
- The ModifyRequest instance
-
setMessageId
public ModifyRequest setMessageId(int messageId)
Sets the Message ID for this request- Specified by:
setMessageIdin interfaceMessage- Specified by:
setMessageIdin interfaceModifyRequest- Overrides:
setMessageIdin classAbstractDsmlMessageDecorator<ModifyRequest>- Parameters:
messageId- The message Id- Returns:
- A Message reference
-
addControl
public ModifyRequest addControl(Control control)
Adds a control to this Message.- Specified by:
addControlin interfaceMessage- Specified by:
addControlin interfaceModifyRequest- Overrides:
addControlin classAbstractDsmlMessageDecorator<ModifyRequest>- Parameters:
control- the control to add.- Returns:
- A Message reference
-
addAllControls
public ModifyRequest addAllControls(Control[] controls)
Adds an array of controls to this Message.- Specified by:
addAllControlsin interfaceMessage- Specified by:
addAllControlsin interfaceModifyRequest- Overrides:
addAllControlsin classAbstractDsmlMessageDecorator<ModifyRequest>- Parameters:
controls- the controls to add.- Returns:
- A Message reference
-
removeControl
public ModifyRequest removeControl(Control control)
Deletes a control removing it from this Message.- Specified by:
removeControlin interfaceMessage- Specified by:
removeControlin interfaceModifyRequest- Overrides:
removeControlin classAbstractDsmlMessageDecorator<ModifyRequest>- Parameters:
control- the control to remove.- Returns:
- A Message reference
-
-