Pages

Tuesday, July 17, 2012

PlatformUtilsService API Example

The PlatformUtilsService inteface API being used to purge the cache,Upload Jar Files,Update Jar Files, DownLoad Jar Files, and Delete Jar Files in the OIM Server.

Pre-Requisite:


Initial Setup.

Please follow the link and setup the OIM client environment to use to create the OIM Objects.

Client Code Setup

Note: Update, download and delete Jar file functions will only work in the Oracle Identity Manager Local Server instance. Please execute the PlatformUtilsService methods in the Oracle Identity Manager local instance.

PlatformUtilsService API Usage:

The following tasks needs to be performed to purge the cache in the  Oracle Identity Manager Server. They are

1.    Create the OIMClient Handle


OIMClient client= new OIMClient();
client.login(username,password.toCharArray());

2.    Get PlatformUtilsService service object


PlatformUtilsService service= client.getService(PlatformUtilsService.class);

3.   Purge the Cache All

service.purgeCache("All");

4.   Building Upload Jar Set Elements Objects

The following type of jar files you can upload to the OIM Server. They are

4.1 JavaTasks

Set<JarElement> jarElements= new HashSet<JarElement>();

JarElement javatask= new  JarElement();
javatask.setType("JavaTasks");
javatask.setPath("Aboslute path of the FileName.jar");
javatask.setName("FileName.jar");
jarElements.add(javatask);


4.2 ThirdParty

JarElement thirdparty= new  JarElement();
thirdparty.setType("ThirdParty");
thirdparty.setPath("Aboslute path of the FileName.jar");
thirdparty.setName("FileName.jar");
jarElements.add(thirdparty);

4.3 ScheduleTask

JarElement scheduletask= new  JarElement();
scheduletask.setType("ScheduleTask");
scheduletask.setPath("Aboslute path of the FileName.jar");
scheduletask.setName("FileName.jar");
jarElements.add(scheduletask);
 

5.   Upload Jar to the OIM Server

service.uploadJars(jarElements); 

6.   Building Updated Jar Set Elements Objects

The following type of jar files you can update to the OIM Server. They are

6.1 JavaTasks

Set<JarElement> updateElements= new HashSet<JarElement>();

JarElement ujavatask= new  JarElement();
ujavatask.setType("JavaTasks");
ujavatask.setPath("Aboslute path of the FileName.jar");
ujavatask.setName("FileName.jar");
updateElements.add(ujavatask);


6.2 ThirdParty

JarElement uthirdparty= new  JarElement();
uthirdparty.setType("ThirdParty");
uthirdparty.setPath("Aboslute path of the FileName.jar");
uthirdparty.setName("FileName.jar");
updateElements.add(uthirdparty);

6.3 ScheduleTask

JarElement uscheduletask= new  JarElement();
uscheduletask.setType("ScheduleTask");
uscheduletask.setPath("Aboslute path of the FileName.jar");
uscheduletask.setName("FileName.jar");
updateElements.add(uscheduletask);
 

7.   Update Jar to the OIM Server

service.updateJars(updateElements); 

 

8.   Building Downloaded Jar Set Elements Objects

The following type of jar files you can update to the OIM Server. They are

8.1 JavaTasks

Set<JarElement> downloadElements= new HashSet<JarElement>();

JarElement dljavatask= new  JarElement();
dljavatask.setType("JavaTasks");
dljavatask.setPath("Dowload Directory");
dljavatask.setName("FileName.jar");
downloadElements.add(dljavatask);


8.2 ThirdParty

JarElement dlthirdparty= new  JarElement();
dlthirdparty.setType("ThirdParty");
dlthirdparty.setPath("Dowload Directory");
dlthirdparty.setName("FileName.jar");
downloadElements.add(dlthirdparty);

8.3 ScheduleTask

JarElement dlscheduletask= new  JarElement();
dlscheduletask.setType("ScheduleTask");
dlscheduletask.setPath("Dowload Directory");
dlscheduletask.setName("FileName.jar");
downloadElements.add(dlscheduletask);
 

9.   Download Jars from the OIM Server

service.downloadJars(downloadElements); 


10.   Building Delete Jar Set Elements Objects

The following type of jar files you can update to the OIM Server. They are

10.1 JavaTasks

Set<JarElement> deleteElements= new HashSet<JarElement>();

JarElement deljavatask= new  JarElement();
deljavatask.setType("JavaTasks");
deljavatask.setName("FileName.jar"); deleteElements.add(dljavatask);


10.2 ThirdParty

JarElement delthirdparty= new  JarElement();
dlthirdparty.setType("ThirdParty");
dlthirdparty.setName("FileName.jar");
deleteElements.add(dlthirdparty);

10.3 ScheduleTask

JarElement delscheduletask= new  JarElement();
delscheduletask.setType("ScheduleTask");
delscheduletask.setName("FileName.jar"); delscheduletask.add(dlscheduletask);
 

11.   Delete Jars from the OIM Server

service.deleteJars(deleteElements); 



12.   Verifying Jars Files Updated in the OIM Schema

Login to the OIM data base instance and verify the uploaded or updated jar files are available in the OIMHOME_JARS table. If your jar files are available, upload and update functions are working as expected.




13.   ERRORS

Please follow the url and you will see the few common errors related to the  PlatformUtilsService API executing the Upload, Update, and Download Jar files from the OIM Server.


 Common Errors


 

No comments:

Post a Comment