Class AbstractThreadedObjectIteratorTask<ItemType>

  • Type Parameters:
    ItemType - the type of object being iterated over
    All Implemented Interfaces:
    PrivateContextObjectConsumer<ItemType>, sailpoint.object.BaseExecutor, sailpoint.object.TaskExecutor

    public abstract class AbstractThreadedObjectIteratorTask<ItemType>
    extends AbstractThreadedTask<ItemType>
    A more advanced AbstractThreadedTask that implements a “do this to these” pattern.

    The task will retrieve its list of items via a rule, script, flat file, or search filter. Subclasses are still responsible for implementing the AbstractThreadedTask.threadExecute(SailPointContext, Map, Object) method.

    A ‘retrievalType’ must be specified that is one of rule, script, sql, file, connector, provided, or filter, along with the appropriate arguments for that type of retrieval.

    The other arguments are the ones expected by BasicObjectRetriever. See that class for details.

    If the output of your retrieval is not the type you want passed to your threadExecute, you must override convertObject(Object) and return the appropriately translated object. This class assumes that the output of convertObject is the correct type. Returning a value of the incorrect type will result in ClassCastExceptions.

    If you only want to support a subset of outputs, you may override supportsRetrievalType(RetrievalType) and return false for those you do not want to support.

    Subclasses must invoke super.parseArgs() if they override it to extract their own inputs.

    • Method Detail

      • convertObject

        protected ItemType convertObject​(Object input)
        Converts the input to the expected type T.

        By default, this just returns the input as-is. If you know what you’re doing, you can leave this implementation intact, but you probably want to convert things.

        If the result is null, the object will be ignored.

        Parameters:
        input - The input
        Returns:
        The output object
      • getObjectIterator

        protected Iterator<ItemTypegetObjectIterator​(sailpoint.api.SailPointContext context,
                                                       sailpoint.object.Attributes<String,​Object> args)
                                                throws sailpoint.tools.GeneralException
        Gets the iterator over the given object type
        Specified by:
        getObjectIterator in class AbstractThreadedTask<ItemType>
        Parameters:
        context - Sailpoint context
        args - The task arguments
        Returns:
        The iterator of items retrieved from whatever source
        Throws:
        sailpoint.tools.GeneralException - if any failures occur
      • getObjectRetriever

        protected ObjectRetriever<ItemTypegetObjectRetriever​(sailpoint.api.SailPointContext context,
                                                               sailpoint.object.Attributes<String,​Object> args)
                                                        throws sailpoint.tools.GeneralException
        Gets the ObjectRetriever associated with this task execution
        Parameters:
        context - The context of the object retriever
        args - The arguments to the task
        Returns:
        The object retriever
        Throws:
        sailpoint.tools.GeneralException - if any failure occurs
      • isTerminated

        protected final boolean isTerminated()
        Termination indicator to be used by the subclasses
        Returns:
        True if this task has been terminated
      • supportsRetrievalType

        protected boolean supportsRetrievalType​(com.identityworksllc.iiq.common.task.BasicObjectRetriever.RetrievalType type)
        This method should return false if this task executor does not want to support the given retrieval type.
        Parameters:
        type - The type of the retrieval