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.types
Interface Entry

All Known Subinterfaces:
AddRequest, SearchResultEntry
All Known Implementing Classes:
AddRequestWrapper

public interface Entry

An entry, comprising of a distinguished name and zero or more attributes.

Full LDAP modify semantics are provided via the addAttribute(oracle.oud.types.Attribute), removeAttribute(oracle.oud.types.Attribute, java.util.Collection<oracle.oud.types.AttributeValue>), and replaceAttribute(oracle.oud.types.Attribute) methods.

Creation of Entry is provided by newEntry(DN)


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).
 Entry addAttribute(java.lang.String attributeDescription, java.lang.Object... values)
          Ensures that this entry contains the provided attribute and values (optional operation).
 Entry 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.
 boolean equals(java.lang.Object object)
          Returns true if object is an entry which is equal to this entry.
 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.
 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.
 DN getName()
          Returns the string representation of the distinguished name of this entry.
 int hashCode()
          Returns the hash code for this entry.
 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).
 Entry 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).
 boolean replaceAttribute(Attribute attribute)
          Adds all of the attribute values contained in attribute to this entry, replacing any existing attribute values (optional operation).
 Entry 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).
 Entry setName(DN dn)
          Sets the distinguished name of this entry (optional operation).
 Entry setName(java.lang.String dn)
          Sets the distinguished name of this entry (optional operation).
 java.lang.String toString()
          Returns a string representation of this entry.

 

Method Detail

addAttribute

boolean addAttribute(Attribute attribute)
                     throws java.lang.UnsupportedOperationException,
                            java.lang.NullPointerException
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.

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

boolean addAttribute(Attribute attribute,
                     java.util.Collection<AttributeValue> duplicateValues)
                     throws java.lang.UnsupportedOperationException,
                            java.lang.NullPointerException
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.

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

Entry addAttribute(java.lang.String attributeDescription,
                   java.lang.Object... values)
                   throws PluginException,
                          java.lang.UnsupportedOperationException,
                          java.lang.NullPointerException
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.

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.

clearAttributes

Entry clearAttributes()
                      throws java.lang.UnsupportedOperationException
Removes all the attributes from this entry (optional operation).
Returns:
This entry.
Throws:
java.lang.UnsupportedOperationException - If this entry does not permit attributes to be removed.

containsAttribute

boolean containsAttribute(Attribute attribute,
                          java.util.Collection<AttributeValue> missingValues)
                          throws java.lang.NullPointerException
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.
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

boolean containsAttribute(java.lang.String attributeDescription)
                          throws PluginException,
                                 java.lang.NullPointerException
Returns true if the attribute is present in this entry, regardless of how many values it contains.
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

boolean containsAttribute(java.lang.String attributeDescription,
                          java.lang.Object... values)
                          throws PluginException,
                                 java.lang.NullPointerException
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.
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.

equals

boolean equals(java.lang.Object object)
Returns true if object is an entry which is equal to this entry. Two entries are considered equal if their distinguished names are equal, they both have the same number of attributes, and every attribute contained in the first entry is also contained in the second entry.
Overrides:
equals in class java.lang.Object
Parameters:
object - The object to be tested for equality with this entry.
Returns:
true if object is an entry which is equal to this entry, or false if not.

getAllAttributes

java.lang.Iterable<Attribute> getAllAttributes()
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.
Returns:
An Iterable containing all of the attributes.

getAllAttributes

java.lang.Iterable<Attribute> getAllAttributes(AttributeDescription attributeDescription)
                                               throws java.lang.NullPointerException
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.
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

java.lang.Iterable<Attribute> getAllAttributes(java.lang.String attributeDescription)
                                               throws PluginException,
                                                      java.lang.NullPointerException
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).

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

Attribute getAttribute(AttributeDescription attributeDescription)
                       throws java.lang.NullPointerException
Returns the named attribute contained in this entry, or null if it is not included with this 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

Attribute getAttribute(java.lang.String attributeDescription)
                       throws PluginException,
                              java.lang.NullPointerException
Returns the named attribute contained in this entry, or null if it is not included with this 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

DN getName()
Returns the string representation of the distinguished name of this entry.
Returns:
The string representation of the distinguished name.

hashCode

int hashCode()
Returns the hash code for this entry. It will be calculated as the sum of the hash codes of the distinguished name and all of the attributes.
Overrides:
hashCode in class java.lang.Object
Returns:
The hash code for this entry.

removeAttribute

boolean removeAttribute(Attribute attribute,
                        java.util.Collection<AttributeValue> missingValues)
                        throws java.lang.UnsupportedOperationException,
                               java.lang.NullPointerException
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.

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

boolean removeAttribute(java.lang.String attributeDescription)
                        throws PluginException,
                               java.lang.UnsupportedOperationException,
                               java.lang.NullPointerException
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.
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

boolean removeAttribute(AttributeDescription attributeDescription)
                        throws java.lang.UnsupportedOperationException,
                               java.lang.NullPointerException
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.
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

Entry removeAttribute(java.lang.String attributeDescription,
                      java.lang.Object... values)
                      throws PluginException,
                             java.lang.UnsupportedOperationException,
                             java.lang.NullPointerException
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.

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

boolean replaceAttribute(Attribute attribute)
                         throws java.lang.UnsupportedOperationException,
                                java.lang.NullPointerException
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.

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

Entry replaceAttribute(java.lang.String attributeDescription,
                       java.lang.Object... values)
                       throws PluginException,
                              java.lang.UnsupportedOperationException,
                              java.lang.NullPointerException
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.

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

Entry setName(DN dn)
              throws java.lang.UnsupportedOperationException,
                     java.lang.NullPointerException
Sets the distinguished name of this entry (optional operation).
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

Entry setName(java.lang.String dn)
              throws PluginException,
                     java.lang.UnsupportedOperationException,
                     java.lang.NullPointerException
Sets the distinguished name of this entry (optional operation).
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.

toString

java.lang.String toString()
Returns a string representation of this entry.
Overrides:
toString in class java.lang.Object
Returns:
The string representation of this entry.

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.