- package com.oimacademy.provision;
- import java.util.ArrayList;
- import java.util.Calendar;
- import java.util.List;
- import javax.xml.registry.InvalidRequestException;
- import com.oimacademy.connection.Platform;
- import oracle.iam.platform.utils.vo.OIMType;
- import oracle.iam.request.api.RequestService;
- import oracle.iam.request.exception.BulkBeneficiariesAddException;
- import oracle.iam.request.exception.BulkEntitiesAddException;
- import oracle.iam.request.exception.InvalidRequestDataException;
- import oracle.iam.request.exception.RequestServiceException;
- import oracle.iam.request.vo.Beneficiary;
- import oracle.iam.request.vo.RequestBeneficiaryEntity;
- import oracle.iam.request.vo.RequestBeneficiaryEntityAttribute;
- import oracle.iam.request.vo.RequestConstants;
- import oracle.iam.request.vo.RequestData;
- public class EntitlementRequest {
- public long createRevokeEntitlementRequest(RequestService reqSvc) throws InvalidRequestException, InvalidRequestDataException, RequestServiceException, BulkBeneficiariesAddException, BulkEntitiesAddException, oracle.iam.request.exception.InvalidRequestException{
- long requestKey=0;
- RequestData reqData = new RequestData();
- List<Beneficiary> benList = new ArrayList<Beneficiary>();
- RequestBeneficiaryEntity reqBenEnt = new RequestBeneficiaryEntity();
- reqBenEnt.setRequestEntityType(OIMType.Entitlement);
- reqBenEnt.setEntitySubType("148"); //ENT_LIST_KEY
- reqBenEnt.setOperation(RequestConstants.MODEL_REVOKE_ENTITLEMENT_OPERATION);
- reqBenEnt.setEntityKey("27"); //ENT_ASSIGN_KEY
- RequestBeneficiaryEntityAttribute reqBenEntAttr = new RequestBeneficiaryEntityAttribute();
- reqBenEntAttr.setName("ParentAccountId");
- reqBenEntAttr.setType(RequestBeneficiaryEntityAttribute.TYPE.String);
- reqBenEntAttr.setValue("167"); //OIU_KEY
- List<RequestBeneficiaryEntityAttribute> reqBenEntAttrList = new ArrayList();
- reqBenEntAttrList.add(reqBenEntAttr);
- reqBenEnt.setEntityData(reqBenEntAttrList);
- List<RequestBeneficiaryEntity> reqBenEntList = new ArrayList();
- reqBenEntList.add(reqBenEnt);
- Beneficiary ben = new Beneficiary("User","107");
- ben.setTargetEntities(reqBenEntList);
- benList.add(ben);
- reqData.setBeneficiaries(benList);
- reqData.setJustification("Testing to check the time lag for revoke request");
- System.out.println(Calendar.getInstance().getTime());
- String requestId = reqSvc.submitRequest(reqData);
- System.out.println("Request Id: "+requestId);
- System.out.println(Calendar.getInstance().getTime());
- return requestKey;
- }
- public static void main(String[] args){
- RequestService reqSvc = Platform.getService(RequestService.class);
- try {
- new EntitlementRequest().createRevokeEntitlementRequest(reqSvc);
- } catch (InvalidRequestException | InvalidRequestDataException
- | RequestServiceException | BulkBeneficiariesAddException
- | BulkEntitiesAddException
- | oracle.iam.request.exception.InvalidRequestException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
- }
Oracle Identity Manager(OIM) is the Provisioning Solution from oracle. This page contains an index with references to all OIM related posts in the oracle identity manager Academy blog. The posts included herein are intended to provide oracle identity management customers and developers with technical information about best practices for implementing OIM based solutions.
OIM Entitlement Revoke Request
Subscribe to:
Post Comments (Atom)
-
Connection Related API's : OIM DB Connection/ Data Source connection OIMClient API / OIMConnection API OIM Platform API to getSer...
-
Error : Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory at org.springframewor...
-
In this post, we set the middle name as “MiddleName” if user does not provide middle name during user create operation. Below are high...
Hi,
ReplyDeleteI have used the same codes to revoke the entitlement in OIM-11gR2ps3 but we are getting issues. Once we run the program, Entitlement is getting revoked and request Id is also getting generated but for Connected Application(like Active Directory), the request status is showing Request Approved Fulfillment failed. Do you have any idea about this issue.
You response will be much appreciated.