org.openmrs.scheduler
Class Schedule

java.lang.Object
  extended by org.openmrs.scheduler.Schedule

public class Schedule
extends java.lang.Object

Describes when to start a task and how often it should be executed.


Field Summary
static int DAILY
           
static int DAYS_PER_WEEK
           
 java.lang.String DEFAULT_DATE_FORMAT
          Default TODO Move to constants or properties
static int HOURS_PER_DAY
           
static int MILLISECONDS_PER_SECOND
          Constants
static int MINUTES_PER_HOUR
           
static int SECONDS_PER_MINUTE
           
static int WEEKLY
           
 
Constructor Summary
Schedule()
          Public no-arg constructor.
Schedule(java.util.Date startTime, long repeatInterval)
          Public constructor
Schedule(java.lang.String name, java.lang.String description, java.util.Date startTime, long repeatInterval)
          Public constructor
 
Method Summary
 java.lang.String getDateFormat()
          Get the date format used to set the start time.
 java.lang.String getDescription()
          Gets the description of the schedule.
 java.lang.Integer getId()
          Gets the identifier of the schedule.
 java.lang.String getName()
          Gets the name of the schedule.
 long getRepeatInterval()
          Gets the number of seconds until task is executed again.
 java.lang.Boolean getStartOnStartup()
          Gets the flag that indicates whether we start on scheduler startup.
 java.util.Date getStartTime()
          Get the start time for when the task should be executed.
 void setDateFormat(java.lang.String dateFormat)
          Sets the date format used to set the start time.
 void setDescription(java.lang.String description)
          Sets the description of the schedule.
 void setId(java.lang.Integer id)
          Sets the identifier of the schedule.
 void setName(java.lang.String name)
          Sets the name of the schedule.
 void setRepeatInterval(long repeatInterval)
          Sets the number of seconds until task is executed again.
 void setStartOnStartup(java.lang.Boolean startOnStartup)
          Sets the flag that indicates whether we start on scheduler startup.
 void setStartTime(java.util.Date startTime)
          Set the start time for when the task should be executed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_DATE_FORMAT

public final java.lang.String DEFAULT_DATE_FORMAT
Default TODO Move to constants or properties

See Also:
Constant Field Values

MILLISECONDS_PER_SECOND

public static final int MILLISECONDS_PER_SECOND
Constants

See Also:
Constant Field Values

SECONDS_PER_MINUTE

public static final int SECONDS_PER_MINUTE
See Also:
Constant Field Values

MINUTES_PER_HOUR

public static final int MINUTES_PER_HOUR
See Also:
Constant Field Values

HOURS_PER_DAY

public static final int HOURS_PER_DAY
See Also:
Constant Field Values

DAYS_PER_WEEK

public static final int DAYS_PER_WEEK
See Also:
Constant Field Values

DAILY

public static final int DAILY
See Also:
Constant Field Values

WEEKLY

public static final int WEEKLY
See Also:
Constant Field Values
Constructor Detail

Schedule

public Schedule()
Public no-arg constructor.


Schedule

public Schedule(java.util.Date startTime,
                long repeatInterval)
Public constructor

Parameters:
startTime - Date for when to start the task (does not need to be in the future if the interval is specified).
repeatInterval - interval time in seconds to wait between executing task (<= 0 indicates that it should only be run once)

Schedule

public Schedule(java.lang.String name,
                java.lang.String description,
                java.util.Date startTime,
                long repeatInterval)
Public constructor

Parameters:
name -
description -
startTime - Date for when to start the task (does not need to be in the future if the interval is specified).
repeatInterval - interval time in seconds to wait between executing task (<= 0 indicates that it should only be run once)
Method Detail

getId

public java.lang.Integer getId()
Gets the identifier of the schedule.

Returns:
the identifier of the schedule

setId

public void setId(java.lang.Integer id)
Sets the identifier of the schedule.

Parameters:
id - the identifier of the schedule

getName

public java.lang.String getName()
Gets the name of the schedule.

Returns:
the name of the schedule

setName

public void setName(java.lang.String name)
Sets the name of the schedule.

Parameters:
name - the name of the schedule

getDescription

public java.lang.String getDescription()
Gets the description of the schedule.

Returns:
the description of the schedule

setDescription

public void setDescription(java.lang.String description)
Sets the description of the schedule.

Parameters:
description - the description of the schedule

getStartTime

public java.util.Date getStartTime()
Get the start time for when the task should be executed.

Returns:
long start time

setStartTime

public void setStartTime(java.util.Date startTime)
Set the start time for when the task should be executed. For instance, use "new Date()", if you want it to start now.

Parameters:
startTime - start time for the task

getRepeatInterval

public long getRepeatInterval()
Gets the number of seconds until task is executed again.

Returns:
long number of seconds.

setRepeatInterval

public void setRepeatInterval(long repeatInterval)
Sets the number of seconds until task is executed again.

Parameters:
repeatInterval -

getDateFormat

public java.lang.String getDateFormat()
Get the date format used to set the start time.


setDateFormat

public void setDateFormat(java.lang.String dateFormat)
Sets the date format used to set the start time.


getStartOnStartup

public java.lang.Boolean getStartOnStartup()
Gets the flag that indicates whether we start on scheduler startup.


setStartOnStartup

public void setStartOnStartup(java.lang.Boolean startOnStartup)
Sets the flag that indicates whether we start on scheduler startup.


OpenMRS-1.7.x

Generated Apr 27 2012 10:06 PM. NOTE - these libraries are in active development and subject to change