|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.directory.shared.ldap.entry.AbstractEntry<String>
org.apache.directory.shared.ldap.entry.client.DefaultClientEntry
public final class DefaultClientEntry
A default implementation of a ServerEntry which should suite most use cases. This class is final, it should not be extended.
| Field Summary |
|---|
| Fields inherited from class org.apache.directory.shared.ldap.entry.AbstractEntry |
|---|
attributes, dn |
| Constructor Summary | |
|---|---|
DefaultClientEntry()
Creates a new instance of DefaultClientEntry. |
|
DefaultClientEntry(DN dn)
Creates a new instance of DefaultServerEntry, with a DN. |
|
DefaultClientEntry(DN dn,
EntryAttribute... attributes)
Creates a new instance of DefaultClientEntry, with a DN and a list of EntryAttributes. |
|
DefaultClientEntry(DN dn,
String... upIds)
Creates a new instance of DefaultServerEntry, with a DN and a list of IDs. |
|
| Method Summary | |
|---|---|
void |
add(EntryAttribute... attributes)
Add some Attributes to the current Entry. |
void |
add(String upId,
byte[]... values)
Add an attribute (represented by its ID and binary values) into an entry. |
void |
add(String upId,
String... values)
Add some String values to the current Entry. |
void |
add(String upId,
Value<?>... values)
Add an attribute (represented by its ID and Value values) into an entry. |
Entry |
clone()
Clone an entry. |
boolean |
contains(EntryAttribute... attributes)
Checks if an entry contains a list of attributes. |
boolean |
contains(String upId)
Checks if an entry contains a specific attribute |
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. |
boolean |
equals(Object o)
|
EntryAttribute |
get(String alias)
Returns the attribute with the specified alias. |
int |
hashCode()
Get the hash code of this ClientEntry. |
boolean |
hasObjectClass(String objectClass)
Tells if an entry has 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. |
void |
readExternal(ObjectInput in)
|
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. |
String |
toString()
|
void |
writeExternal(ObjectOutput out)
|
| Methods inherited from class org.apache.directory.shared.ldap.entry.AbstractEntry |
|---|
clear, getDn, setDn, size |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.apache.directory.shared.ldap.entry.Entry |
|---|
clear, getDn, setDn, size |
| Constructor Detail |
|---|
public DefaultClientEntry()
This entry must be initialized before being used !
public DefaultClientEntry(DN dn)
dn - The DN for this serverEntry. Can be null.
public DefaultClientEntry(DN dn,
String... upIds)
dn - The DN for this serverEntry. Can be null.upIds - The list of attributes to create.
public DefaultClientEntry(DN dn,
EntryAttribute... attributes)
Creates a new instance of DefaultClientEntry, with a DN and a list of EntryAttributes.
dn - The DN for this serverEntry. Can be nullattributes - The list of attributes to create| Method Detail |
|---|
public void add(EntryAttribute... attributes)
throws NamingException
add in interface Entryattributes - The attributes to add
NamingException - If we can't add any of the attributes
public void add(String upId,
byte[]... values)
throws NamingException
add in interface EntryupId - The attribute IDvalues - The list of binary values to inject. It can be empty
NamingException - If the attribute does not exist
public void add(String upId,
String... values)
throws NamingException
add in interface EntryupId - The user provided ID of the attribute we want to add
some values tovalues - The list of String values to add
NamingException - If we can't add any of the values
public void add(String upId,
Value<?>... values)
throws NamingException
add in interface EntryupId - The attribute IDvalues - The list of Value values to inject. It can be empty
NamingException - If the attribute does not existpublic Entry clone()
clone in interface Entryclone in class AbstractEntry<String>
public boolean contains(EntryAttribute... attributes)
throws 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.
contains in interface Entryattributes - The Attributes to look for
true if all the attributes are found within
the entry, false if at least one of them is not present.
NamingException - If the attribute does not exist
public boolean contains(String upId)
throws NamingException
attributes - The Attributes to look for
true if the attributes are found within the entry
NamingException - If the attribute does not exist
public boolean contains(String upId,
byte[]... values)
contains in interface Entryid - 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.
public boolean contains(String upId,
String... values)
contains in interface Entryid - 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.
public boolean contains(String upId,
Value<?>... values)
contains in interface Entryid - 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.public boolean containsAttribute(String... attributes)
containsAttribute in interface Entryattributes - The Attributes to look for.
true if the attributes are all found within the entry.public EntryAttribute 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'.
get in interface Entryalias - an aliased name of the attribute identifier
public EntryAttribute 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.
put in interface EntryupId - The attribute IDvalues - The list of binary values to put. It can be empty.
public 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.
put in interface EntryupId - The attribute IDvalues - The list of String values to put. It can be empty.
public 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.
put in interface EntryupId - The attribute IDvalues - The list of values to put. It can be empty.
public List<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.
set in interface EntryupIds - The user provided IDs of the AttributeTypes to add.
public List<EntryAttribute> put(EntryAttribute... attributes)
throws 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.
put in interface Entryattributes - the attributes to be put
null
NamingException - if the operation fails
public List<EntryAttribute> remove(EntryAttribute... attributes)
throws NamingException
Entrynull.
remove in interface Entryattributes - the attributes to be removed
null
NamingExceptionpublic 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.
removeAttributes in interface Entryattributes - an aliased name of the attribute to be removed
null
public boolean remove(String upId,
byte[]... values)
throws 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
remove in interface EntryupId - The attribute IDvalues - the values to be removed
true if at least a value is removed, false
if not all the values have been removed or if the attribute does not exist.
NamingException
public boolean remove(String upId,
String... values)
throws 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 having removed the values, the attribute will be removed too.
If the attribute does not exist, nothing is done and the method returns
false
remove in interface EntryupId - The attribute IDattributes - the attributes to be removed
true if at least a value is removed, false
if not all the values have been removed or if the attribute does not exist.
NamingException
public boolean remove(String upId,
Value<?>... values)
throws 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
remove in interface EntryupId - The attribute IDattributes - the attributes to be removed
true if at least a value is removed, false
if not all the values have been removed or if the attribute does not exist.
NamingExceptionpublic Iterator<EntryAttribute> iterator()
AbstractEntry
iterator in interface Iterable<EntryAttribute>iterator in interface Entryiterator in class AbstractEntry<String>
public void writeExternal(ObjectOutput out)
throws IOException
writeExternal in interface ExternalizableIOExceptionThis is the place where we serialize entries, and all theirs
elements.
The structure used to store the entry is the following :
-
[DN] : If it's null, stores an empty DN
-
[attributes number] : the number of attributes.
-
[attribute]* : each attribute, if we have some
public void readExternal(ObjectInput in)
throws IOException,
ClassNotFoundException
readExternal in interface ExternalizableIOException
ClassNotFoundExceptionExternalizable#readExternal(ObjectInput)public int hashCode()
hashCode in class ObjectObject.hashCode()public boolean hasObjectClass(String objectClass)
hasObjectClass in interface EntryobjectClass - The ObjectClass we want to check
true if the ObjectClass value is present
in the ObjectClass attributepublic boolean equals(Object o)
equals in class ObjectObject.equals(Object)public String toString()
toString in class ObjectObject.toString()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||