IT CanvassTalk to an advisor
Examples · LessonBy , SailPoint Trainer, 7 yrs · Published · IdentityIQ 8.4 · all levels

Java examples

Example Java using the IdentityIQ API/context.

Quick answer

These Java examples show using the SailPoint context to query objects programmatically inside IdentityIQ.

Key takeaways
  • Using SailPointContext
  • Querying objects
  • Committing changes
  • Run within IIQ or a plugin

Server-side Java in IdentityIQ uses the SailPointContext to read and write objects. These examples show the fundamental pattern used inside rules, tasks and plugins.

Load and read an identity

import sailpoint.object.Identity;
Identity id = context.getObjectByName(Identity.class, "jdoe");
if (id != null) {
  String dept = id.getStringAttribute("department");
  Identity mgr = id.getManager();
}

Query with a filter

import sailpoint.object.*;
QueryOptions qo = new QueryOptions();
qo.addFilter(Filter.eq("department", "Finance"));
Iterator it = context.search(Identity.class, qo);

Guidance

  • Use context.search with projection for large result sets.
  • Decache in long loops to avoid memory build-up.
  • Commit deliberately, only when you intend to persist.

Common pitfalls

  • Loading full objects in large loops, exhausting memory.
  • Forgetting null checks on getObjectByName.
  • Uncommitted or over-committed changes.

Practice challenge

+0 XPStreak ×0
Question 1 of 3
What do Java examples use?

Frequently asked questions

What does the term Java examples refer to in SailPoint?
Server-side Java in IdentityIQ uses the SailPointContext to read and write objects. These examples show the fundamental pattern used inside rules, tasks and plugins.
What is another point to note about Java examples?
Use context.search with projection for large result sets. Decache in long loops to avoid memory build-up. Commit deliberately, only when you intend to persist.
What tends to go wrong with Java examples?
Loading full objects in large loops, exhausting memory. Forgetting null checks on getObjectByName. Uncommitted or over-committed changes.
Want this with a live instructor and a lab tenant?
SailPoint Developer training →
Already working on SailPoint and stuck on a live ticket?Get an expert SailPoint developer on screen-share to finish your daily tasks with you. Deliver on time, protect your reputation and your job. Monthly support only, no task-wise plans.Task assigned · no idea where to startStill stuck · your job on the lineExpert joins your screenDelivered on timeExplore On Job Support