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 String |
CANCELLED |
static String |
ERROR |
static String |
FINISHED |
static String |
QUEUED |
static String |
REQUEUED |
static String |
RESUBMITTED |
static String |
RUNNING |
static String |
SUBMITTED |
static 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. |
Timestamp |
jobFinished() |
String |
jobMessage() |
boolean |
jobRunning()
Returns true if the
Job is running, i.e. has an attached
Process . |
ome.model.jobs.JobStatus |
jobStatus() |
String |
setMessage(String message)
Sets the job's message string, and returns the previous value.
|
String |
setStatus(String status)
Updates the
JobStatus for the current job. |
String |
setStatusAndMessage(String status,
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 String SUBMITTED
static final String RESUBMITTED
static final String QUEUED
static final String REQUEUED
static final String RUNNING
static final String ERROR
static final String WAITING
static final String FINISHED
static final 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.Timestamp jobFinished()
Job
is not finished, otherwise the
Timestamp
for when it completed.String jobMessage()
boolean jobRunning()
Job
is running, i.e. has an attached
Process
.boolean jobError()
Job
has thrown an error.void cancelJob()
String setStatus(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()
.String setStatusAndMessage(String status, String message)
setStatus(String)
but also sets the message.
Version: 5.1.2-ice35-b45
Copyright © 2015 The University of Dundee & Open Microscopy Environment. All Rights Reserved.