public interface JobHandle extends StatefulServiceInterface
NOTE: The calling order for the service is as follows:
Job
) or attach(long)close()
does not cancel or otherwise change the Job
state. See cancelJob()
.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CANCELLED |
static java.lang.String |
ERROR |
static java.lang.String |
FINISHED |
static java.lang.String |
QUEUED |
static java.lang.String |
REQUEUED |
static java.lang.String |
RESUBMITTED |
static java.lang.String |
RUNNING |
static java.lang.String |
SUBMITTED |
static java.lang.String |
WAITING |
Modifier and Type | Method and Description |
---|---|
ome.model.jobs.JobStatus |
attach(long jobId) |
void |
cancelJob()
Marks a job for cancellation.
|
ome.model.jobs.Job |
getJob() |
boolean |
jobError()
Returns true if the
Job has thrown an error. |
java.sql.Timestamp |
jobFinished() |
java.lang.String |
jobMessage() |
boolean |
jobRunning()
Returns true if the
Job is running, i.e. |
ome.model.jobs.JobStatus |
jobStatus() |
java.lang.String |
setMessage(java.lang.String message)
Sets the job's message string, and returns the previous value.
|
java.lang.String |
setStatus(java.lang.String status)
Updates the
JobStatus for the current job. |
java.lang.String |
setStatusAndMessage(java.lang.String status,
java.lang.String message)
Like
setStatus(String) but also sets the message. |
long |
submit(ome.model.jobs.Job job)
Submits a
Job and returns its database id. |
activate, close, getCurrentEventContext, passivate
static final java.lang.String SUBMITTED
static final java.lang.String RESUBMITTED
static final java.lang.String QUEUED
static final java.lang.String REQUEUED
static final java.lang.String RUNNING
static final java.lang.String ERROR
static final java.lang.String WAITING
static final java.lang.String FINISHED
static final java.lang.String CANCELLED
long submit(ome.model.jobs.Job job)
Job
and returns its database id. The only fields
directly on status which are editable are message,
scheduledFor and status. The latter two must be
sensible.job
- Not nullome.model.jobs.JobStatus attach(long jobId) throws ome.conditions.ApiUsageException
JobStatus
for the id
ome.conditions.ApiUsageException
- if the id
does not exist.ome.model.jobs.Job getJob()
Job
ome.model.jobs.JobStatus jobStatus()
JobStatus
. Will never return null.java.sql.Timestamp jobFinished()
Job
is not finished, otherwise the
Timestamp
for when it completed.java.lang.String jobMessage()
boolean jobRunning()
Job
is running, i.e. has an attached
Process
.boolean jobError()
Job
has thrown an error.void cancelJob()
java.lang.String setStatus(java.lang.String status)
JobStatus
for the current job. The previous status
is returned as a string. If the status is CANCELLED
, this
method is equivalent to cancelJob()
.java.lang.String setStatusAndMessage(java.lang.String status, java.lang.String message)
setStatus(String)
but also sets the message.java.lang.String setMessage(java.lang.String message)
message
-