public final class JobStatus extends Object implements Serializable
| Constructor and Description |
|---|
JobStatus(UUID jobId,
String description,
JobState state,
double progress,
String status)
Creates a new
JobStatus with no event ID. |
JobStatus(UUID jobId,
String description,
JobState state,
String status)
Creates a new
JobStatus with no event ID and
indeterminant progress. |
| Modifier and Type | Method and Description |
|---|---|
JobStatus |
asCancelled()
Creates a copy of this
JobStatus with the state set to
JobState.CANCELLED. |
JobStatus |
asComplete()
Creates a copy of this
JobStatus with the state set to
JobState.COMPLETE. |
String |
getDescription()
Gets a description of the job.
|
long |
getEventId()
Gets the event ID.
|
UUID |
getJobId()
Gets the
UUID that identifies the job. |
double |
getProgress()
Gets a value indicating the progress of the job (complete = 1.0).
|
JobState |
getState()
Gets the current state of the job (new, running, complete, etc.).
|
String |
getStatus()
Gets a description of the status of the job.
|
boolean |
isCancelled()
Gets a value indicating if the job has been cancelled.
|
boolean |
isComplete()
Gets a value indicating if the job is complete.
|
boolean |
isProgressIndeterminant()
Gets a value indicating if the progress of the job is indeterminant.
|
JobStatus |
withIndeterminantProgress()
Creates a copy of this
JobStatus with the progress set to
an indeterminant value (Double.NaN). |
JobStatus |
withNewEventId()
Creates a copy of this
JobStatus with an auto-generated
event ID. |
JobStatus |
withProgress(double newProgress)
Creates a copy of this
JobStatus with the progress set to
the specified value. |
JobStatus |
withStatus(String newStatus)
Creates a copy of this
JobStatus with the status string set
to the specified value. |
public JobStatus(UUID jobId, String description, JobState state, double progress, String status)
JobStatus with no event ID.jobId - The UUID identifying the job.description - A description of the job.state - The current state of the job (new, running, complete, etc).progress - The progress toward completion (complete = 1.0). If
equal to Double.NaN, the progress is indeterminant.status - A description of the current status of the job.public JobStatus(UUID jobId, String description, JobState state, String status)
JobStatus with no event ID and
indeterminant progress.jobId - The UUID identifying the job.description - A description of the job.state - The current state of the job (new, running, complete, etc).status - A description of the current status of the job.public JobStatus withProgress(double newProgress)
JobStatus with the progress set to
the specified value.newProgress - The progress toward completion (complete = 1.0). If
equal to Double.NaN, the progress is indeterminant.JobStatus with the progress set to
the specified value.public JobStatus withStatus(String newStatus)
JobStatus with the status string set
to the specified value.newStatus - A description of the current status of the job.JobStatus with the status string set
to the specified value.public JobStatus asComplete()
JobStatus with the state set to
JobState.COMPLETE.JobStatus with the state set to
JobState.COMPLETE.public JobStatus asCancelled()
JobStatus with the state set to
JobState.CANCELLED.JobStatus with the state set to
JobState.CANCELLED.public JobStatus withIndeterminantProgress()
JobStatus with the progress set to
an indeterminant value (Double.NaN).JobStatus with the progress set to
indeterminant.public JobStatus withNewEventId()
JobStatus with an auto-generated
event ID. The event ID will be greater than any previously generated
event ID.JobStatus with an auto-generated
event ID.public UUID getJobId()
UUID that identifies the job.UUID that identifies the job.public String getDescription()
public JobState getState()
public boolean isComplete()
public boolean isCancelled()
public double getProgress()
public boolean isProgressIndeterminant()
public String getStatus()
public long getEventId()
Copyright © 2016. All rights reserved.