public class JobPhase
extends java.lang.Object
implements java.io.Serializable
ExecutionPhase
,
UWSJob
,
Serialized FormModifier and Type | Field and Description |
---|---|
protected UWSJob |
job
The job whose the current phase is represented by this class.
|
protected ExecutionPhase |
phase
Current phase of the associated job.
|
Constructor and Description |
---|
JobPhase(UWSJob j)
Builds the phase manager of the given job.
|
Modifier and Type | Method and Description |
---|---|
UWSJob |
getJob()
Gets the job whose the execution phase is represented by this object.
|
ExecutionPhase |
getPhase()
Gets the current phase of the job.
|
boolean |
isExecuting()
Indicates whether the job is executing, considering its current phase.
|
boolean |
isFinished()
Indicates whether the job is finished or not, considering its current
phase.
|
boolean |
isJobUpdatable()
Indicates whether the job attributes (except errors and results) can be
updated, considering its current phase.
|
protected void |
setAbortedPhase(boolean force)
Changes the current phase to
ABORTED . |
protected void |
setArchivedPhase(boolean force)
Changes the current phase to
ARCHIVED . |
protected void |
setCompletedPhase(boolean force)
Changes the current phase to
COMPLETED . |
protected void |
setErrorPhase(boolean force)
Changes the current phase to
ERROR . |
protected void |
setExecutingPhase(boolean force)
Changes the current phase to
EXECUTING . |
protected void |
setHeldPhase(boolean force)
Changes the current phase to
HELD . |
protected void |
setPendingPhase(boolean force)
Changes the current phase to
PENDING . |
void |
setPhase(ExecutionPhase p)
Lets changing the current phase of the associated job considering the
order of execution phases.
|
void |
setPhase(ExecutionPhase p,
boolean force)
Lets changing the current phase of the associated job considering or
not the order of execution phases.
|
protected void |
setQueuedPhase(boolean force)
Changes the current phase to
QUEUED . |
protected void |
setSuspendedPhase(boolean force)
Changes the current phase to
SUSPENDED . |
protected void |
setUnknownPhase(boolean force)
Changes the current phase to
UNKNOWN . |
java.lang.String |
toString() |
protected ExecutionPhase phase
protected final UWSJob job
public JobPhase(UWSJob j) throws java.lang.NullPointerException
j
- The job whose the execution phase must be represented by the
built JobPhase instance.java.lang.NullPointerException
- If the given job is null.public final UWSJob getJob()
public final ExecutionPhase getPhase()
public final void setPhase(ExecutionPhase p) throws UWSException
p
- The new execution phase.UWSException
- If the given phase is null or if the phase
transition is forbidden.setPhase(ExecutionPhase, boolean)
public void setPhase(ExecutionPhase p, boolean force) throws UWSException
Note: If the given phase is null, nothing is done.
p
- The new phase.force
- true to ignore the phases order,
false otherwise.UWSException
- If the phase transition is forbidden.setPendingPhase(boolean)
,
setQueuedPhase(boolean)
,
setExecutingPhase(boolean)
,
setCompletedPhase(boolean)
,
setAbortedPhase(boolean)
,
setErrorPhase(boolean)
,
setHeldPhase(boolean)
,
setSuspendedPhase(boolean)
,
setArchivedPhase(boolean)
,
setUnknownPhase(boolean)
protected void setPendingPhase(boolean force) throws UWSException
PENDING
.force
- true to ignore the phases order,
false otherwise.UWSException
- If this phase transition is forbidden
(by default: IF force=false
AND currentPhase != PENDING and UNKNOWN).protected void setQueuedPhase(boolean force) throws UWSException
QUEUED
.force
- true to ignore the phases order,
false otherwise.UWSException
- If this phase transition is forbidden
(by default: IF force=false
AND currentPhase != QUEUED, HELD, PENDING
and UNKNOWN).protected void setExecutingPhase(boolean force) throws UWSException
EXECUTING
.force
- true to ignore the phases order,
false otherwise.UWSException
- If this phase transition is forbidden
(by default: IF force=false
AND currentPhase != EXECUTING, HELD, SUSPENDED,
QUEUED and UNKNOWN).protected void setCompletedPhase(boolean force) throws UWSException
COMPLETED
.force
- true to ignore the phases order,
false otherwise.UWSException
- If this phase transition is forbidden
(by default: IF force=false
AND currentPhase != COMPLETED, EXECUTING
and UNKNOWN).protected void setAbortedPhase(boolean force) throws UWSException
ABORTED
.force
- true to ignore the phases order,
false otherwise.UWSException
- If this phase transition is forbidden
(by default: IF force=false
AND currentPhase = COMPLETED, ERROR
or ARCHIVED).protected void setErrorPhase(boolean force) throws UWSException
ERROR
.force
- true to ignore the phases order,
false otherwise.UWSException
- If this phase transition is forbidden
(by default: IF force=false
AND currentPhase = COMPLETED, ABORTED
or ARCHIVED).protected void setHeldPhase(boolean force) throws UWSException
HELD
.force
- true to ignore the phases order,
false otherwise.UWSException
- If this phase transition is forbidden
(by default: IF force=false
AND currentPhase != HELD, PENDING, EXECUTING
and UNKNOWN).protected void setSuspendedPhase(boolean force) throws UWSException
SUSPENDED
.force
- true to ignore the phases order,
false otherwise.UWSException
- If this phase transition is forbidden
(by default: IF force=false
AND currentPhase != SUSPENDED, EXECUTING
and UNKNOWN).protected void setArchivedPhase(boolean force) throws UWSException
ARCHIVED
.force
- true to ignore the phases order,
false otherwise.UWSException
- If this phase transition is forbidden
(by default: IF force=false
AND currentPhase != ARCHIVED, COMPLETED, ABORTED,
and UNKNOWN).protected void setUnknownPhase(boolean force) throws UWSException
UNKNOWN
.force
- true to ignore the phases order,
false otherwise.UWSException
- By default, never!public boolean isJobUpdatable()
Note:
By default, it returns TRUE only if the current phase is equals to
PENDING
!
public boolean isFinished()
Note:
By default, it returns TRUE only if the current phase is either
COMPLETED
,
ABORTED
,
ERROR
or ARCHIVED
!
public boolean isExecuting()
Note:
By default, it returns TRUE only if the current phase is
EXECUTING
or
SUSPENDED
(since it is a phase that can
happen only during execution)!
public java.lang.String toString()
toString
in class java.lang.Object