Package lumis.service.newsletter
Class Schedule
- java.lang.Object
-
- lumis.service.newsletter.Schedule
-
public class Schedule extends java.lang.Object
- Since:
- 4.0.8
- Version:
- $Revision: 16294 $ $Date: 2014-06-24 13:51:20 -0300 (Tue, 24 Jun 2014) $
-
-
Field Summary
Fields Modifier and Type Field Description static int
EXECUTION_STATUS_IDLE
static int
EXECUTION_STATUS_RUNNING
static int
STATUS_DISABLED
static int
STATUS_ENABLED
static int
TYPE_DAILY
static int
TYPE_MONTHLY
static int
TYPE_WEEKLY
-
Constructor Summary
Constructors Constructor Description Schedule()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static boolean
compareWithThreshold(java.util.Calendar date1, java.util.Calendar date2, int threshold)
Compares date1 and date2 considering the specified threshold.java.util.Date
computeNextProcessDateTime(int threshold)
Computes the next process date/time based only on the start date and last process date.java.sql.Date
getEndDate()
int
getExecutionStatus()
Returns the executionStatus.java.lang.String
getId()
java.util.Date
getLastProcessDateTime()
java.lang.String
getModelId()
java.util.Date
getNextProcessDateTime()
java.sql.Time
getProcessTime()
java.lang.Integer
getScheduleMonthDay()
int
getScheduleType()
java.lang.Integer
getScheduleWeekDay()
java.sql.Date
getStartDate()
int
getStatus()
void
setEndDate(java.sql.Date endDateTime)
void
setExecutionStatus(int executionStatus)
Sets the executionStatus.void
setId(java.lang.String id)
void
setLastProcessDateTime(java.util.Date lastProcessDateTime)
void
setModelId(java.lang.String modelId)
void
setNextProcessDateTime(java.util.Date nextProcessDateTime)
void
setProcessTime(java.sql.Time processDateTime)
void
setScheduleMonthDay(java.lang.Integer scheduleMonthDay)
void
setScheduleType(int scheduleType)
void
setScheduleWeekDay(java.lang.Integer scheduleWeekDay)
void
setStartDate(java.sql.Date startDateTime)
void
setStatus(int status)
-
-
-
Field Detail
-
STATUS_DISABLED
public static final int STATUS_DISABLED
- See Also:
- Constant Field Values
-
STATUS_ENABLED
public static final int STATUS_ENABLED
- See Also:
- Constant Field Values
-
EXECUTION_STATUS_RUNNING
public static final int EXECUTION_STATUS_RUNNING
- See Also:
- Constant Field Values
-
EXECUTION_STATUS_IDLE
public static final int EXECUTION_STATUS_IDLE
- See Also:
- Constant Field Values
-
TYPE_DAILY
public static final int TYPE_DAILY
- See Also:
- Constant Field Values
-
TYPE_WEEKLY
public static final int TYPE_WEEKLY
- See Also:
- Constant Field Values
-
TYPE_MONTHLY
public static final int TYPE_MONTHLY
- See Also:
- Constant Field Values
-
-
Method Detail
-
getEndDate
public java.sql.Date getEndDate()
-
setEndDate
public void setEndDate(java.sql.Date endDateTime)
-
getId
public java.lang.String getId()
-
setId
public void setId(java.lang.String id)
-
getLastProcessDateTime
public java.util.Date getLastProcessDateTime()
-
setLastProcessDateTime
public void setLastProcessDateTime(java.util.Date lastProcessDateTime)
-
getModelId
public java.lang.String getModelId()
-
setModelId
public void setModelId(java.lang.String modelId)
-
getNextProcessDateTime
public java.util.Date getNextProcessDateTime()
-
setNextProcessDateTime
public void setNextProcessDateTime(java.util.Date nextProcessDateTime)
-
getProcessTime
public java.sql.Time getProcessTime()
-
setProcessTime
public void setProcessTime(java.sql.Time processDateTime)
-
getScheduleMonthDay
public java.lang.Integer getScheduleMonthDay()
-
setScheduleMonthDay
public void setScheduleMonthDay(java.lang.Integer scheduleMonthDay)
-
getScheduleType
public int getScheduleType()
-
setScheduleType
public void setScheduleType(int scheduleType)
-
getScheduleWeekDay
public java.lang.Integer getScheduleWeekDay()
-
setScheduleWeekDay
public void setScheduleWeekDay(java.lang.Integer scheduleWeekDay)
-
getStartDate
public java.sql.Date getStartDate()
-
setStartDate
public void setStartDate(java.sql.Date startDateTime)
-
getStatus
public int getStatus()
-
setStatus
public void setStatus(int status)
-
computeNextProcessDateTime
public java.util.Date computeNextProcessDateTime(int threshold)
Computes the next process date/time based only on the start date and last process date. This method does not take into consideration any values set on thenextProcessDateTime
field.- Parameters:
threshold
- the acceptable variation from the schedule process time and the current date in order to allow the schedule to be executed in case it's late.- Returns:
- Since:
- 4.0.8
-
compareWithThreshold
public static boolean compareWithThreshold(java.util.Calendar date1, java.util.Calendar date2, int threshold)
Compares date1 and date2 considering the specified threshold. Returns true if (date1 + threshold) is before date2, false otherwise.- Parameters:
date1
-date2
-threshold
- the acceptable thershold in minutes- Returns:
- Since:
- 4.0.8
-
getExecutionStatus
public int getExecutionStatus()
Returns the executionStatus.- Returns:
- the executionStatus
- Since:
- 4.0.8
-
setExecutionStatus
public void setExecutionStatus(int executionStatus)
Sets the executionStatus.- Parameters:
executionStatus
- the executionStatus value to set- Since:
- 4.0.8
-
-