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

Developing Prepopulate Adapter with OIM 11g R2

1.      Prepopulate Adapter in OIM uses the plugin point oracle.iam.request.plugins.PrePopulationAdapte r. 2.      Write the Java code which returns the value which has to be populated on the form. 3.      This code will implement the plugin point oracle.iam.request.plugins.PrePopulationAdapte r. Code Snippet: - package com.oracle.oim.utility.eventhandler; import java.io.Serializable; import java.util.Iterator; import java.util.List; import java.util.logging.Logger; import oracle.iam.identity.exception.NoSuchUserException; import oracle.iam.identity.exception.UserLookupException; import oracle.iam.identity.usermgmt.api.UserManager; import oracle.iam.identity.usermgmt.vo.User; import oracle.iam.platform.Platform; import oracle.iam.platform.authz.exception.AccessDeniedException; import oracle.iam.request.exception.RequestServiceException; import oracle.iam.request.vo.Beneficiary; ...

Custom Login Page Protection- OAM 11g R2

Create a login page with fields having username,password and requestid. Below is the sample login page : <%@page language="java" session="true" contentType="text/html;charset=ISO-8859-1"  %> <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request. getServerPort()+path+"/"; String requestID = request.getParameter("request_id"); %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <font color="blue">Login Page </font><br><br> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>Implementing css and javascript</title> <meta http-equi...

Oracle Traffic Director (OTD) configuration

Download the OTD software and install it on a server by running runInstaller command from <Binaries>/Disk1. Preferred is to configure the OTD as root user because when the administration server is configured as root, then Oracle Traffic Director starts the keepalived daemon automatically when you start instances that are part of a failover group, and stops the daemon when you stop the instances. Set Oracle_Home as the new Installed OTD Home. Run below command to configure the Admin server: <OTD_HOME>/otd/bin/tadm configure-server --port=8989 --user=admin --server-user=root --instance- home= <OTD_HOME> /otd/instance_name/otd_instance1 This command will ask for admin password and will create the admin server. Run Below command to start the admin server: <OTD_HOME> /otd/instance_name/otd_instance1/admin-server/bin/startserv Login to the OTD console on http://<host>:8989 as admin user.  Click New configuration: Click Next and create ne...