如何使用oim 11g客户端api以编程方式获取配置资源

时间:2011-12-26 18:08:26

标签: oracle oracle11g identity identity-management oim

我正在使用oracle OIM 11g api(在oracle.iam包中)。我使用类oracle.iam.platform.OIMClient来获取所有OIM客户端服务,如UserManager。

我需要找到配置工作流程获得的资源。我可以使用哪种服务?我该如何处理OIM api?

1 个答案:

答案 0 :(得分:3)

以下方法应将所有资源导出到XML文件中 -

public Boolean export() {
    Boolean result = true;
    String export_object="Resource";
    try {
       FileWriter fstream = new FileWriter("OIMResources.xml");
       BufferedWriter out = new BufferedWriter(fstream);
       tcExportOperationsIntf moExportUtility = (tcExportOperationsIntf) ioUtilityFactory.getUtility("Thor.API.Operations.tcExportOperationsIntf");
       Collection<RootObject> lstObjects = moExportUtility.findObjects(export_object, "*");
       System.out.println(lstObjects);
       lstObjects.addAll(moExportUtility.getDependencies(lstObjects));
       lstObjects.addAll(moExportUtility.retrieveChildren(lstObjects));
       lstObjects.addAll(moExportUtility.retrieveDependencyTree(lstObjects));
       String s = moExportUtility.getExportXML(lstObjects, "*");    
       out.write(s);
       LOG.info(Resource + "Objects successfully exported");
       out.close();
   } catch (Exception e) {
        LOG.log(Level.SEVERE, "Exception occured while exporting OIM object" + Resource, e);
     }
   return result;
 }