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

All Superinterfaces:
java.lang.Cloneable, Entry, java.io.Externalizable, java.lang.Iterable<EntryAttribute>, java.io.Serializable
All Known Implementing Classes:
DefaultServerEntry

public interface ServerEntry
extends Entry, java.lang.Cloneable

A server side entry which is schema aware.

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

Method Summary
 void add(AttributeType attributeType, byte[]... values)
           Add an attribute (represented by its AttributeType and some binary values) into an entry.
 void add(AttributeType attributeType, java.lang.String... values)
           Add an attribute (represented by its AttributeType and some String values) into an entry.
 void add(AttributeType attributeType, Value<?>... values)
           Add an attribute (represented by its AttributeType and some values) into an entry.
 void add(java.lang.String upId, AttributeType attributeType, byte[]... values)
           Add an attribute (represented by its AttributeType and some binary values) into an entry.
 void add(java.lang.String upId, AttributeType attributeType, java.lang.String... values)
           Add an attribute (represented by its AttributeType and some String values) into an entry.
 void add(java.lang.String upId, AttributeType attributeType, Value<?>... values)
           Add an attribute (represented by its AttributeType and some values) into an entry.
 Entry clone()
          A clone method to produce a clone of the current object
 boolean contains(AttributeType attributeType, byte[]... values)
          Checks if an entry contains an attribute with some given binary values.
 boolean contains(AttributeType attributeType, java.lang.String... values)
          Checks if an entry contains an attribute with some given String values.
 boolean contains(AttributeType attributeType, Value<?>... values)
          Checks if an entry contains an attribute with some given binary values.
 boolean containsAttribute(AttributeType attributeType)
          Checks if an entry contains a specific AttributeType.
 EntryAttribute get(AttributeType attributeType)
          Returns the attribute associated with an AttributeType
 java.util.Set<AttributeType> getAttributeTypes()
          Gets all the attributes type
 boolean hasObjectClass(EntryAttribute objectClass)
          Tells if an entry has a specific ObjectClass Attribute
 boolean isValid()
          Fail fast check performed to determine entry consistency according to schema characteristics.
 boolean isValid(EntryAttribute objectClass)
          Check performed to determine entry consistency according to the schema requirements of a particular objectClass.
 boolean isValid(java.lang.String objectClass)
          Check performed to determine entry consistency according to the schema requirements of a particular objectClass.
 EntryAttribute put(AttributeType attributeType, byte[]... values)
           Places a new attribute with the supplied AttributeType and binary values into the attribute collection.
 EntryAttribute put(AttributeType attributeType, java.lang.String... values)
           Places a new attribute with the supplied AttributeType and String values into the attribute collection.
 EntryAttribute put(AttributeType attributeType, Value<?>... values)
           Places a new attribute with the supplied AttributeType and some values into the attribute collection.
 EntryAttribute put(java.lang.String upId, AttributeType attributeType, byte[]... values)
           Places a new attribute with the supplied AttributeType and some binary values into the attribute collection.
 EntryAttribute put(java.lang.String upId, AttributeType attributeType, java.lang.String... values)
           Places a new attribute with the supplied AttributeType and some String values into the attribute collection.
 EntryAttribute put(java.lang.String upId, AttributeType attributeType, Value<?>... values)
           Places a new attribute with the supplied AttributeType and some values into the attribute collection.
 boolean remove(AttributeType attributeType, byte[]... values)
           Removes the specified binary values from an attribute.
 boolean remove(AttributeType attributeType, java.lang.String... values)
           Removes the specified String values from an attribute.
 boolean remove(AttributeType attributeType, Value<?>... values)
           Removes the specified values from an attribute.
 java.util.List<EntryAttribute> remove(EntryAttribute... attributes)
          Removes the specified attributes.
 java.util.List<EntryAttribute> removeAttributes(AttributeType... attributes)
           Removes the attribute with the specified AttributeTypes.
 java.util.List<EntryAttribute> set(AttributeType... attributeTypes)
           Put some new attributes using the attributeTypes.
 Entry toClientEntry()
          Convert the ServerEntry to a ClientEntry
 
Methods inherited from interface org.apache.directory.shared.ldap.entry.Entry
add, add, add, add, clear, contains, contains, contains, contains, containsAttribute, get, getDn, hasObjectClass, iterator, put, put, put, put, remove, remove, remove, removeAttributes, set, setDn, size
 
Methods inherited from interface java.io.Externalizable
readExternal, writeExternal
 

Method Detail

add

void add(AttributeType attributeType,
         byte[]... values)
         throws LdapException

Add an attribute (represented by its AttributeType and some binary values) into an entry.

If we already have an attribute with the same values, the duplicated values are not added (duplicated values are not allowed)

If the value cannot be added, or if the AttributeType is null or invalid, a LdapException is thrown.

Parameters:
attributeType - The attribute Type.
values - The list of binary values to inject. It can be empty.
Throws:
LdapException - If the attribute does not exist

add

void add(AttributeType attributeType,
         java.lang.String... values)
         throws LdapException

Add an attribute (represented by its AttributeType and some String values) into an entry.

If we already have an attribute with the same values, the duplicated values are not added (duplicated values are not allowed)

If the value cannot be added, or if the AttributeType is null or invalid, a LdapException is thrown.

Parameters:
attributeType - The attribute Type
values - The list of binary values to inject. It can be empty
Throws:
LdapException - If the attribute does not exist

add

void add(AttributeType attributeType,
         Value<?>... values)
         throws LdapException

Add an attribute (represented by its AttributeType and some values) into an entry.

If we already have an attribute with the same values, the duplicated values are not added (duplicated values are not allowed)

If the value cannot be added, or if the AttributeType is null or invalid, a LdapException is thrown.

Parameters:
attributeType - The attribute Type
values - The list of binary values to inject. It can be empty
Throws:
LdapException - If the attribute does not exist

add

void add(java.lang.String upId,
         AttributeType attributeType,
         byte[]... values)
         throws LdapException

Add an attribute (represented by its AttributeType and some binary values) into an entry. Set the User Provider ID at the same time

If we already have an attribute with the same values, the duplicated values are not added (duplicated values are not allowed)

If the value cannot be added, or if the AttributeType is null or invalid, a LdapException is thrown.

Parameters:
upId - The user provided ID for the added AttributeType
attributeType - The attribute Type.
values - The list of binary values to add. It can be empty.
Throws:
LdapException - If the attribute does not exist

add

void add(java.lang.String upId,
         AttributeType attributeType,
         java.lang.String... values)
         throws LdapException

Add an attribute (represented by its AttributeType and some String values) into an entry. Set the User Provider ID at the same time

If we already have an attribute with the same values, the duplicated values are not added (duplicated values are not allowed)

If the value cannot be added, or if the AttributeType is null or invalid, a LdapException is thrown.

Parameters:
upId - The user provided ID for the added AttributeType
attributeType - The attribute Type.
values - The list of binary values to add. It can be empty.
Throws:
LdapException - If the attribute does not exist

add

void add(java.lang.String upId,
         AttributeType attributeType,
         Value<?>... values)
         throws LdapException

Add an attribute (represented by its AttributeType and some values) into an entry. Set the User Provider ID at the same time

If we already have an attribute with the same values, nothing is done (duplicated values are not allowed)

If the value cannot be added, or if the AttributeType is null or invalid, a LdapException is thrown.

Parameters:
upId - The user provided ID for the added AttributeType
attributeType - The attribute Type.
values - The list of values to add. It can be empty.
Throws:
LdapException - If the attribute does not exist

contains

boolean contains(AttributeType attributeType,
                 byte[]... values)
Checks if an entry contains an attribute with some given binary values.

Parameters:
attributeType - The Attribute we are looking for.
values - The searched values.
Returns:
true if all the values are found within the attribute, false otherwise, or if the attributes does not exist.
Throws:
LdapException - If the attribute does not exists

contains

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

Parameters:
attributeType - The Attribute we are looking for.
values - The searched values.
Returns:
true if all the values are found within the attribute, false otherwise, or if the attributes does not exist.
Throws:
LdapException - If the attribute does not exists

contains

boolean contains(AttributeType attributeType,
                 Value<?>... values)
Checks if an entry contains an attribute with some given binary values.

Parameters:
attributeType - The Attribute we are looking for.
values - The searched values.
Returns:
true if all the values are found within the attribute, false otherwise, or if the attributes does not exist.
Throws:
LdapException - If the attribute does not exists

containsAttribute

boolean containsAttribute(AttributeType attributeType)
Checks if an entry contains a specific AttributeType.

Parameters:
attributeType - The AttributeType to look for.
Returns:
true if the attribute is found within the entry.

get

EntryAttribute get(AttributeType attributeType)
Returns the attribute associated with an AttributeType

Parameters:
the - AttributeType we are looking for
Returns:
the associated attribute

getAttributeTypes

java.util.Set<AttributeType> getAttributeTypes()
Gets all the attributes type

Returns:
The combined set of all the attributes.

hasObjectClass

boolean hasObjectClass(EntryAttribute objectClass)
Tells if an entry has a specific ObjectClass Attribute

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

isValid

boolean isValid()
Fail fast check performed to determine entry consistency according to schema characteristics.

Returns:
true if the entry, it's attributes and their values are consistent with the schema

isValid

boolean isValid(java.lang.String objectClass)
Check performed to determine entry consistency according to the schema requirements of a particular objectClass. The entry must be of that objectClass to return true: meaning if the entry's objectClass attribute does not contain the objectClass argument, then false should be returned.

Parameters:
objectClass - the objectClass to use while checking for validity
Returns:
true if the entry, it's attributes and their values are consistent with the objectClass

isValid

boolean isValid(EntryAttribute objectClass)
Check performed to determine entry consistency according to the schema requirements of a particular objectClass. The entry must be of that objectClass to return true: meaning if the entry's objectClass attribute does not contain the objectClass argument, then false should be returned.

Parameters:
objectClass - the objectClass to use while checking for validity
Returns:
true if the entry, it's attributes and their values are consistent with the objectClass

put

EntryAttribute put(AttributeType attributeType,
                   byte[]... values)
                   throws LdapException

Places a new attribute with the supplied AttributeType and binary values into the attribute collection.

If there is already an attribute with the same AttributeType, the old one is removed from the collection and is returned by this method.

This method provides a mechanism to put an attribute with a null value: the value may be null.

Parameters:
attributeType - the type of the new attribute to be put
values - the binary values of the new attribute to be put
Returns:
the old attribute with the same identifier, if exists; otherwise null
Throws:
LdapException - if there are failures

put

EntryAttribute put(AttributeType attributeType,
                   java.lang.String... values)
                   throws LdapException

Places a new attribute with the supplied AttributeType and String values into the attribute collection.

If there is already an attribute with the same AttributeType, the old one is removed from the collection and is returned by this method.

This method provides a mechanism to put an attribute with a null value: the value may be null.

Parameters:
attributeType - the type of the new attribute to be put
values - the String values of the new attribute to be put
Returns:
the old attribute with the same identifier, if exists; otherwise null
Throws:
LdapException - if there are failures

put

EntryAttribute put(AttributeType attributeType,
                   Value<?>... values)
                   throws LdapException

Places a new attribute with the supplied AttributeType and some values into the attribute collection.

If there is already an attribute with the same AttributeType, the old one is removed from the collection and is returned by this method.

This method provides a mechanism to put an attribute with a null value: the value may be null.

Parameters:
attributeType - the type of the new attribute to be put
values - the values of the new attribute to be put
Returns:
the old attribute with the same identifier, if exists; otherwise null
Throws:
LdapException - if there are failures

put

EntryAttribute put(java.lang.String upId,
                   AttributeType attributeType,
                   byte[]... values)
                   throws LdapException

Places a new attribute with the supplied AttributeType and some binary values into the attribute collection.

The given User provided ID will be used for this new AttributeEntry.

If there is already an attribute with the same AttributeType, the old one is removed from the collection and is returned by this method.

This method provides a mechanism to put an attribute with a null value: the value may be null.

Parameters:
upId - The User Provided ID to be stored into the AttributeEntry
values - the binary values of the new attribute to be put
Returns:
the old attribute with the same identifier, if exists; otherwise null
Throws:
LdapException - if there are failures.

put

EntryAttribute put(java.lang.String upId,
                   AttributeType attributeType,
                   java.lang.String... values)
                   throws LdapException

Places a new attribute with the supplied AttributeType and some String values into the attribute collection.

The given User provided ID will be used for this new AttributeEntry.

If there is already an attribute with the same AttributeType, the old one is removed from the collection and is returned by this method.

This method provides a mechanism to put an attribute with a null value: the value may be null.

Parameters:
upId - The User Provided ID to be stored into the AttributeEntry
attributeType - the type of the new attribute to be put
values - the String values of the new attribute to be put
Returns:
the old attribute with the same identifier, if exists; otherwise null
Throws:
LdapException - if there are failures.

put

EntryAttribute put(java.lang.String upId,
                   AttributeType attributeType,
                   Value<?>... values)
                   throws LdapException

Places a new attribute with the supplied AttributeType and some values into the attribute collection.

The given User provided ID will be used for this new AttributeEntry.

If there is already an attribute with the same AttributeType, the old one is removed from the collection and is returned by this method.

This method provides a mechanism to put an attribute with a null value: the value may be null.

Parameters:
upId - The User Provided ID to be stored into the AttributeEntry
attributeType - the type of the new attribute to be put
values - the values of the new attribute to be put
Returns:
the old attribute with the same identifier, if exists; otherwise null
Throws:
LdapException - if there are failures.

remove

boolean remove(AttributeType attributeType,
               byte[]... values)
               throws LdapException

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:
attributeType - The attribute type
values - the values 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:
LdapException

remove

boolean remove(AttributeType attributeType,
               java.lang.String... values)
               throws LdapException

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 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:
attributeType - The attribute type
values - the values 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:
LdapException

remove

boolean remove(AttributeType attributeType,
               Value<?>... values)
               throws LdapException

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:
attributeType - The attribute type
values - the values 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:
LdapException

remove

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

Specified by:
remove in interface Entry
Parameters:
attributes - the attributes to be removed
Returns:
the removed attribute, if exists; otherwise null
Throws:
LdapException

removeAttributes

java.util.List<EntryAttribute> removeAttributes(AttributeType... attributes)

Removes the attribute with the specified AttributeTypes.

The removed attribute are returned by this method.

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

Parameters:
attributes - the AttributeTypes to be removed
Returns:
the removed attributes, if any, as a list; otherwise null

set

java.util.List<EntryAttribute> set(AttributeType... attributeTypes)

Put some new attributes using the attributeTypes. No value is inserted.

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

Parameters:
attributeTypes - The AttributeTypes to add.
Returns:
A list of replaced Attributes, of null if no attribute are removed.

clone

Entry clone()
A clone method to produce a clone of the current object

Specified by:
clone in interface Entry

toClientEntry

Entry toClientEntry()
                    throws LdapException
Convert the ServerEntry to a ClientEntry

Returns:
An instance of ClientEntry
Throws:
LdapException


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