Previous Topic: Rename Operation TestingNext Topic: Example: Implementing doMoveAssocs


How You Move the Object

Implementing the optional move operation (passed in as an LDAP MOVE request), involves extending AbstractAttributeStyleOpProcessor and implementing the following methods:

implementing AttributeStyle  
   public void doMove(ObjectInfo objInfo,
            Name newParentName)
            throws NamingException
    public void doMove(ObjectInfo objInfo,
            Name newParentName,
            Rdn newRdn)
            throws NamingException

Both operations move the object identified by objInfo so it now has a new parent, with the second flavor also changing its name at the same time. indicated by

The objInfo.getObjectClassMapping().getConnectorClassName() method indicates the type of object being renamed. The old object DN is objInfo.getConnectorDN() and the new object name is constructed using newParentName combined with either newRdn or the object's existing RDN.

Modify the appropriate endpoint objects to perform the equivalent of the move operation. If your endpoint does not support a move operation, simulate the behavior by following these steps:

  1. Call doLookup to retrieve the existing attributes.
  2. Call doAdd to create an object under the specified parent (with either the same name or a new name depending on which doMove() variant was called).
  3. Call doDelete to remove the old object.

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

Note: As of CA IdentityMinder SP6, you do not need to code OpProcessor.doMove(ObjectInfo objInfo, Name newParentName) as this method is no longer called. Calling this method is equivalent to calling OpProcessor.doMove(ObjectInfo objInfo, Name newParentName, Rdn newRdn) where the last argument is null.