Spring LDAP

org.springframework.ldap.transaction.compensating
Class RebindOperationExecutor

java.lang.Object
  extended by org.springframework.ldap.transaction.compensating.RebindOperationExecutor
All Implemented Interfaces:
CompensatingTransactionOperationExecutor

public class RebindOperationExecutor
extends Object
implements CompensatingTransactionOperationExecutor

A CompensatingTransactionOperationExecutor to manage a rebind operation. The methods in this class do not behave as expected, since it might be impossible to retrieve all the original attributes from the entry. Instead this class performs a rename in performOperation(), a negating rename in rollback(), and the commit() operation unbinds the original entry from its temporary location and binds a new entry to the original location using the attributes supplied to the original rebind opertaion.

Since:
1.2
Author:
Mattias Hellborg Arthursson

Constructor Summary
RebindOperationExecutor(LdapOperations ldapOperations, Name originalDn, Name temporaryDn, Object originalObject, Attributes originalAttributes)
          Constructor.
 
Method Summary
 void commit()
          Commit the operation.
 void performOperation()
          Perform the operation.
 void rollback()
          Rollback the operation, restoring state of the target as it was before the operation was performed using the information supplied on creation of this instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RebindOperationExecutor

public RebindOperationExecutor(LdapOperations ldapOperations,
                               Name originalDn,
                               Name temporaryDn,
                               Object originalObject,
                               Attributes originalAttributes)
Constructor.

Parameters:
ldapOperations - the LdapOperations to use to perform the rollback.
originalDn - The original DN of the entry to bind.
temporaryDn - The temporary DN of the entry.
originalObject - Original 'object' parameter sent to the rebind operation.
originalAttributes - Original 'attributes' parameter sent to the rebind operation
Method Detail

rollback

public void rollback()
Description copied from interface: CompensatingTransactionOperationExecutor
Rollback the operation, restoring state of the target as it was before the operation was performed using the information supplied on creation of this instance.

Specified by:
rollback in interface CompensatingTransactionOperationExecutor

commit

public void commit()
Description copied from interface: CompensatingTransactionOperationExecutor
Commit the operation. In many cases, this will not require any work at all to be performed. However, in some cases there will be interesting stuff to do. See class description for elaboration on this.

Specified by:
commit in interface CompensatingTransactionOperationExecutor

performOperation

public void performOperation()
Description copied from interface: CompensatingTransactionOperationExecutor
Perform the operation. This will most often require performing the recorded operation, but in some cases the actual operation performed by this method might be something else. See class description for elaboration on this.

Specified by:
performOperation in interface CompensatingTransactionOperationExecutor

Spring LDAP