public class ModifyRequestWrapper extends java.lang.Object implements ModifyRequest
Constructor and Description |
---|
ModifyRequestWrapper(ModifyRequest request)
Creates a new ModifyRequestWrapper that wraps the specified modify request.
|
Modifier and Type | Method and Description |
---|---|
ModifyRequest |
addControl(Control control)
Adds the provided control to this request.
|
ModifyRequest |
addModification(Modification modification)
Appends the provided modification to the list of modifications included
with this modify request.
|
ModifyRequest |
addModification(ModificationType type,
java.lang.String attributeDescription,
java.lang.Object... values)
Appends the provided modification to the list of modifications included
with this modify request.
|
java.lang.Object |
getAttachment(java.lang.String name)
Retrieves the attachment with the specified name.
|
java.util.Set<java.lang.String> |
getAttachmentNames()
Retrieves the set of attachment names defined for this holder, as a
mapping between the attachment name and the associated object.
|
<C extends Control> |
getControl(ControlDecoder<C> decoder)
Decodes and returns the first control in this request having an OID
corresponding to the provided control decoder.
|
java.util.List<Control> |
getControls()
Returns a
List containing the controls included with this request. |
java.util.List<Modification> |
getModifications()
Returns a
List containing the modifications included with this
modify request. |
DN |
getName()
Returns the distinguished name of the entry to be modified.
|
boolean |
isInternal()
Returns
true if this request is flagged as internal; false
otherwise. |
java.lang.Object |
removeAttachment(java.lang.String name)
Removes the attachment with the specified name.
|
Request |
removeControl(Control control)
Removes the provided control from this request.
|
java.lang.Object |
setAttachment(java.lang.String name,
java.lang.Object value)
Sets the value of the specified attachment.
|
ModifyRequest |
setName(DN dn)
Sets the distinguished name of the entry to be modified.
|
ModifyRequest |
setName(java.lang.String dn)
Sets the distinguished name of the entry to be modified.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getControl, getControls, isInternal, removeControl
getAttachment, getAttachmentNames, removeAttachment, setAttachment
public ModifyRequestWrapper(ModifyRequest request)
request
- the request to wrap.public ModifyRequest addControl(Control control) throws java.lang.UnsupportedOperationException, java.lang.NullPointerException
Request
addControl
in interface ModifyRequest
addControl
in interface Request
control
- The control to be added to this request.java.lang.UnsupportedOperationException
- If this request does not permit controls to be added.java.lang.NullPointerException
- If control
was null
.public ModifyRequest addModification(Modification modification) throws java.lang.UnsupportedOperationException, java.lang.NullPointerException
ModifyRequest
addModification
in interface ModifyRequest
modification
- The modification to be performed.java.lang.UnsupportedOperationException
- If this modify request does not permit modifications to be added.java.lang.NullPointerException
- If modification
was null
.public ModifyRequest addModification(ModificationType type, java.lang.String attributeDescription, java.lang.Object... values) throws PluginException, java.lang.UnsupportedOperationException, java.lang.NullPointerException
ModifyRequest
If the attribute value is not an instance of ByteString
then it
will be converted using the ByteString.valueOf(Object)
method.
addModification
in interface ModifyRequest
type
- The type of modification to be performed.attributeDescription
- The name of the attribute to be modified.values
- The attribute values to be modified.PluginException
- If attributeDescription
could not be decoded.java.lang.UnsupportedOperationException
- If this modify request does not permit modifications to be added.java.lang.NullPointerException
- If type
, attributeDescription
, or value
was null
.public java.util.List<Modification> getModifications()
ModifyRequest
List
containing the modifications included with this
modify request. The returned List
may be modified if permitted by
this modify request.getModifications
in interface ModifyRequest
List
containing the modifications.public DN getName()
ModifyRequest
getName
in interface ModifyRequest
public ModifyRequest setName(DN dn) throws java.lang.UnsupportedOperationException, java.lang.NullPointerException
ModifyRequest
setName
in interface ModifyRequest
dn
- The the distinguished name of the entry to be modified.java.lang.UnsupportedOperationException
- If this modify request does not permit the distinguished name to
be set.java.lang.NullPointerException
- If dn
was null
.public ModifyRequest setName(java.lang.String dn) throws PluginException, java.lang.UnsupportedOperationException, java.lang.NullPointerException
ModifyRequest
setName
in interface ModifyRequest
dn
- The the distinguished name of the entry to be modified.PluginException
- If dn
could not be decoded.java.lang.UnsupportedOperationException
- If this modify request does not permit the distinguished name to
be set.java.lang.NullPointerException
- If dn
was null
.public <C extends Control> C getControl(ControlDecoder<C> decoder) throws java.lang.NullPointerException, PluginException
Request
getControl
in interface Request
C
- The type of control to be decoded and returned.decoder
- The control decoder.null
if the control is not included
with this request.java.lang.NullPointerException
- If decoder
was null
.PluginException
- If the control could not be decoded because it was malformed in
some way (e.g. the control value was missing, or its content
could not be decoded).public java.util.List<Control> getControls()
Request
List
containing the controls included with this request.
The returned List
is immutable.getControls
in interface Request
List
containing the controls.public Request removeControl(Control control) throws java.lang.UnsupportedOperationException, java.lang.NullPointerException
Request
removeControl
in interface Request
control
- The control to be removed from this request.java.lang.UnsupportedOperationException
- If this request does not permit controls to be removed.java.lang.NullPointerException
- If control
was null
.public java.lang.Object removeAttachment(java.lang.String name)
AttachmentHolder
removeAttachment
in interface AttachmentHolder
name
- The name for the attachment to remove. It will be
treated in a case-sensitive manner.null
if it
does not exist.public java.lang.Object setAttachment(java.lang.String name, java.lang.Object value)
AttachmentHolder
setAttachment
in interface AttachmentHolder
name
- The name to use for the attachment.value
- The value to use for the attachment.null
if there was previously no such
attachment.public java.lang.Object getAttachment(java.lang.String name)
AttachmentHolder
getAttachment
in interface AttachmentHolder
name
- The name for the attachment to retrieve. It will
be treated in a case-sensitive manner.null
if it
does not exist.public java.util.Set<java.lang.String> getAttachmentNames()
AttachmentHolder
getAttachmentNames
in interface AttachmentHolder
public boolean isInternal()
Request
true
if this request is flagged as internal; false
otherwise.
When a request is flagged internal, various components of the server may behave in a manner that is less restrictive. For example, attributes defined as NO-USER-MODIFICATION are allowed to be added, private backends are accessible, ...
isInternal
in interface Request
true
if this request is flagged as internal; false
otherwise.