Problem calling custom method with parameters from operation bindings

book

Article ID: 130297

calendar_today

Updated On:

Products

CA Identity Manager CA Identity Governance CA Identity Portal

Issue/Introduction

Problems are encountered when using an LDAP connector defined in CA Identity Manager Connector Xpress to call an external method by using operation bindings.

Example:

A java class with an empty constructor ActiveDirectoryExecutor and a simple method adModifyAssocs with an ObjectInfo object as input:

package com.ingdirect.iam.ActiveDirectoryConnector; 

import com.ca.jcs.ObjectInfo; 

public class ActiveDirectoryExecutor { 

public ActiveDirectoryExecutor(){ 
}; 

public void adModifyAssocs(ObjectInfo objInfo) { 
String adCorporateKey = objInfo.getName(); 
System.out.println("[ActiveDirectoryExecutor] [adModify] In adModify method. User: " + adCorporateKey); 



I have generated the jar with my java classes and loaded it on the connector server in the \Connector Server\lib\ext folder. In the same folder I've loaded tbe jcs.jar which contains the class com.ca.jcs.ObjectInfo. 

In the connector created by using the Connector Xpress I have defined a script for my operation binding in which I import the package and I defined the insteadOfModifyAssocs function that have to be executed 

importPackage(com.ingdirect.iam.ActiveDirectoryConnector) 

function insteadOfModifyAssocs(objInfo, modItems, context) { 
debug("ing","[ing] [LDAP] [----------------------------------------INSTEAD_OF_MODIFY_ASSOCIATIONS----------------------------------------]"); 
debug("ing","[ing] [LDAP] [modifyAssocs] [objInfo] " + objInfo); 
debug("ing","[ing] [LDAP] [modifyAssocs] [objInfo] [getName] " + objInfo.getName()); 

var adExecutor = new ActiveDirectoryExecutor(); 
adExecutor.adModifyAssocs(objInfo); 


After generating the the jar with the java classes and loading it on the connector server in the "\Connector Server\lib\ext" folder. (The same folder contains the jcs.jar which contains the class com.ca.jcs.ObjectInfo).   In the connector (created using a Connector Xpress), a script has been defined for the operation binding in which the package has been imported and a function has been defined "insteadOfModifyAssocs" function that have to be executed

importPackage(com.ingdirect.iam.ActiveDirectoryConnector) 

function insteadOfModifyAssocs(objInfo, modItems, context) { 
debug("ing","[ing] [LDAP] [----------------------------------------INSTEAD_OF_MODIFY_ASSOCIATIONS----------------------------------------]"); 
debug("ing","[ing] [LDAP] [modifyAssocs] [objInfo] " + objInfo); 
debug("ing","[ing] [LDAP] [modifyAssocs] [objInfo] [getName] " + objInfo.getName()); 

var adExecutor = new ActiveDirectoryExecutor(); 
adExecutor.adModifyAssocs(objInfo); 


When performing a test from the Provisioning Server the following error is returned from the specified method

com.ingdirect.iam.ActiveDirectoryConnector.ActiveDirectoryExecutor.adModifyAssocs(com.ca.jcs.ObjectInfo) has been not found :ETA_E_0083, Account for Global User 'david' on DYN Endpoint 'agent' update failed: Connector Server Modify failed: code 80 (OTHER-LdapConfigurationException): failed to modify entry: eTDYNAccountName=HR11UD,eTDYNContainerName=Test Accounts,eTDYNContainerName=Accounts,eTDYNDirectoryName=agent,eTNamespaceName=LDAPTEST,dc=COMPANY,dc=etasa: [email protected]: failed executing script for OpBinding: connector-speak objectClass=organization|organizationalUnit|groupOfNames|groupOfUniqueNames|group|user, operation=MODIFY_ASSOCS, timing=OP [scriptFunction: parentScriptName=GlobalScript, function=insteadOfModifyAssocs]: com.ca.jcs.processor.script.ScriptPool: failed invoking function 'insteadOfModifyAssocs': Can't find method com.ingdirect.iam.ActiveDirectoryConnector.ActiveDirectoryExecutor.adModifyAssocs(com.ca.jcs.ObjectInfo). (line 144 in eTOpBindings value [line 144 into script which starts at line 1]) (ldaps://idm.company.it:20411)

Modifying the input   method, by replacing the ObjectInfo with a String object it works fine, but "  AssocModificationItem" as input does not.

Cause

CA IM does not support this method (calling external java class with connector class Object as input parameter).

Environment

CA Identity Manager 12.6.x

Resolution

Unfortunately we do not support this method (calling external java class with connector class Object as input parameter).  Please find alternative approaches.

Additional Information

Possible methods that can be scripted to extract all the possible data from the ObjectInfo and ModificationItem objects (below).

ObjectInfo:

   objInfo.getName()
   objInfo.getObjectClassMapping().getConnectorClassName()  
   objInfo.getContainerName()
   
   there are few set methods also
   
 ModificationItem  :

you can print all list of attribute in this array of object(like below)
        
    for (i = 0; i < modItems.length; i++)
        {
            var     modItem = modItems[i];
            var     attribute = modItem.getAttribute();     
            connector.logger.debug("modItem=" + modItem);
            connector.logger.debug("attribute=" + attribute.getID().toString() + " , Value = " + attribute.get().toString());
     }