//In Finance application,list out employees belongs to 'PAYROLL' department with privileged
//,inactive and service as 'FALSE'.Output should display identity details like first Name,LastName and email.
import sailpoint.object.QueryOptions;
import sailpoint.object.Filter;
import sailpoint.object.Identity;
import sailpoint.object.Link;
import sailpoint.object.Attributes;
List linksList = new ArrayList();
ArrayList accountInfo = new ArrayList();
String privileged = null;
String service = null;
QueryOptions qo = new QueryOptions();
Filter linkFilter = Filter.eq("links.application.name","Financials");
Filter depFilter = Filter.eq("department","Accounting");
qo.addFilter(Filter.and(linkFilter, depFilter));
List identityList = context.getObjects(Identity.class, qo);
if(identityList != null){
for(Identity identity : identityList){
List links = identity.getLinks();
if(links != null){
for(Link link : links){
String applicationName = link.getApplicationName();
if(applicationName!= null && (applicationName.equalsIgnoreCase("Financials"))){
Attributes attributes = link.getAttributes();
if (attributes != null){
if(attributes.getString("app2_privileged") != null &&
(attributes.getString("app2_privileged").equalsIgnoreCase("false")) &&
(attributes.getString("app2_service") != null) &&
(attributes.getString("app2_service").equalsIgnoreCase("false")) ){
privileged = attributes.getString("app2_privileged");
service = attributes.getString("app2_service");
accountInfo.add(identity.getName() + " :: " + identity.getFirstname() + " :: " +
" :: " + applicationName + " :: " + privileged + " :: "+ service);
}
}
}
}
}
}
log.debug( accountInfo);
}
//,inactive and service as 'FALSE'.Output should display identity details like first Name,LastName and email.
import sailpoint.object.QueryOptions;
import sailpoint.object.Filter;
import sailpoint.object.Identity;
import sailpoint.object.Link;
import sailpoint.object.Attributes;
List linksList = new ArrayList();
ArrayList accountInfo = new ArrayList();
String privileged = null;
String service = null;
QueryOptions qo = new QueryOptions();
Filter linkFilter = Filter.eq("links.application.name","Financials");
Filter depFilter = Filter.eq("department","Accounting");
qo.addFilter(Filter.and(linkFilter, depFilter));
List identityList = context.getObjects(Identity.class, qo);
if(identityList != null){
for(Identity identity : identityList){
List links = identity.getLinks();
if(links != null){
for(Link link : links){
String applicationName = link.getApplicationName();
if(applicationName!= null && (applicationName.equalsIgnoreCase("Financials"))){
Attributes attributes = link.getAttributes();
if (attributes != null){
if(attributes.getString("app2_privileged") != null &&
(attributes.getString("app2_privileged").equalsIgnoreCase("false")) &&
(attributes.getString("app2_service") != null) &&
(attributes.getString("app2_service").equalsIgnoreCase("false")) ){
privileged = attributes.getString("app2_privileged");
service = attributes.getString("app2_service");
accountInfo.add(identity.getName() + " :: " + identity.getFirstname() + " :: " +
" :: " + applicationName + " :: " + privileged + " :: "+ service);
}
}
}
}
}
}
log.debug( accountInfo);
}
Comment below if you find this post helpful.
No comments:
Post a Comment