|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.dspace.curate.AbstractCurationTask
public abstract class AbstractCurationTask
AbstractCurationTask encapsulates a few common patterns of task use, resources, and convenience methods.
| Field Summary | |
|---|---|
protected Curator |
curator
|
protected String |
taskId
|
| Constructor Summary | |
|---|---|
AbstractCurationTask()
|
|
| Method Summary | |
|---|---|
protected DSpaceObject |
dereference(Context ctx,
String id)
Returns a DSpaceObject for passed identifier, if it exists |
protected void |
distribute(DSpaceObject dso)
Distributes a task through a DSpace container - a convenience method for tasks declaring the @Distributive property. |
void |
init(Curator curator,
String taskId)
Initialize task - parameters inform the task of it's invoking curator. |
int |
perform(Context ctx,
String id)
Perform the curation task for passed id |
abstract int |
perform(DSpaceObject dso)
Perform the curation task upon passed DSO |
protected void |
performItem(Item item)
Performs task upon an Item. |
protected void |
report(String message)
Sends message to the reporting stream |
protected void |
setResult(String result)
Assigns the result of the task performance |
protected boolean |
taskBooleanProperty(String name,
boolean defaultValue)
Returns task configuration boolean property value for passed name, else passed default value if no properties defined or no value for passed key. |
protected int |
taskIntProperty(String name,
int defaultValue)
Returns task configuration integer property value for passed name, else passed default value if no properties defined or no value for passed key. |
protected long |
taskLongProperty(String name,
long defaultValue)
Returns task configuration long property value for passed name, else passed default value if no properties defined or no value for passed key. |
protected String |
taskProperty(String name)
Returns task configuration property value for passed name, else null if no properties defined or no value for passed key. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Curator curator
protected String taskId
| Constructor Detail |
|---|
public AbstractCurationTask()
| Method Detail |
|---|
public void init(Curator curator,
String taskId)
throws IOException
CurationTask
init in interface CurationTaskcurator - the Curator controlling this tasktaskId - identifier task should use in invoking services
IOException
public abstract int perform(DSpaceObject dso)
throws IOException
CurationTask
perform in interface CurationTaskdso - the DSpace object
IOException
protected void distribute(DSpaceObject dso)
throws IOException
@Distributive property. Users must
override the 'performItem' invoked by this method.
dso -
IOException
protected void performItem(Item item)
throws SQLException,
IOException
distribute
method is used.
item -
SQLException
IOException
public int perform(Context ctx,
String id)
throws IOException
CurationTask
perform in interface CurationTaskctx - DSpace context objectid - persistent ID for DSpace object
IOException
protected DSpaceObject dereference(Context ctx,
String id)
throws IOException
ctx - DSpace contextid - canonical id of object
IOExceptionprotected void report(String message)
message - the message to streamprotected void setResult(String result)
result - the result stringprotected String taskProperty(String name)
null if no properties defined or no value for passed key.
name - the property name
protected int taskIntProperty(String name,
int defaultValue)
name - the property namedefaultValue - value
the default value
protected long taskLongProperty(String name,
long defaultValue)
name - the property namedefaultValue - value
the default value
protected boolean taskBooleanProperty(String name,
boolean defaultValue)
name - the property namedefaultValue - value
the default value
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||