|
||||||||||
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<AttributeType>
org.apache.directory.shared.ldap.entry.DefaultServerEntry
public final class DefaultServerEntry
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 | |
---|---|
DefaultServerEntry()
Creates a new instance of DefaultServerEntry. |
|
DefaultServerEntry(SchemaManager schemaManager)
Creates a new instance of DefaultServerEntry, with registries. |
|
DefaultServerEntry(SchemaManager schemaManager,
DN dn)
Creates a new instance of DefaultServerEntry, with a DN and registries. |
|
DefaultServerEntry(SchemaManager schemaManager,
DN dn,
AttributeType... attributeTypes)
Creates a new instance of DefaultServerEntry, with a DN, registries and a list of attributeTypes. |
|
DefaultServerEntry(SchemaManager schemaManager,
DN dn,
AttributeType attributeType,
java.lang.String upId)
Creates a new instance of DefaultServerEntry, with a DN, registries and an attributeType with the user provided ID. |
|
DefaultServerEntry(SchemaManager schemaManager,
DN dn,
EntryAttribute... attributes)
Creates a new instance of DefaultServerEntry, with a DN, registries and a list of ServerAttributes. |
|
DefaultServerEntry(SchemaManager schemaManager,
DN dn,
java.lang.String... upIds)
Creates a new instance of DefaultServerEntry, with a DN, registries and a list of IDs. |
|
DefaultServerEntry(SchemaManager schemaManager,
Entry entry)
Creates a new instance of DefaultServerEntry, copying another entry, which can be a ClientEntry. |
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(EntryAttribute... attributes)
Add some EntryAttributes to the current 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)
Adds a new attribute with some String values into an entry, setting the User Provided ID in the same time. |
void |
add(java.lang.String upId,
AttributeType attributeType,
Value<?>... values)
Add an attribute (represented by its AttributeType and some values) into an entry. |
void |
add(java.lang.String upId,
byte[]... values)
Add an attribute (represented by its ID and binary values) into an entry. |
void |
add(java.lang.String upId,
java.lang.String... values)
Add an attribute (represented by its ID and string values) into an entry. |
void |
add(java.lang.String upId,
Value<?>... values)
Add an attribute (represented by its ID and Value values) into an entry. |
Entry |
clone()
Clone an entry. |
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 |
contains(EntryAttribute... attributes)
Checks if an entry contains a list of attributes. |
boolean |
contains(java.lang.String id,
byte[]... values)
Checks if an entry contains an attribute with some binary values. |
boolean |
contains(java.lang.String id,
java.lang.String... values)
Checks if an entry contains an attribute with some String values. |
boolean |
contains(java.lang.String id,
Value<?>... values)
Checks if an entry contains an attribute with some values. |
boolean |
containsAttribute(AttributeType attributeType)
Checks if an entry contains a specific AttributeType. |
boolean |
containsAttribute(java.lang.String... attributes)
Checks if an entry contains some specific attributes. |
void |
deserialize(java.io.ObjectInput in)
Deserialize a server entry. |
boolean |
equals(java.lang.Object o)
|
EntryAttribute |
get(AttributeType attributeType)
Returns the attribute associated with an AttributeType |
EntryAttribute |
get(java.lang.String alias)
Returns the attribute with the specified alias. |
java.util.Set<AttributeType> |
getAttributeTypes()
Gets all the attributes type |
static java.lang.String |
getUpId(java.lang.String upId,
AttributeType attributeType)
Get the UpId if it was null. |
int |
hashCode()
Gets the hashCode of this ServerEntry. |
boolean |
hasObjectClass(EntryAttribute objectClass)
Tells if an entry has a specific ObjectClass Attribute |
boolean |
hasObjectClass(java.lang.String objectClass)
Tells if an entry has a specific ObjectClass value |
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. |
java.util.List<EntryAttribute> |
put(EntryAttribute... attributes)
Places attributes in 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. |
EntryAttribute |
put(java.lang.String upId,
byte[]... values)
Put an attribute (represented by its ID and some binary values) into an entry. |
EntryAttribute |
put(java.lang.String upId,
java.lang.String... values)
Put an attribute (represented by its ID and some String values) into an entry. |
EntryAttribute |
put(java.lang.String upId,
Value<?>... values)
Put an attribute (represented by its ID and some values) into an entry. |
void |
readExternal(java.io.ObjectInput in)
|
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. |
boolean |
remove(java.lang.String upId,
byte[]... values)
Removes the specified binary values from an attribute. |
boolean |
remove(java.lang.String upId,
java.lang.String... values)
Removes the specified String values from an attribute. |
boolean |
remove(java.lang.String upId,
Value<?>... values)
Removes the specified Value values from an attribute. |
java.util.List<EntryAttribute> |
removeAttributes(AttributeType... attributes)
Removes the attribute with the specified AttributeTypes. |
java.util.List<EntryAttribute> |
removeAttributes(java.lang.String... attributes)
Removes the attribute with the specified alias. |
void |
serialize(java.io.ObjectOutput out)
Serialize a server entry. |
java.util.List<EntryAttribute> |
set(AttributeType... attributeTypes)
Put some new attributes using the attributeTypes. |
java.util.List<EntryAttribute> |
set(java.lang.String... upIds)
Put some new EntryAttribute using the User Provided ID. |
Entry |
toClientEntry()
Convert the ServerEntry to a ClientEntry |
java.lang.String |
toString()
|
void |
writeExternal(java.io.ObjectOutput out)
|
Methods inherited from class org.apache.directory.shared.ldap.entry.AbstractEntry |
---|
clear, getDn, iterator, 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, iterator, setDn, size |
Constructor Detail |
---|
public DefaultServerEntry()
Creates a new instance of DefaultServerEntry.
This entry must be initialized before being used !
public DefaultServerEntry(SchemaManager schemaManager)
Creates a new instance of DefaultServerEntry, with registries.
No attributes will be created.
registries
- The reference to the global registriespublic DefaultServerEntry(SchemaManager schemaManager, Entry entry)
Creates a new instance of DefaultServerEntry, copying another entry, which can be a ClientEntry.
No attributes will be created.
registries
- The reference to the global registriesentry
- the entry to copypublic DefaultServerEntry(SchemaManager schemaManager, DN dn)
Creates a new instance of DefaultServerEntry, with a DN and registries.
No attributes will be created.
registries
- The reference to the global registriesdn
- The DN for this serverEntry. Can be null.public DefaultServerEntry(SchemaManager schemaManager, DN dn, AttributeType... attributeTypes)
Creates a new instance of DefaultServerEntry, with a DN, registries and a list of attributeTypes.
The newly created entry is fed with the list of attributeTypes. No values are associated with those attributeTypes.
If any of the AttributeType does not exist, they it's simply discarded.
registries
- The reference to the global registriesdn
- The DN for this serverEntry. Can be null.attributeTypes
- The list of attributes to create, without value.public DefaultServerEntry(SchemaManager schemaManager, DN dn, AttributeType attributeType, java.lang.String upId)
Creates a new instance of DefaultServerEntry, with a DN, registries and an attributeType with the user provided ID.
The newly created entry is fed with the given attributeType. No values are associated with this attributeType.
If the AttributeType does not exist, they it's simply discarded.
We also check that the normalized upID equals the AttributeType ID
registries
- The reference to the global registriesdn
- The DN for this serverEntry. Can be null.attributeType
- The attribute to create, without value.upId
- The User Provided ID fro this AttributeTypepublic DefaultServerEntry(SchemaManager schemaManager, DN dn, java.lang.String... upIds)
No attributes will be created except the ObjectClass attribute, which will contains "top".
If any of the AttributeType does not exist, they are simply discarded.
registries
- The reference to the global registriesdn
- The DN for this serverEntry. Can be null.upIds
- The list of attributes to create.public DefaultServerEntry(SchemaManager schemaManager, DN dn, EntryAttribute... attributes)
No attributes will be created except the ObjectClass attribute, which will contains "top".
If any of the AttributeType does not exist, they are simply discarded.
registries
- The reference to the global registriesdn
- The DN for this serverEntry. Can be nullattributes
- The list of attributes to createMethod Detail |
---|
public static java.lang.String getUpId(java.lang.String upId, AttributeType attributeType)
public 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, 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.
add
in interface ServerEntry
attributeType
- The attribute Type.values
- The list of binary values to inject. It can be empty.
LdapException
- If the attribute does not existpublic 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 public the same value, nothing is done (duplicated values are not allowed)
public If the value cannot be added, or if the AttributeType is null or invalid, a LdapException is thrown.
public
add
in interface ServerEntry
attributeType
- The attribute Typevalues
- The list of binary values to inject. It can be empty
LdapException
- If the attribute does not existpublic 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 value, 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.
add
in interface ServerEntry
attributeType
- The attribute Typevalues
- The list of binary values to inject. It can be empty
LdapException
- If the attribute does not existpublic void add(EntryAttribute... attributes) throws LdapException
add
in interface Entry
attributes
- The attributes to add
LdapException
- If we can't add any of the attributespublic 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, 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.
add
in interface ServerEntry
upId
- The user provided ID for the added AttributeTypeattributeType
- The attribute Type.values
- The list of binary values to add. It can be empty.
LdapException
- If the attribute does not existpublic 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.
add
in interface ServerEntry
upId
- The user provided ID for the added AttributeTypeattributeType
- The attribute Type.values
- The list of values to add. It can be empty.
LdapException
- If the attribute does not existpublic void add(java.lang.String upId, AttributeType attributeType, java.lang.String... values) throws LdapException
add
in interface ServerEntry
upId
- The User provided IDattributeType
- The associated AttributeTypevalues
- The String values to store into the new Attribute
LdapException
public void add(java.lang.String upId, byte[]... values) throws LdapException
add
in interface Entry
upId
- The attribute IDvalues
- The list of binary values to inject. It can be empty
LdapException
- If the attribute does not existpublic void add(java.lang.String upId, java.lang.String... values) throws LdapException
add
in interface Entry
upId
- The attribute IDvalues
- The list of string values to inject. It can be empty
LdapException
- If the attribute does not existpublic void add(java.lang.String upId, Value<?>... values) throws LdapException
add
in interface Entry
upId
- The attribute IDvalues
- The list of Value values to inject. It can be empty
LdapException
- If the attribute does not existpublic boolean contains(AttributeType attributeType, byte[]... values)
contains
in interface ServerEntry
attributeType
- The Attribute we are looking for.values
- The searched values.
true
if all the values are found within the attribute,
false
otherwise, or if the attributes does not exist.public boolean contains(AttributeType attributeType, java.lang.String... values)
contains
in interface ServerEntry
attributeType
- The Attribute we are looking for.values
- The searched values.
true
if all the values are found within the attribute,
false
otherwise, or if the attributes does not exist.public boolean contains(AttributeType attributeType, Value<?>... values)
contains
in interface ServerEntry
attributeType
- The Attribute we are looking for.values
- The searched values.
true
if all the values are found within the attribute,
false
otherwise, or if the attributes does not exist.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.
contains
in interface Entry
attributes
- 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.
LdapException
- If the attribute does not existpublic boolean contains(java.lang.String id, byte[]... values)
contains
in interface Entry
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(java.lang.String id, java.lang.String... values)
contains
in interface Entry
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(java.lang.String id, Value<?>... values)
contains
in interface Entry
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(AttributeType attributeType)
containsAttribute
in interface ServerEntry
attributeType
- The AttributeType to look for.
true
if the attribute is found within the entry.public boolean containsAttribute(java.lang.String... attributes)
containsAttribute
in interface Entry
attributes
- The Attributes to look for.
true
if the attributes are all found within the entry.public EntryAttribute get(AttributeType attributeType)
get
in interface ServerEntry
attributeType
- the AttributeType we are looking for
public EntryAttribute get(java.lang.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'.
If the attributeType is not found, returns null.
get
in interface Entry
alias
- an aliased name of the attribute identifier
public java.util.Set<AttributeType> getAttributeTypes()
getAttributeTypes
in interface ServerEntry
public boolean hasObjectClass(java.lang.String objectClass)
hasObjectClass
in interface Entry
objectClass
- The ObjectClass ID we want to check
true
if the ObjectClass value is present
in the ObjectClass attributepublic boolean hasObjectClass(EntryAttribute objectClass)
hasObjectClass
in interface ServerEntry
objectClass
- The ObjectClass we want to check
true
if the ObjectClass value is present
in the ObjectClass attributepublic boolean isValid()
isValid
in interface ServerEntry
public boolean isValid(EntryAttribute objectClass)
isValid
in interface ServerEntry
objectClass
- the objectClass to use while checking for validity
public boolean isValid(java.lang.String objectClass)
isValid
in interface ServerEntry
objectClass
- the objectClass to use while checking for validity
public 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
.
put
in interface ServerEntry
attributeType
- the type of the new attribute to be putvalues
- the binary values of the new attribute to be put
null
LdapException
- if there are failurespublic 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
.
put
in interface ServerEntry
attributeType
- the type of the new attribute to be putvalues
- the String values of the new attribute to be put
null
LdapException
- if there are failurespublic 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
.
put
in interface ServerEntry
attributeType
- the type of the new attribute to be putvalues
- the values of the new attribute to be put
null
LdapException
- if there are failurespublic java.util.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
.
put
in interface Entry
attributes
- the attributes to be put
null
LdapException
- if the operation failspublic 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
.
put
in interface ServerEntry
upId
- The User Provided ID to be stored into the AttributeEntryattributeType
- the type of the new attribute to be putvalues
- the binary values of the new attribute to be put
null
LdapException
- if there are failures.public 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
.
put
in interface ServerEntry
upId
- The User Provided ID to be stored into the AttributeEntryattributeType
- the type of the new attribute to be putvalues
- the String values of the new attribute to be put
null
LdapException
- if there are failures.public 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
.
put
in interface ServerEntry
upId
- The User Provided ID to be stored into the AttributeEntryattributeType
- the type of the new attribute to be putvalues
- the values of the new attribute to be put
null
LdapException
- if there are failures.public EntryAttribute put(java.lang.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.
If the upId is not the ID of an existing AttributeType, an IllegalArgumentException is thrown.
put
in interface Entry
upId
- The attribute IDvalues
- The list of binary values to put. It can be empty.
public EntryAttribute put(java.lang.String upId, java.lang.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.
If the upId is not the ID of an existing AttributeType, an IllegalArgumentException is thrown.
put
in interface Entry
upId
- The attribute IDvalues
- The list of String values to put. It can be empty.
public EntryAttribute put(java.lang.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.
If the upId is not the ID of an existing AttributeType, an IllegalArgumentException is thrown.
put
in interface Entry
upId
- The attribute IDvalues
- The list of values to put. It can be empty.
public 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
remove
in interface ServerEntry
attributeType
- The attribute typevalues
- 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.
LdapException
public 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
remove
in interface ServerEntry
attributeType
- The attribute typevalues
- 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.
LdapException
public 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
remove
in interface ServerEntry
attributeType
- The attribute typevalues
- 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.
LdapException
public java.util.List<EntryAttribute> remove(EntryAttribute... attributes) throws LdapException
ServerEntry
null
.
remove
in interface Entry
remove
in interface ServerEntry
attributes
- the attributes to be removed
null
LdapException
public boolean remove(java.lang.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
remove
in interface Entry
upId
- 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.
LdapException
public boolean remove(java.lang.String upId, 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
remove
in interface Entry
upId
- 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.
LdapException
public boolean remove(java.lang.String upId, Value<?>... values) throws LdapException
Removes the specified Value 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 Entry
upId
- 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.
LdapException
public 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
.
removeAttributes
in interface ServerEntry
attributes
- the AttributeTypes to be removed
null
public java.util.List<EntryAttribute> removeAttributes(java.lang.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 Entry
attributes
- an aliased name of the attribute to be removed
null
public 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.
set
in interface ServerEntry
attributeTypes
- The AttributeTypes to add.
null
if no attribute are removed.public java.util.List<EntryAttribute> set(java.lang.String... upIds)
Put some new EntryAttribute 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 Entry
upIds
- The user provided IDs of the AttributeTypes to add.
public Entry toClientEntry() throws LdapException
toClientEntry
in interface ServerEntry
LdapException
public Entry clone()
clone
in interface Entry
clone
in interface ServerEntry
clone
in class AbstractEntry<AttributeType>
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
java.io.IOException
We can't use this method for a ServerEntry, as we have to feed the entry
with an registries reference
public void serialize(java.io.ObjectOutput out) throws java.io.IOException
out
- the buffer in which the data will be serialized
java.io.IOException
- if the serialization failedpublic void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
readExternal
in interface java.io.Externalizable
java.io.IOException
java.lang.ClassNotFoundException
We can't use this method for a ServerEntry, as we have to feed the entry
with an registries reference
public void deserialize(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
in
- The buffer containing the serialized serverEntry
java.io.IOException
- if there was a problem when deserializing
java.lang.ClassNotFoundException
- if we can't deserialize an expected objectpublic int hashCode()
hashCode
in class java.lang.Object
Object.hashCode()
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
Object.equals(Object)
public java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |