Package com.identityworksllc.iiq.common
Class BaseIdentityUtilities
- java.lang.Object
-
- com.identityworksllc.iiq.common.AbstractBaseUtility
-
- com.identityworksllc.iiq.common.BaseIdentityUtilities
-
public class BaseIdentityUtilities extends AbstractBaseUtility
Utilities for handling Identity operations
-
-
Field Summary
-
Fields inherited from class com.identityworksllc.iiq.common.AbstractBaseUtility
context, debug, log
-
-
Constructor Summary
Constructors Constructor Description BaseIdentityUtilities(sailpoint.api.SailPointContext context)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description sailpoint.object.Attributes<String,Object>
getDefaultRefreshOptions(boolean shouldProcessEvents)
Gets the default set of refresh options, with or without process-events.boolean
hasDetectedRole(sailpoint.object.Identity identity, String roleName)
Returns true if the user has at least one of the detected roleboolean
hasMultiple(sailpoint.object.Identity identity, String roleName)
Returns true if the user has the given role more than one time (either via assignment or detection or both)void
maskSecretAttributes(Map<String,Object> attributes)
Transforms the existing Map in place by replacing attributes of type Secret with asterisksList<Object[]>
recursivelyExplodeHierarchy(String parent, String attribute)
Returns the entire tree below the ‘parent’ Identity by recursively querying for other objects that reference it via the given attribute.List<Object[]>
recursivelyExplodeHierarchy(sailpoint.object.Identity parent)
Returns a recursive list of all subordinates of the given Identity by recursively navigating other Identity objects starting with this one as their ‘manager’.List<sailpoint.object.Identity>
recursivelyExplodeWorkgroup(sailpoint.object.Identity possibleWorkgroup)
Recursively expands the input Identity, returning a list of workgroup members.void
refresh(sailpoint.object.Identity id)
Performs a refresh with default options on the identityvoid
refresh(sailpoint.object.Identity id, boolean shouldProcessEvents)
Performs a refresh with mostly-default options on the identityvoid
refresh(sailpoint.object.Identity id, Map<String,Object> args)
Performs a refresh against the identity with the given argumentsvoid
rename(sailpoint.object.Identity target, String newName)
Attempt to do a best effort rename of a user.-
Methods inherited from class com.identityworksllc.iiq.common.AbstractBaseUtility
inject, isDebug, setDebug
-
-
-
-
Constructor Detail
-
BaseIdentityUtilities
public BaseIdentityUtilities(sailpoint.api.SailPointContext context)
-
-
Method Detail
-
getDefaultRefreshOptions
public sailpoint.object.Attributes<String,Object> getDefaultRefreshOptions(boolean shouldProcessEvents)
Gets the default set of refresh options, with or without process-events.The refresh options set to true are:
- provision
- correlateEntitlements
- promoteManagedAttributes
- refreshRoleMetadata
- promoteAttributes
- synchronizeAttributes
- refreshManagerStatus
- noResetNeedsRefresh
- refreshProvisioningRequests
- checkHistory
If the provided shouldProcessEvents is true, then processTriggers will also be set to true. This is optional because triggers can prolong a refresh considerably.
- Parameters:
shouldProcessEvents
- True if we should also process events, false if not- Returns:
- A new Attributes with the default set of refresh options
-
hasDetectedRole
public boolean hasDetectedRole(sailpoint.object.Identity identity, String roleName)
Returns true if the user has at least one of the detected role- Parameters:
identity
- The identity to checkroleName
- The role name to look for- Returns:
- true if the user has at least one detected role of this name
-
hasMultiple
public boolean hasMultiple(sailpoint.object.Identity identity, String roleName)
Returns true if the user has the given role more than one time (either via assignment or detection or both)- Parameters:
identity
- The identity to checkroleName
- The role name to look for- Returns:
- true if the user has at least two assigned/detected roles of this name
-
maskSecretAttributes
public void maskSecretAttributes(Map<String,Object> attributes)
Transforms the existing Map in place by replacing attributes of type Secret with asterisks- Parameters:
attributes
- The attribute map to modify
-
recursivelyExplodeHierarchy
public List<Object[]> recursivelyExplodeHierarchy(sailpoint.object.Identity parent) throws sailpoint.tools.GeneralException
Returns a recursive list of all subordinates of the given Identity by recursively navigating other Identity objects starting with this one as their ‘manager’.- Parameters:
parent
- The parent Identity- Returns:
- A list of object arrays, containing the ‘id’ and ‘name’ of any Identities
- Throws:
sailpoint.tools.GeneralException
- if this fails
-
recursivelyExplodeHierarchy
public List<Object[]> recursivelyExplodeHierarchy(String parent, String attribute) throws sailpoint.tools.GeneralException
Returns the entire tree below the ‘parent’ Identity by recursively querying for other objects that reference it via the given attribute.For example, this might return a manager’s entire tree of subordinates.
- Parameters:
parent
- an Identity ID to search in the given attributeattribute
- the attribute containing an Identity ID reference (e.g.,manager
)- Returns:
- A list of object arrays, containing the ‘id’ and ‘name’ of any Identities
- Throws:
sailpoint.tools.GeneralException
- if this fails
-
recursivelyExplodeWorkgroup
public List<sailpoint.object.Identity> recursivelyExplodeWorkgroup(sailpoint.object.Identity possibleWorkgroup) throws sailpoint.tools.GeneralException
Recursively expands the input Identity, returning a list of workgroup members.If the input Identity is not a workgroup, it is returned alone. If any members of a workgroup are themselves workgroups, they will be recursively expanded.
This can be used, for example, to send a notification to an entire workgroup.
- Parameters:
possibleWorkgroup
- anIdentity
object, which is likely a workgroup- Returns:
- The list of Identities in the given workgroup, and any child workgroups
- Throws:
sailpoint.tools.GeneralException
- if this fails
-
refresh
public void refresh(sailpoint.object.Identity id) throws sailpoint.tools.GeneralException
Performs a refresh with default options on the identity- Parameters:
id
- The identity in question- Throws:
sailpoint.tools.GeneralException
- if any IIQ failure occurs
-
refresh
public void refresh(sailpoint.object.Identity id, boolean shouldProcessEvents) throws sailpoint.tools.GeneralException
Performs a refresh with mostly-default options on the identity- Parameters:
id
- The identity to targetshouldProcessEvents
- if true, processEvents will also be added- Throws:
sailpoint.tools.GeneralException
- if any IIQ failure occurs
-
refresh
public void refresh(sailpoint.object.Identity id, Map<String,Object> args) throws sailpoint.tools.GeneralException
Performs a refresh against the identity with the given arguments- Parameters:
id
- The target identityargs
- the refresh arguments- Throws:
sailpoint.tools.GeneralException
- if any IIQ failure occurs
-
rename
public void rename(sailpoint.object.Identity target, String newName) throws sailpoint.tools.GeneralException
Attempt to do a best effort rename of a user.Note that this will not catch usernames stored in:
(1) ProvisioningPlan objects (2) Running workflow variables
- Parameters:
target
- The Identity object to renamenewName
- The new name of the identity- Throws:
sailpoint.tools.GeneralException
- if any renaming failures occur
-
-