Previous Topic: Handling DN ConversionNext Topic: Example: Implementing doModifyRnAssocs


How You Rename the Object

Implementing the optional rename operation (passed in as an LDAP MODIFYRN request) involves extending AbstractAttributeStyleOpProcessor and implementing the following method:

implementing AttributeStyle  
   public void doModifyRn(ObjectInfo objInfo, final Rdn newRdn) 
            throws NamingException 

This operation renames the object identified by objInfo to the new name newRn. ObjInfo.getObjectClassMapping().getConnectorClassName() specifies the type of object being renamed. The old object name is objInfo.getName() and the new object name is newRn.

To perform the equivalent of a rename operation, modify the appropriate endpoint objects. If your endpoint does not support a rename operation, simulate the behavior by doing the following:

  1. Call doLookup to retrieve the existing attributes.
  2. Call doAdd to create an object with the new name.
  3. Call doDelete to remove the old object.

If your endpoint does not support renaming objects, write you connector so that it raises an LdapNotImplementedException.

The JDBC connector supports both the direct rename operation and the simulated rename which involves delete and add operations. In this case the MD_IS_RENAME_VIA_DELETE_ADD (“isRenameViaDeleteAdd”) metadata is used to signify which rename style is requested per class.