Spring LDAP

org.springframework.ldap.transaction.compensating.support
Class DefaultTempEntryRenamingStrategy

java.lang.Object
  extended by org.springframework.ldap.transaction.compensating.support.DefaultTempEntryRenamingStrategy
All Implemented Interfaces:
TempEntryRenamingStrategy

public class DefaultTempEntryRenamingStrategy
extends Object
implements TempEntryRenamingStrategy

Default implementation of TempEntryRenamingStrategy. This implementation simply adds "_temp" to the leftmost (least significant part) of the name. For example:

 cn=john doe, ou=company1, c=SE
 
becomes:
 cn=john doe_temp, ou=company1, c=SE
 

Note that using this strategy means that the entry remains in virtually the same location as where it originally resided. This means that searches later in the same transaction might return references to the temporary entry even though it should have been removed or rebound.

Since:
1.2
Author:
Mattias Hellborg Arthursson

Field Summary
static String DEFAULT_TEMP_SUFFIX
          The default temp entry suffix, "_temp".
 
Constructor Summary
DefaultTempEntryRenamingStrategy()
           
 
Method Summary
 Name getTemporaryName(Name originalName)
          Get a temporary name for the current entry to be renamed to.
 String getTempSuffix()
          Get the suffix that will be used for renaming temporary entries.
 void setTempSuffix(String tempSuffix)
          Set the suffix to use for renaming temporary entries.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_TEMP_SUFFIX

public static final String DEFAULT_TEMP_SUFFIX
The default temp entry suffix, "_temp".

See Also:
Constant Field Values
Constructor Detail

DefaultTempEntryRenamingStrategy

public DefaultTempEntryRenamingStrategy()
Method Detail

getTemporaryName

public Name getTemporaryName(Name originalName)
Description copied from interface: TempEntryRenamingStrategy
Get a temporary name for the current entry to be renamed to.

Specified by:
getTemporaryName in interface TempEntryRenamingStrategy
Parameters:
originalName - The original name of the entry.
Returns:
The name to which the entry should be temporarily renamed according to this strategy.

getTempSuffix

public String getTempSuffix()
Get the suffix that will be used for renaming temporary entries.

Returns:
the suffix.

setTempSuffix

public void setTempSuffix(String tempSuffix)
Set the suffix to use for renaming temporary entries. Default value is DEFAULT_TEMP_SUFFIX.

Parameters:
tempSuffix - the suffix.

Spring LDAP