- package com.oimacademy.role;
- import static oracle.iam.identity.rolemgmt.api.RoleManagerConstants.ROLE_CATEGORY_KEY;
- import static oracle.iam.identity.rolemgmt.api.RoleManagerConstants.ROLE_DESCRIPTION;
- import static oracle.iam.identity.rolemgmt.api.RoleManagerConstants.ROLE_DISPLAY_NAME;
- import static oracle.iam.identity.rolemgmt.api.RoleManagerConstants.ROLE_KEY;
- import static oracle.iam.identity.rolemgmt.api.RoleManagerConstants.ROLE_LDAP_DN;
- import static oracle.iam.identity.rolemgmt.api.RoleManagerConstants.ROLE_NAME;
- import static oracle.iam.identity.rolemgmt.api.RoleManagerConstants.ROLE_OWNER_KEY;
- 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.rolemgmt.api.RoleManager;
- import oracle.iam.identity.rolemgmt.vo.Role;
- import oracle.iam.platform.entitymgr.spi.entity.Searchable;
- import oracle.iam.platform.entitymgr.vo.SearchCriteria;
- import com.oimacademy.connection.Platform;
- public class SearchRole {
- protected static final String ROLE_NAME_PREFIX = "load*";
- protected RoleManager m_roleManager = Platform.getService(RoleManager.class);
- public static void main(String args[]) throws Exception{
- //long startTime = System.currentTimeMillis();
- System.out.println("***");
- new SearchRole().searchRoleConfigParams(ROLE_NAME_PREFIX);
- /* long endTime = System.currentTimeMillis();
- long totalTime = endTime - startTime;
- System.out.println(totalTime/1000.0);*/
- }
- public List searchRoleConfigParams(String ROLE_NAME_PREFIX) throws Exception {
- SearchCriteria criteria = new SearchCriteria(ROLE_NAME, ROLE_NAME_PREFIX, SearchCriteria.Operator.EQUAL);
- Set<String> searchAttrs = getSearchRoleAttributes();
- Map<String, Object> configParams = new HashMap<String, Object>();
- int start = 0;
- int end = 250;
- configParams.put(SEARCH_STARTROW, start);
- configParams.put(SEARCH_ENDROW, end);
- configParams.put(SEARCH_SORTORDER, Searchable.SortOrder.DESCENDING);
- configParams.put(SEARCH_SORTEDBY,ROLE_NAME);
- List<Role> roles =null;;
- try {
- roles = m_roleManager.search(criteria, searchAttrs, configParams);
- // System.out.println(roles);
- } catch (Exception e) {
- e.printStackTrace();
- }
- return roles; }
- protected HashSet<String> getSearchRoleAttributes() {
- // NOTE for SRGs we can't use getEntityAttributes()
- HashSet<String> searchAttributes = new HashSet<String>();
- searchAttributes.add(ROLE_KEY);
- searchAttributes.add(ROLE_NAME);
- searchAttributes.add(ROLE_DISPLAY_NAME);
- searchAttributes.add(ROLE_DESCRIPTION);
- searchAttributes.add(ROLE_OWNER_KEY);
- searchAttributes.add(ROLE_CATEGORY_KEY);
- searchAttributes.add(ROLE_LDAP_DN);
- return searchAttributes;
- }
- }
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 for Search Role
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