org.apache.directory.server.core.entry
Class ClonedServerEntry

java.lang.Object
  extended by org.apache.directory.server.core.entry.ClonedServerEntry
All Implemented Interfaces:
java.io.Externalizable, java.io.Serializable, java.lang.Cloneable, java.lang.Iterable<org.apache.directory.shared.ldap.entry.EntryAttribute>, ServerEntry, org.apache.directory.shared.ldap.entry.Entry

public class ClonedServerEntry
extends java.lang.Object
implements ServerEntry

A ServerEntry refers to the original entry before being modified by EntryFilters or operations.

Version:
$Rev$, $Date$
Author:
Apache Directory Project
See Also:
Serialized Form

Constructor Summary
ClonedServerEntry(ServerEntry originalEntry)
          Creates a new instance of ClonedServerEntry.
 
Method Summary
 void add(org.apache.directory.shared.ldap.schema.AttributeType attributeType, byte[]... values)
           Add an attribute (represented by its AttributeType and some binary values) into an entry.
 void add(org.apache.directory.shared.ldap.schema.AttributeType attributeType, java.lang.String... values)
           Add an attribute (represented by its AttributeType and some String values) into an entry.
 void add(org.apache.directory.shared.ldap.schema.AttributeType attributeType, org.apache.directory.shared.ldap.entry.Value<?>... values)
           Add an attribute (represented by its AttributeType and some values) into an entry.
 void add(org.apache.directory.shared.ldap.entry.EntryAttribute... attributes)
           
 void add(java.lang.String upId, org.apache.directory.shared.ldap.schema.AttributeType attributeType, byte[]... values)
           Add an attribute (represented by its AttributeType and some binary values) into an entry.
 void add(java.lang.String upId, org.apache.directory.shared.ldap.schema.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, org.apache.directory.shared.ldap.schema.AttributeType attributeType, org.apache.directory.shared.ldap.entry.Value<?>... values)
           Add an attribute (represented by its AttributeType and some values) into an entry.
 void add(java.lang.String upId, byte[]... values)
           
 void add(java.lang.String upId, java.lang.String... values)
           
 void add(java.lang.String upId, org.apache.directory.shared.ldap.entry.Value<?>... values)
           
 void clear()
           
 ServerEntry clone()
          A clone method to produce a clone of the current object
 boolean contains(org.apache.directory.shared.ldap.schema.AttributeType attributeType, byte[]... values)
          Checks if an entry contains an attribute with some given binary values.
 boolean contains(org.apache.directory.shared.ldap.schema.AttributeType attributeType, java.lang.String... values)
          Checks if an entry contains an attribute with some given String values.
 boolean contains(org.apache.directory.shared.ldap.schema.AttributeType attributeType, org.apache.directory.shared.ldap.entry.Value<?>... values)
          Checks if an entry contains an attribute with some given binary values.
 boolean contains(org.apache.directory.shared.ldap.entry.EntryAttribute... attributes)
           
 boolean contains(java.lang.String upId, byte[]... values)
           
 boolean contains(java.lang.String upId, java.lang.String... values)
           
 boolean contains(java.lang.String upId, org.apache.directory.shared.ldap.entry.Value<?>... values)
           
 boolean containsAttribute(org.apache.directory.shared.ldap.schema.AttributeType attributeType)
          Checks if an entry contains a specific AttributeType.
 boolean containsAttribute(java.lang.String... attributes)
           
 org.apache.directory.shared.ldap.entry.EntryAttribute get(org.apache.directory.shared.ldap.schema.AttributeType attributeType)
          Returns the attribute associated with an AttributeType
 org.apache.directory.shared.ldap.entry.EntryAttribute get(java.lang.String alias)
           
 java.util.Set<org.apache.directory.shared.ldap.schema.AttributeType> getAttributeTypes()
          Gets all the attributes type
 org.apache.directory.shared.ldap.entry.Entry getClonedEntry()
           
 org.apache.directory.shared.ldap.name.LdapDN getDn()
           
 ServerEntry getOriginalEntry()
           
 boolean hasObjectClass(org.apache.directory.shared.ldap.entry.EntryAttribute objectClass)
          Tells if an entry has a specific ObjectClass Attribute
 boolean hasObjectClass(java.lang.String objectClass)
           
 boolean isValid()
          Fail fast check performed to determine entry consistency according to schema characteristics.
 boolean isValid(org.apache.directory.shared.ldap.entry.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.
 java.util.Iterator<org.apache.directory.shared.ldap.entry.EntryAttribute> iterator()
           
 org.apache.directory.shared.ldap.entry.EntryAttribute put(org.apache.directory.shared.ldap.schema.AttributeType attributeType, byte[]... values)
           Places a new attribute with the supplied AttributeType and binary values into the attribute collection.
 org.apache.directory.shared.ldap.entry.EntryAttribute put(org.apache.directory.shared.ldap.schema.AttributeType attributeType, java.lang.String... values)
           Places a new attribute with the supplied AttributeType and String values into the attribute collection.
 org.apache.directory.shared.ldap.entry.EntryAttribute put(org.apache.directory.shared.ldap.schema.AttributeType attributeType, org.apache.directory.shared.ldap.entry.Value<?>... values)
           Places a new attribute with the supplied AttributeType and some values into the attribute collection.
 java.util.List<org.apache.directory.shared.ldap.entry.EntryAttribute> put(org.apache.directory.shared.ldap.entry.EntryAttribute... attributes)
           
 org.apache.directory.shared.ldap.entry.EntryAttribute put(java.lang.String upId, org.apache.directory.shared.ldap.schema.AttributeType attributeType, byte[]... values)
           Places a new attribute with the supplied AttributeType and some binary values into the attribute collection.
 org.apache.directory.shared.ldap.entry.EntryAttribute put(java.lang.String upId, org.apache.directory.shared.ldap.schema.AttributeType attributeType, java.lang.String... values)
           Places a new attribute with the supplied AttributeType and some String values into the attribute collection.
 org.apache.directory.shared.ldap.entry.EntryAttribute put(java.lang.String upId, org.apache.directory.shared.ldap.schema.AttributeType attributeType, org.apache.directory.shared.ldap.entry.Value<?>... values)
           Places a new attribute with the supplied AttributeType and some values into the attribute collection.
 org.apache.directory.shared.ldap.entry.EntryAttribute put(java.lang.String upId, byte[]... values)
           
 org.apache.directory.shared.ldap.entry.EntryAttribute put(java.lang.String upId, java.lang.String... values)
           
 org.apache.directory.shared.ldap.entry.EntryAttribute put(java.lang.String upId, org.apache.directory.shared.ldap.entry.Value<?>... values)
           
 void readExternal(java.io.ObjectInput in)
           
 boolean remove(org.apache.directory.shared.ldap.schema.AttributeType attributeType, byte[]... values)
           Removes the specified binary values from an attribute.
 boolean remove(org.apache.directory.shared.ldap.schema.AttributeType attributeType, java.lang.String... values)
           Removes the specified String values from an attribute.
 boolean remove(org.apache.directory.shared.ldap.schema.AttributeType attributeType, org.apache.directory.shared.ldap.entry.Value<?>... values)
           Removes the specified values from an attribute.
 java.util.List<org.apache.directory.shared.ldap.entry.EntryAttribute> remove(org.apache.directory.shared.ldap.entry.EntryAttribute... attributes)
          Removes the specified attributes.
 boolean remove(java.lang.String upId, byte[]... values)
           
 boolean remove(java.lang.String upId, java.lang.String... values)
           
 boolean remove(java.lang.String upId, org.apache.directory.shared.ldap.entry.Value<?>... values)
           
 java.util.List<org.apache.directory.shared.ldap.entry.EntryAttribute> removeAttributes(org.apache.directory.shared.ldap.schema.AttributeType... attributes)
           Removes the attribute with the specified AttributeTypes.
 java.util.List<org.apache.directory.shared.ldap.entry.EntryAttribute> removeAttributes(java.lang.String... attributes)
           
 java.util.List<org.apache.directory.shared.ldap.entry.EntryAttribute> set(org.apache.directory.shared.ldap.schema.AttributeType... attributeTypes)
           Put some new attributes using the attributeTypes.
 java.util.List<org.apache.directory.shared.ldap.entry.EntryAttribute> set(java.lang.String... upIds)
           
 void setDn(org.apache.directory.shared.ldap.name.LdapDN dn)
           
 int size()
           
 org.apache.directory.shared.ldap.entry.Entry toClientEntry()
          Convert the ServerEntry to a ClientEntry
 java.lang.String toString()
           
 void writeExternal(java.io.ObjectOutput out)
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ClonedServerEntry

public ClonedServerEntry(ServerEntry originalEntry)
Creates a new instance of ClonedServerEntry. The original entry is cloned in order to protect its content.

Parameters:
originalEntry - The original entry
Method Detail

getOriginalEntry

public ServerEntry getOriginalEntry()
Returns:
the originalEntry

getClonedEntry

public org.apache.directory.shared.ldap.entry.Entry getClonedEntry()
Returns:
the cloned Entry

add

public void add(org.apache.directory.shared.ldap.schema.AttributeType attributeType,
                byte[]... values)
         throws javax.naming.NamingException
Description copied from interface: ServerEntry

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 NamingException is thrown.

Specified by:
add in interface ServerEntry
Parameters:
attributeType - The attribute Type.
values - The list of binary values to inject. It can be empty.
Throws:
javax.naming.NamingException - If the attribute does not exist

add

public void add(org.apache.directory.shared.ldap.schema.AttributeType attributeType,
                java.lang.String... values)
         throws javax.naming.NamingException
Description copied from interface: ServerEntry

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 NamingException is thrown.

Specified by:
add in interface ServerEntry
Parameters:
attributeType - The attribute Type
values - The list of binary values to inject. It can be empty
Throws:
javax.naming.NamingException - If the attribute does not exist

add

public void add(org.apache.directory.shared.ldap.schema.AttributeType attributeType,
                org.apache.directory.shared.ldap.entry.Value<?>... values)
         throws javax.naming.NamingException
Description copied from interface: ServerEntry

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 NamingException is thrown.

Specified by:
add in interface ServerEntry
Parameters:
attributeType - The attribute Type
values - The list of binary values to inject. It can be empty
Throws:
javax.naming.NamingException - If the attribute does not exist

add

public void add(java.lang.String upId,
                org.apache.directory.shared.ldap.schema.AttributeType attributeType,
                byte[]... values)
         throws javax.naming.NamingException
Description copied from interface: ServerEntry

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 NamingException is thrown.

Specified by:
add in interface ServerEntry
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:
javax.naming.NamingException - If the attribute does not exist

add

public void add(java.lang.String upId,
                org.apache.directory.shared.ldap.schema.AttributeType attributeType,
                java.lang.String... values)
         throws javax.naming.NamingException
Description copied from interface: ServerEntry

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 NamingException is thrown.

Specified by:
add in interface ServerEntry
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:
javax.naming.NamingException - If the attribute does not exist

add

public void add(java.lang.String upId,
                org.apache.directory.shared.ldap.schema.AttributeType attributeType,
                org.apache.directory.shared.ldap.entry.Value<?>... values)
         throws javax.naming.NamingException
Description copied from interface: ServerEntry

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 NamingException is thrown.

Specified by:
add in interface ServerEntry
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:
javax.naming.NamingException - If the attribute does not exist

contains

public boolean contains(org.apache.directory.shared.ldap.schema.AttributeType attributeType,
                        byte[]... values)
Description copied from interface: ServerEntry
Checks if an entry contains an attribute with some given binary values.

Specified by:
contains in interface ServerEntry
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.

contains

public boolean contains(org.apache.directory.shared.ldap.schema.AttributeType attributeType,
                        java.lang.String... values)
Description copied from interface: ServerEntry
Checks if an entry contains an attribute with some given String values.

Specified by:
contains in interface ServerEntry
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.

contains

public boolean contains(org.apache.directory.shared.ldap.schema.AttributeType attributeType,
                        org.apache.directory.shared.ldap.entry.Value<?>... values)
Description copied from interface: ServerEntry
Checks if an entry contains an attribute with some given binary values.

Specified by:
contains in interface ServerEntry
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.

containsAttribute

public boolean containsAttribute(org.apache.directory.shared.ldap.schema.AttributeType attributeType)
Description copied from interface: ServerEntry
Checks if an entry contains a specific AttributeType.

Specified by:
containsAttribute in interface ServerEntry
Parameters:
attributeType - The AttributeType to look for.
Returns:
true if the attribute is found within the entry.

get

public org.apache.directory.shared.ldap.entry.EntryAttribute get(org.apache.directory.shared.ldap.schema.AttributeType attributeType)
Description copied from interface: ServerEntry
Returns the attribute associated with an AttributeType

Specified by:
get in interface ServerEntry
Returns:
the associated attribute

getAttributeTypes

public java.util.Set<org.apache.directory.shared.ldap.schema.AttributeType> getAttributeTypes()
Description copied from interface: ServerEntry
Gets all the attributes type

Specified by:
getAttributeTypes in interface ServerEntry
Returns:
The combined set of all the attributes.

hasObjectClass

public boolean hasObjectClass(org.apache.directory.shared.ldap.entry.EntryAttribute objectClass)
Description copied from interface: ServerEntry
Tells if an entry has a specific ObjectClass Attribute

Specified by:
hasObjectClass in interface ServerEntry
Parameters:
objectClass - The ObjectClass we want to check
Returns:
true if the ObjectClass value is present in the ObjectClass attribute

isValid

public boolean isValid()
Description copied from interface: ServerEntry
Fail fast check performed to determine entry consistency according to schema characteristics.

Specified by:
isValid in interface ServerEntry
Returns:
true if the entry, it's attributes and their values are consistent with the schema

isValid

public boolean isValid(java.lang.String objectClass)
Description copied from interface: ServerEntry
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.

Specified by:
isValid in interface ServerEntry
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

public boolean isValid(org.apache.directory.shared.ldap.entry.EntryAttribute objectClass)
Description copied from interface: ServerEntry
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.

Specified by:
isValid in interface ServerEntry
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

public org.apache.directory.shared.ldap.entry.EntryAttribute put(org.apache.directory.shared.ldap.schema.AttributeType attributeType,
                                                                 byte[]... values)
                                                          throws javax.naming.NamingException
Description copied from interface: ServerEntry

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.

Specified by:
put in interface ServerEntry
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:
javax.naming.NamingException - if there are failures

put

public org.apache.directory.shared.ldap.entry.EntryAttribute put(org.apache.directory.shared.ldap.schema.AttributeType attributeType,
                                                                 java.lang.String... values)
                                                          throws javax.naming.NamingException
Description copied from interface: ServerEntry

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.

Specified by:
put in interface ServerEntry
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:
javax.naming.NamingException - if there are failures

put

public org.apache.directory.shared.ldap.entry.EntryAttribute put(org.apache.directory.shared.ldap.schema.AttributeType attributeType,
                                                                 org.apache.directory.shared.ldap.entry.Value<?>... values)
                                                          throws javax.naming.NamingException
Description copied from interface: ServerEntry

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.

Specified by:
put in interface ServerEntry
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:
javax.naming.NamingException - if there are failures

put

public org.apache.directory.shared.ldap.entry.EntryAttribute put(java.lang.String upId,
                                                                 org.apache.directory.shared.ldap.schema.AttributeType attributeType,
                                                                 byte[]... values)
                                                          throws javax.naming.NamingException
Description copied from interface: ServerEntry

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.

Specified by:
put in interface ServerEntry
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:
javax.naming.NamingException - if there are failures.

put

public org.apache.directory.shared.ldap.entry.EntryAttribute put(java.lang.String upId,
                                                                 org.apache.directory.shared.ldap.schema.AttributeType attributeType,
                                                                 java.lang.String... values)
                                                          throws javax.naming.NamingException
Description copied from interface: ServerEntry

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.

Specified by:
put in interface ServerEntry
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:
javax.naming.NamingException - if there are failures.

put

public org.apache.directory.shared.ldap.entry.EntryAttribute put(java.lang.String upId,
                                                                 org.apache.directory.shared.ldap.schema.AttributeType attributeType,
                                                                 org.apache.directory.shared.ldap.entry.Value<?>... values)
                                                          throws javax.naming.NamingException
Description copied from interface: ServerEntry

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.

Specified by:
put in interface ServerEntry
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:
javax.naming.NamingException - if there are failures.

remove

public boolean remove(org.apache.directory.shared.ldap.schema.AttributeType attributeType,
                      byte[]... values)
               throws javax.naming.NamingException
Description copied from interface: ServerEntry

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

Specified by:
remove in interface ServerEntry
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:
javax.naming.NamingException

remove

public boolean remove(org.apache.directory.shared.ldap.schema.AttributeType attributeType,
                      java.lang.String... values)
               throws javax.naming.NamingException
Description copied from interface: ServerEntry

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

Specified by:
remove in interface ServerEntry
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:
javax.naming.NamingException

remove

public boolean remove(org.apache.directory.shared.ldap.schema.AttributeType attributeType,
                      org.apache.directory.shared.ldap.entry.Value<?>... values)
               throws javax.naming.NamingException
Description copied from interface: ServerEntry

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

Specified by:
remove in interface ServerEntry
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:
javax.naming.NamingException

remove

public java.util.List<org.apache.directory.shared.ldap.entry.EntryAttribute> remove(org.apache.directory.shared.ldap.entry.EntryAttribute... attributes)
                                                                             throws javax.naming.NamingException
Description copied from interface: ServerEntry
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 ServerEntry
Specified by:
remove in interface org.apache.directory.shared.ldap.entry.Entry
Parameters:
attributes - the attributes to be removed
Returns:
the removed attribute, if exists; otherwise null
Throws:
javax.naming.NamingException

removeAttributes

public java.util.List<org.apache.directory.shared.ldap.entry.EntryAttribute> removeAttributes(org.apache.directory.shared.ldap.schema.AttributeType... attributes)
Description copied from interface: ServerEntry

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.

Specified by:
removeAttributes in interface ServerEntry
Parameters:
attributes - the AttributeTypes to be removed
Returns:
the removed attributes, if any, as a list; otherwise null

set

public java.util.List<org.apache.directory.shared.ldap.entry.EntryAttribute> set(org.apache.directory.shared.ldap.schema.AttributeType... attributeTypes)
Description copied from interface: ServerEntry

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.

Specified by:
set in interface ServerEntry
Parameters:
attributeTypes - The AttributeTypes to add.
Returns:
A list of replaced Attributes, of null if no attribute are removed.

add

public void add(org.apache.directory.shared.ldap.entry.EntryAttribute... attributes)
         throws javax.naming.NamingException
Specified by:
add in interface org.apache.directory.shared.ldap.entry.Entry
Throws:
javax.naming.NamingException

add

public void add(java.lang.String upId,
                java.lang.String... values)
         throws javax.naming.NamingException
Specified by:
add in interface org.apache.directory.shared.ldap.entry.Entry
Throws:
javax.naming.NamingException

add

public void add(java.lang.String upId,
                byte[]... values)
         throws javax.naming.NamingException
Specified by:
add in interface org.apache.directory.shared.ldap.entry.Entry
Throws:
javax.naming.NamingException

add

public void add(java.lang.String upId,
                org.apache.directory.shared.ldap.entry.Value<?>... values)
         throws javax.naming.NamingException
Specified by:
add in interface org.apache.directory.shared.ldap.entry.Entry
Throws:
javax.naming.NamingException

clear

public void clear()
Specified by:
clear in interface org.apache.directory.shared.ldap.entry.Entry

contains

public boolean contains(org.apache.directory.shared.ldap.entry.EntryAttribute... attributes)
                 throws javax.naming.NamingException
Specified by:
contains in interface org.apache.directory.shared.ldap.entry.Entry
Throws:
javax.naming.NamingException

contains

public boolean contains(java.lang.String upId,
                        byte[]... values)
Specified by:
contains in interface org.apache.directory.shared.ldap.entry.Entry

contains

public boolean contains(java.lang.String upId,
                        java.lang.String... values)
Specified by:
contains in interface org.apache.directory.shared.ldap.entry.Entry

contains

public boolean contains(java.lang.String upId,
                        org.apache.directory.shared.ldap.entry.Value<?>... values)
Specified by:
contains in interface org.apache.directory.shared.ldap.entry.Entry

containsAttribute

public boolean containsAttribute(java.lang.String... attributes)
Specified by:
containsAttribute in interface org.apache.directory.shared.ldap.entry.Entry

get

public org.apache.directory.shared.ldap.entry.EntryAttribute get(java.lang.String alias)
Specified by:
get in interface org.apache.directory.shared.ldap.entry.Entry

getDn

public org.apache.directory.shared.ldap.name.LdapDN getDn()
Specified by:
getDn in interface org.apache.directory.shared.ldap.entry.Entry

hasObjectClass

public boolean hasObjectClass(java.lang.String objectClass)
Specified by:
hasObjectClass in interface org.apache.directory.shared.ldap.entry.Entry

iterator

public java.util.Iterator<org.apache.directory.shared.ldap.entry.EntryAttribute> iterator()
Specified by:
iterator in interface java.lang.Iterable<org.apache.directory.shared.ldap.entry.EntryAttribute>
Specified by:
iterator in interface org.apache.directory.shared.ldap.entry.Entry

put

public java.util.List<org.apache.directory.shared.ldap.entry.EntryAttribute> put(org.apache.directory.shared.ldap.entry.EntryAttribute... attributes)
                                                                          throws javax.naming.NamingException
Specified by:
put in interface org.apache.directory.shared.ldap.entry.Entry
Throws:
javax.naming.NamingException

put

public org.apache.directory.shared.ldap.entry.EntryAttribute put(java.lang.String upId,
                                                                 byte[]... values)
Specified by:
put in interface org.apache.directory.shared.ldap.entry.Entry

put

public org.apache.directory.shared.ldap.entry.EntryAttribute put(java.lang.String upId,
                                                                 java.lang.String... values)
Specified by:
put in interface org.apache.directory.shared.ldap.entry.Entry

put

public org.apache.directory.shared.ldap.entry.EntryAttribute put(java.lang.String upId,
                                                                 org.apache.directory.shared.ldap.entry.Value<?>... values)
Specified by:
put in interface org.apache.directory.shared.ldap.entry.Entry

remove

public boolean remove(java.lang.String upId,
                      byte[]... values)
               throws javax.naming.NamingException
Specified by:
remove in interface org.apache.directory.shared.ldap.entry.Entry
Throws:
javax.naming.NamingException

remove

public boolean remove(java.lang.String upId,
                      java.lang.String... values)
               throws javax.naming.NamingException
Specified by:
remove in interface org.apache.directory.shared.ldap.entry.Entry
Throws:
javax.naming.NamingException

remove

public boolean remove(java.lang.String upId,
                      org.apache.directory.shared.ldap.entry.Value<?>... values)
               throws javax.naming.NamingException
Specified by:
remove in interface org.apache.directory.shared.ldap.entry.Entry
Throws:
javax.naming.NamingException

removeAttributes

public java.util.List<org.apache.directory.shared.ldap.entry.EntryAttribute> removeAttributes(java.lang.String... attributes)
Specified by:
removeAttributes in interface org.apache.directory.shared.ldap.entry.Entry

set

public java.util.List<org.apache.directory.shared.ldap.entry.EntryAttribute> set(java.lang.String... upIds)
Specified by:
set in interface org.apache.directory.shared.ldap.entry.Entry

setDn

public void setDn(org.apache.directory.shared.ldap.name.LdapDN dn)
Specified by:
setDn in interface org.apache.directory.shared.ldap.entry.Entry

size

public int size()
Specified by:
size in interface org.apache.directory.shared.ldap.entry.Entry

toClientEntry

public org.apache.directory.shared.ldap.entry.Entry toClientEntry()
                                                           throws javax.naming.NamingException
Description copied from interface: ServerEntry
Convert the ServerEntry to a ClientEntry

Specified by:
toClientEntry in interface ServerEntry
Returns:
An instance of ClientEntry
Throws:
javax.naming.NamingException

readExternal

public void readExternal(java.io.ObjectInput in)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
Specified by:
readExternal in interface java.io.Externalizable
Throws:
java.io.IOException
java.lang.ClassNotFoundException
See Also:
We can't use this method for a ServerEntry

writeExternal

public void writeExternal(java.io.ObjectOutput out)
                   throws java.io.IOException
Specified by:
writeExternal in interface java.io.Externalizable
Throws:
java.io.IOException
See Also:
We can't use this method for a ServerEntry

clone

public ServerEntry clone()
Description copied from interface: ServerEntry
A clone method to produce a clone of the current object

Specified by:
clone in interface ServerEntry
Specified by:
clone in interface org.apache.directory.shared.ldap.entry.Entry
Overrides:
clone in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


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