- package com.oimacamedy.request;
- import java.util.ArrayList;
- import java.util.List;
- import com.oimacademy.connection.Platform;
- import oracle.iam.api.OIMService;
- import oracle.iam.platform.utils.vo.OIMType;
- import oracle.iam.provisioning.api.ApplicationInstanceService;
- import oracle.iam.provisioning.vo.ApplicationInstance;
- 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;
- import oracle.iam.vo.OperationResult;
- public class CreateAppInstanceProvisioningRequest {
- public static void main(String[] args) throws Exception {
- OIMService unifiedService = Platform.getService(OIMService.class);
- ApplicationInstanceService applicationInstanceService=Platform.getService(ApplicationInstanceService.class);
- ApplicationInstance applicationInstance=applicationInstanceService.findApplicationInstanceByName("DisconnectedA");
- System.out.println("ApplicationInstanceName ->"+applicationInstance.getApplicationInstanceName());
- String applicationInstanceName = applicationInstance.getApplicationInstanceName();
- String applicationInstanceKey = applicationInstance.getApplicationInstanceKey()+"";
- RequestData requestData = new RequestData();
- RequestBeneficiaryEntity requestEntity = new RequestBeneficiaryEntity();
- requestEntity.setRequestEntityType(OIMType.ApplicationInstance);
- requestEntity.setEntitySubType(applicationInstanceName);
- requestEntity.setEntityKey(applicationInstanceKey);
- requestEntity.setOperation(RequestConstants.MODEL_PROVISION_APPLICATION_INSTANCE_OPERATION);
- List<RequestBeneficiaryEntityAttribute> attrs = new ArrayList<RequestBeneficiaryEntityAttribute>();
- //Need to Change "Account Login" / "Account ID" / "Password" as per form attributes
- RequestBeneficiaryEntityAttribute attr = new RequestBeneficiaryEntityAttribute("Account Login", "TUSER"+Math.random(), RequestBeneficiaryEntityAttribute.TYPE.String);
- attrs.add(attr);
- attr = new RequestBeneficiaryEntityAttribute("Password", "Welcome1", RequestBeneficiaryEntityAttribute.TYPE.String);
- attrs.add(attr);
- attr = new RequestBeneficiaryEntityAttribute("Account ID", "FEDERER", RequestBeneficiaryEntityAttribute.TYPE.String);
- attrs.add(attr);
- requestEntity.setEntityData(attrs);
- List<RequestBeneficiaryEntity> entities = new ArrayList<RequestBeneficiaryEntity>();
- entities.add(requestEntity);
- Beneficiary beneficiary = new Beneficiary();
- String userKey = "11780"; //user key from USR Table
- beneficiary.setBeneficiaryKey(userKey);
- beneficiary.setBeneficiaryType(Beneficiary.USER_BENEFICIARY);
- beneficiary.setTargetEntities(entities);
- List<Beneficiary> beneficiaries = new ArrayList<Beneficiary>();
- beneficiaries.add(beneficiary);
- requestData.setBeneficiaries(beneficiaries);
- OperationResult result = unifiedService.doOperation(requestData, OIMService.Intent.REQUEST);
- System.out.println("Request ID :: " + result.getEntityId());
- }
- }
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 Create/Provision Application Instance via 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...
No comments:
Post a Comment