import java.util.HashMap;
import java.util.Map;
import sailpoint.api.Identitizer;
import sailpoint.api.ObjectUtil;
import sailpoint.api.PersistenceManager;
import sailpoint.api.SailPointContext;
import sailpoint.object.Attributes;
import sailpoint.object.Identity;
import sailpoint.tools.GeneralException;
public class SingleIdentityRefresh {
static SailPointContext context = null;
public static String singleIdentityRefresh(String name) {
try {
// pass the refresh task attributes
Map map = new HashMap();
map.put("", true);
map.put("", true);
map.put("", true);
map.put("", true);
Attributes attributes = new Attributes(map);
Identity identity = ObjectUtil.lockObject(context, Identity.class, null, name, PersistenceManager.LOCK_TYPE_TRANSACTION);
Identitizer identitizer = new Identitizer(context, attributes);
identitizer.refresh(identity);
context.saveObject(identity);
context.commitTransaction();
} catch (GeneralException e) {
System.out.println("GeneralException : " + e.getMessage());
}
return "success";
}
public static void main(String[] args) {
singleIdentityRefresh("Aaron.Nicols");
}
}
No comments:
Post a Comment