Skip to main content

Developing Scheduler with OIM 11g R2-

1.     Scheduler in OIM uses oracle.iam.scheduler.vo.TaskSupport plugin point.

2.     Write the Java code extending oracle.iam.scheduler.vo.TaskSupport.
            Code Snippet:-
package com.oracle.oim.scheduler;


import oracle.iam.platform.Platform;
import oracle.iam.provisioning.api.ApplicationInstanceService;
import oracle.iam.provisioning.vo.Account;
import oracle.iam.provisioning.vo.AccountData;
import oracle.iam.provisioning.vo.ApplicationInstance;
import oracle.iam.provisioning.vo.FormInfo;
import oracle.iam.scheduler.vo.ITResource;
import oracle.iam.scheduler.vo.ITResourceParameter;

import com.thortech.xl.dataaccess.tcDataProvider;
import Thor.API.Operations.tcITResourceInstanceOperationsIntf;
import Thor.API.Operations.tcLookupOperationsIntf;
import Thor.API.tcResultSet;
import Thor.API.tcUtilityFactory;
import oracle.iam.connectors.icfcommon.service.ProvisioningService;
import oracle.iam.identity.rolemgmt.api.RoleManager;
import oracle.iam.identity.rolemgmt.api.RoleManagerConstants;
import oracle.iam.identity.rolemgmt.vo.Role;
import oracle.iam.identity.usermgmt.api.UserManagerConstants;
import oracle.iam.identity.usermgmt.vo.User;
public class CustomDBScheduler extends oracle.iam.scheduler.vo.TaskSupport {
       private static final Logger LOGGER = Logger.getLogger(CustomDBScheduler.class.getName());
      
      
      

       public CustomDBScheduler(){
             debugLogger("CustomDBScheduler :: execute :: Instantiated ..");      
       }
       @Override
       public void execute(HashMap attr) throws Exception {
             // TODO Auto-generated method stub
             debugLogger("CustomDBScheduler :: execute :: Execute Method Started ..");
            
            
             try
             {
                    if (attr!=null)
                    {

                           debugLogger("CustomDBScheduler :: execute :: Execute method ...");
                           itResource=(String) attr.get("IT Resource");
                           debugLogger("CustomDBScheduler :: execute :: IT Resource Value is "+itResource);
                           if (itResource == null || itResource.equals(""))
                           {
                                 debugLogger("CustomDBScheduler :: execute :: IT Resource Value is Empty");
                                 return;
                           }
                           role=(String) attr.get("Role");
                           debugLogger("CustomDBScheduler :: execute :: role Value is "+role);
                           if (role == null || role.equals(""))
                           {
                                 debugLogger("CustomDBScheduler :: execute :: role Value is Empty");
                                 return;
                           }
                           appIns=(String) attr.get("App Instance");
                           debugLogger("CustomDBScheduler :: execute :: appIns Value is "+appIns);
                           if (appIns == null || appIns.equals(""))
                           {
                                 debugLogger("CustomDBScheduler :: execute :: appIns Value is Empty");
                                 return;
                           }
                           lookupName=(String) attr.get("Lookup Name");
                           debugLogger("CustomDBScheduler :: execute :: lookupName Value is "+lookupName);
                           if (lookupName == null || lookupName.equals(""))
                           {
                                 debugLogger("CustomDBScheduler :: execute :: lookupName Value is Empty");
                                 return;
                           }
                           itResMap.put("IT Resources.Name", itResource);
                          
       // Write Logic Here …..                

                    }

             }
             catch (Exception e){
                    errorLogger("CustomDBScheduler :: execute :: Exception is "+e.getMessage(),e);
                    e.printStackTrace();
             }
             finally
             {
                   
             }
       }

       @Override
       public HashMap getAttributes() {
             // TODO Auto-generated method stub
             return null;
       }

       @Override
       public void setAttributes() {
             // TODO Auto-generated method stub

       }
3.     Prepare the plugin.xml as below:
<?xml version="1.0" encoding="UTF-8"?>
<oimplugins xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<plugins pluginpoint="oracle.iam.scheduler.vo.TaskSupport">
<plugin pluginclass= "com.oracle.oim.scheduler.CustomDBScheduler" version="1.0.1" name="CustomDBScheduler">
</plugin>
</plugins>
</oimplugins>

4.     Jar the class file and put it in a lib folder.
5.     Put the Plugin.xml and lib folder in a structure as below:
<Scheduler.zip>
Plugin.xml                   lib
                           <Scheduler.jar>
6.     Zip the folder and After the zip is prepared put it into <Middleware_home>/Oracle_IDM/server/plugins  folder.

7.     Go to <Middleware_home>/Oracle_IDM/server/plugin_utility folder and change the ant.properties file.

8.     Update the wls.home, oim.home, login.config and mw.home with proper details.

9.     Run the ant -f pluginregistration.xml register command to register the plugin.

10.     Prepare the Scheduler.xml file as below:
<?xml version="1.0" encoding="UTF-8"?>
<scheduledTasks  xmlns="http://xmlns.oracle.com/oim/scheduler">
  <task>
    <name>CustomDBScheduler</name>
    <class>com.oracle.oim.scheduler.CustomDBScheduler</class>
    <description>OIM Sample Scheduled Task</description>
    <retry>5</retry>
      <parameters>
            <string-param required="true" helpText="Name of the IT Resource">IT Resource</string-param>
            <string-param required="true" encrypted="false" helpText="Name of the Role">Role</string-param>
            <string-param required="true" helpText="Name of App Instance">App Instance</string-param>
            <string-param required="true" helpText="Name of Lookup Name">Lookup Name</string-param>
        </parameters>
  </task>
</scheduledTasks>

11.     All the parameters have to be taken from scheduler need to be mentioned within <parameter> tag.

12.     After xml is prepared import the xml into metadata either through EM or wlst. Name of the xml should be same as the name of scheduler. Make sure xml is inside db folder.

13.     After It is imported in MDS login to sysadmin console and click scheduler.

14.     Create a new scheduler and from the task list select the scheduler just imported. Provide the values required and run the scheduler.

Comments

  1. Oracle Access Management Online Training
    http://www.21cssindia.com/courses/oracleaccessmanagement-online-training-5.html
    Introduction to Identity and Access Management Systems
    Introduction to Oracle Access Manager
    Installing Oracle Access Manager Identity System
    Configuring Identity System Object Classes
    Creating Derived Attributes
    Configuring Tabs, Profile Pages, and Panels
    Configuring Access Controls in Identity System
    Access System Configuration
    Configuring Policy Domains and Policies
    Configuring User Authorization
    Managing Access Servers
    Configuring Single Sign-On and Integrating with Oracle WL Single Sign-On
    If you are seeking training and support you can reach me on 91-9000444287

    ReplyDelete
  2. Oracle Access Management Online Training, ONLINE TRAINING – IT SUPPORT – CORPORATE TRAINING http://www.21cssindia.com/courses/oracleaccessmanagement-online-training-5.html The 21st Century Software Solutions of India offers one of the Largest conglomerations of Software Training, If you’re serious about a career in IT, 21st Century would like to provide you a guidance don’t hesitate to organize a free demo session. For any further information regarding the courses once go through our website Visit: http://www.21cssindia.com | Call Us +917386622889 - +919000444287 - contact@21cssindia.com

    ReplyDelete

Post a Comment

Popular posts from this blog

Adding UDF (User Defined Field) on create user page OIM 11g R2 PS1:-

    Login to Sysadmin console and create a Sandbox and activate it. Click on Form Designer and search for user form. 2.      Create a new field of desired type. 3.      Provide the Required Values for UDF creation and click save and close. UDF field will be added then publish the sand box. 4.      Login to Identity console now and create another sandbox and activate it. After sandbox is activated click on users link and the click on create user. 5.      Provide the mandatory values on the form and then click the customize button on top. Select source from the view. 6.      Select the panel where the field has to be added. Select panel form lay out click add content. Select Data component Catalog from the box. 7.      Select UserVO from the bottom. ...

Oracle Identity Cloud Service (IDCS)

   Oracle Identity Cloud Service i s the next generation comprehensive security and identity platform that is cloud-native and designed to be an integral part of the enterprise security fabric, providing modern identity for modern applications.  IDCS is a cloud-based identity management system that works by associating specific rights and restrictions with each user’s established identity. User provisioning, access control, and directory services are critical components of Oracle’s cloud-based security portfolio. Oracle Identity Cloud Service has been designed to meet the needs of organizations in a number of typical use-case scenarios, such as the cloud (allowing both on-premise and cloud resources to be secured from a single set of controls), mobile access (providing sign on for native or browser-based apps), employee-facing intranet and customer-facing extranet solutions.  Key Features: Oracle Identity Cloud Service provides the following functionali...

Setting Java in Linux

After setting Java_home and Path variable also /usr/bin/java points to the open jdk in Linux. To resolve this we need to establish the link between usr/bin/java and the new JDK installed. Run below command as root to move the java: mv /usr/bin/java /home/ After this run below command to establish the link: ln -s /usr/bin/java /<New_JAVA_HOME/bin/java>