public class Curator
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
Curator.Invoked |
static class |
Curator.TxScope |
| Modifier and Type | Field and Description |
|---|---|
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 and Description |
|---|
Curator()
No-arg constructor
|
| Modifier and Type | Method and Description |
|---|---|
Curator |
addTask(java.lang.String taskName)
Add a task to the set to be performed.
|
void |
clear()
Removes all configured tasks from the Curator.
|
void |
curate(Context c,
java.lang.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 thread.
|
java.lang.String |
getResult(java.lang.String taskName)
Returns the result string for the latest performance of the named task.
|
int |
getStatus(java.lang.String taskName)
Returns the status code for the latest performance of the named task.
|
boolean |
hasTask(java.lang.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,
java.lang.String id,
java.lang.String queueId)
Places a curation request for the object identified by id on a
managed queue named by the queueId.
|
Curator |
removeTask(java.lang.String taskName)
Removes a task from the set to be performed.
|
void |
report(java.lang.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(java.lang.String reporter)
Sets the reporting stream for this curator.
|
void |
setResult(java.lang.String taskName,
java.lang.String result)
Assigns a result to the performance of the named task.
|
Curator |
setTransactionScope(Curator.TxScope scope)
Defines the transactional scope of curator executions.
|
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
public Curator addTask(java.lang.String taskName)
taskName - - logical name of taskpublic boolean hasTask(java.lang.String taskName)
taskName - - logical name of the taskpublic Curator removeTask(java.lang.String taskName)
taskName - - logical name of the taskpublic Curator setInvoked(Curator.Invoked mode)
mode - one of INTERACTIVE, BATCH, ANYpublic Curator setReporter(java.lang.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, java.lang.String id) throws java.io.IOException
c - a Dpace contextid - an object identifierjava.io.IOExceptionpublic void curate(DSpaceObject dso) throws java.io.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 objectjava.io.IOExceptionpublic void queue(Context c, java.lang.String id, java.lang.String queueId) throws java.io.IOException
c - A DSpace contextid - an object IdqueueId - name of a queue. If queue does not exist, it will
be created automatically.java.io.IOExceptionpublic void clear()
public void report(java.lang.String message)
message - the message to output to the reporting stream.public int getStatus(java.lang.String taskName)
taskName - the task namepublic java.lang.String getResult(java.lang.String taskName)
taskName - the task namenull if task has not set it.public void setResult(java.lang.String taskName,
java.lang.String result)
taskName - the task nameresult - a string indicating results of performing task.public static Context curationContext() throws java.sql.SQLException
If the context is null or not set, then this just returns a brand new Context object representing an Anonymous User.
java.sql.SQLExceptionpublic static boolean isContainer(DSpaceObject dso)
dso - a DSpace objectCopyright © 2013 DuraSpace. All Rights Reserved.