Minor fix to RebindOperation and UnbindOperation

This commit is contained in:
Mattias Arthursson
2007-01-18 19:37:44 +00:00
parent 7d2d68e7c2
commit ac20372706
8 changed files with 8 additions and 10 deletions

View File

@@ -115,7 +115,9 @@ public class RebindOperationExecutor implements
*/
public void performOperation() {
log.debug("Performing rebind operation - "
+ "renaming original entry and "
+ "binding new contents to entry.");
ldapOperations.rename(originalDn, temporaryDn);
ldapOperations.bind(originalDn, originalObject, originalAttributes);
}

View File

@@ -68,7 +68,6 @@ public class RebindOperationRecorder implements
Name temporaryName = renamingStrategy.getTemporaryName(dn);
ldapOperations.rename(dn, temporaryName);
return new RebindOperationExecutor(ldapOperations, dn, temporaryName,
object, attributes);
}

View File

@@ -97,7 +97,9 @@ public class UnbindOperationExecutor implements
* @see org.springframework.ldap.support.transaction.CompensatingTransactionOperationExecutor#performOperation()
*/
public void performOperation() {
log.debug("Nothing to do in performOperation for unbind");
log.debug("Performing operation for unbind -"
+ " renaming to temporary entry.");
ldapOperations.rename(originalDn, temporaryDn);
}
LdapOperations getLdapOperations() {

View File

@@ -55,8 +55,6 @@ public class UnbindOperationRecorder implements
Name dn = LdapUtils.getFirstArgumentAsName(args);
Name temporaryDn = renamingStrategy.getTemporaryName(dn);
ldapOperations.rename(dn, temporaryDn);
return new UnbindOperationExecutor(ldapOperations, dn, temporaryDn);
}

View File

@@ -43,6 +43,7 @@ public class RebindOperationExecutorTest extends TestCase {
ldapOperationsMock, expectedOriginalDn, expectedTempDn,
expectedObject, expectedAttributes);
ldapOperationsMock.rename(expectedOriginalDn, expectedTempDn);
ldapOperationsMock.bind(expectedOriginalDn, expectedObject,
expectedAttributes);

View File

@@ -59,8 +59,6 @@ public class RebindOperationRecorderTest extends TestCase {
renamingStrategyControl.expectAndReturn(renamingStrategyMock
.getTemporaryName(expectedDn), expectedTempDn);
ldapOperationsMock.rename(expectedDn, expectedTempDn);
replay();
Object expectedObject = new Object();
BasicAttributes expectedAttributes = new BasicAttributes();

View File

@@ -37,8 +37,8 @@ public class UnbindOperationExecutorTest extends TestCase {
UnbindOperationExecutor tested = new UnbindOperationExecutor(
ldapOperationsMock, expectedOldName, expectedTempName);
// Nothing to do in performOperation for unbind.
ldapOperationsMock.rename(expectedOldName, expectedTempName);
replay();
// Perform test
tested.performOperation();

View File

@@ -57,8 +57,6 @@ public class UnbindOperationRecorderTest extends TestCase {
renamingStrategyControl.expectAndReturn(renamingStrategyMock
.getTemporaryName(expectedDn), expectedTempName);
ldapOperationsMock.rename(expectedDn, expectedTempName);
replay();
// Perform test
CompensatingTransactionOperationExecutor operation = tested