public interface ModifyRequest extends SingleReplyRequest, AbandonableRequest
4.6. Modify Operation The Modify Operation allows a client to request that a modification of an entry be performed on its behalf by a server. The Modify Request is defined as follows: 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 } Parameters of the Modify Request are: - object: The object to be modified. The value of this field contains the Dn of the entry to be modified. The server will not perform any alias dereferencing in determining the object to be modified. - modification: A list of modifications to be performed on the entry. The entire list of entry modifications MUST be performed in the order they are listed, as a single atomic operation. While individual modifications may violate the directory schema, the resulting entry after the entire list of modifications is performed MUST conform to the requirements of the directory schema. The values that may be taken on by the 'operation' field in each modification construct have the following semantics respectively: add: add values listed to the given attribute, creating the attribute if necessary; delete: delete values listed from the given attribute, removing the entire attribute if no values are listed, or if all current values of the attribute are listed for deletion; replace: replace all existing values of the given attribute with the new values listed, creating the attribute if it did not already exist. A replace with no value will delete the entire attribute if it exists, and is ignored if the attribute does not exist.Notice that we tried to leverage as much as we already can from the JNDI. Both the Names and ModificationItems are used here to make the API as easy as possible to understand. We do not attempt here to write a JNDI provider which losses the explicit request type usage that we are looking for. Also note that this library is both for the client side as well as the server side unlike the JNDI which is strictly for the client side. From the JNDI we borrow good ideas and familiar signatures, interfaces and classes where we can. RFC 4525 suggest to add an operation in the enumeration:
ModifyRequest ::= [APPLICATION 6] SEQUENCE { object LDAPDN, modification SEQUENCE OF SEQUENCE { operation ENUMERATED { add (0), delete (1), replace (2), increment (3), ... },
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.
|
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.
|
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 |
increment(Attribute attr)
marks a given attribute for increment by 1 in the target entry.
|
ModifyRequest |
increment(Attribute attr,
int increment)
marks a given attribute for increment in the target entry.
|
ModifyRequest |
increment(String attributeName)
marks a given attribute for increment by 1 in the target entry.
|
ModifyRequest |
increment(String attributeName,
int increment)
marks a given attribute for increment in the target entry.
|
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.
|
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.
|
getResponseType
getResultResponse
hasResponse
get, getControl, getControls, getMessageId, getType, hasControl, put
abandon, addAbandonListener, isAbandoned
Dn getName()
ModifyRequest setName(Dn name)
name
- the Dn of the modified entry.Collection<Modification> getModifications()
ModifyRequest addModification(Modification mod)
mod
- a Modification to add.ModifyRequest removeModification(Modification mod)
mod
- a Modification to remove.ModifyRequest remove(String attributeName, String... attributeValue)
attributeName
- name of the attribute to be removedattributeValue
- values of the attributeModifyRequest remove(String attributeName, byte[]... attributeValue)
attributeName
- name of the attribute to be addedattributeValue
- values of the attributeremove(String, String...)
ModifyRequest remove(Attribute attr)
attr
- the attribute to be removedModifyRequest remove(String attributeName)
attributeName
- the attribute to be removedModifyRequest addModification(Attribute attr, ModificationOperation modOp)
attr
- The attribute to be modifiedmodOp
- The operationModifyRequest add(String attributeName, String... attributeValue)
attributeName
- name of the attribute to be addedattributeValue
- values of the attributeModifyRequest add(String attributeName, byte[]... attributeValue)
attributeName
- name of the attribute to be addedattributeValue
- values of the attributeadd(String, String...)
ModifyRequest add(Attribute attr)
attr
- the attribute to be addedModifyRequest replace(String attributeName)
attributeName
- name of the attribute to be addedreplace(String, String...)
ModifyRequest replace(String attributeName, String... attributeValue)
attributeName
- name of the attribute to be addedattributeValue
- values of the attributeModifyRequest replace(String attributeName, byte[]... attributeValue)
attributeName
- name of the attribute to be addedattributeValue
- values of the attributereplace(String, String...)
ModifyRequest replace(Attribute attr)
attr
- the attribute to be addedModifyRequest increment(String attributeName)
attributeName
- the attribute to be incrementedModifyRequest increment(String attributeName, int increment)
attributeName
- the attribute to be incrementedincrement
- The increment value (>=1)ModifyRequest increment(Attribute attr)
attr
- the attribute to be incrementedModifyRequest increment(Attribute attr, int increment)
attr
- the attribute to be incrementedincrement
- The increment value (>=1)ModifyRequest setMessageId(int messageId)
setMessageId
in interface Message
messageId
- The message IdModifyRequest addControl(Control control)
addControl
in interface Message
control
- the control to add.ModifyRequest addAllControls(Control[] controls)
addAllControls
in interface Message
controls
- the controls to add.ModifyRequest removeControl(Control control)
removeControl
in interface Message
control
- the control to remove.Copyright © 2003–2023 The Apache Software Foundation. All rights reserved.