Previous Topic: How You Rename the ObjectNext Topic: Example: Calling doModifyRnAssocs()inside doModifyRn()


Example: Implementing doModifyRnAssocs

The following is an example of implementing doModifyRnAssocs:

    public void doModifyRnAssocs(final ObjectInfo objInfo, final Rdn newRn, final Object context) throws NamingException
    {
        final Name      connDn = objInfo.getConnectorDn();
        final Name      newName = connDn.getPrefix(connDn.size() - 1);

        newName.add(newRn.toString());
        doAssocUpdateReferencesTo(objInfo, newName, connector);
    }

This code contains the following formats:

objInfo

Specifies the object that is modified or deleted.

newRnValue

New relative name (RN) for object, "namingAttr=newName".

context

Optional field which can provide additional context for the requested updates. For example, transactional connectors can require want the updates of the associative relationships to occur within a larger transaction.

The com.ca.jcs.assoc.DefaultAssocDirectAttributeOpProcessor.doAssocUpdateReferencesTo() method constructs the search filter and invokes the doSearch method of this connector’s attribute-style processor to retrieve all objects referencing the target object renamed, through associations. For example, Groups referencing an Account which is being renamed. The method then constructs a modification item for each and invokes the doModify() method to update the associative attributes on any impacted referencing objects. For example, the member attribute on each Group that references the renamed Account.