It's all about IAM

Sample Code: OIM API Code for Provision Application Instance

Here is the sample OIM API code for submitting request for Provision Application Instance:



public void submitProvisionRequest(RequestService requestService) throws InvalidRequestException, InvalidRequestDataException, RequestServiceException, BulkBeneficiariesAddException, BulkEntitiesAddException{
      
        String beneficiaryKey = "141";
        String applicationInstanceName = "ActiveDirectory";
        String applicationInstanceKey = "14";
        RequestData requestData = new RequestData();
        Beneficiary beneficiary = new Beneficiary();
      
        beneficiary.setBeneficiaryKey(beneficiaryKey);
        beneficiary.setBeneficiaryType(Beneficiary.USER_BENEFICIARY);

        RequestBeneficiaryEntity requestEntity = new RequestBeneficiaryEntity();
        requestEntity.setRequestEntityType(OIMType.ApplicationInstance);
        requestEntity.setEntitySubType(applicationInstanceName);
        requestEntity.setEntityKey(applicationInstanceKey);
        requestEntity.setOperation(RequestConstants.MODEL_PROVISION_APPLICATION_INSTANCE_OPERATION);

      
        List targetEntities = new ArrayList();
        targetEntities.add(requestEntity);

        beneficiary.setTargetEntities(targetEntities);

        List beneficiaries = new ArrayList();
        beneficiaries.add(beneficiary);
        requestData.setBeneficiaries(beneficiaries);
      
        String requestID = requestService.submitRequest(requestData);
        System.out.println("Request ID :: " + requestID);
    }

No comments:

Post a Comment