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; import oracle.iam.request.vo.RequestData; public c

OIM Tuning

Application Module tuning is a critical setting which will affect the UI performance. Following are the recommended application module settings for OIM and these are already set out-of-box (OOB) in later releases of OIM 11g R2. Ensure that these settings are implemented as recommended in your environment. -Djbo.ampool.doampooling=true -Djbo.ampool.minavailablesize=1 -Djbo.ampool.maxavailablesize=120 -Djbo.recyclethreshold=60 - Djbo.ampool.timetolive=-1 -Djbo.load.components.lazily=true - Djbo.doconnectionpooling=true -Djbo.txn.disconnect_level=1 - Djbo.connectfailover=false -Djbo.max.cursors=5 - Doracle.jdbc.implicitStatementCacheSize=5 - Doracle.jdbc.maxCachedBufferSize=19 open DOMAIN_HOME/bin/setDomainEnv.sh file for the WebLogic Server instance.find these lines: JAVA_OPTIONS="${JAVA_OPTIONS}" export JAVA_OPTIONS and change it to: JAVA_OPTIONS="-Djbo.ampool.doampooling=true -Djbo.ampool.minavailablesize=1 -Djbo.ampool.maxavailablesize=120 -D

Creating Role through OIM API - 11gR2

package com.oim.utilities; import java.util.HashMap; import oracle.iam.identity.rolemgmt.api.RoleManager; import oracle.iam.identity.rolemgmt.api.RoleManagerConstants; import oracle.iam.identity.rolemgmt.vo.Role; import oracle.iam.platform.OIMClient; public class RoleManagement  { static RoleManager roleManager=null; static OIMClient client=null; @SuppressWarnings("null") public static void createRole(String roleName){ System.out.println("RoleManagement :: createRole :: role name is "+roleName); try  { if (roleName!=null) { HashMap<String, Object> mapAttrs = new HashMap<String, Object>();; mapAttrs.put(RoleManagerConstants.ROLE_NAME, roleName); mapAttrs.put(RoleManagerConstants.ROLE_DISPLAY_NAME,roleName); mapAttrs.put(RoleManagerConstants.ROLE_DESCRIPTION, roleName); Role role = new Role(mapAttrs); // Initialising the OIM Connection client=ClientOIM.initialise(); System.out.println("RoleManagemen