Package org.dspace.curate
Class ResolvedTask
- java.lang.Object
-
- org.dspace.curate.ResolvedTask
-
public class ResolvedTask extends Object
ResolvedTask wraps an implementation of one of the CurationTask or ScriptedTask interfaces and provides for uniform invocation based on CurationTask methods.- Author:
- richardrodgers
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedResolvedTask(String taskName, CurationTask cTask)protectedResolvedTask(String taskName, ScriptedTask sTask)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int[]getCodes()Curator.InvokedgetMode()StringgetName()Returns local name of taskvoidinit(Curator curator)Initialize task - parameters inform the task of it's invoking curator.booleanisDistributive()Returns whether task should be distributed through containersbooleanisMutative()Returns whether task alters (mutates) it's target objectsintperform(DSpaceObject dso)Perform the curation task upon passed DSOintperform(Context ctx, String id)Perform the curation task for passed id
-
-
-
Constructor Detail
-
ResolvedTask
protected ResolvedTask(String taskName, CurationTask cTask)
-
ResolvedTask
protected ResolvedTask(String taskName, ScriptedTask sTask)
-
-
Method Detail
-
init
public void init(Curator curator) throws IOException
Initialize task - parameters inform the task of it's invoking curator. Since the curator can provide services to the task, this represents curation DI.- Parameters:
curator- the Curator controlling this task- Throws:
IOException- if IO error
-
perform
public int perform(DSpaceObject dso) throws IOException
Perform the curation task upon passed DSO- Parameters:
dso- the DSpace object- Returns:
- status code
- Throws:
IOException- if error
-
perform
public int perform(Context ctx, String id) throws IOException
Perform the curation task for passed id- Parameters:
ctx- DSpace context objectid- persistent ID for DSpace object- Returns:
- status code
- Throws:
IOException- if error
-
getName
public String getName()
Returns local name of task- Returns:
- name the local name of the task
-
isDistributive
public boolean isDistributive()
Returns whether task should be distributed through containers- Returns:
- whether task should be distributed through containers
-
isMutative
public boolean isMutative()
Returns whether task alters (mutates) it's target objects- Returns:
- whether task alters (mutates) it's target objects
-
getMode
public Curator.Invoked getMode()
-
getCodes
public int[] getCodes()
-
-