Skip navigation links

Oracle® Fusion Middleware Java API Reference for Oracle Unified Directory
11g Release 2 (11.1.2.2.0)

E38583-02


oracle.oud.requests
Class AddRequestWrapper

java.lang.Object
  extended by oracle.oud.requests.AddRequestWrapper

All Implemented Interfaces:
AttachmentHolder, AddRequest, Request, Entry

public class AddRequestWrapper
extends java.lang.Object
implements AddRequest

This class wraps an Add request.


Constructor Summary
AddRequestWrapper(AddRequest request)
          Creates a new AddRequestWrapper that wraps the specified add request.

 

Method Summary
 boolean addAttribute(Attribute attribute)
          Ensures that this entry contains the provided attribute and values (optional operation).
 boolean addAttribute(Attribute attribute, java.util.Collection<AttributeValue> duplicateValues)
          Ensures that this entry contains the provided attribute and values (optional operation).
 AddRequest addAttribute(java.lang.String attributeDescription, java.lang.Object... values)
          Ensures that this entry contains the provided attribute and values (optional operation).
 AddRequest addControl(Control control)
          Adds the provided control to this request.
 AddRequest clearAttributes()
          Removes all the attributes from this entry (optional operation).
 boolean containsAttribute(Attribute attribute, java.util.Collection<AttributeValue> missingValues)
          Returns true if this entry contains all of the attribute values contained in attribute.
 boolean containsAttribute(java.lang.String attributeDescription)
          Returns true if the attribute is present in this entry, regardless of how many values it contains.
 boolean containsAttribute(java.lang.String attributeDescription, java.lang.Object... values)
          Returns true if this entry contains all of the attribute values contained in values.
 java.lang.Iterable<Attribute> getAllAttributes()
          Returns an Iterable containing all of the attributes in this entry.
 java.lang.Iterable<Attribute> getAllAttributes(AttributeDescription attributeDescription)
          Returns an Iterable containing all the attributes in this entry having an attribute description which is a sub-type of the provided attribute description.
 java.lang.Iterable<Attribute> getAllAttributes(java.lang.String attributeDescription)
          Returns an Iterable containing all the attributes in this entry having an attribute description which is a sub-type of the provided attribute description.
 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.
 Attribute getAttribute(AttributeDescription attributeDescription)
          Returns the named attribute contained in this entry, or null if it is not included with this entry.
 Attribute getAttribute(java.lang.String attributeDescription)
          Returns the named attribute contained in this entry, or null if it is not included with this entry.
<C extends Control>
C
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.
 DN getName()
          Returns the string representation of the distinguished name of this entry.
 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.
 boolean removeAttribute(Attribute attribute, java.util.Collection<AttributeValue> missingValues)
          Removes all of the attribute values contained in attribute from this entry if it is present (optional operation).
 boolean removeAttribute(AttributeDescription attributeDescription)
          Removes the named attribute from this entry if it is present (optional operation).
 boolean removeAttribute(java.lang.String attributeDescription)
          Removes the named attribute from this entry if it is present (optional operation).
 AddRequest removeAttribute(java.lang.String attributeDescription, java.lang.Object... values)
          Removes all of the attribute values contained in values from the named attribute in this entry if it is present (optional operation).
 Request removeControl(Control control)
          Removes the provided control from this request.
 boolean replaceAttribute(Attribute attribute)
          Adds all of the attribute values contained in attribute to this entry, replacing any existing attribute values (optional operation).
 AddRequest replaceAttribute(java.lang.String attributeDescription, java.lang.Object... values)
          Adds all of the attribute values contained in values to this entry, replacing any existing attribute values (optional operation).
 java.lang.Object setAttachment(java.lang.String name, java.lang.Object value)
          Sets the value of the specified attachment.
 AddRequest setName(DN dn)
          Sets the distinguished name of this entry (optional operation).
 AddRequest setName(java.lang.String dn)
          Sets the distinguished name of this entry (optional operation).

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Methods inherited from interface oracle.oud.requests.Request
getControl, getControls, isInternal, removeControl

 

Methods inherited from interface oracle.oud.plugin.AttachmentHolder
getAttachment, getAttachmentNames, removeAttachment, setAttachment

 

Methods inherited from interface oracle.oud.types.Entry
equals, hashCode, toString

 

Constructor Detail

AddRequestWrapper

public AddRequestWrapper(AddRequest request)
Creates a new AddRequestWrapper that wraps the specified add request.
Parameters:
request - the request to wrap.

Method Detail

addAttribute

public boolean addAttribute(Attribute attribute)
                     throws java.lang.UnsupportedOperationException,
                            java.lang.NullPointerException
Description copied from interface: AddRequest
Ensures that this entry contains the provided attribute and values (optional operation). This method has the following semantics:

NOTE: When attribute is non-empty, this method implements LDAP Modify add semantics.

Specified by:
addAttribute in interface AddRequest
Specified by:
addAttribute in interface Entry
Parameters:
attribute - The attribute values to be added to this entry, merging with any existing attribute values.
Returns:
true if this entry changed as a result of this call.
Throws:
java.lang.UnsupportedOperationException - If this entry does not permit attributes or their values to be added.
java.lang.NullPointerException - If attribute was null.

addAttribute

public boolean addAttribute(Attribute attribute,
                            java.util.Collection<AttributeValue> duplicateValues)
                     throws java.lang.UnsupportedOperationException,
                            java.lang.NullPointerException
Description copied from interface: AddRequest
Ensures that this entry contains the provided attribute and values (optional operation). This method has the following semantics:

NOTE: When attribute is non-empty, this method implements LDAP Modify add semantics.

Specified by:
addAttribute in interface AddRequest
Specified by:
addAttribute in interface Entry
Parameters:
attribute - The attribute values to be added to this entry, merging with any existing attribute values.
duplicateValues - A collection into which duplicate values will be added, or null if duplicate values should not be saved.
Returns:
true if this entry changed as a result of this call.
Throws:
java.lang.UnsupportedOperationException - If this entry does not permit attributes or their values to be added.
java.lang.NullPointerException - If attribute was null.

addAttribute

public AddRequest addAttribute(java.lang.String attributeDescription,
                               java.lang.Object... values)
                        throws PluginException,
                               java.lang.UnsupportedOperationException,
                               java.lang.NullPointerException
Description copied from interface: AddRequest
Ensures that this entry contains the provided attribute and values (optional operation). This method has the following semantics:

NOTE: When attribute is non-empty, this method implements LDAP Modify add semantics.

Specified by:
addAttribute in interface AddRequest
Specified by:
addAttribute in interface Entry
Parameters:
attributeDescription - The name of the attribute whose values are to be added.
values - The attribute values to be added to this entry, merging any existing attribute values.
Returns:
This entry.
Throws:
PluginException - If attributeDescription could not be decoded.
java.lang.UnsupportedOperationException - If this entry does not permit attributes or their values to be added.
java.lang.NullPointerException - If attributeDescription was null.

addControl

public AddRequest addControl(Control control)
                      throws java.lang.UnsupportedOperationException,
                             java.lang.NullPointerException
Description copied from interface: Request
Adds the provided control to this request.
Specified by:
addControl in interface AddRequest
Specified by:
addControl in interface Request
Parameters:
control - The control to be added to this request.
Returns:
This request.
Throws:
java.lang.UnsupportedOperationException - If this request does not permit controls to be added.
java.lang.NullPointerException - If control was null.

clearAttributes

public AddRequest clearAttributes()
                           throws java.lang.UnsupportedOperationException
Description copied from interface: AddRequest
Removes all the attributes from this entry (optional operation).
Specified by:
clearAttributes in interface AddRequest
Specified by:
clearAttributes in interface Entry
Returns:
This entry.
Throws:
java.lang.UnsupportedOperationException - If this entry does not permit attributes to be removed.

containsAttribute

public boolean containsAttribute(Attribute attribute,
                                 java.util.Collection<AttributeValue> missingValues)
                          throws java.lang.NullPointerException
Description copied from interface: AddRequest
Returns true if this entry contains all of the attribute values contained in attribute. If attribute is empty then this method will return true if the attribute is present in this entry, regardless of how many values it contains.
Specified by:
containsAttribute in interface AddRequest
Specified by:
containsAttribute in interface Entry
Parameters:
attribute - The attribute values whose presence in this entry is to be tested.
missingValues - A collection into which missing values will be added, or null if missing values should not be saved.
Returns:
true if this entry contains all of the attribute values contained in attribute.
Throws:
java.lang.NullPointerException - If attribute was null.

containsAttribute

public boolean containsAttribute(java.lang.String attributeDescription)
                          throws PluginException,
                                 java.lang.NullPointerException
Description copied from interface: Entry
Returns true if the attribute is present in this entry, regardless of how many values it contains.
Specified by:
containsAttribute in interface Entry
Parameters:
attributeDescription - The name of the attribute whose presence in this entry is to be tested.
Returns:
true if this entry contains all of the attribute values contained in values.
Throws:
PluginException - If attributeDescription could not be decoded.
java.lang.NullPointerException - If attributeDescription was null.

containsAttribute

public boolean containsAttribute(java.lang.String attributeDescription,
                                 java.lang.Object... values)
                          throws PluginException,
                                 java.lang.NullPointerException
Description copied from interface: AddRequest
Returns true if this entry contains all of the attribute values contained in values. If values is null or empty then this method will return true if the attribute is present in this entry, regardless of how many values it contains.
Specified by:
containsAttribute in interface AddRequest
Specified by:
containsAttribute in interface Entry
Parameters:
attributeDescription - The name of the attribute whose presence in this entry is to be tested.
values - The attribute values whose presence in this entry is to be tested, which may be null.
Returns:
true if this entry contains all of the attribute values contained in values.
Throws:
PluginException - If attributeDescription could not be decoded.
java.lang.NullPointerException - If attributeDescription was null.

getAllAttributes

public java.lang.Iterable<Attribute> getAllAttributes()
Description copied from interface: AddRequest
Returns an Iterable containing all of the attributes in this entry. The returned Iterable may be used to remove attributes if permitted by this entry.
Specified by:
getAllAttributes in interface AddRequest
Specified by:
getAllAttributes in interface Entry
Returns:
An Iterable containing all of the attributes.

getAllAttributes

public java.lang.Iterable<Attribute> getAllAttributes(AttributeDescription attributeDescription)
                                               throws java.lang.NullPointerException
Description copied from interface: AddRequest
Returns an Iterable containing all the attributes in this entry having an attribute description which is a sub-type of the provided attribute description. The returned Iterable may be used to remove attributes if permitted by this entry.
Specified by:
getAllAttributes in interface AddRequest
Specified by:
getAllAttributes in interface Entry
Parameters:
attributeDescription - The name of the attributes to be returned.
Returns:
An Iterable containing the matching attributes.
Throws:
java.lang.NullPointerException - If attributeDescription was null.

getAllAttributes

public java.lang.Iterable<Attribute> getAllAttributes(java.lang.String attributeDescription)
                                               throws PluginException,
                                                      java.lang.NullPointerException
Description copied from interface: AddRequest
Returns an Iterable containing all the attributes in this entry having an attribute description which is a sub-type of the provided attribute description. The returned Iterable may be used to remove attributes if permitted by this entry.

The attribute description will be decoded using the schema associated with this entry (usually the default schema).

Specified by:
getAllAttributes in interface AddRequest
Specified by:
getAllAttributes in interface Entry
Parameters:
attributeDescription - The name of the attributes to be returned.
Returns:
An Iterable containing the matching attributes.
Throws:
PluginException - If attributeDescription could not be decoded.
java.lang.NullPointerException - If attributeDescription was null.

getAttribute

public Attribute getAttribute(AttributeDescription attributeDescription)
                       throws java.lang.NullPointerException
Description copied from interface: AddRequest
Returns the named attribute contained in this entry, or null if it is not included with this entry.
Specified by:
getAttribute in interface AddRequest
Specified by:
getAttribute in interface Entry
Parameters:
attributeDescription - The name of the attribute to be returned.
Returns:
The named attribute, or null if it is not included with this entry.
Throws:
java.lang.NullPointerException - If attributeDescription was null.

getAttribute

public Attribute getAttribute(java.lang.String attributeDescription)
                       throws PluginException,
                              java.lang.NullPointerException
Description copied from interface: AddRequest
Returns the named attribute contained in this entry, or null if it is not included with this entry.
Specified by:
getAttribute in interface AddRequest
Specified by:
getAttribute in interface Entry
Parameters:
attributeDescription - The name of the attribute to be returned.
Returns:
The named attribute, or null if it is not included with this entry.
Throws:
PluginException - If attributeDescription could not be decoded.
java.lang.NullPointerException - If attributeDescription was null.

getName

public DN getName()
Description copied from interface: AddRequest
Returns the string representation of the distinguished name of this entry.
Specified by:
getName in interface AddRequest
Specified by:
getName in interface Entry
Returns:
The string representation of the distinguished name.

removeAttribute

public boolean removeAttribute(Attribute attribute,
                               java.util.Collection<AttributeValue> missingValues)
                        throws java.lang.UnsupportedOperationException,
                               java.lang.NullPointerException
Description copied from interface: AddRequest
Removes all of the attribute values contained in attribute from this entry if it is present (optional operation). If attribute is empty then the entire attribute will be removed if it is present.

NOTE: This method implements LDAP Modify delete semantics.

Specified by:
removeAttribute in interface AddRequest
Specified by:
removeAttribute in interface Entry
Parameters:
attribute - The attribute values to be removed from this entry, which may be empty if the entire attribute is to be removed.
missingValues - A collection into which missing values will be added, or null if missing values should not be saved.
Returns:
true if this entry changed as a result of this call.
Throws:
java.lang.UnsupportedOperationException - If this entry does not permit attributes or their values to be removed.
java.lang.NullPointerException - If attribute was null.

removeAttribute

public boolean removeAttribute(java.lang.String attributeDescription)
                        throws PluginException,
                               java.lang.UnsupportedOperationException,
                               java.lang.NullPointerException
Description copied from interface: Entry
Removes the named attribute from this entry if it is present (optional operation). If this attribute does not contain the attribute, the call leaves this entry unchanged and returns false.
Specified by:
removeAttribute in interface Entry
Parameters:
attributeDescription - The name of the attribute to be removed.
Returns:
true if this entry changed as a result of this call.
Throws:
PluginException - If attributeDescription could not be decoded.
java.lang.UnsupportedOperationException - If this entry does not permit attributes to be removed.
java.lang.NullPointerException - If attributeDescription was null.

removeAttribute

public boolean removeAttribute(AttributeDescription attributeDescription)
                        throws java.lang.UnsupportedOperationException,
                               java.lang.NullPointerException
Description copied from interface: AddRequest
Removes the named attribute from this entry if it is present (optional operation). If this attribute does not contain the attribute, the call leaves this entry unchanged and returns false.
Specified by:
removeAttribute in interface AddRequest
Specified by:
removeAttribute in interface Entry
Parameters:
attributeDescription - The name of the attribute to be removed.
Returns:
true if this entry changed as a result of this call.
Throws:
java.lang.UnsupportedOperationException - If this entry does not permit attributes to be removed.
java.lang.NullPointerException - If attributeDescription was null.

removeAttribute

public AddRequest removeAttribute(java.lang.String attributeDescription,
                                  java.lang.Object... values)
                           throws PluginException,
                                  java.lang.UnsupportedOperationException,
                                  java.lang.NullPointerException
Description copied from interface: AddRequest
Removes all of the attribute values contained in values from the named attribute in this entry if it is present (optional operation). If values is null or empty then the entire attribute will be removed if it is present.

NOTE: This method implements LDAP Modify delete semantics.

Specified by:
removeAttribute in interface AddRequest
Specified by:
removeAttribute in interface Entry
Parameters:
attributeDescription - The name of the attribute whose values are to be removed.
values - The attribute values to be removed from this entry, which may be null or empty if the entire attribute is to be removed.
Returns:
This entry.
Throws:
PluginException - If attributeDescription could not be decoded.
java.lang.UnsupportedOperationException - If this entry does not permit attributes or their values to be removed.
java.lang.NullPointerException - If attributeDescription was null.

replaceAttribute

public boolean replaceAttribute(Attribute attribute)
                         throws java.lang.UnsupportedOperationException,
                                java.lang.NullPointerException
Description copied from interface: AddRequest
Adds all of the attribute values contained in attribute to this entry, replacing any existing attribute values (optional operation). If attribute is empty then the entire attribute will be removed if it is present.

NOTE: This method implements LDAP Modify replace semantics.

Specified by:
replaceAttribute in interface AddRequest
Specified by:
replaceAttribute in interface Entry
Parameters:
attribute - The attribute values to be added to this entry, replacing any existing attribute values, and which may be empty if the entire attribute is to be removed.
Returns:
true if this entry changed as a result of this call.
Throws:
java.lang.UnsupportedOperationException - If this entry does not permit attributes or their values to be replaced.
java.lang.NullPointerException - If attribute was null.

replaceAttribute

public AddRequest replaceAttribute(java.lang.String attributeDescription,
                                   java.lang.Object... values)
                            throws PluginException,
                                   java.lang.UnsupportedOperationException,
                                   java.lang.NullPointerException
Description copied from interface: AddRequest
Adds all of the attribute values contained in values to this entry, replacing any existing attribute values (optional operation). If values is null or empty then the entire attribute will be removed if it is present.

NOTE: This method implements LDAP Modify replace semantics.

Specified by:
replaceAttribute in interface AddRequest
Specified by:
replaceAttribute in interface Entry
Parameters:
attributeDescription - The name of the attribute whose values are to be replaced.
values - The attribute values to be added to this entry, replacing any existing attribute values, and which may be null or empty if the entire attribute is to be removed.
Returns:
This entry.
Throws:
PluginException - If attributeDescription could not be decoded.
java.lang.UnsupportedOperationException - If this entry does not permit attributes or their values to be replaced.
java.lang.NullPointerException - If attribute was null.

setName

public AddRequest setName(DN dn)
                   throws java.lang.UnsupportedOperationException,
                          java.lang.NullPointerException
Description copied from interface: AddRequest
Sets the distinguished name of this entry (optional operation).
Specified by:
setName in interface AddRequest
Specified by:
setName in interface Entry
Parameters:
dn - The distinguished name.
Returns:
This entry.
Throws:
java.lang.UnsupportedOperationException - If this entry does not permit the distinguished name to be set.
java.lang.NullPointerException - If dn was null.

setName

public AddRequest setName(java.lang.String dn)
                   throws PluginException,
                          java.lang.UnsupportedOperationException,
                          java.lang.NullPointerException
Description copied from interface: AddRequest
Sets the distinguished name of this entry (optional operation).
Specified by:
setName in interface AddRequest
Specified by:
setName in interface Entry
Parameters:
dn - The string representation of the distinguished name.
Returns:
This entry.
Throws:
PluginException - If dn could not be decoded.
java.lang.UnsupportedOperationException - If this entry does not permit the distinguished name to be set.
java.lang.NullPointerException - If dn was null.

getControl

public <C extends Control> C getControl(ControlDecoder<C> decoder)
                             throws java.lang.NullPointerException,
                                    PluginException
Description copied from interface: Request
Decodes and returns the first control in this request having an OID corresponding to the provided control decoder.
Specified by:
getControl in interface Request
Type Parameters:
C - The type of control to be decoded and returned.
Parameters:
decoder - The control decoder.
Returns:
The decoded control, or null if the control is not included with this request.
Throws:
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).

getControls

public java.util.List<Control> getControls()
Description copied from interface: Request
Returns a List containing the controls included with this request. The returned List is immutable.
Specified by:
getControls in interface Request
Returns:
A List containing the controls.

removeControl

public Request removeControl(Control control)
                      throws java.lang.UnsupportedOperationException,
                             java.lang.NullPointerException
Description copied from interface: Request
Removes the provided control from this request.
Specified by:
removeControl in interface Request
Parameters:
control - The control to be removed from this request.
Returns:
This request.
Throws:
java.lang.UnsupportedOperationException - If this request does not permit controls to be removed.
java.lang.NullPointerException - If control was null.

removeAttachment

public java.lang.Object removeAttachment(java.lang.String name)
Description copied from interface: AttachmentHolder
Removes the attachment with the specified name.
Specified by:
removeAttachment in interface AttachmentHolder
Parameters:
name - The name for the attachment to remove. It will be treated in a case-sensitive manner.
Returns:
The attachment that was removed, or null if it does not exist.

setAttachment

public java.lang.Object setAttachment(java.lang.String name,
                                      java.lang.Object value)
Description copied from interface: AttachmentHolder
Sets the value of the specified attachment. If an attachment already exists with the same name, it will be replaced. Otherwise, a new attachment will be added.
Specified by:
setAttachment in interface AttachmentHolder
Parameters:
name - The name to use for the attachment.
value - The value to use for the attachment.
Returns:
The former value held by the attachment with the given name, or null if there was previously no such attachment.

getAttachment

public java.lang.Object getAttachment(java.lang.String name)
Description copied from interface: AttachmentHolder
Retrieves the attachment with the specified name.
Specified by:
getAttachment in interface AttachmentHolder
Parameters:
name - The name for the attachment to retrieve. It will be treated in a case-sensitive manner.
Returns:
The requested attachment object, or null if it does not exist.

getAttachmentNames

public java.util.Set<java.lang.String> getAttachmentNames()
Description copied from interface: AttachmentHolder
Retrieves the set of attachment names defined for this holder, as a mapping between the attachment name and the associated object.
Specified by:
getAttachmentNames in interface AttachmentHolder
Returns:
The set of attachments defined for this request.

isInternal

public boolean isInternal()
Description copied from interface: Request
Returns 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, ...

Specified by:
isInternal in interface Request
Returns:
true if this request is flagged as internal; false otherwise.

Skip navigation links

Oracle® Fusion Middleware Java API Reference for Oracle Unified Directory
11g Release 2 (11.1.2.2.0)

E38583-02


Copyright © 2013, Oracle and/or its affiliates. All rights reserved.