- package com.oimacademy.provision;
- import java.sql.Connection;
- import java.sql.DriverManager;
- import java.sql.ResultSet;
- import java.sql.Statement;
- import java.util.ArrayList;
- import java.util.HashMap;
- import java.util.Hashtable;
- import java.util.List;
- import java.util.Map;
- import java.util.Properties;
- import oracle.iam.identity.rolemgmt.api.RoleManager;
- import oracle.iam.identity.usermgmt.api.UserManager;
- import oracle.iam.platform.OIMClient;
- import Thor.API.tcResultSet;
- import Thor.API.Operations.tcProvisioningOperationsIntf;
- import com.oimacademy.connection.Platform;
- import com.thortech.xl.util.LocalConfiguration;
- public class processFailedTasksModified
- {
- public static void main(String[] args) {
- try{
- tcProvisioningOperationsIntf provOperIntf =
- (tcProvisioningOperationsIntf) Platform.getService(Thor.API.Operations.tcProvisioningOperationsIntf.class);
- //Retry the Rejected Tasks
- //In query itself we are filtering based on osi_assigned_date attribute.
- //JDBC API starts.
- String query="select sch.sch_key,usr.usr_key, usr.usr_login, oiu.oiu_key,orc.orc_key,sch.sch_create,sch.sch_data,obj.obj_name,mil.mil_name,mil.mil_key,ost.ost_status from usr,oiu, obi, obj, orc, osi, sch, mil, tos, pkg,ost ost where usr.usr_key=oiu.usr_key and oiu.obi_key=obi.obi_key and obi.obj_key=obj.obj_key and oiu.orc_key=orc.orc_key and osi.orc_key=orc.orc_key and osi.sch_key=sch.sch_key and obj.obj_key=pkg.obj_key and pkg.pkg_key=tos.pkg_key and tos.tos_key=mil.tos_key and oiu.ost_key = ost.ost_key and obj.obj_name='OID User' and mil.mil_name ='Create User' and ost_status in ('Provisioning','Provisioned','Enabled') and sch.sch_status='R' ";
- System.out.println("-------- Oracle JDBC Connection Testing ------");
- List<String> taskKeys= new ArrayList<String>();
- try {
- Class.forName("oracle.jdbc.driver.OracleDriver");
- System.out.println("Oracle JDBC Driver Registered!");
- Connection connection = null;
- connection = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:sid", "userSchema","password");
- Statement stmt = connection.createStatement();
- stmt.execute(query);
- ResultSet rs=stmt.getResultSet();
- while ( rs.next() )
- {
- taskKeys.add(rs.getString("sch_key"));
- }
- }
- catch (ClassNotFoundException e) {
- System.out.println("Where is your Oracle JDBC Driver?");
- e.printStackTrace();
- return;
- }
- for(String taskKey : taskKeys )
- {
- System.out.println("Task retrying using API..... " + Long.parseLong(taskKey));
- try {
- provOperIntf.retryTask(Long.parseLong(taskKey));
- System.out.println("Task retrying Done.... ");
- } catch (Exception e) {
- System.out.println(" - tcAPIException - Error" + e);
- }
- }
- System.out.println("...Completed..");
- }catch (Exception e){
- e.printStackTrace();
- }
- }
- }
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.
OIM API to Retry Failed/Rejected Provisioning Tasks
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