public final class LdifRevertor extends Object
| Modifier and Type | Field and Description |
|---|---|
static boolean |
DELETE_OLD_RDN
Flag used when we want to delete the old Rdn
|
static boolean |
KEEP_OLD_RDN
Flag used when we want to keep the old Rdn
|
| Modifier | Constructor and Description |
|---|---|
private |
LdifRevertor()
Private constructor.
|
| Modifier and Type | Method and Description |
|---|---|
private static LdifEntry |
generateModify(Dn parentDn,
Entry entry,
Rdn oldRdn,
Rdn newRdn)
A helper method to generate the modified attribute after a rename.
|
private static LdifEntry |
generateReverted(Dn newSuperior,
Rdn newRdn,
Dn newDn,
Rdn oldRdn,
boolean deleteOldRdn)
A helper method which generates a reverted entry
|
static LdifEntry |
reverseAdd(Dn dn)
Compute a reverse LDIF of an AddRequest.
|
static LdifEntry |
reverseDel(Dn dn,
Entry deletedEntry)
Compute a reverse LDIF of a DeleteRequest.
|
static LdifEntry |
reverseModify(Dn dn,
List<Modification> forwardModifications,
Entry modifiedEntry)
Compute the reversed LDIF for a modify request.
|
static LdifEntry |
reverseMove(Dn newSuperiorDn,
Dn modifiedDn)
Compute a reverse LDIF for a forward change which if in LDIF format
would represent a Move operation.
|
static List<LdifEntry> |
reverseMoveAndRename(Entry entry,
Dn newSuperior,
Rdn newRdn,
boolean deleteOldRdn)
Revert a Dn to it's previous version by removing the first Rdn and adding the given Rdn.
|
static List<LdifEntry> |
reverseRename(Entry entry,
Rdn newRdn,
boolean deleteOldRdn)
Revert a Dn to it's previous version by removing the first Rdn and adding the given Rdn.
|
private static LdifEntry |
revertEntry(Entry entry,
Dn newDn,
Dn newSuperior,
Rdn oldRdn,
Rdn newRdn)
A small helper class to compute the simple revert.
|
public static final boolean DELETE_OLD_RDN
public static final boolean KEEP_OLD_RDN
public static LdifEntry reverseAdd(Dn dn)
dn - the dn of the added entrypublic static LdifEntry reverseDel(Dn dn, Entry deletedEntry) throws LdapException
dn - The deleted entry DndeletedEntry - The entry which has been deletedLdapException - If something went wrongpublic static LdifEntry reverseModify(Dn dn, List<Modification> forwardModifications, Entry modifiedEntry) throws LdapException
dn - the dn of the modified entryforwardModifications - the modification items for the forward changemodifiedEntry - The modified entry. Necessary for the destructive modificationsLdapException - If something went wrongpublic static LdifEntry reverseMove(Dn newSuperiorDn, Dn modifiedDn) throws LdapException
newSuperiorDn - the new parent dn to be (must not be null)modifiedDn - the dn of the entry being moved (must not be null)LdapException - if something went wrongprivate static LdifEntry revertEntry(Entry entry, Dn newDn, Dn newSuperior, Rdn oldRdn, Rdn newRdn) throws LdapInvalidDnException
LdapInvalidDnExceptionprivate static LdifEntry generateModify(Dn parentDn, Entry entry, Rdn oldRdn, Rdn newRdn)
private static LdifEntry generateReverted(Dn newSuperior, Rdn newRdn, Dn newDn, Rdn oldRdn, boolean deleteOldRdn) throws LdapInvalidDnException
LdapInvalidDnExceptionpublic static List<LdifEntry> reverseRename(Entry entry, Rdn newRdn, boolean deleteOldRdn) throws LdapInvalidDnException
entry - The initial EntrynewRdn - The new RdndeleteOldRdn - A flag which tells to delete the old Rdn AVAsLdapInvalidDnException - If the name reverting failedpublic static List<LdifEntry> reverseMoveAndRename(Entry entry, Dn newSuperior, Rdn newRdn, boolean deleteOldRdn) throws LdapInvalidDnException
entry - The initial EntrynewSuperior - The new superior Dn (can be null if it's just a rename)newRdn - The new RdndeleteOldRdn - A flag which tells to delete the old Rdn AVAsLdapInvalidDnException - If the name reverting failedCopyright © 2003–2017 The Apache Software Foundation. All rights reserved.