Class RoleTargetCleanupService

    • Method Detail

      • getObjectIterator

        protected Iterator<? extends StringgetObjectIterator​(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 class AbstractThreadedTask<String>
        Parameters:
        context - The top-level task Sailpoint context
        args - The task arguments
        Returns:
        An iterator containing the objects to be iterated over
        Throws:
        sailpoint.tools.GeneralException - if any failures occur