class DefaultTempEntryRenamingStrategy implements
        TempEntryRenamingStrategy {

    public Name getTemporaryName(Name originalName) {
        LdapName temporaryName = LdapUtils.newLdapName(originalName);

        // Add tempSuffix to the leaf node name.
        try {
            String leafNode = (String) temporaryName.remove(temporaryName.size() - 1);
            temporaryName.add(new Rdn(leafNode  + tempSuffix));
        } catch (InvalidNameException e) {
            throw new org.springframework.ldap.InvalidNameException(e);
        }

        return temporaryName;
    }

}