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