Class RoleTargetCleanupService
- java.lang.Object
-
- sailpoint.task.AbstractTaskExecutor
-
- com.identityworksllc.iiq.common.task.AbstractThreadedTask<String>
-
- com.identityworksllc.iiq.common.task.RoleTargetCleanupService
-
- All Implemented Interfaces:
PrivateContextObjectConsumer<String>
,sailpoint.object.BaseExecutor
,sailpoint.object.TaskExecutor
public class RoleTargetCleanupService extends AbstractThreadedTask<String>
-
-
Field Summary
-
Fields inherited from class com.identityworksllc.iiq.common.task.AbstractThreadedTask
beforeExecutionHook, context, executor, failureCounter, log, successCounter, taskResult, taskSchedule, terminated, threadCount
-
-
Constructor Summary
Constructors Constructor Description RoleTargetCleanupService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Iterator<? extends String>
getObjectIterator(sailpoint.api.SailPointContext context, sailpoint.object.Attributes<String,Object> args)
Retrieves an Iterator that will produce the stream of objects to be processed in parallel.Object
threadExecute(sailpoint.api.SailPointContext threadContext, Map<String,Object> parameters, String obj)
This method will be called in parallel for each item produced byAbstractThreadedTask.getObjectIterator(SailPointContext, Attributes)
.-
Methods inherited from class com.identityworksllc.iiq.common.task.AbstractThreadedTask
addTerminationHandler, afterBatch, beforeBatch, createBatchIterator, execute, getBatchSize, getExecutor, markFailure, markSuccess, parseArgs, prepareExecutor, setBeforeExecutionHook, setFailureMarker, setSuccessMarker, setWorkerCreator, submitAndWait, terminate
-
-
-
-
Constructor Detail
-
RoleTargetCleanupService
public RoleTargetCleanupService()
-
-
Method Detail
-
getObjectIterator
protected Iterator<? extends String> getObjectIterator(sailpoint.api.SailPointContext context, sailpoint.object.Attributes<String,Object> args) throws sailpoint.tools.GeneralException
Description copied from class:AbstractThreadedTask
Retrieves an Iterator that will produce the stream of objects to be processed in parallel.Each object produced by this Iterator will be passed in its turn to
AbstractThreadedTask.threadExecute(SailPointContext, Map, Object)
as the third parameter.IMPORTANT NOTES RE: HIBERNATE:
It may be unwise to return a “live” Hibernate iterator of the sort provided by context.search here. The next read of the iterator will fail with a “Result Set Closed” exception if anything commits this context while the iterator is still being consumed. It is likely that the first worker threads will execute before the iterator is fully read.
If you return a SailPointObject or any other object dependent on a Hibernate context, you will likely receive context-related errors in your worker thread unless you make an effort to re-attach the object to the thread context.
TODO One option may be to pass in a private context here, but it couldn’t be closed until after iteration is complete.
- Specified by:
getObjectIterator
in classAbstractThreadedTask<String>
- Parameters:
context
- The top-level task Sailpoint contextargs
- The task arguments- Returns:
- An iterator containing the objects to be iterated over
- Throws:
sailpoint.tools.GeneralException
- if any failures occur
-
threadExecute
public Object threadExecute(sailpoint.api.SailPointContext threadContext, Map<String,Object> parameters, String obj) throws sailpoint.tools.GeneralException
Description copied from class:AbstractThreadedTask
This method will be called in parallel for each item produced byAbstractThreadedTask.getObjectIterator(SailPointContext, Attributes)
.DO NOT use the parent context in this method. You will encounter Weird Database Issues.
- Specified by:
threadExecute
in interfacePrivateContextObjectConsumer<String>
- Specified by:
threadExecute
in classAbstractThreadedTask<String>
- Parameters:
threadContext
- A private IIQ context for the current JVM threadparameters
- A set of default parameters suitable for a Rule or Script. In the default implementation, the object will be in this map as ‘object’.obj
- The object to process- Returns:
- An arbitrary value (ignored by default)
- Throws:
sailpoint.tools.GeneralException
- if any failures occur
-
-