Pages

Tuesday, June 26, 2012

tcLookupOperationsIntf Interface API Example

The tcLookupOperationsIntf inteface API being used to create, update, and remove the Lookup Definition to the Oracle Identity Manager repository.

Pre-Requisite:


Initial Setup.


Please follow the link and setup the OIM client environment to use to create the OIM Objects.

Client Code Setup

tcLookupOperationsIntf API Usage:

The following tasks needs to be performed to add, update, and delete the Lookup Definition to the Oracle Identity Manager. They are

1.    Create the OIMClient Handle

OIMClient client= new OIMClient();
client.login(username,password.toCharArray());

 

2.    Get tcSchedulerOperationsIntf service object

tcLookupOperationsIntf lookup= client.getService(tcLookupOperationsIntf.class);

 

3.    Adding Lookup Definition

String lookupName = "Lookup.Test Lookup";
lookup.addLookupCode(lookupName);

 

4.    Adding Lookup Value to Lookup Definition

String lookupCode="basedn";
String lookupValue="dc=test,dc=com";
lookup.addLookupValue(lookupName,LookupCode,lookupValue,"","");

 

5.    Updating the Lookup Value to the Lookup Definition

lookupCode="basedn";
lookupValue="ou=people,dc=test,dc=com";
Map<String, String> updateMap= new HashMap<String, String>();
updateMap.put("Lookup Definition.Lookup Code Information.Code Key", lookupCode);
updateMap.put("Lookup Definition.Lookup Code Information.Decode",lookupValue );
lookup.updateLookupValue(lookupName, lookupCode, updateMap);

 

6.    Deleting the Lookup Code from The Lookup Definition

lookup.removeLookupValue(lookupName,lookupCode);

 

7.    Getting the Lookup Definition Values

Map<String,String> lookupPairs= new HashMap<String,String>();
tcResultSet rs= lookup.getLookupValues(lookupName);
int count=rs.getRowCount();
if(count >0)
{
    For(int i=0;i<count;i++)
   {
       lookupPairs.put(rs.getStringValue("Lookup Definition.Lookup Code Information.Code Key"),rs.getStringValue("Lookup Definition.Lookup Code Information.Decode"));  
   }
}

 

8.    Removing the Lookup Definition

lookup.removeLookupCode(lookupName);

7 comments:

  1. -register-to-was-server:

    -register-to-wls-server:
    [java] Java Result: 1
    [delete] Deleting: C:\Oracle\Middleware\Oracle_IDM1\server\plugin_utility\20131216164145.tmp
    [echo] Exception in thread "Main Thread" java.lang.NoClassDefFoundError: oracle/iam/platformservi
    ce/utils/PluginUtility
    [echo] Caused by: java.lang.ClassNotFoundException: oracle.iam.platformservice.utils.PluginUtilit
    y
    [echo] at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    [echo] at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    [echo] at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    [echo] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
    [echo] at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
    [echo] Could not find the main class: oracle.iam.platformservice.utils.PluginUtility. Program wi
    ll exit.
    [echo]

    BUILD SUCCESSFUL

    ReplyDelete
    Replies
    1. Hi
      1. Go to WebLogic Domain directory c:\Oracle\Middleware\user_projects\domains\yourdomain\bin\
      2. run the setSOADomainEnv.bat file.
      3. run the build script.
      Please let me know if you have any issues.

      Delete
  2. Hi Sir,

    I want to get security questions which the user had set during his first login. I am able to get security questions using tclookupoperationsintf but I am not sure how to get it for particular userlogin. Can you help me out.

    Thanks & Regards,
    Sumanth A Raichur

    ReplyDelete
    Replies
    1. Hi Sumanth.

      You can look the user configured security question and answer in tcUserOperationsIntf interface. Using this interface you can retrieve the user secret question answers. Method : getChallengeValuesForUser(long userKey).

      Delete
  3. Hi nice post helps lot to retrieve specific lookup values. What if we want all lookup's present in OIM.
    Please help on this.

    ReplyDelete
  4. HI,
    I want to write java code from which i want decoded value from lookup table for the specific domain name..

    ReplyDelete
  5. how could i do that? how could i make connection with lookup to get that value.

    ReplyDelete