org.pentaho.platform.repository.subscription
Class Schedule

java.lang.Object
  extended by org.pentaho.platform.repository.subscription.Schedule
All Implemented Interfaces:
ISchedule

public class Schedule
extends Object
implements ISchedule


Constructor Summary
Schedule(String id, String title, String scheduleRef, String description, Integer repeatCount, Integer repeatInterval, String group, Date startDate, Date endDate)
           
Schedule(String id, String title, String scheduleRef, String description, String cronString, String group, Date startDate, Date endDate)
           
 
Method Summary
 boolean equals(Object other)
           
 String getCronString()
          Get the cron string for this schedule.
 String getDescription()
           
 Date getEndDate()
           
 String getGroup()
           
 String getId()
          A unique id, often a GUID uniquely identifying the schedule, used to locate the schedule in the Solution Repository (ISolutionRepository implementors).
 Date getLastTrigger()
           
 Integer getRepeatCount()
          Get the repeat count (number of times the schedule should run).
 Integer getRepeatInterval()
          Get repeat time in milliseconds.
 int getRevision()
           
 String getScheduleReference()
          Typically the "name" of the schedule
 Date getStartDate()
           
 String getTitle()
           
 int hashCode()
           
 boolean isCronSchedule()
          NOTE: in this implementation, it is possible for isCronSchedule to return false and isRepeatSchedule to return false on the same instance.
 boolean isRepeatSchedule()
          NOTE: see NOTE in isCronSchedule
 void setCronString(String cronString)
          NOTE: see NOTE in setRepeatInterval
 void setDescription(String description)
           
 void setEndDate(Date endDate)
           
 void setGroup(String group)
           
 void setId(String id)
           
 void setLastTrigger(Date lastTrigger)
           
 void setRepeatCount(Integer repeatCount)
          Set the repeat count (number of times the schedule should run).
 void setRepeatInterval(Integer repeatInterval)
          NOTE: repeat schedules and cron schedules are mutually exclusive.
 void setScheduleReference(String scheduleRef)
           
 void setStartDate(Date startDate)
           
 void setTitle(String title)
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Schedule

public Schedule(String id,
                String title,
                String scheduleRef,
                String description,
                String cronString,
                String group,
                Date startDate,
                Date endDate)

Schedule

public Schedule(String id,
                String title,
                String scheduleRef,
                String description,
                Integer repeatCount,
                Integer repeatInterval,
                String group,
                Date startDate,
                Date endDate)
Method Detail

equals

public boolean equals(Object other)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

getRevision

public int getRevision()
Specified by:
getRevision in interface ISchedule
Returns:
Returns the revision.

getId

public String getId()
Description copied from interface: ISchedule
A unique id, often a GUID uniquely identifying the schedule, used to locate the schedule in the Solution Repository (ISolutionRepository implementors).

Specified by:
getId in interface ISchedule
Returns:

getTitle

public String getTitle()
Specified by:
getTitle in interface ISchedule

getScheduleReference

public String getScheduleReference()
Description copied from interface: ISchedule
Typically the "name" of the schedule

Specified by:
getScheduleReference in interface ISchedule
Returns:

setId

public void setId(String id)
Specified by:
setId in interface ISchedule

setTitle

public void setTitle(String title)
Specified by:
setTitle in interface ISchedule

setScheduleReference

public void setScheduleReference(String scheduleRef)
Specified by:
setScheduleReference in interface ISchedule

getDescription

public String getDescription()
Specified by:
getDescription in interface ISchedule

setDescription

public void setDescription(String description)
Specified by:
setDescription in interface ISchedule

getCronString

public String getCronString()
Description copied from interface: ISchedule
Get the cron string for this schedule. You should only call this method if isCronSchedule() returns true.

Specified by:
getCronString in interface ISchedule
Returns:

setCronString

public void setCronString(String cronString)
NOTE: see NOTE in setRepeatInterval

Specified by:
setCronString in interface ISchedule

getGroup

public String getGroup()
Specified by:
getGroup in interface ISchedule

setGroup

public void setGroup(String group)
Specified by:
setGroup in interface ISchedule

getLastTrigger

public Date getLastTrigger()
Specified by:
getLastTrigger in interface ISchedule

setLastTrigger

public void setLastTrigger(Date lastTrigger)
Specified by:
setLastTrigger in interface ISchedule

getRepeatCount

public Integer getRepeatCount()
Description copied from interface: ISchedule
Get the repeat count (number of times the schedule should run). You should only call this method if isRepeatSchedule() returns true.

Specified by:
getRepeatCount in interface ISchedule
Returns:
repeat count

getRepeatInterval

public Integer getRepeatInterval()
Description copied from interface: ISchedule
Get repeat time in milliseconds. You should only call this method if isRepeatSchedule() returns true.

Specified by:
getRepeatInterval in interface ISchedule
Returns:
Integer the repeat time in milliseconds

setRepeatCount

public void setRepeatCount(Integer repeatCount)
Description copied from interface: ISchedule
Set the repeat count (number of times the schedule should run).

Specified by:
setRepeatCount in interface ISchedule

setRepeatInterval

public void setRepeatInterval(Integer repeatInterval)
NOTE: repeat schedules and cron schedules are mutually exclusive. When setting the repeat interval, the cron string will be nulled, and visa versa.

Specified by:
setRepeatInterval in interface ISchedule
Parameters:
repeatInterval - Integer repeat time in milliseconds

isCronSchedule

public boolean isCronSchedule()
NOTE: in this implementation, it is possible for isCronSchedule to return false and isRepeatSchedule to return false on the same instance. This can happen if the instance has had neither its cronString nor its repeatCount and repeatInterval initialized. While the instance is in a state where both of these methods return false, the instance should be considered insufficiently initialized, and invalid.

Specified by:
isCronSchedule in interface ISchedule
Returns:
true if this is a cron schedule, else false

isRepeatSchedule

public boolean isRepeatSchedule()
NOTE: see NOTE in isCronSchedule

Specified by:
isRepeatSchedule in interface ISchedule
Returns:
true if this is a repeating schedule, else false

getEndDate

public Date getEndDate()
Specified by:
getEndDate in interface ISchedule

getStartDate

public Date getStartDate()
Specified by:
getStartDate in interface ISchedule

setEndDate

public void setEndDate(Date endDate)
Specified by:
setEndDate in interface ISchedule

setStartDate

public void setStartDate(Date startDate)
Specified by:
setStartDate in interface ISchedule