Package com.unboundid.ldap.sdk
Class ChangeLogEntry
java.lang.Object
com.unboundid.ldap.sdk.Entry
com.unboundid.ldap.sdk.ReadOnlyEntry
com.unboundid.ldap.sdk.ChangeLogEntry
- All Implemented Interfaces:
LDIFRecord,Serializable
- Direct Known Subclasses:
UnboundIDChangeLogEntry
@NotExtensible
@NotMutable
@ThreadSafety(level=COMPLETELY_THREADSAFE)
public class ChangeLogEntry
extends ReadOnlyEntry
This class provides a data structure for representing a changelog entry as
described in draft-good-ldap-changelog. Changelog entries provide
information about a change (add, delete, modify, or modify DN) operation
that was processed in the directory server. Changelog entries may be
parsed from entries, and they may be converted to LDIF change records or
processed as LDAP operations.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe name of an alternative attribute that may be used to obtain information about attributes from a deleted entry if the deletedEntryAttrs attribute is not present.static final StringThe name of the attribute that contains the change number that identifies the change and the order it was processed in the server.static final StringThe name of the attribute that contains the type of change made to the target entry.static final StringThe name of the attribute used to hold a list of changes.static final StringThe name of the attribute used to hold the flag indicating whether the old RDN value(s) should be removed from the target entry for a modify DN operation.static final StringThe name of the attribute used to hold information about attributes from a deleted entry, if available.static final StringThe name of the attribute used to hold the new RDN for a modify DN operation.static final StringThe name of the attribute used to hold the new superior DN for a modify DN operation.static final StringThe name of the attribute that contains the DN of the entry targeted by the change. -
Constructor Summary
ConstructorsConstructorDescriptionChangeLogEntry(Entry entry) Creates a new changelog entry from the provided entry. -
Method Summary
Modifier and TypeMethodDescriptionstatic ChangeLogEntryconstructChangeLogEntry(long changeNumber, LDIFChangeRecord changeRecord) Constructs a changelog entry from information contained in the provided LDIF change record.final booleanIndicates whether the old RDN value(s) should be removed from the entry targeted by this modify DN changelog entry.Retrieves the attribute list for an add changelog entry.final longRetrieves the change number for this changelog entry.final ChangeTypeRetrieves the change type for this changelog entry.Retrieves the list of deleted entry attributes for a delete changelog entry.final List<Modification> Retrieves the list of modifications for a modify changelog entry.final StringgetNewDN()Retrieves the DN of the entry after the change has been processed.final StringRetrieves the new RDN for a modify DN changelog entry.final StringRetrieves the new superior DN for a modify DN changelog entry.final StringRetrieves the target DN for this changelog entry.parseAddAttributeList(Entry entry, String attrName, String targetDN) Parses the attribute list from the specified attribute in a changelog entry.final LDAPResultprocessChange(LDAPInterface connection) Processes the operation represented by this changelog entry using the provided LDAP connection.final LDIFChangeRecordRetrieves an LDIF change record that is analogous to the operation represented by this changelog entry.Methods inherited from class com.unboundid.ldap.sdk.ReadOnlyEntry
addAttribute, addAttribute, addAttribute, addAttribute, addAttribute, removeAttribute, removeAttributeValue, removeAttributeValue, removeAttributeValues, removeAttributeValues, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setDN, setDNMethods inherited from class com.unboundid.ldap.sdk.Entry
addAttribute, applyModifications, applyModifications, applyModifyDN, applyModifyDN, diff, diff, diff, duplicate, equals, getAttribute, getAttribute, getAttributes, getAttributesWithOptions, getAttributeValue, getAttributeValueAsBoolean, getAttributeValueAsDate, getAttributeValueAsDN, getAttributeValueAsInteger, getAttributeValueAsLong, getAttributeValueByteArrays, getAttributeValueBytes, getAttributeValues, getDN, getObjectClassAttribute, getObjectClassValues, getParentDN, getParentDNString, getParsedDN, getRDN, getSchema, hasAttribute, hasAttribute, hasAttribute, hasAttributeValue, hasAttributeValue, hasAttributeValue, hasAttributeValue, hashCode, hasObjectClass, intersectEntries, matchesBaseAndScope, matchesBaseAndScope, mergeEntries, removeAttributeValue, removeAttributeValue, setAttribute, toLDIF, toLDIF, toLDIF, toLDIF, toLDIFString, toLDIFString, toLDIFString, toLDIFString, toString, toString
-
Field Details
-
ATTR_CHANGE_NUMBER
The name of the attribute that contains the change number that identifies the change and the order it was processed in the server.- See Also:
-
ATTR_TARGET_DN
The name of the attribute that contains the DN of the entry targeted by the change.- See Also:
-
ATTR_CHANGE_TYPE
The name of the attribute that contains the type of change made to the target entry.- See Also:
-
ATTR_CHANGES
The name of the attribute used to hold a list of changes. For an add operation, this will be an LDIF representation of the attributes that make up the entry. For a modify operation, this will be an LDIF representation of the changes to the target entry.- See Also:
-
ATTR_NEW_RDN
The name of the attribute used to hold the new RDN for a modify DN operation.- See Also:
-
ATTR_DELETE_OLD_RDN
The name of the attribute used to hold the flag indicating whether the old RDN value(s) should be removed from the target entry for a modify DN operation.- See Also:
-
ATTR_NEW_SUPERIOR
The name of the attribute used to hold the new superior DN for a modify DN operation.- See Also:
-
ATTR_DELETED_ENTRY_ATTRS
The name of the attribute used to hold information about attributes from a deleted entry, if available.- See Also:
-
ATTR_ALTERNATIVE_DELETED_ENTRY_ATTRS_INCLUDED_ATTRIBUTES
The name of an alternative attribute that may be used to obtain information about attributes from a deleted entry if the deletedEntryAttrs attribute is not present.- See Also:
-
-
Constructor Details
-
ChangeLogEntry
Creates a new changelog entry from the provided entry.- Parameters:
entry- The entry from which to create this changelog entry.- Throws:
LDAPException- If the provided entry cannot be parsed as a changelog entry.
-
-
Method Details
-
constructChangeLogEntry
@NotNull public static ChangeLogEntry constructChangeLogEntry(long changeNumber, @NotNull LDIFChangeRecord changeRecord) throws LDAPException Constructs a changelog entry from information contained in the provided LDIF change record.- Parameters:
changeNumber- The change number to use for the constructed changelog entry.changeRecord- The LDIF change record with the information to include in the generated changelog entry.- Returns:
- The changelog entry constructed from the provided change record.
- Throws:
LDAPException- If a problem is encountered while constructing the changelog entry.
-
parseAddAttributeList
@NotNull protected static List<Attribute> parseAddAttributeList(@NotNull Entry entry, @NotNull String attrName, @NotNull String targetDN) throws LDAPException Parses the attribute list from the specified attribute in a changelog entry.- Parameters:
entry- The entry containing the data to parse.attrName- The name of the attribute from which to parse the attribute list.targetDN- The DN of the target entry.- Returns:
- The parsed attribute list.
- Throws:
LDAPException- If an error occurs while parsing the attribute list.
-
getChangeNumber
Retrieves the change number for this changelog entry.- Returns:
- The change number for this changelog entry.
-
getTargetDN
Retrieves the target DN for this changelog entry.- Returns:
- The target DN for this changelog entry.
-
getChangeType
Retrieves the change type for this changelog entry.- Returns:
- The change type for this changelog entry.
-
getAddAttributes
Retrieves the attribute list for an add changelog entry.- Returns:
- The attribute list for an add changelog entry, or
nullif this changelog entry does not represent an add operation.
-
getDeletedEntryAttributes
Retrieves the list of deleted entry attributes for a delete changelog entry. Note that this is a non-standard extension implemented by some types of servers and is not defined in draft-good-ldap-changelog and may not be provided by some servers.- Returns:
- The delete entry attribute list for a delete changelog entry, or
nullif this changelog entry does not represent a delete operation or no deleted entry attributes were included in the changelog entry.
-
getModifications
Retrieves the list of modifications for a modify changelog entry. Note some directory servers may also include changes for modify DN change records if there were updates to operational attributes (e.g., modifiersName and modifyTimestamp).- Returns:
- The list of modifications for a modify (or possibly modify DN)
changelog entry, or
nullif this changelog entry does not represent a modify operation or a modify DN operation with additional changes.
-
getNewRDN
Retrieves the new RDN for a modify DN changelog entry.- Returns:
- The new RDN for a modify DN changelog entry, or
nullif this changelog entry does not represent a modify DN operation.
-
deleteOldRDN
Indicates whether the old RDN value(s) should be removed from the entry targeted by this modify DN changelog entry.- Returns:
trueif the old RDN value(s) should be removed from the entry, orfalseif not or if this changelog entry does not represent a modify DN operation.
-
getNewSuperior
Retrieves the new superior DN for a modify DN changelog entry.- Returns:
- The new superior DN for a modify DN changelog entry, or
nullif there is no new superior DN, or if this changelog entry does not represent a modify DN operation.
-
getNewDN
Retrieves the DN of the entry after the change has been processed. For an add or modify operation, the new DN will be the same as the target DN. For a modify DN operation, the new DN will be constructed from the original DN, the new RDN, and the new superior DN. For a delete operation, it will benullbecause the entry will no longer exist.- Returns:
- The DN of the entry after the change has been processed, or
nullif the entry no longer exists.
-
toLDIFChangeRecord
Retrieves an LDIF change record that is analogous to the operation represented by this changelog entry.- Returns:
- An LDIF change record that is analogous to the operation represented by this changelog entry.
-
processChange
@NotNull public final LDAPResult processChange(@NotNull LDAPInterface connection) throws LDAPException Processes the operation represented by this changelog entry using the provided LDAP connection.- Parameters:
connection- The connection (or connection pool) to use to process the operation.- Returns:
- The result of processing the operation.
- Throws:
LDAPException- If the operation could not be processed successfully.
-