net.sourceforge.java.util.jobs.scheduling
Class JobExecutionStatus

java.lang.Object
  extended bynet.sourceforge.java.util.jobs.scheduling.JobExecutionStatus

public class JobExecutionStatus
extends Object

Represents the execution status of an ScheduledJob which is scheduled for execution in the JobManager context.

Author:
Sebastian Machhausen

Field Summary
private  JobExecutionInterval interval
           The execution interval of an IJob
private  long lastExecutionTime
           The time in milliseconds since January 1, 1970, 00:00:00 GMT that an IJob was last executed at
private  ScheduledJob scheduledJob
           The ScheduledJob whose execution status is described
 
Constructor Summary
JobExecutionStatus(JobExecutionInterval interval)
           Creates a new JobExceutionInterval.
 
Method Summary
 JobExecutionInterval getExecutionInterval()
           Gets the JobExecutionInterval of this JobExceutionStatus which hold the period which separates subsequent executions of an IJob.
 long getLastExecutionTime()
           Gets the time in milliseconds since January 1, 1970, 00:00:00 GMT that an IJob was last executed at.
 long getNextExecutionTime()
           Gets the next execution time of an IJob in milliseconds since January 1, 1970, 00:00:00 GMT.
 long getPeriod()
           Gets the period in milliseconds that separates subsequent executions of a IJob.
 ScheduledJob getScheduledJob()
           Gets the ScheduledJob whose status is described by this JobExecutionStatus.
 void setExecutionInterval(JobExecutionInterval interval)
           Sets the JobExecutionInterval of this JobExceutionStatus which hold the period which separates subsequent executions of an IJob.
 void setLastExecutionTime(long lastExecutionTime)
           Sets the time in milliseconds since January 1, 1970, 00:00:00 GMT that an IJob was last executed at.
 void setScheduledJob(ScheduledJob scheduledJob)
           Sets the ScheduledJob whose status is described by this JobExecutionStatus.
 String toString()
           Gets the textual representation of this JobExecutionStatus instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

interval

private JobExecutionInterval interval

The execution interval of an IJob


lastExecutionTime

private long lastExecutionTime

The time in milliseconds since January 1, 1970, 00:00:00 GMT that an IJob was last executed at


scheduledJob

private ScheduledJob scheduledJob

The ScheduledJob whose execution status is described

Constructor Detail

JobExecutionStatus

public JobExecutionStatus(JobExecutionInterval interval)

Creates a new JobExceutionInterval.

Parameters:
interval - a JobExecutionInterval object that holds the period in milliseconds that separates executions of an IJob
Method Detail

setScheduledJob

public void setScheduledJob(ScheduledJob scheduledJob)

Sets the ScheduledJob whose status is described by this JobExecutionStatus.

Parameters:
scheduledJob - the ScheduledJob whose status is described by this JobExecutionStatus

getScheduledJob

public ScheduledJob getScheduledJob()

Gets the ScheduledJob whose status is described by this JobExecutionStatus.

Returns:
the ScheduledJob whose status is described by this JobExecutionStatus

setExecutionInterval

public void setExecutionInterval(JobExecutionInterval interval)

Sets the JobExecutionInterval of this JobExceutionStatus which hold the period which separates subsequent executions of an IJob.

Parameters:
interval - the JobExecutionInterval to set
Throws:
IllegalArgumentException - if a null value is specified for the interval argument

getExecutionInterval

public JobExecutionInterval getExecutionInterval()

Gets the JobExecutionInterval of this JobExceutionStatus which hold the period which separates subsequent executions of an IJob.

Returns:
the JobExecutionInterval of this JobExceutionStatus

getPeriod

public long getPeriod()

Gets the period in milliseconds that separates subsequent executions of a IJob.

Returns:
the period in milliseconds that separates subsequent executions of a IJob

setLastExecutionTime

public void setLastExecutionTime(long lastExecutionTime)

Sets the time in milliseconds since January 1, 1970, 00:00:00 GMT that an IJob was last executed at.

Parameters:
lastExecutionTime - the time in milliseconds since January 1, 1970, 00:00:00 GMT that an IJob was last executed at
Throws:
IllegalArgumentException - if a value less than zero is specified for lastExecutionTime

getLastExecutionTime

public long getLastExecutionTime()

Gets the time in milliseconds since January 1, 1970, 00:00:00 GMT that an IJob was last executed at.

Returns:
the time in milliseconds since January 1, 1970, 00:00:00 GMT that an IJob was last executed at

getNextExecutionTime

public long getNextExecutionTime()

Gets the next execution time of an IJob in milliseconds since January 1, 1970, 00:00:00 GMT.

Returns:
the next execution time of an IJob in milliseconds since January 1, 1970, 00:00:00 GMT

toString

public String toString()

Gets the textual representation of this JobExecutionStatus instance. This method returns the localized textual representation of the currently set period as returned by the JobExecutionInterval.getLocalizedPeriod() method, e.g. "5 minutes".

Returns:
the textual representation of this JobExecutionStatus instance