|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface DocumentTaskManager
The DocumentTaskManager is concerned with the execution of a certain task on a set of documents. The task is executed in a background-thread. The task is executed once for each document in the set, and the state of execution for each document is tracked individually. This execution progress is recorded persistently, so it is possible to see afterwards if the task has run on all documents, and what the outcome was (succesful or error), even after server restarts.
The run-information of a task can afterwards be explicitely deleted, or the implementation of DocumentTaskManager may provide automatic cleanup based on an expiration interval.
Method Summary | |
---|---|
DocumentSelection |
createEnumerationDocumentSelection(org.outerj.daisy.repository.VariantKey[] variantKeys)
|
DocumentSelection |
createQueryDocumentSelection(java.lang.String query)
|
SimpleActionsTaskSpecification |
createSimpleActionsTaskSpecification(java.lang.String description,
boolean stopOnFirstError)
|
TaskSpecification |
createTaskSpecification(java.lang.String description,
java.lang.String script,
java.lang.String scriptLanguage,
boolean stopOnFirstError)
|
void |
deleteTask(long id)
Deletes a task. |
Task |
getTask(long id)
|
TaskDocDetails |
getTaskDocDetails(long taskId)
|
Tasks |
getTasks()
For non-administrator users, this returns all tasks belonging to the user. |
void |
interruptTask(long id)
Interrupts a task (i.e. |
long |
runTask(DocumentSelection documentSelection,
TaskSpecification taskSpecification)
Runs a task. |
Method Detail |
---|
long runTask(DocumentSelection documentSelection, TaskSpecification taskSpecification) throws TaskException, org.outerj.daisy.repository.RepositoryException
The documentSelection can be created via createEnumerationDocumentSelection(org.outerj.daisy.repository.VariantKey[])
or createQueryDocumentSelection(String)
.
The taskSpecification can be created via createTaskSpecification(String, String, String, boolean)
or
createSimpleActionsTaskSpecification(String, boolean)
.
Non-administrator users can only run tasks created via createSimpleActionsTaskSpecification(String, boolean)
, since
using generic scripting languages nasty things can be done (infinite loops, calling System.exit, etc.).
After creation of the task, this method returns immediatelly. The state of the task
can then be queried using the getTask(long)
method.
TaskException
org.outerj.daisy.repository.RepositoryException
Task getTask(long id) throws TaskException, org.outerj.daisy.repository.RepositoryException
TaskException
org.outerj.daisy.repository.RepositoryException
Tasks getTasks() throws TaskException, org.outerj.daisy.repository.RepositoryException
TaskException
org.outerj.daisy.repository.RepositoryException
void deleteTask(long id) throws TaskException, org.outerj.daisy.repository.RepositoryException
TaskException
org.outerj.daisy.repository.RepositoryException
void interruptTask(long id) throws TaskException, org.outerj.daisy.repository.RepositoryException
TaskException
org.outerj.daisy.repository.RepositoryException
TaskDocDetails getTaskDocDetails(long taskId) throws TaskException, org.outerj.daisy.repository.RepositoryException
TaskException
org.outerj.daisy.repository.RepositoryException
TaskSpecification createTaskSpecification(java.lang.String description, java.lang.String script, java.lang.String scriptLanguage, boolean stopOnFirstError)
SimpleActionsTaskSpecification createSimpleActionsTaskSpecification(java.lang.String description, boolean stopOnFirstError)
DocumentSelection createQueryDocumentSelection(java.lang.String query)
DocumentSelection createEnumerationDocumentSelection(org.outerj.daisy.repository.VariantKey[] variantKeys)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |