Class Entry
- All Implemented Interfaces:
Comparable<GenericEntry>
,Iterable<Attribute>
Entry objects are returned via an Indication when data is read from a directory, or when reading non-change entries from an LDIF file.
-
Field Summary
Fields inherited from class com.isode.dsapi.GenericEntry
attributeList, DS_Entry, logger
-
Constructor Summary
ConstructorsConstructorDescriptionCreate an Entry from an AddEntry.Create a new blank Entry using a specified DNCreate an Entry by copying an existing Entry.Entry
(Entry entry, ModifyEntry change) Create an Entry containing the result of applying a ModifyEntry to the given Entry.Entry
(ModifyEntry change) Create an Entry from a ModifyEntry, by applying the change to an empty Entry. -
Method Summary
Modifier and TypeMethodDescriptiongetAttribute
(int index) Returns a specific Attribute for this Entry.getAttribute
(AttributeType attrType) Return a specific attribute from this Entry's list of attributes.int
Returns a count of the number of attributes attached to this entry.Returns an Iterator over all the Attribute instances associated with this Entry.Do a rename operation on the entry, and return the result as a new AddEntry.toString()
Returns a String representation of this Entry.Methods inherited from class com.isode.dsapi.GenericEntry
compareTo, finalize, getChangeIterator, getDN, hasChanges, iterator, setDN, sortArrayByDN, toLDIF
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
Entry
Create a new blank Entry using a specified DN- Parameters:
dn
- the distinguished name (must not be null)- Throws:
NullPointerException
- if dn is nullNativeLibraryException
- if an unrecoverable error was detected by the native library
-
Entry
Create an Entry from a ModifyEntry, by applying the change to an empty Entry.If one or more delete-attribute modifications from the ModifyEntry fail (due to not matching a value), then the DeleteAttributeException is thrown. This exception contains the resulting Entry without the failed deletions, which is otherwise complete and correct and which can be used if deletions failing is acceptable.
- Parameters:
change
- ModifyEntry to apply to an empty entry- Throws:
DeleteAttributeException
- In the case that there are failed deletions
-
Entry
Create an Entry from an AddEntry.- Parameters:
add
- AddEntry to convert
-
Entry
Create an Entry by copying an existing Entry.- Parameters:
entry
- Entry to copy- Since:
- 14.6
-
Entry
Create an Entry containing the result of applying a ModifyEntry to the given Entry.If one or more delete-attribute modifications from the ModifyEntry fail (due to not matching a value), then the DeleteAttributeException is thrown. This exception contains the resulting Entry without the failed deletions, which is otherwise complete and correct and which can be used if deletions failing is acceptable.
- Parameters:
entry
- Base entry to apply changes tochange
- Changes to apply- Throws:
DeleteAttributeException
- In the case that there are failed deletions
-
-
Method Details
-
getAttributeIterator
Returns an Iterator over all the Attribute instances associated with this Entry.- Overrides:
getAttributeIterator
in classGenericEntry
- Returns:
- Iterator
-
getAttributeCount
public int getAttributeCount()Returns a count of the number of attributes attached to this entry. The value returned by this method may be used to determine the limit for a subsequent call to getAttribute().- Returns:
- attribute count
- See Also:
-
getAttribute
Returns a specific Attribute for this Entry. The value specified by index is zero based and must not be equal to or greater than the value returned by getAttributeCount().- Parameters:
index
- a value which must be between 0 and one less than whatever getAttributeCount() returns- Returns:
- an Attribute
- Throws:
ArrayIndexOutOfBoundsException
- if index is out of range.- See Also:
-
getAttribute
Return a specific attribute from this Entry's list of attributes. If the Entry has multiple Attributes of the same type (for example, if it's been created ready for a modify operation), then there is no guarantee as to which of the Attributes will be returned by this method.- Parameters:
attrType
- the AttributeType required- Returns:
- the specified Attribute
- Throws:
NoSuchAttributeException
- if the Entry doesn't contain an Attribute of type attrType.
-
rename
Do a rename operation on the entry, and return the result as a new AddEntry. A rename operation involves deleting the attribute value(s) corresponding to the current RDN and adding new attribute value(s) corresponding to the new RDN. The entry's DN is also changed.- Parameters:
new_dn
- DN required for the returned AddEntry- Returns:
- AddEntry result of rename operation
- Since:
- 14.4
-
toString
Returns a String representation of this Entry. The String contains the Entry's DN and a count of the number of attributes that the Entry contains.- Overrides:
toString
in classGenericEntry
- Returns:
- a String representation of the Entry.
-