|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.dspace.curate.Curator
public class Curator
Curator orchestrates and manages the application of a one or more curation tasks to a DSpace object. It provides common services and runtime environment to the tasks.
| Nested Class Summary | |
|---|---|
static class |
Curator.Invoked
|
static class |
Curator.TxScope
|
| Field Summary | |
|---|---|
static int |
CURATE_ERROR
task encountered a error in processing |
static int |
CURATE_FAIL
task failed |
static int |
CURATE_NOTASK
Curator unable to find requested task |
static int |
CURATE_SKIP
task was not applicable to passed object |
static int |
CURATE_SUCCESS
task completed successfully |
static int |
CURATE_UNSET
no assigned status code - typically because task not yet performed |
| Constructor Summary | |
|---|---|
Curator()
No-arg constructor |
|
| Method Summary | |
|---|---|
Curator |
addTask(String taskName)
Add a task to the set to be performed. |
void |
clear()
Removes all configured tasks from the Curator. |
void |
curate(Context c,
String id)
Performs all configured tasks upon object identified by id. |
void |
curate(DSpaceObject dso)
Performs all configured tasks upon DSpace object (Community, Collection or Item). |
static Context |
curationContext()
Returns the context object used in the current curation performance. |
String |
getResult(String taskName)
Returns the result string for the latest performance of the named task. |
int |
getStatus(String taskName)
Returns the status code for the latest performance of the named task. |
boolean |
hasTask(String taskName)
Returns whether this curator has the specified task |
static boolean |
isContainer(DSpaceObject dso)
Returns whether a given DSO is a 'container' - collection or community |
void |
queue(Context c,
String id,
String queueId)
Places a curation request for the object identified by id on a managed queue named by the queueId. |
Curator |
removeTask(String taskName)
Removes a task from the set to be performed. |
void |
report(String message)
Adds a message to the configured reporting stream. |
Curator |
setCacheLimit(int limit)
Sets an upper limit for the number of objects in the context cache used in a curation, if context accessible. |
Curator |
setInvoked(Curator.Invoked mode)
Assigns invocation mode. |
Curator |
setReporter(String reporter)
Sets the reporting stream for this curator. |
void |
setResult(String taskName,
String result)
Assigns a result to the performance of the named task. |
Curator |
setTransactionScope(Curator.TxScope scope)
Defines the transactional scope of curator executions. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int CURATE_NOTASK
public static final int CURATE_UNSET
public static final int CURATE_ERROR
public static final int CURATE_SUCCESS
public static final int CURATE_FAIL
public static final int CURATE_SKIP
| Constructor Detail |
|---|
public Curator()
| Method Detail |
|---|
public Curator addTask(String taskName)
taskName - - logical name of task
public boolean hasTask(String taskName)
taskName - - logical name of the task
public Curator removeTask(String taskName)
taskName - - logical name of the task
public Curator setInvoked(Curator.Invoked mode)
mode - one of INTERACTIVE, BATCH, ANY
public Curator setReporter(String reporter)
reporter - name of reporting stream. The name '-'
causes reporting to standard out.
public Curator setCacheLimit(int limit)
public Curator setTransactionScope(Curator.TxScope scope)
public void curate(Context c,
String id)
throws IOException
c - a Dpace contextid - an object identifier
IOException
public void curate(DSpaceObject dso)
throws IOException
Note: Site-wide tasks will default to running as an Anonymous User unless you call the Site-wide task via the 'curate(Context,String)' method with an authenticated Context object.
dso - the DSpace object
IOException
public void queue(Context c,
String id,
String queueId)
throws IOException
c - A DSpace contextid - an object IdqueueId - name of a queue. If queue does not exist, it will
be created automatically.
IOExceptionpublic void clear()
public void report(String message)
message - the message to output to the reporting stream.public int getStatus(String taskName)
taskName - the task name
public String getResult(String taskName)
taskName - the task name
null if task has not set it.
public void setResult(String taskName,
String result)
taskName - the task nameresult - a string indicating results of performing task.
public static Context curationContext()
throws SQLException
If the context is null or not set, then this just returns a brand new Context object representing an Anonymous User.
SQLExceptionpublic static boolean isContainer(DSpaceObject dso)
dso - a DSpace object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||