OIM Recon API for Account and Entitlement


  1. package com.oimacademy.reconciliation;
  2. import java.util.HashMap;
  3. import java.util.Map;
  4. import oracle.iam.reconciliation.api.ChangeType;
  5. import oracle.iam.reconciliation.api.EventAttributes;
  6. import oracle.iam.reconciliation.api.ReconOperationsService;
  7. import com.oimacademy.connection.Platform; 
  8. public class TestReconViaAPI {  
  9. public static void main(String[] args) {
  10.     try {
  11.             ReconOperationsService recService = Platform.getService(ReconOperationsService.class);
  12.             //Add Object Reconciliation Fields for resource Object. No Childern fields.
  13.              Map<String, Object> mapKeyValue = new HashMap<String,Object>();            
  14.             mapKeyValue.put("Account Name","TUSER3");
  15.             mapKeyValue.put("IT resource","TestITResourceName");           
  16.             mapKeyValue.put("User Name","TUSER3");             
  17.              mapKeyValue.put("Password","Welcome1"); 
  18.                 //Create Even Attribute and call createReconciliationEvent
  19.                 EventAttributes eventAttr = new EventAttributes();
  20.                 eventAttr.setEventFinished(false);  
  21.                 eventAttr.setChangeType(ChangeType.REGULAR);
  22.                 long reconEventKey = recService.createReconciliationEvent("TESTResource", mapKeyValue,eventAttr);
  23.                 System.out.println("Recon Event ID -> "+reconEventKey);
  24.                 /*********Creating Data set Up for Child Forms *******************************/             
  25.                 //Create multi valued AttributeData for Child Forms
  26.                 Map<String,Object> mapChldKeyValue = null;           
  27.                 recService.providingAllMultiAttributeData(reconEventKey, "Group Name",true);
  28.                //Add Child Form multi valued data  
  29.                 mapChldKeyValue = new HashMap<String,Object>();
  30.                 mapChldKeyValue.put("CHDLKU","fgdfg");                  
  31.                 recService.addMultiAttributeData(reconEventKey,"Group Name", mapChldKeyValue);                
  32.                 recService.finishReconciliationEvent(reconEventKey); 
  33.                 recService.processReconciliationEvent(reconEventKey);                
  34.                 //processing event
  35.                //recService.callingEndOfJobAPI();     
  36.                 System.out.println("Completed Recon Event Operation -> "+reconEventKey);                
  37.               }catch(Exception e){
  38.                   e.printStackTrace();              
  39.               }
  40.     }
  41. }

No comments:

Post a Comment