- package com.oimacademy.reconciliation;
- import java.sql.Connection;
- import java.sql.ResultSet;
- import java.sql.SQLException;
- import java.sql.Statement;
- import java.util.ArrayList;
- import java.util.HashMap;
- import java.util.List;
- import java.util.Map;
- import oracle.iam.reconciliation.api.ChangeType;
- import oracle.iam.reconciliation.api.EventAttributes;
- import oracle.iam.reconciliation.api.ReconOperationsService;
- import com.oimacademy.connection.DataSource;
- import com.oimacademy.connection.Platform;
- public class BulkProvisioningEntitlementsViaReconciliation {
- public static void main(String[] args) {
- try {
- List list =getLookupCodes("1629");
- ReconOperationsService recService = Platform.getService(ReconOperationsService.class);
- //Add Object Reconciliation Fields for resource Object. No Childern fields.
- Map<String, Object> mapKeyValue = new HashMap<String,Object>();
- //For Dummy Connector
- /* mapKeyValue.put("USR_LOGIN","USER"+i);
- mapKeyValue.put("ACCOUNT_NAME","USER Account");
- mapKeyValue.put("IT Resource","dummyITResName"); */
- //For DBUM Connector // You can get below details from Design Console -> Connector Resource Object.
- // Need to add all mandatory attributes as defined in Connector Resource Object
- mapKeyValue.put("IT Resource Name","Oracle DB"); // IT Resource Name
- mapKeyValue.put("User Name","TUSER"); // To Which user need to provision entitlements
- mapKeyValue.put("Password","Welcome1");
- mapKeyValue.put("Authentication Type","PASSWORD");
- mapKeyValue.put("Account Status","OPEN");
- mapKeyValue.put("Reference ID","TUSER");
- //Create Even Attribute and call createReconciliationEvent
- EventAttributes eventAttr = new EventAttributes();
- eventAttr.setEventFinished(false);
- eventAttr.setChangeType(ChangeType.CHANGELOG);
- //long reconEventKey = recService.createReconciliationEvent("dummy", mapKeyValue,eventAttr);
- long reconEventKey = recService.createReconciliationEvent("Oracle DB User", mapKeyValue,eventAttr);
- System.out.println("Recon Event ID -> "+reconEventKey);
- /*********Creating Data set Up for Child Forms *******************************/
- //Create multi valued AttributeData for Child Forms
- Map<String,Object> mapChldKeyValue = null;
- //DBUM Connector
- recService.providingAllMultiAttributeData(reconEventKey, "Privilege List",true);
- //Add Child Form multi valued data
- for(int j=0; j<list.size();j++){
- mapChldKeyValue = new HashMap<String,Object>();
- mapChldKeyValue.put("Privilege Name",list.get(j));
- // mapChldKeyValue.put("Privilege Name","4~CREATE PROFILE");
- mapChldKeyValue.put("Privilege Admin Option","");
- recService.addMultiAttributeData(reconEventKey,"Privilege List", mapChldKeyValue);
- System.out.println(" Added into Recon Service with loop value -> "+j);
- }
- recService.finishReconciliationEvent(reconEventKey);
- recService.processReconciliationEvent(reconEventKey);
- //processing event
- System.out.println("Completed Recon Event Operation -> "+reconEventKey);
- }catch(Exception e){
- e.printStackTrace();
- }
- }
- // Method to get Entitlements From LKV table. Need to pass LKU_KEY
- public static List getLookupCodes(String lkuKey){
- List list = new ArrayList();
- Connection con = DataSource.getConnection();
- try {
- Statement stmt = con.createStatement();
- String query ="select * from LKV where lku_key="+lkuKey;
- ResultSet rs = stmt.executeQuery(query);
- while (rs.next()) {
- list.add(rs.getString("lkv_encoded"));
- }
- } catch (SQLException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- System.out.println("Size"+ list.size());
- return list;
- }
- }
Oracle Identity Manager(OIM) is the Provisioning Solution from oracle. This page contains an index with references to all OIM related posts in the oracle identity manager Academy blog. The posts included herein are intended to provide oracle identity management customers and developers with technical information about best practices for implementing OIM based solutions.
Bulk Provisioning Entitlements Via Reconciliation process for DBUM Connector
Subscribe to:
Post Comments (Atom)
-
Connection Related API's : OIM DB Connection/ Data Source connection OIMClient API / OIMConnection API OIM Platform API to getSer...
-
Error : Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory at org.springframewor...
-
In this post, we set the middle name as “MiddleName” if user does not provide middle name during user create operation. Below are high...
No comments:
Post a Comment