Package fr.gouv.vitam.worker.core.impl
Class WorkerImpl
java.lang.Object
fr.gouv.vitam.worker.core.impl.WorkerImpl
- All Implemented Interfaces:
VitamAutoCloseable
,Worker
,AutoCloseable
WorkerImpl class implements Worker interface
manages and executes actions by step
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddActionHandler
(String actionName, ActionHandler actionHandler) Add an actionhandler in the pool of actionvoid
close()
get Worker Idrun
(WorkerParameters workParams, Step step) Worker execute the step's actions
-
Constructor Details
-
WorkerImpl
Constructor- Parameters:
pluginLoader
- the plugin loader
-
-
Method Details
-
addActionHandler
Add an actionhandler in the pool of action- Specified by:
addActionHandler
in interfaceWorker
- Parameters:
actionName
- action nameactionHandler
- action handler- Returns:
- WorkerImpl
-
run
public ItemStatus run(WorkerParameters workParams, Step step) throws IllegalArgumentException, ProcessingException Description copied from interface:Worker
Worker execute the step's actions- Specified by:
run
in interfaceWorker
- 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:
IllegalArgumentException
- throws when arguments are nullProcessingException
- throws when error in execution
-
getWorkerId
Description copied from interface:Worker
get Worker Id- Specified by:
getWorkerId
in interfaceWorker
- Returns:
- id
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceVitamAutoCloseable
-