org.apache.directory.shared.ldap.entry
Interface Entry

All Superinterfaces:
java.lang.Cloneable, java.io.Externalizable, java.lang.Iterable<EntryAttribute>, java.io.Serializable
All Known Subinterfaces:
ClientEntry
All Known Implementing Classes:
AbstractEntry, DefaultClientEntry

public interface Entry
extends java.lang.Cloneable, java.lang.Iterable<EntryAttribute>, java.io.Externalizable

This interface represent a LDAP entry. An LDAP entry contains :

  • A distinguished name (DN)
  • A list of attributes
  • The available methods on this object are described in this interface.

    This interface is used by the serverEntry and clientEntry interfaces.

    Version:
    $Rev$, $Date$
    Author:
    Apache Directory Project

    Method Summary
     void add(EntryAttribute... attributes)
              Add some Attributes to the current Entry.
     void add(java.lang.String upId, byte[]... values)
              Add some binary values to the current Entry.
     void add(java.lang.String upId, java.lang.String... values)
              Add some String values to the current Entry.
     void add(java.lang.String upId, Value<?>... values)
              Add some Values to the current Entry.
     void clear()
              Remove all the attributes for this entry.
     Entry clone()
              Clone the current entry
     boolean contains(EntryAttribute... attributes)
               Checks if an entry contains a list of attributes.
     boolean contains(java.lang.String upId, byte[]... values)
              Checks if an entry contains an attribute with some binary values.
     boolean contains(java.lang.String upId, java.lang.String... values)
              Checks if an entry contains an attribute with some String values.
     boolean contains(java.lang.String upId, Value<?>... values)
              Checks if an entry contains an attribute with some values.
     boolean containsAttribute(java.lang.String... attributes)
              Checks if an entry contains some specific attributes.
     EntryAttribute get(java.lang.String alias)
               Returns the attribute with the specified alias.
     LdapDN getDn()
              Get this entry's DN.
     boolean hasObjectClass(java.lang.String objectClass)
              Tells if an entry as a specific ObjectClass value
     java.util.Iterator<EntryAttribute> iterator()
              Returns an enumeration containing the zero or more attributes in the collection.
     java.util.List<EntryAttribute> put(EntryAttribute... attributes)
               Places attributes in the attribute collection.
     EntryAttribute put(java.lang.String upId, byte[]... values)
               Put an attribute (represented by its ID and some binary values) into an entry.
     EntryAttribute put(java.lang.String upId, java.lang.String... values)
               Put an attribute (represented by its ID and some String values) into an entry.
     EntryAttribute put(java.lang.String upId, Value<?>... values)
               Put an attribute (represented by its ID and some values) into an entry.
     java.util.List<EntryAttribute> remove(EntryAttribute... attributes)
              Removes the specified attributes.
     boolean remove(java.lang.String upId, byte[]... values)
               Removes the specified binary values from an attribute.
     boolean remove(java.lang.String upId, java.lang.String... values)
               Removes the specified String values from an attribute.
     boolean remove(java.lang.String upId, Value<?>... values)
               Removes the specified values from an attribute.
     java.util.List<EntryAttribute> removeAttributes(java.lang.String... attributes)
               Removes the attribute with the specified alias.
     java.util.List<EntryAttribute> set(java.lang.String... upIds)
               Put some new ClientAttribute using the User Provided ID.
     void setDn(LdapDN dn)
              Set this entry's DN.
     int size()
              Returns the number of attributes.
     
    Methods inherited from interface java.io.Externalizable
    readExternal, writeExternal
     

    Method Detail

    clear

    void clear()
    Remove all the attributes for this entry. The DN is not reset


    clone

    Entry clone()
    Clone the current entry


    getDn

    LdapDN getDn()
    Get this entry's DN.

    Returns:
    The entry's DN

    hasObjectClass

    boolean hasObjectClass(java.lang.String objectClass)
    Tells if an entry as a specific ObjectClass value

    Parameters:
    objectClass - The ObjectClassw we want to check
    Returns:
    true if the ObjectClass value is present in the ObjectClass attribute

    get

    EntryAttribute get(java.lang.String alias)

    Returns the attribute with the specified alias. The return value is null if no match is found.

    An Attribute with an id different from the supplied alias may be returned: for example a call with 'cn' may in some implementations return an Attribute whose getId() field returns 'commonName'.

    Parameters:
    alias - an aliased name of the attribute identifier
    Returns:
    the attribute associated with the alias

    set

    java.util.List<EntryAttribute> set(java.lang.String... upIds)

    Put some new ClientAttribute using the User Provided ID. No value is inserted.

    If an existing Attribute is found, it will be replaced by an empty attribute, and returned to the caller.

    Parameters:
    upIds - The user provided IDs of the AttributeTypes to add.
    Returns:
    A list of replaced Attributes.

    setDn

    void setDn(LdapDN dn)
    Set this entry's DN.

    Parameters:
    dn - The DN associated with this entry

    iterator

    java.util.Iterator<EntryAttribute> iterator()
    Returns an enumeration containing the zero or more attributes in the collection. The behavior of the enumeration is not specified if the attribute collection is changed.

    Specified by:
    iterator in interface java.lang.Iterable<EntryAttribute>
    Returns:
    an enumeration of all contained attributes

    add

    void add(EntryAttribute... attributes)
             throws javax.naming.NamingException
    Add some Attributes to the current Entry.

    Parameters:
    attributes - The attributes to add
    Throws:
    javax.naming.NamingException - If we can't add any of the attributes

    add

    void add(java.lang.String upId,
             java.lang.String... values)
             throws javax.naming.NamingException
    Add some String values to the current Entry.

    Parameters:
    upId - The user provided ID of the attribute we want to add some values to
    values - The list of String values to add
    Throws:
    javax.naming.NamingException - If we can't add any of the values

    add

    void add(java.lang.String upId,
             byte[]... values)
             throws javax.naming.NamingException
    Add some binary values to the current Entry.

    Parameters:
    upId - The user provided ID of the attribute we want to add some values to
    values - The list of binary values to add
    Throws:
    javax.naming.NamingException - If we can't add any of the values

    add

    void add(java.lang.String upId,
             Value<?>... values)
             throws javax.naming.NamingException
    Add some Values to the current Entry.

    Parameters:
    upId - The user provided ID of the attribute we want to add some values to
    values - The list of Values to add
    Throws:
    javax.naming.NamingException - If we can't add any of the values

    put

    java.util.List<EntryAttribute> put(EntryAttribute... attributes)
                                       throws javax.naming.NamingException

    Places attributes in the attribute collection.

    If there is already an attribute with the same ID as any of the new attributes, the old ones are removed from the collection and are returned by this method. If there was no attribute with the same ID the return value is null.

    Parameters:
    attributes - the attributes to be put
    Returns:
    the old attributes with the same OID, if exist; otherwise null
    Throws:
    javax.naming.NamingException - if the operation fails

    put

    EntryAttribute put(java.lang.String upId,
                       byte[]... values)

    Put an attribute (represented by its ID and some binary values) into an entry.

    If the attribute already exists, the previous attribute will be replaced and returned.

    Parameters:
    upId - The attribute ID
    values - The list of binary values to put. It can be empty.
    Returns:
    The replaced attribute

    put

    EntryAttribute put(java.lang.String upId,
                       java.lang.String... values)

    Put an attribute (represented by its ID and some String values) into an entry.

    If the attribute already exists, the previous attribute will be replaced and returned.

    Parameters:
    upId - The attribute ID
    values - The list of String values to put. It can be empty.
    Returns:
    The replaced attribute

    put

    EntryAttribute put(java.lang.String upId,
                       Value<?>... values)

    Put an attribute (represented by its ID and some values) into an entry.

    If the attribute already exists, the previous attribute will be replaced and returned.

    Parameters:
    upId - The attribute ID
    values - The list of values to put. It can be empty.
    Returns:
    The replaced attribute

    remove

    java.util.List<EntryAttribute> remove(EntryAttribute... attributes)
                                          throws javax.naming.NamingException
    Removes the specified attributes. The removed attributes are returned by this method. If there were no attribute the return value is null.

    Parameters:
    attributes - the attributes to be removed
    Returns:
    the removed attribute, if exists; otherwise null
    Throws:
    javax.naming.NamingException

    remove

    boolean remove(java.lang.String upId,
                   byte[]... values)
                   throws javax.naming.NamingException

    Removes the specified binary values from an attribute.

    If at least one value is removed, this method returns true.

    If there is no more value after having removed the values, the attribute will be removed too.

    If the attribute does not exist, nothing is done and the method returns false

    Parameters:
    upId - The attribute ID
    attributes - the attributes to be removed
    Returns:
    true if at least a value is removed, false if not all the values have been removed or if the attribute does not exist.
    Throws:
    javax.naming.NamingException

    remove

    boolean remove(java.lang.String upId,
                   java.lang.String... values)
                   throws javax.naming.NamingException

    Removes the specified String values from an attribute.

    If at least one value is removed, this method returns true.

    If there is no more value after havong removed the values, the attribute will be removed too.

    If the attribute does not exist, nothing is done and the method returns false

    Parameters:
    upId - The attribute ID
    attributes - the attributes to be removed
    Returns:
    true if at least a value is removed, false if no values have been removed or if the attribute does not exist.
    Throws:
    javax.naming.NamingException

    remove

    boolean remove(java.lang.String upId,
                   Value<?>... values)
                   throws javax.naming.NamingException

    Removes the specified values from an attribute.

    If at least one value is removed, this method returns true.

    If there is no more value after having removed the values, the attribute will be removed too.

    If the attribute does not exist, nothing is done and the method returns false

    Parameters:
    upId - The attribute ID
    attributes - the attributes to be removed
    Returns:
    true if at least a value is removed, false if not all the values have been removed or if the attribute does not exist.
    Throws:
    javax.naming.NamingException

    removeAttributes

    java.util.List<EntryAttribute> removeAttributes(java.lang.String... attributes)

    Removes the attribute with the specified alias.

    The removed attribute are returned by this method.

    If there is no attribute with the specified alias, the return value is null.

    Parameters:
    attributes - an aliased name of the attribute to be removed
    Returns:
    the removed attributes, if any, as a list; otherwise null

    contains

    boolean contains(EntryAttribute... attributes)
                     throws javax.naming.NamingException

    Checks if an entry contains a list of attributes.

    If the list is null or empty, this method will return true if the entry has no attribute, false otherwise.

    Parameters:
    attributes - The Attributes to look for
    Returns:
    true if all the attributes are found within the entry, false if at least one of them is not present.
    Throws:
    javax.naming.NamingException - If the attribute does not exist

    contains

    boolean contains(java.lang.String upId,
                     byte[]... values)
    Checks if an entry contains an attribute with some binary values.

    Parameters:
    id - The Attribute we are looking for.
    values - The searched values.
    Returns:
    true if all the values are found within the attribute, false if at least one value is not present or if the ID is not valid.

    contains

    boolean contains(java.lang.String upId,
                     java.lang.String... values)
    Checks if an entry contains an attribute with some String values.

    Parameters:
    id - The Attribute we are looking for.
    values - The searched values.
    Returns:
    true if all the values are found within the attribute, false if at least one value is not present or if the ID is not valid.

    contains

    boolean contains(java.lang.String upId,
                     Value<?>... values)
    Checks if an entry contains an attribute with some values.

    Parameters:
    id - The Attribute we are looking for.
    values - The searched values.
    Returns:
    true if all the values are found within the attribute, false if at least one value is not present or if the ID is not valid.

    containsAttribute

    boolean containsAttribute(java.lang.String... attributes)
    Checks if an entry contains some specific attributes.

    Parameters:
    attributes - The Attributes to look for.
    Returns:
    true if the attributes are all found within the entry.

    size

    int size()
    Returns the number of attributes.

    Returns:
    the number of attributes


    Copyright © 2003-2009 Apache Software Foundation. All Rights Reserved.