- package com.oimacademy.request;
- import java.util.ArrayList;
- import java.util.List;
- import oracle.iam.api.OIMService;
- import oracle.iam.exception.OIMServiceException;
- import oracle.iam.identity.exception.NoSuchUserException;
- import oracle.iam.identity.exception.UserLookupException;
- import oracle.iam.platform.utils.vo.OIMType;
- import oracle.iam.request.vo.Beneficiary;
- import oracle.iam.request.vo.RequestBeneficiaryEntity;
- import oracle.iam.request.vo.RequestConstants;
- import oracle.iam.request.vo.RequestData;
- import oracle.iam.vo.OperationResult;
- import com.oimacademy.connection.Platform;
- public class RequestToGrantEntitlementToUser {
- private final OIMService oimService =Platform.getService(OIMService.class);
- public OperationResult grantEntitlement(String usrKey, String entitlementName, String entKey) throws NoSuchUserException, UserLookupException, OIMServiceException
- {
- RequestBeneficiaryEntity reqBenefEntity = new RequestBeneficiaryEntity();
- reqBenefEntity.setRequestEntityType(OIMType.Entitlement);
- reqBenefEntity.setEntitySubType(entitlementName);
- reqBenefEntity.setEntityKey(entKey);
- reqBenefEntity.setOperation(RequestConstants.MODEL_PROVISION_ENTITLEMENT_OPERATION);
- List<RequestBeneficiaryEntity> entities = new ArrayList<RequestBeneficiaryEntity>();
- entities.add(reqBenefEntity);
- Beneficiary beneficiary = new Beneficiary();
- beneficiary.setBeneficiaryKey(usrKey);
- beneficiary.setBeneficiaryType(Beneficiary.USER_BENEFICIARY);
- beneficiary.setTargetEntities(entities);
- List<Beneficiary> beneficiaries = new ArrayList<Beneficiary>();
- beneficiaries.add(beneficiary);
- RequestData reqData = new RequestData();
- reqData.setBeneficiaries(beneficiaries); // Set list of request entity
- OperationResult result = oimService.doOperation(reqData, OIMService.Intent.REQUEST);
- return result;
- }
- }
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 API To Grant Entitlement To User Request API
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...
No comments:
Post a Comment