public final class DefaultClientEntry extends AbstractEntry<String>
attributes, dn
Constructor and Description |
---|
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.
|
Modifier and Type | Method and Description |
---|---|
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) |
clear, getDn, setDn, size
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 createpublic void add(EntryAttribute... attributes) throws LdapException
attributes
- The attributes to addLdapException
- If we can't add any of the attributespublic void add(String upId, byte[]... values) throws LdapException
upId
- The attribute IDvalues
- The list of binary values to inject. It can be emptyLdapException
- If the attribute does not existpublic void 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 valuespublic void add(String upId, Value<?>... values) throws LdapException
upId
- The attribute IDvalues
- The list of Value values to inject. It can be emptyLdapException
- If the attribute does not existpublic Entry clone()
clone
in interface Entry
clone
in class AbstractEntry<String>
public 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 existpublic boolean contains(String upId) throws LdapException
attributes
- The Attributes to look fortrue
if the attributes are found within the entryLdapException
- If the attribute does not existpublic boolean 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.public 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.public 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.public boolean containsAttribute(String... attributes)
attributes
- 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'.
alias
- an aliased name of the attribute identifierpublic 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.
upId
- 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.
upId
- 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.
upId
- 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.
upIds
- The user provided IDs of the AttributeTypes to add.public List<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 failspublic List<EntryAttribute> remove(EntryAttribute... attributes) throws LdapException
Entry
null
.attributes
- the attributes to be removednull
LdapException
public 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
public 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 IDvalues
- the values 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
public 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 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
public 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
public Iterator<EntryAttribute> iterator()
AbstractEntry
iterator
in interface Iterable<EntryAttribute>
iterator
in interface Entry
iterator
in class AbstractEntry<String>
public void writeExternal(ObjectOutput out) throws IOException
IOException
This 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
IOException
ClassNotFoundException
Externalizable#readExternal(ObjectInput)
public int hashCode()
hashCode
in class Object
Object.hashCode()
public boolean hasObjectClass(String objectClass)
objectClass
- The ObjectClass we want to checktrue
if the ObjectClass value is present
in the ObjectClass attributepublic boolean equals(Object o)
equals
in class Object
Object.equals(Object)
public String toString()
toString
in class Object
Object.toString()
Copyright © 2003–2013 The Apache Software Foundation. All rights reserved.