- package com.oimacademy.role;
- import static oracle.iam.identity.utils.Constants.FIRSTNAME;
- import static oracle.iam.identity.utils.Constants.SEARCH_ENDROW;
- import static oracle.iam.identity.utils.Constants.SEARCH_SORTEDBY;
- import static oracle.iam.identity.utils.Constants.SEARCH_SORTORDER;
- import static oracle.iam.identity.utils.Constants.SEARCH_STARTROW;
- import java.util.HashMap;
- import java.util.HashSet;
- import java.util.List;
- import java.util.Map;
- import java.util.Set;
- import oracle.iam.identity.exception.RoleMemberException;
- import oracle.iam.identity.rolemgmt.api.RoleManager;
- import oracle.iam.identity.usermgmt.vo.User;
- import oracle.iam.platform.authz.exception.AccessDeniedException;
- import oracle.iam.platform.entitymgr.spi.entity.Searchable.SortOrder;
- import oracle.iam.platform.entitymgr.vo.SearchCriteria;
- import com.oimacademy.connection.Platform;
- public class GetRoleIndirectMembers {
- protected RoleManager m_roleManager = Platform.getService(RoleManager.class);
- public static void main(String[] args) throws Exception {
- new GetRoleIndirectMembers().getRoleIndirectMembersWithPagenation();
- }
- public void getRoleIndirectMembersWithPagenation() throws Exception {
- String roleKey = "61";
- //actual test case.
- SearchCriteria criteria = getSearchCriteriaAllUsers();
- //test getting all members by passing null to control and retrieve
- Set<String> retAttr = new HashSet<String>();
- Map<String, Object> control = new HashMap<String, Object>();
- control.put(SEARCH_SORTORDER, SortOrder.ASCENDING);
- control.put(SEARCH_SORTEDBY, FIRSTNAME);
- control.put(SEARCH_STARTROW, 0);
- control.put(SEARCH_ENDROW, 30);
- retAttr.add("rownum");
- retAttr.add("First Name");
- retAttr.add("User Login");
- List<User> listOfIndirectMembers = null;
- try {
- listOfIndirectMembers =
- m_roleManager.getRoleMembers(roleKey,criteria,retAttr,control, false);
- } catch (RoleMemberException e) {
- } catch (AccessDeniedException e) {
- }
- System.out.println(listOfIndirectMembers);}
- protected SearchCriteria getSearchCriteriaAllUsers() {
- SearchCriteria criteria1 = new SearchCriteria("Display Name", "ABC", SearchCriteria.Operator.OR);
- return new SearchCriteria(FIRSTNAME, "ABC", SearchCriteria.Operator.CONTAINS);
- }
- }
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 Get Indirect Role Members
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