public interface Entry extends Cloneable, Iterable<EntryAttribute>, Externalizable
This interface represent a LDAP entry. An LDAP entry contains :
The available methods on this object are described in this interface.
This interface is used by the serverEntry and clientEntry interfaces.
Modifier and Type | Method and Description |
---|---|
void |
add(EntryAttribute... attributes)
Add some Attributes to the current Entry.
|
void |
add(String upId,
byte[]... values)
Add some binary values to the current Entry.
|
void |
add(String upId,
String... values)
Add some String values to the current Entry.
|
void |
add(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(String upId,
byte[]... values)
Checks if an entry contains an attribute with some binary values.
|
boolean |
contains(String upId,
String... values)
Checks if an entry contains an attribute with some String values.
|
boolean |
contains(String upId,
Value<?>... values)
Checks if an entry contains an attribute with some values.
|
boolean |
containsAttribute(String... attributes)
Checks if an entry contains some specific attributes.
|
EntryAttribute |
get(String alias)
Returns the attribute with the specified alias.
|
DN |
getDn()
Get this entry's DN.
|
boolean |
hasObjectClass(String objectClass)
Tells if an entry as a specific ObjectClass value
|
Iterator<EntryAttribute> |
iterator()
Returns an enumeration containing the zero or more attributes in the
collection.
|
List<EntryAttribute> |
put(EntryAttribute... attributes)
Places attributes in the attribute collection.
|
EntryAttribute |
put(String upId,
byte[]... values)
Put an attribute (represented by its ID and some binary values) into an entry.
|
EntryAttribute |
put(String upId,
String... values)
Put an attribute (represented by its ID and some String values) into an entry.
|
EntryAttribute |
put(String upId,
Value<?>... values)
Put an attribute (represented by its ID and some values) into an entry.
|
List<EntryAttribute> |
remove(EntryAttribute... attributes)
Removes the specified attributes.
|
boolean |
remove(String upId,
byte[]... values)
Removes the specified binary values from an attribute.
|
boolean |
remove(String upId,
String... values)
Removes the specified String values from an attribute.
|
boolean |
remove(String upId,
Value<?>... values)
Removes the specified values from an attribute.
|
List<EntryAttribute> |
removeAttributes(String... attributes)
Removes the attribute with the specified alias.
|
List<EntryAttribute> |
set(String... upIds)
Put some new ClientAttribute using the User Provided ID.
|
void |
setDn(DN dn)
Set this entry's DN.
|
int |
size()
Returns the number of attributes.
|
readExternal, writeExternal
void clear()
Entry clone()
DN getDn()
boolean hasObjectClass(String objectClass)
objectClass
- The ObjectClassw we want to checktrue
if the ObjectClass value is present
in the ObjectClass attributeEntryAttribute get(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'.
alias
- an aliased name of the attribute identifierList<EntryAttribute> set(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.
upIds
- The user provided IDs of the AttributeTypes to add.void setDn(DN dn)
dn
- The DN associated with this entryIterator<EntryAttribute> iterator()
iterator
in interface Iterable<EntryAttribute>
void add(EntryAttribute... attributes) throws LdapException
attributes
- The attributes to addLdapException
- If we can't add any of the attributesvoid add(String upId, String... values) throws LdapException
upId
- The user provided ID of the attribute we want to add
some values tovalues
- The list of String values to addLdapException
- If we can't add any of the valuesvoid add(String upId, byte[]... values) throws LdapException
upId
- The user provided ID of the attribute we want to add
some values tovalues
- The list of binary values to addLdapException
- If we can't add any of the valuesvoid add(String upId, Value<?>... values) throws LdapException
upId
- The user provided ID of the attribute we want to add
some values tovalues
- The list of Values to addLdapException
- If we can't add any of the valuesList<EntryAttribute> put(EntryAttribute... attributes) throws LdapException
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
.
attributes
- the attributes to be putnull
LdapException
- if the operation failsEntryAttribute put(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.
upId
- The attribute IDvalues
- The list of binary values to put. It can be empty.EntryAttribute put(String upId, 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.
upId
- The attribute IDvalues
- The list of String values to put. It can be empty.EntryAttribute put(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.
upId
- The attribute IDvalues
- The list of values to put. It can be empty.List<EntryAttribute> remove(EntryAttribute... attributes) throws LdapException
null
.attributes
- the attributes to be removednull
LdapException
boolean remove(String upId, 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
upId
- The attribute IDattributes
- the attributes to be removedtrue
if at least a value is removed, false
if not all the values have been removed or if the attribute does not exist.LdapException
boolean remove(String upId, 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 havong removed the values, the attribute will be removed too.
If the attribute does not exist, nothing is done and the method returns
false
upId
- The attribute IDattributes
- the attributes to be removedtrue
if at least a value is removed, false
if no values have been removed or if the attribute does not exist.LdapException
boolean remove(String upId, 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
upId
- The attribute IDattributes
- the attributes to be removedtrue
if at least a value is removed, false
if not all the values have been removed or if the attribute does not exist.LdapException
List<EntryAttribute> removeAttributes(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
.
attributes
- an aliased name of the attribute to be removednull
boolean contains(EntryAttribute... attributes) throws LdapException
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.
attributes
- The Attributes to look fortrue
if all the attributes are found within
the entry, false
if at least one of them is not present.LdapException
- If the attribute does not existboolean contains(String upId, byte[]... values)
id
- The Attribute we are looking for.values
- The searched values.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.boolean contains(String upId, String... values)
id
- The Attribute we are looking for.values
- The searched values.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.boolean contains(String upId, Value<?>... values)
id
- The Attribute we are looking for.values
- The searched values.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.boolean containsAttribute(String... attributes)
attributes
- The Attributes to look for.true
if the attributes are all found within the entry.int size()
Copyright © 2003–2013 The Apache Software Foundation. All rights reserved.