Package oracle.iam.api
Interface OIMService
public interface OIMService
OIMService is used to perform all requestable operations in OIM.
Following operations are supported by this service:
Create User
Modify User
Enable User
Disable User
Delete User
Assign Roles
Remove from Roles
Modify Role Grant
Create Role
Modify Role
Delete Role
Provision Application Instance
Modify Account
Disable Account
Enable Account
Revoke Account
Provision Entitlement
Revoke Entitlement
Modify Entitlement
Invoking doOperation method will result in to either request creation or direct operation based on the Intent passed.
Sample for disabling a user:
Sample for provisioning an application instance to a user
Following operations are supported by this service:
Create User
Modify User
Enable User
Disable User
Delete User
Assign Roles
Remove from Roles
Modify Role Grant
Create Role
Modify Role
Delete Role
Provision Application Instance
Modify Account
Disable Account
Enable Account
Revoke Account
Provision Entitlement
Revoke Entitlement
Modify Entitlement
Invoking doOperation method will result in to either request creation or direct operation based on the Intent passed.
- If Intent is "ANY", operation will result in to either request or direct based on authorization of logged-in user.
- If Intent is "REQUEST", a request will be created for the operation.
- If Intent is "DIRECT", operaion will be performed immediately, subject to authorization of logged-in user.
- All bulk operations will result in to request creation.
- "DIRECT" intent is not supported for bulk operations.
- All operations with future effective date will result in to request creation.
//Get instance of OIMService OIMClient clientPlatform = login("UserLogin", "Passwd"); OIMService oimService = clientPlatform.getService(OIMService.class); //Construct RequestData object to assign role "expense approver" with key "10" to user with key "12" RequestData requestData = new RequestData(); Beneficiary beneficiary = new Beneficiary(); String userKey = "12"; //User with key 12 beneficiary.setBeneficiaryKey(userKey); beneficiary.setBeneficiaryType(Beneficiary.USER_BENEFICIARY); RequestBeneficiaryEntity requestEntity = new RequestBeneficiaryEntity(); requestEntity.setRequestEntityType(OIMType.Role); requestEntity.setEntitySubType("expense approver"); requestEntity.setEntityKey("10"); //Role with key 10 requestEntity.setOperation(RequestConstants.MODEL_ASSIGN_ROLES_OPERATION); Listentities = new ArrayList (); entities.add(requestEntity); beneficiary.setTargetEntities(entities); List beneficiaries = new ArrayList (); beneficiaries.add(beneficiary); requestData.setBeneficiaries(beneficiaries); OperationResult result = oimService.doOperation(requestData, OIMService.Intent.ANY); if( result.getRequestID() != null ) { //Operation resulted in to request creation. System.out.println("Request submitted with ID: " + result.getRequestID()); } else { System.out.println("Role is assigned to user successfully"); }
Sample for disabling a user:
//Disable user with key "12". RequestData requestData = new RequestData(); RequestEntity ent = new RequestEntity(); ent.setRequestEntityType(OIMType.User); String userKey = "12"; //User with key 12. ent.setEntityKey(userKey); ent.setOperation(RequestConstants.MODEL_DISABLE_OPERATION); Listentities = new ArrayList (); entities.add(ent); requestData.setTargetEntities(entities); OperationResult result = oimService.doOperation(requestData, OIMService.Intent.ANY);
Sample for provisioning an application instance to a user
//Construct RequestData object to provision application instance "Email Server1" with key "10" to a user with key "12" RequestData requestData = new RequestData(); Beneficiary beneficiary = new Beneficiary(); String userKey = "12"; //User with key 12 beneficiary.setBeneficiaryKey(userKey); beneficiary.setBeneficiaryType(Beneficiary.USER_BENEFICIARY); RequestBeneficiaryEntity requestEntity = new RequestBeneficiaryEntity(); requestEntity.setRequestEntityType(OIMType.ApplicationInstance); requestEntity.setEntitySubType("Email Server1"); requestEntity.setEntityKey("10"); //Application instnace with key 10 requestEntity.setOperation(RequestConstants.MODEL_PROVISION_APPLICATION_INSTANCE_OPERATION); Listattrs = new ArrayList (); RequestBeneficiaryEntityAttribute attr = new RequestBeneficiaryEntityAttribute("email id", "user@example.com", RequestBeneficiaryEntityAttribute.TYPE.String); attrs.add(attr); requestEntity.setEntityData(attrs); List entities = new ArrayList (); entities.add(requestEntity); beneficiary.setTargetEntities(entities); List beneficiaries = new ArrayList (); beneficiaries.add(beneficiary); requestData.setBeneficiaries(beneficiaries); OperationResult result = oimService.doOperation(requestData, OIMService.Intent.ANY);
-
Nested Class Summary
Nested Classes -
Method Summary
-
Method Details
-
doOperation
OperationResult doOperation(RequestData requestData, OIMService.Intent intent) throws OIMServiceException - Parameters:
requestData
- data to be provided, specific to the operationintent
- can be one of Intent.REQUEST, Intent.DIRECT, Intent.ANY- Returns:
- OperationResult
- Throws:
OIMServiceException
- if operation fails
-