|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object uws.service.controller.ExecutionDurationController
public class ExecutionDurationController
Lets controlling the execution duration of all jobs managed by a UWS. Thus it is possible to set a default and a maximum value. Moreover you can indicate whether the execution duration of jobs can be modified by the user or not.
Note:
By default, the execution duration can be modified by anyone without any limitation.
The default value is AbstractJob.UNLIMITED_DURATION
.
Field Summary | |
---|---|
protected boolean |
allowModification
Indicates whether the execution duration of jobs can be modified. |
protected long |
defaultDuration
The default duration. |
protected long |
maxDuration
The maximum duration. |
Constructor Summary | |
---|---|
ExecutionDurationController()
|
Method Summary | |
---|---|
boolean |
allowModification()
Tells whether the execution duration of any managed job can be modified. |
void |
allowModification(boolean allowModification)
Lets indicating whether the execution duration of any managed job can be modified. |
void |
control(AbstractJob jobToControl,
long durationToCheck)
Controls the given execution duration. |
void |
control(AbstractJob job,
java.util.Map<java.lang.String,java.lang.String> params)
Extracts the execution duration from the given map and controls its value. |
long |
getDefaultExecutionDuration()
Gets the default execution duration. |
long |
getMaxExecutionDuration()
Gets the maximum execution duration. |
void |
init(java.util.Map<java.lang.String,java.lang.String> params)
Controls the execution duration given in the map or initializes it with the default value if not present in the map. |
void |
setDefaultExecutionDuration(AbstractJob job)
Sets the execution duration of the given job with the default value. |
boolean |
setDefaultExecutionDuration(long defaultExecutionDuration)
Sets the default execution duration. |
void |
setExecutionDuration(AbstractJob job,
long duration)
Controls the given value and sets the execution duration of the given job with this value. |
void |
setMaxExecutionDuration(long maxExecutionDuration)
Sets the maximum execution duration. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected long defaultDuration
protected long maxDuration
protected boolean allowModification
Constructor Detail |
---|
public ExecutionDurationController()
Method Detail |
---|
public final long getDefaultExecutionDuration()
public final boolean setDefaultExecutionDuration(long defaultExecutionDuration)
defaultExecutionDuration
- The new default execution duration (AbstractJob.UNLIMITED_DURATION
, 0 or a negative value mean an unlimited duration).public final long getMaxExecutionDuration()
public final void setMaxExecutionDuration(long maxExecutionDuration)
maxExecutionDuration
- The maximum execution duration (AbstractJob.UNLIMITED_DURATION
, 0 or a negative value mean an unlimited duration).public final boolean allowModification()
public final void allowModification(boolean allowModification)
allowModification
- true if the execution duration can be modified, false otherwise.public void init(java.util.Map<java.lang.String,java.lang.String> params) throws UWSException
params
- The map of all parameters to use for the creation of a job.
UWSException
- If the execution duration given in the map is not valid.control(AbstractJob, Map)
public void control(AbstractJob job, java.util.Map<java.lang.String,java.lang.String> params) throws UWSException
job
- The job whose the execution duration will be set.params
- The map which contains the new execution duration of the given job.
UWSException
- If the new execution duration is not a long number
or if the execution duration of the given job can not be modified
or if the given value exceeds the maximum value.control(AbstractJob, long)
public void control(AbstractJob jobToControl, long durationToCheck) throws UWSException
jobToControl
- The job whose the execution duration will be updated by the given value.durationToCheck
- The new execution duration of the given value.
UWSException
- If the current phase of the job doesn't allow any modification
or if this controller forbids the modification of the execution duration
or if the new execution duration exceeds the maximum value.public void setDefaultExecutionDuration(AbstractJob job) throws UWSException
job
- The job whose the execution duration must be set.
UWSException
- If it is impossible to set the execution duration of the given job (for instance, if the job is running or is finished).setExecutionDuration(AbstractJob, long)
public void setExecutionDuration(AbstractJob job, long duration) throws UWSException
job
- The job whose the execution duration must be set.duration
- The new execution duration of the given job.
UWSException
- If the current phase of the job doesn't allow any modification
or if this controller forbids the modification of the execution duration
or if the new execution duration exceeds the maximum value.control(AbstractJob, long)
,
AbstractJob.setExecutionDuration(long)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |