Class WorkerImpl

  • All Implemented Interfaces:
    VitamAutoCloseable, Worker, java.lang.AutoCloseable

    public class WorkerImpl
    extends java.lang.Object
    implements Worker
    WorkerImpl class implements Worker interface

    manages and executes actions by step

    • Constructor Detail

      • WorkerImpl

        public WorkerImpl​(PluginLoader pluginLoader)
        Constructor
        Parameters:
        pluginLoader - the plugin loader
    • Method Detail

      • addActionHandler

        public WorkerImpl addActionHandler​(java.lang.String actionName,
                                           ActionHandler actionHandler)
        Add an actionhandler in the pool of action
        Specified by:
        addActionHandler in interface Worker
        Parameters:
        actionName - action name
        actionHandler - action handler
        Returns:
        WorkerImpl
      • run

        public ItemStatus run​(WorkerParameters workParams,
                              Step step)
                       throws java.lang.IllegalArgumentException,
                              ProcessingException
        Description copied from interface: Worker
        Worker execute the step's actions
        Specified by:
        run in interface Worker
        Parameters:
        workParams - WorkerParameters (one and only workItem will be in workParams)
        step - Step null not allowed
        Returns:
        List EngineResponse EngineResponse : list of action response {OK,KO,FATAL...}
        Throws:
        java.lang.IllegalArgumentException - throws when arguments are null
        ProcessingException - throws when error in execution
      • getWorkerId

        public java.lang.String getWorkerId()
        Description copied from interface: Worker
        get Worker Id
        Specified by:
        getWorkerId in interface Worker
        Returns:
        id
      • close

        public void close()
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface VitamAutoCloseable