package com.massiveGaze.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.massiveGaze.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 R2PS2/PS3/12C) is a highly flexible and scalable enterprise identity administration system that provides operational and business efficiency by providing centralized administration & complete automation of identity and user provisioning events across enterprise as well as extranet applications.
OIM API for Search Role
Subscribe to:
Posts (Atom)
About OIM
Oracle Identity Management enables organizations to effectively manage the end - to - end life - cycle of user ide...
Popular Posts
-
OIM API's Sample Code : Videos: Massive Gaze Videos Connection Related API's : OIM DB Connection/ Data Source connection ...
-
Videos: Massive Gaze Videos 1. Basic OIM Information 2. MDS Export/Import 3. Steps For R2PS2 / R2PS3 Custom Pre-processor Ev...
-
Videos: Massive Gaze Videos 1. Query to get OIM Provsioned/provisioning Account details 2. Query to get usr keys For Rejected / ...
No comments:
Post a Comment