Revoke Application Instance request
}
For role revoke, it is almost same as Entitlement revoke request. Only changes required are as follows
reqBenEnt.setRequestEntityType(oracle.iam.platform.utils.vo.OIMType.Role);
reqBenEnt.setEntitySubType("ROLE_KEY");//it will be Role_key
reqBenEnt.setEntityKey("ROLE_KEY"); //It will be role_key
reqBenEnt.setOperation(RequestConstants.MODEL_REMOVE_ROLES_OPERATION);
public String createRevokeApplicationInstanceRequest(){
String requestKey="0";
RequestBeneficiaryEntity reqBenEnt = new RequestBeneficiaryEntity();
reqBenEnt.setRequestEntityType(oracle.iam.platform.utils.vo.OIMType.ApplicationInstance);
reqBenEnt.setEntitySubType("APP_INSTANCE_NAME"); //Application Instance Name as SubType
reqBenEnt.setOperation(RequestConstants.MODEL_REVOKE_ACCOUNT_OPERATION);
reqBenEnt.setEntityKey("ACCOUNT_ID"); //for AppInst it will be OIU key, for entitlement it will be ent_assign_key
List<RequestBeneficiaryEntityAttribute> reqBenEntAttrList = new ArrayList();
List<RequestBeneficiaryEntity> reqBenEntList = new ArrayList();
reqBenEntList.add(reqBenEnt);
//Create Beneficiary for the request
Beneficiary beneficiary = new Beneficiary();
beneficiary.setBeneficiaryKey("USR_KEY");
beneficiary.setBeneficiaryType(Beneficiary.USER_BENEFICIARY);
beneficiary.setTargetEntities(reqBenEntList);
List<Beneficiary> benList = new ArrayList<Beneficiary>();
benList.add(beneficiary);
//Create Request Data
RequestData reqData = new RequestData();
reqData.setBeneficiaries(benList);
reqData.setJustification("Business Justification");
OIMClient oimClientObjReq = OIMClientFactory.getOIMClient(requester);
RequestService reqAPI = (RequestService)oimClientObjReq.getService(RequestService.class);
try {
requestKey = reqAPI.submitRequest(reqData);
System.out.println(requestKey);
} catch (Exception rse) {
// TODO: Add catch code
rse.printStackTrace();
}
return requestKey;
Revoke Entitlement Request
public String createRevokeEntitlementRequest(){
String requestKey="0";
RequestBeneficiaryEntity reqBenEnt = new RequestBeneficiaryEntity();
reqBenEnt.setRequestEntityType(oracle.iam.platform.utils.vo.OIMType.Entitlement);
reqBenEnt.setEntitySubType("ENT_LIST_KEY");//it will be ent_list_key
reqBenEnt.setOperation(RequestConstants.MODEL_REVOKE_ENTITLEMENT_OPERATION);
reqBenEnt.setEntityKey("ENT_ASSIGN_KEY"); //It will be ent_assign_key which is entitlement instance key
List<RequestBeneficiaryEntityAttribute> reqBenEntAttrList = new ArrayList();
List<RequestBeneficiaryEntity> reqBenEntList = new ArrayList();
reqBenEntList.add(reqBenEnt);
//Create Beneficiary for the request
Beneficiary beneficiary = new Beneficiary();
beneficiary.setBeneficiaryKey("USR_KEY");
beneficiary.setBeneficiaryType(Beneficiary.USER_BENEFICIARY);
beneficiary.setTargetEntities(reqBenEntList);
List<Beneficiary> benList = new ArrayList<Beneficiary>();
benList.add(beneficiary);
//Create Request Data
RequestData reqData = new RequestData();
reqData.setBeneficiaries(benList);
reqData.setJustification("Business Justification");
OIMClient oimClientObjReq = OIMClientFactory.getOIMClient("REQUESTER_LOGIN_ID");
RequestService reqAPI = (RequestService)oimClientObjReq.getService(RequestService.class);
try {
requestKey = reqAPI.submitRequest(reqData);
System.out.println(requestKey);
} catch (Exception rse) {
// TODO: Add catch code
rse.printStackTrace();
}
return requestKey;
}
Revoke Role Request
For role revoke, it is almost same as Entitlement revoke request. Only changes required are as follows
reqBenEnt.setRequestEntityType(oracle.iam.platform.utils.vo.OIMType.Role);
reqBenEnt.setEntitySubType("ROLE_KEY");//it will be Role_key
reqBenEnt.setEntityKey("ROLE_KEY"); //It will be role_key
reqBenEnt.setOperation(RequestConstants.MODEL_REMOVE_ROLES_OPERATION);
No comments:
Post a Comment