Saturday 16 June 2018

OIM API - Code Snippet to Get Organization Details by Organization Name.

public void getOrganizationDetails(String orgName) {
        OrganizationManager orgManager = Platform.getService(OrganizationManager.class);
        Organization org;
        try{
            org = orgManager.getDetails(orgName, null, true);
           
            System.out.println("Organization ID :: " + org.getEntityId());
            System.out.println("Organization Name :: " + org.getAttribute(OrganizationManagerConstants.AttributeName.ORG_NAME.getId()));
            System.out.println("Parent Organization Name :: " + org.getAttribute(OrganizationManagerConstants.AttributeName.ORG_PARENT_NAME.getId()));
            System.out.println("Organization Password Policy Name :: " + org.getAttribute(OrganizationManagerConstants.AttributeName.ORG_PASSWORD_POLICY_NAME.getId()));
        } catch (OrganizationManagerException e) {
            System.out.println("Exception occured while fetching organization details");
        }
}


Happy Learning!!!

No comments:

Post a Comment