Previous Topic: How Metadata Is UsedNext Topic: Association Modeling


Association Related Code

At runtime, associations are encapsulated in instances of the com.ca.jcs.assoc.Association class and managed by attribute-style processors deriving from either DefaultAssocDirectAttributeOpProcessor or implementing AssocIndirectAttributeOpProcessor.

The DefaultAssocDirectAttributeOpProcessor can provide reverse association logic to you for free. The direct case is more amenable to a reusable default implementation. Therefore, consider carefully which class to use as the basis for your connector’s attribute-style processor.

The AssocAttributeOpProcessorProxy can be used to provide default reverse association handling for connectors which use direct associations. The connector triggers the proxy when the connector returns true from its isAutoDirectAssocRequired() method. This defaults to ! isIndirectAssociations()), where the getAutoDirectAssocExlusions() method can also be overridden to name operations you want to exempt from this processing, if necessary.

Its full source file is bundled with the SDK and provides a reference for the appropriate preprocessing and postprocessing required to handle associations around each type of operation and LDAP request.

The reverse association handling service offered by the CA IAM CS covers all LDAP operations, not just computing values when querying. For example, if group.members is the value persistently stored on the endpoint, then the account.memberOf value can be automatically calculated for you by the CA IAM CS framework. In this case, creating a new account and providing memberOf values will have the side-effect of adding the new account to all the named groups automatically. Renaming and account will cause the member list for all groups referencing to be automatically updated to its new name.

If you want to use this service, but want to exclude certain LDAP operations, (for example, because they are performed asynchronously by the endpoint) then you need to override the com.ca.jcs.BaseConnector.getAutoDirectAssocExlusions() to specify exclusions for the methods listed below.

Then either leave it to endpoint logic to tidy up dangling references as required, or customize the matching association methods in your attribute style processor to handle the special requirements of your endpoint for the following example:

import com.ca.jcs.processor.OpProcessor.MethodName
importcom.ca.jcs.processor.OpProcessor.MethodName
publicHashSet<MethodName>getAutoDirectAssocExlusions()
{
	final HashSet<MethodName>exclusions=newHashSet<MethodName>(1);
	exclusions.add(MethodName.doDelete);
	exclsions.add(MethodName.doModifyRn);
	exclusions.add(MethodName.doMove);
	return exclusions;

These methods for the previous example would be: