@Test public void testReverseDel() throws LdapException { Dn dn = new Dn( "dc=apache, dc=com" ); Entry deletedEntry = new DefaultEntry( dn , "objectClass: top", "objectClass: person", "cn: test", "sn: apache", "dc: apache" ); LdifEntry reversed = LdifRevertor.reverseDel( dn, deletedEntry ); assertNotNull( reversed ); assertEquals( dn.getName(), reversed.getDn().getName() ); assertEquals( ChangeType.Add, reversed.getChangeType() ); assertNotNull( reversed.getEntry() ); assertEquals( deletedEntry, reversed.getEntry() ); }
public static LdifEntry reverseDel( Dn dn, Entry deletedEntry ) throws LdapException { LdifEntry entry = new LdifEntry(); entry.setDn( dn ); entry.setChangeType( ChangeType.Add ); for ( Attribute attribute : deletedEntry ) { entry.addAttribute( attribute ); } return entry; }
LdifRevertor { public static LdifEntry reverseDel( Dn dn, Entry deletedEntry ) throws LdapException { LdifEntry entry = new LdifEntry(); entry.setDn( dn ); entry.setChangeType( ChangeType.Add ); for ( Attribute attribute : deletedEntry ) { entry.addAttribute( attribute ); } return entry; } }
LdifRevertor { public static LdifEntry reverseDel( Dn dn, Entry deletedEntry ) throws LdapException { LdifEntry entry = new LdifEntry(); entry.setDn( dn ); entry.setChangeType( ChangeType.Add ); for ( Attribute attribute : deletedEntry ) { entry.addAttribute( attribute ); } return entry; } private  LdifRevertor(); }
LdifRevertor { public static LdifEntry reverseDel( Dn dn, Entry deletedEntry ) throws LdapException { LdifEntry entry = new LdifEntry(); entry.setDn( dn ); entry.setChangeType( ChangeType.Add ); for ( Attribute attribute : deletedEntry ) { entry.addAttribute( attribute ); } return entry; } private  LdifRevertor(); static LdifEntry reverseAdd( Dn dn ); static LdifEntry reverseDel( Dn dn, Entry deletedEntry ); static LdifEntry reverseModify( Dn dn, List<Modification> forwardModifications, Entry modifiedEntry ); static LdifEntry reverseMove( Dn newSuperiorDn, Dn modifiedDn ); static List<LdifEntry> reverseRename( Entry entry, Rdn newRdn, boolean deleteOldRdn ); static List<LdifEntry> reverseMoveAndRename( Entry entry, Dn newSuperior, Rdn newRdn, boolean deleteOldRdn ); }
LdifRevertor { public static LdifEntry reverseDel( Dn dn, Entry deletedEntry ) throws LdapException { LdifEntry entry = new LdifEntry(); entry.setDn( dn ); entry.setChangeType( ChangeType.Add ); for ( Attribute attribute : deletedEntry ) { entry.addAttribute( attribute ); } return entry; } private  LdifRevertor(); static LdifEntry reverseAdd( Dn dn ); static LdifEntry reverseDel( Dn dn, Entry deletedEntry ); static LdifEntry reverseModify( Dn dn, List<Modification> forwardModifications, Entry modifiedEntry ); static LdifEntry reverseMove( Dn newSuperiorDn, Dn modifiedDn ); static List<LdifEntry> reverseRename( Entry entry, Rdn newRdn, boolean deleteOldRdn ); static List<LdifEntry> reverseMoveAndRename( Entry entry, Dn newSuperior, Rdn newRdn, boolean deleteOldRdn ); static final boolean DELETE_OLD_RDN; static final boolean KEEP_OLD_RDN; }