- package com.oimacademy.NeedEvaluate;
- import java.util.Hashtable;
- import java.util.List;
- import java.util.Properties;
- import javax.security.auth.login.LoginException;
- import oracle.iam.platform.OIMClient;
- import oracle.iam.scheduler.api.SchedulerService;
- import oracle.iam.scheduler.vo.JobHistory;
- import com.thortech.xl.util.LocalConfiguration;
- public class ReadJobHistroyData {
- private static SchedulerService schedulerService = getConnection().getService(SchedulerService.class);
- private static OIMClient connectionObject = null;
- public static void main(String[] args) {
- List<JobHistory> history= schedulerService.getHistoryOfJob("Entitlement List");
- if(history != null && !history.isEmpty())
- {
- for (JobHistory jobHistory : history)
- { // Retrieving the Error Data
- System.out.println("Error Data :"+new String(jobHistory.getErrorData() != null ? jobHistory.getErrorData() : "Success".getBytes()));
- System.out.println("Status "+jobHistory.getStatus());
- System.out.println("ErrorData "+jobHistory.getErrorData());
- try
- {
- if(jobHistory.getExceptionObject()!=null){
- //Retrieving the Error Message
- Exception exp= jobHistory.getExceptionObject();
- if(exp != null)
- {
- System.out.println("Exception Message :"+exp.getMessage());
- }
- }
- } catch (Exception e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
- }
- }
- private static OIMClient connection() {
- System.out.println("Startup...");
- System.out.println("Getting configuration...");
- Hashtable env = new Hashtable();
- env.put("java.naming.provider.url", "t3://localhost:14001");
- env.put("java.naming.factory.initial", "weblogic.jndi.WLInitialContextFactory");
- System.setProperty("java.security.auth.login.config", "/config/authwl.conf"); //Update path of authwl.conf file according to your environment
- System.setProperty("OIM.AppServerType", "wls");
- System.setProperty("APPSERVER_TYPE", "wls");
- OIMClient localConnection = new OIMClient(env);
- try {
- localConnection.login("xelsysadm", "Welcome1");
- } catch (LoginException e) { // TODO Auto-generated catch block
- e.printStackTrace();
- }
- Properties props = LocalConfiguration.getLocalCoreServerConfiguration();
- System.out.println(props.toString());
- return localConnection;
- }
- public static synchronized OIMClient getConnection() {
- if (connectionObject == null) {
- connectionObject = connection();
- }
- return connectionObject;
- }
- public static void closeConnection() {
- connectionObject.logout();
- }
- public static Hashtable getEnvironment(){
- Hashtable env = new Hashtable();
- env.put(OIMClient.JAVA_NAMING_PROVIDER_URL, "t3://localhost:1401");
- env.put(OIMClient.JAVA_NAMING_FACTORY_INITIAL, "weblogic.jndi.WLInitialContextFactory");
- return env;
- }
- }
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 read History Data of Job
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