Develop the Scheduled Task Class

6-4 Oracle Fusion Middleware Developers Guide for Oracle Identity Manager 2. Create a JAR file for the Java class that you created. Name the JAR such that you can readily associate this JAR with your custom scheduled task. The JAR file can contain the dependent classes of the Java class. You can also create a separate JAR file for the dependent classes and place it in the libdirectory. 3. Copy the JAR file into the lib directory. 4. Repeat Steps 1 through 3 for every Java class that you want to create.

6.5 Configure the Plug-in XML File

You must configure the plugin.xml file in order to declare the scheduled task as a plug-in. See Chapter 7, Developing Plug-ins for more information about plug-ins. To configure the plugin.xml file: 1. Create the plugin.xml file by using any text editor. 2. Specify the plug-in point for the scheduled task by changing the value of the pluginpoint attribute of the plugins element to oracle.iam.scheduler.vo.TaskSupport. The following XML code block from the plugin.xml file shows the value entered within the plugins element: plugins pluginpoint=oracle.iam.scheduler.vo.TaskSupport

3. Add a plugin element for each scheduled task that you are adding.

To specify the class that implements the plug-in in this case, the scheduled task, change the value of the pluginclass attribute of the plugin element to the name of the Java class that implements the scheduled task. The following XML code block from the plugin.xml file shows sample values entered within the plugin element: plugin pluginclass= oracle.iam.scheduler.TestScheduler version=1.0.1 name=scheduler element After modification, the plugin.xml file looks similar to the following: ?xml version=1.0 encoding=UTF-8? oimplugins xmlns:xsi=http:www.w3.org2001XMLSchema-instance plugins pluginpoint=oracle.iam.scheduler.vo.TaskSupport Note: Oracle recommends creating one plugin.xml file for one scheduled task. This is because when the plugin is unregistered, the corresponding package is deleted. Note: Create the plugin.xml file only if no such file exists. If there are existing plugins, then add a new plugin element for the new plugin. Note: For scheduled tasks, the plugins elment remains the same for all scheduled tasks. Developing Scheduled Tasks 6-5 plugin pluginclass= oracle.iam.scheduler.TestScheduler version=1.0.1 name=scheduler element plugin plugins oimplugins 4. Save and close the plugin.xml file.

6.6 Create the Directory Structure for the Scheduled Task

The final step in configuring the scheduled task is to create a plugin.zip file with the directory structure specified in Example 6–2 . In this example, a single plug-in is being added, but there can be multiple pugins in the plugin.zip file. Scheduler requires that files be zipped in a particular structure and named according to a particular naming convention. This ensures that Oracle Identity Manager identifies the custom scheduled tasks and makes it available in Oracle Identity Manager Administrative and User Console while creating jobs Example 6–2 Directory Structure for the Scheduled Task plugin plugin.xml lib CLASS_NAME1.jar Note that: ■ The XML file for the plug-in must be named plugin.xml. ■ The lib directory must contain only .JAR files. The lib directory consists of JAR files that contains the classes implementing the plug-in logic and the dependent library JAR files. In most instances, this directory consists of a single JAR file with the implementation of all the plug-ins that are specified in plugin.xml. See Developing Plug-ins on page 7-5 for for information about the directory structure. ■ The directory for the scheduled task must contain the following files: – XML for the plug-in – JAR files ■ There is one plugin.zip file for all the plug-ins that you create. In the preceding example, CLASS_NAME.JAR is the JAR file that you create in Section 6.4, Develop the Scheduled Task Class . After you create the plugin.zip file, if deploying in a clustered environment, register the plug-in to the database by using appropriate APIs. See Registering and Unregistering Plug-ins By Using APIs on page 7-6 for details about registering plug-ins to Oracle Identity Manager by using APIs. Note: The XML for the plug-in must be named plugin.xml. Ensure that the lib directory contains only JAR files.