Friday, 6 April 2018

Search Identity by attribute using QueryOptions & Filter


Search Identity by attribute using QueryOptions & Filter

Below is the code to search for Identity using sailpoint api

 import sailpoint.object.Identity;  
 import sailpoint.object.QueryOptions;  
  import sailpoint.object.Link;  
  import sailpoint.object.Filter;  
  import java.util.*;

QueryOptions queryOption = new QueryOptions();
queryOption.addFilter(Filter.eq("firstname","Adam"));
Iterator identityIterator = context.search(Identity.class, queryOption);  

System.out.println("identityIterator : " + identityIterator);
while ( identityIterator.hasNext() ) {  
System.out.println("identityIterator : in while " );
    Identity id = (Identity) identityIterator.next();  
    System.out.println("id : " + id);
   System.out.println("Name : "+id.getName());  
   System.out.println("Attributes : "+id.getAttributes()); 
   System.out.println("Role Assignments : "+id.getRoleAssignments());
   System.out.println("Links : "+id.getLinks());
  
}

No comments:

Post a Comment

SOAPAPi Call and Reading

<?xml version='1.0' encoding='UTF-8'?> <!DOCTYPE Rule PUBLIC "sailpoint.dtd" "sailpoint.dtd"...