HAPPY NEW YEAR 2017

Identity And Access Management - Rajiv Dewan

Sample Code: To Search Organization with Organization Key

Requirement:

Search Organization using OIM 11g API

Solution:

Here is the sample code for the same:

Long orgKey = 1L;
OrganizationManager orgService = oimClient.getService(OrganizationManager.class);
Set orgCritAttrs = new HashSet();
SearchCriteria.Operator.EQUAL);
SearchCriteria orcriteria = new SearchCriteria("act_key", orgKey, SearchCriteria.Operator.EQUAL);
orgCritAttrs .add(OrganizationManagerConstants.AttributeName.ORG_NAME.getId());
List orgs = orgService.search(orcriteria, orgCritAttrs, null);
System.out.println("Organization Result Set Size:: " + orgs.size());
String organizationName = (String) orgs.get(0).getAttribute("Organization Name");
System.out.println("Organization Name :: " + organizationName);

No comments:

Post a Comment