|
||||||||||
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<org.apache.directory.shared.ldap.schema.AttributeType>
org.apache.directory.server.core.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(Registries registries)
Creates a new instance of DefaultServerEntry, with registries. |
|
DefaultServerEntry(Registries registries,
org.apache.directory.shared.ldap.entry.Entry entry)
Creates a new instance of DefaultServerEntry, copying another entry, which can be a ClientEntry. |
|
DefaultServerEntry(Registries registries,
org.apache.directory.shared.ldap.name.LdapDN dn)
Creates a new instance of DefaultServerEntry, with a DN and registries. |
|
DefaultServerEntry(Registries registries,
org.apache.directory.shared.ldap.name.LdapDN dn,
org.apache.directory.shared.ldap.schema.AttributeType... attributeTypes)
Creates a new instance of DefaultServerEntry, with a DN, registries and a list of attributeTypes. |
|
DefaultServerEntry(Registries registries,
org.apache.directory.shared.ldap.name.LdapDN dn,
org.apache.directory.shared.ldap.schema.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(Registries registries,
org.apache.directory.shared.ldap.name.LdapDN dn,
ServerAttribute... attributes)
Creates a new instance of DefaultServerEntry, with a DN, registries and a list of ServerAttributes. |
|
DefaultServerEntry(Registries registries,
org.apache.directory.shared.ldap.name.LdapDN dn,
java.lang.String... upIds)
Creates a new instance of DefaultServerEntry, with a DN, registries and a list of IDs. |
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)
Add some EntryAttributes to the current Entry. |
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)
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,
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)
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,
org.apache.directory.shared.ldap.entry.Value<?>... values)
Add an attribute (represented by its ID and Value values) into an entry. |
org.apache.directory.shared.ldap.entry.Entry |
clone()
Clone an entry. |
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)
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,
org.apache.directory.shared.ldap.entry.Value<?>... values)
Checks if an entry contains an attribute with some 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)
Checks if an entry contains some specific attributes. |
void |
deserialize(java.io.ObjectInput in)
Deserialize a server entry. |
boolean |
equals(java.lang.Object o)
|
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)
Returns the attribute with the specified alias. |
java.util.Set<org.apache.directory.shared.ldap.schema.AttributeType> |
getAttributeTypes()
Gets all the attributes type |
static java.lang.String |
getUpId(java.lang.String upId,
org.apache.directory.shared.ldap.schema.AttributeType attributeType)
Get the UpId if it was null. |
int |
hashCode()
Gets the hashCode of this ServerEntry. |
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)
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(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. |
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)
Places attributes in the attribute collection. |
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)
Put an attribute (represented by its ID and some binary values) into an entry. |
org.apache.directory.shared.ldap.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. |
org.apache.directory.shared.ldap.entry.EntryAttribute |
put(java.lang.String upId,
org.apache.directory.shared.ldap.entry.Value<?>... values)
Put an attribute (represented by its ID and some values) into an entry. |
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)
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,
org.apache.directory.shared.ldap.entry.Value<?>... values)
Removes the specified Value values from an attribute. |
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)
Removes the attribute with the specified alias. |
void |
serialize(java.io.ObjectOutput out)
Serialize a server entry. |
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)
Put some new EntryAttribute using the User Provided ID. |
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 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(Registries registries)
Creates a new instance of DefaultServerEntry, with registries.
No attributes will be created.
registries
- The reference to the global registriespublic DefaultServerEntry(Registries registries, org.apache.directory.shared.ldap.entry.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(Registries registries, org.apache.directory.shared.ldap.name.LdapDN 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(Registries registries, org.apache.directory.shared.ldap.name.LdapDN dn, org.apache.directory.shared.ldap.schema.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(Registries registries, org.apache.directory.shared.ldap.name.LdapDN dn, org.apache.directory.shared.ldap.schema.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(Registries registries, org.apache.directory.shared.ldap.name.LdapDN 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(Registries registries, org.apache.directory.shared.ldap.name.LdapDN dn, ServerAttribute... 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, org.apache.directory.shared.ldap.schema.AttributeType attributeType)
public void add(org.apache.directory.shared.ldap.schema.AttributeType attributeType, byte[]... values) throws javax.naming.NamingException
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 NamingException is thrown.
add
in interface ServerEntry
attributeType
- The attribute Type.values
- The list of binary values to inject. It can be empty.
javax.naming.NamingException
- If the attribute does not existpublic void add(org.apache.directory.shared.ldap.schema.AttributeType attributeType, java.lang.String... values) throws javax.naming.NamingException
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 NamingException is thrown.
public
add
in interface ServerEntry
attributeType
- The attribute Typevalues
- The list of binary values to inject. It can be empty
javax.naming.NamingException
- If the attribute does not existpublic void add(org.apache.directory.shared.ldap.schema.AttributeType attributeType, org.apache.directory.shared.ldap.entry.Value<?>... values) throws javax.naming.NamingException
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 NamingException is thrown.
add
in interface ServerEntry
attributeType
- The attribute Typevalues
- The list of binary values to inject. It can be empty
javax.naming.NamingException
- If the attribute does not existpublic void add(org.apache.directory.shared.ldap.entry.EntryAttribute... attributes) throws javax.naming.NamingException
add
in interface org.apache.directory.shared.ldap.entry.Entry
attributes
- The attributes to add
javax.naming.NamingException
- If we can't add any of the attributespublic void add(java.lang.String upId, org.apache.directory.shared.ldap.schema.AttributeType attributeType, byte[]... values) throws javax.naming.NamingException
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 NamingException 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.
javax.naming.NamingException
- If the attribute does not existpublic 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
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.
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.
javax.naming.NamingException
- If the attribute does not existpublic void add(java.lang.String upId, org.apache.directory.shared.ldap.schema.AttributeType attributeType, java.lang.String... values) throws javax.naming.NamingException
add
in interface ServerEntry
upId
- The User provided IDattributeType
- The associated AttributeTypevalues
- The String values to store into the new Attribute
javax.naming.NamingException
public void add(java.lang.String upId, byte[]... values) throws javax.naming.NamingException
add
in interface org.apache.directory.shared.ldap.entry.Entry
upId
- The attribute IDvalues
- The list of binary values to inject. It can be empty
javax.naming.NamingException
- If the attribute does not existpublic void add(java.lang.String upId, java.lang.String... values) throws javax.naming.NamingException
add
in interface org.apache.directory.shared.ldap.entry.Entry
upId
- The attribute IDvalues
- The list of string values to inject. It can be empty
javax.naming.NamingException
- If the attribute does not existpublic void add(java.lang.String upId, org.apache.directory.shared.ldap.entry.Value<?>... values) throws javax.naming.NamingException
add
in interface org.apache.directory.shared.ldap.entry.Entry
upId
- The attribute IDvalues
- The list of Value values to inject. It can be empty
javax.naming.NamingException
- If the attribute does not existpublic boolean contains(org.apache.directory.shared.ldap.schema.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(org.apache.directory.shared.ldap.schema.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(org.apache.directory.shared.ldap.schema.AttributeType attributeType, org.apache.directory.shared.ldap.entry.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(org.apache.directory.shared.ldap.entry.EntryAttribute... attributes) throws javax.naming.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 org.apache.directory.shared.ldap.entry.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.
javax.naming.NamingException
- If the attribute does not existpublic boolean contains(java.lang.String id, byte[]... values)
contains
in interface org.apache.directory.shared.ldap.entry.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 org.apache.directory.shared.ldap.entry.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, org.apache.directory.shared.ldap.entry.Value<?>... values)
contains
in interface org.apache.directory.shared.ldap.entry.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(org.apache.directory.shared.ldap.schema.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 org.apache.directory.shared.ldap.entry.Entry
attributes
- The Attributes to look for.
true
if the attributes are all found within the entry.public org.apache.directory.shared.ldap.entry.EntryAttribute get(org.apache.directory.shared.ldap.schema.AttributeType attributeType)
get
in interface ServerEntry
attributeType
- the AttributeType we are looking for
public org.apache.directory.shared.ldap.entry.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 org.apache.directory.shared.ldap.entry.Entry
alias
- an aliased name of the attribute identifier
public java.util.Set<org.apache.directory.shared.ldap.schema.AttributeType> getAttributeTypes()
getAttributeTypes
in interface ServerEntry
public boolean hasObjectClass(java.lang.String objectClass)
hasObjectClass
in interface org.apache.directory.shared.ldap.entry.Entry
objectClass
- The ObjectClass ID we want to check
true
if the ObjectClass value is present
in the ObjectClass attributepublic boolean hasObjectClass(org.apache.directory.shared.ldap.entry.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(org.apache.directory.shared.ldap.entry.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 org.apache.directory.shared.ldap.entry.EntryAttribute put(org.apache.directory.shared.ldap.schema.AttributeType attributeType, byte[]... values) throws javax.naming.NamingException
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
javax.naming.NamingException
- if there are failurespublic org.apache.directory.shared.ldap.entry.EntryAttribute put(org.apache.directory.shared.ldap.schema.AttributeType attributeType, java.lang.String... values) throws javax.naming.NamingException
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
javax.naming.NamingException
- if there are failurespublic 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
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
javax.naming.NamingException
- if there are failurespublic java.util.List<org.apache.directory.shared.ldap.entry.EntryAttribute> put(org.apache.directory.shared.ldap.entry.EntryAttribute... attributes) throws javax.naming.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 org.apache.directory.shared.ldap.entry.Entry
attributes
- the attributes to be put
null
javax.naming.NamingException
- if the operation failspublic 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
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
javax.naming.NamingException
- if there are failures.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
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
javax.naming.NamingException
- if there are failures.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
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
javax.naming.NamingException
- if there are failures.public org.apache.directory.shared.ldap.entry.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 org.apache.directory.shared.ldap.entry.Entry
upId
- The attribute IDvalues
- The list of binary values to put. It can be empty.
public org.apache.directory.shared.ldap.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.
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 org.apache.directory.shared.ldap.entry.Entry
upId
- The attribute IDvalues
- The list of String values to put. It can be empty.
public org.apache.directory.shared.ldap.entry.EntryAttribute put(java.lang.String upId, org.apache.directory.shared.ldap.entry.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 org.apache.directory.shared.ldap.entry.Entry
upId
- The attribute IDvalues
- The list of values to put. It can be empty.
public boolean remove(org.apache.directory.shared.ldap.schema.AttributeType attributeType, byte[]... values) throws javax.naming.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 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.
javax.naming.NamingException
public boolean remove(org.apache.directory.shared.ldap.schema.AttributeType attributeType, java.lang.String... values) throws javax.naming.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 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.
javax.naming.NamingException
public boolean remove(org.apache.directory.shared.ldap.schema.AttributeType attributeType, org.apache.directory.shared.ldap.entry.Value<?>... values) throws javax.naming.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 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.
javax.naming.NamingException
public java.util.List<org.apache.directory.shared.ldap.entry.EntryAttribute> remove(org.apache.directory.shared.ldap.entry.EntryAttribute... attributes) throws javax.naming.NamingException
ServerEntry
null
.
remove
in interface ServerEntry
remove
in interface org.apache.directory.shared.ldap.entry.Entry
attributes
- the attributes to be removed
null
javax.naming.NamingException
public boolean remove(java.lang.String upId, byte[]... values) throws javax.naming.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 org.apache.directory.shared.ldap.entry.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.
javax.naming.NamingException
public boolean remove(java.lang.String upId, java.lang.String... values) throws javax.naming.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 org.apache.directory.shared.ldap.entry.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.
javax.naming.NamingException
public boolean remove(java.lang.String upId, org.apache.directory.shared.ldap.entry.Value<?>... values) throws javax.naming.NamingException
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 org.apache.directory.shared.ldap.entry.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.
javax.naming.NamingException
public 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.
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<org.apache.directory.shared.ldap.entry.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 org.apache.directory.shared.ldap.entry.Entry
attributes
- an aliased name of the attribute to be removed
null
public 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. 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<org.apache.directory.shared.ldap.entry.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 org.apache.directory.shared.ldap.entry.Entry
upIds
- The user provided IDs of the AttributeTypes to add.
public org.apache.directory.shared.ldap.entry.Entry toClientEntry() throws javax.naming.NamingException
toClientEntry
in interface ServerEntry
javax.naming.NamingException
public org.apache.directory.shared.ldap.entry.Entry clone()
clone
in interface ServerEntry
clone
in interface org.apache.directory.shared.ldap.entry.Entry
clone
in class org.apache.directory.shared.ldap.entry.AbstractEntry<org.apache.directory.shared.ldap.schema.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 |