net.sourceforge.java.util.jobs
Class JobStatus

java.lang.Object
  extended bynet.sourceforge.java.util.jobs.JobStatus

public class JobStatus
extends Object

Represents the status of a IJob.

Author:
Sebastian Machhausen

Field Summary
private  long duration
           The IJob duration in milliseconds
static int FINISHED
           Constant to indicate a finished IJob
private  String name
           The name of the IJob
private  int priority
           The IJob priority
static int RUNNING
           Constant to indicate a running IJob
private  Date startTime
           The time that the monitored IJob was started at
private  int status
           The IJob status flag.
private  IJobStatusFormat statusFormat
           The format object for the JobStatus
private  double totalWorkUnits
           The total number of work units to be done
static int UNKNOWN_TOTAL_WORK_UNITS
           Flag to indicate an unknown amount of total work units
static int WAITING
           Constant to indicate a waiting IJob
private  double workUnitsDone
           The number of work units done
 
Constructor Summary
JobStatus(String name)
           Creates a new JobStatus instance.
 
Method Summary
 long getDuration()
           Gets the duration of the monitored IJob in milliseconds.
 String getName()
           Gets the name of the IJob whose status is monitored by this JobStatus.
 int getPriority()
           Gets the priority of this JobStatus object.
 Date getStartTime()
           Gets the start time of the monitored IJob.
 int getStatus()
           Gets the status of the monitored IJob.
 IJobStatusFormat getStatusFormat()
           Gets the IJobStatusFormat object of this JobStatus
 double getTotalWorkUnits()
           Gets the number of total work units to be done in the monitored IJob.
 double getWorkUnitsDone()
           Gets the number of work units done in the monitored IJob.
 void setDuration(long duration)
           Sets the duration of the monitored IJob in milliseconds.
 void setName(String name)
           Sets the name for the IJob whose status is monitored by this JobStatus.
 void setPriority(int priority)
           Sets the priority of this JobStatus object.
 void setStartTime(Date startTime)
           Sets the start time of the monitored IJob.
 void setStatus(int status)
           Sets the status for the monitored IJob.
 void setStatusFormat(IJobStatusFormat format)
           Sets the IJobStatusFormat object for this JobStatus
 void setTotalWorkUnits(double totalWorkUnits)
           Sets the number of total work units to be done in the monitored IJob.
 void setWorkUnitsDone(double workUnitsDone)
           Sets the number of work units done in the monitored IJob.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UNKNOWN_TOTAL_WORK_UNITS

public static final int UNKNOWN_TOTAL_WORK_UNITS

Flag to indicate an unknown amount of total work units

See Also:
Constant Field Values

RUNNING

public static final int RUNNING

Constant to indicate a running IJob

See Also:
Constant Field Values

WAITING

public static final int WAITING

Constant to indicate a waiting IJob

See Also:
Constant Field Values

FINISHED

public static final int FINISHED

Constant to indicate a finished IJob

See Also:
Constant Field Values

priority

private int priority

The IJob priority


name

private String name

The name of the IJob


workUnitsDone

private double workUnitsDone

The number of work units done


totalWorkUnits

private double totalWorkUnits

The total number of work units to be done


startTime

private Date startTime

The time that the monitored IJob was started at


duration

private long duration

The IJob duration in milliseconds


status

private int status

The IJob status flag. A Job is waiting by default.


statusFormat

private IJobStatusFormat statusFormat

The format object for the JobStatus

Constructor Detail

JobStatus

public JobStatus(String name)

Creates a new JobStatus instance.

Parameters:
name - the name of the IJob whose status is monitored by this JobStatus
Method Detail

setPriority

public void setPriority(int priority)

Sets the priority of this JobStatus object.

Predefined priorities are: The priority must therefore range between IJob.LOW_PRIORITY and IJob.HIGH_PRIORITY. Priorites beyons this interval will be rejected and don't change the current priority.

Parameters:
priority - the priority to set for this JobStatus object

getPriority

public int getPriority()

Gets the priority of this JobStatus object.

Predefined priorities are: The priority therefore ranges between IJob.LOW_PRIORITY and IJob.HIGH_PRIORITY.

Returns:
the priority of this JobStatus object

setName

public void setName(String name)

Sets the name for the IJob whose status is monitored by this JobStatus.

Parameters:
name - the name for the IJob whose status is monitored by this JobStatus

getName

public String getName()

Gets the name of the IJob whose status is monitored by this JobStatus.

Returns:
the name of the IJob whose status is monitored by this JobStatus

setWorkUnitsDone

public void setWorkUnitsDone(double workUnitsDone)

Sets the number of work units done in the monitored IJob.

Parameters:
workUnitsDone - the number of work units done in the monitored IJob

getWorkUnitsDone

public double getWorkUnitsDone()

Gets the number of work units done in the monitored IJob.

Returns:
the number of work units done in the monitored IJob

setTotalWorkUnits

public void setTotalWorkUnits(double totalWorkUnits)

Sets the number of total work units to be done in the monitored IJob.

Parameters:
totalWorkUnits - the number of total work units to be done in the monitored IJob

getTotalWorkUnits

public double getTotalWorkUnits()

Gets the number of total work units to be done in the monitored IJob.

Returns:
the number of total work units to be done in the monitored IJob

setStatus

public void setStatus(int status)

Sets the status for the monitored IJob.

The legal status values are:

Parameters:
status - the status to set for the monitored IJob

getStatus

public int getStatus()

Gets the status of the monitored IJob.

The returned status is one of these values:

Returns:
the status of the monitored IJob

setStartTime

public void setStartTime(Date startTime)

Sets the start time of the monitored IJob.

Parameters:
startTime - the start time of the monitored IJob

getStartTime

public Date getStartTime()

Gets the start time of the monitored IJob.

Returns:
the start time of the monitored IJob

setDuration

public void setDuration(long duration)

Sets the duration of the monitored IJob in milliseconds.

Parameters:
duration - the duration of the monitored IJob in milliseconds

getDuration

public long getDuration()

Gets the duration of the monitored IJob in milliseconds.

Returns:
the duration of the monitored IJob in milliseconds

setStatusFormat

public void setStatusFormat(IJobStatusFormat format)

Sets the IJobStatusFormat object for this JobStatus

Parameters:
format - the IJobStatusFormat object for this JobStatus

getStatusFormat

public IJobStatusFormat getStatusFormat()

Gets the IJobStatusFormat object of this JobStatus

Returns:
the IJobStatusFormat object of this JobStatus