public class TimeRangeSchedule extends java.lang.Object implements Schedule, ScheduleLookAheadSupport
XML Snippet for TimeRangeSchedule:
<TimeRange impl="com.ibm.commerce.marketing.promotion.schedule.TimeRangeSchedule"> <Start inclusive="true">00:00:00</Start> <End inclusive="false">23:59:59</End> </TimeRange>
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
COPYRIGHT
IBM Copyright
|
static boolean |
INCLUDE_END
Includes the end time
|
static boolean |
INCLUDE_START
Includes start time
|
ALL_WEEK_LONG, END_OF_THE_DAY, END_OF_TIME, START_OF_THE_DAY, START_OF_TIME
DAY, HALF_AN_HOUR, HOUR, MINUTE, MONTH, QUARTER, SECOND, WEEK, YEAR
Constructor and Description |
---|
TimeRangeSchedule()
Default Constructor
|
TimeRangeSchedule(java.util.Date aStartTime,
java.util.Date anEndTime)
Constructor
|
TimeRangeSchedule(java.util.Date aStartTime,
java.util.Date anEndTime,
boolean anIncludeStart,
boolean anIncludeEnd)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
calculateNextStateAndExpirationTime()
Calculates the next state shift time and the next state
|
int |
clockResolution()
returns the clock resolution
|
static boolean |
convertPromotionDatesToUTC()
Read the value of the flag "ConvertPromotionDatesToUTC" defined in the
promotion component configuration file (wc-admin-component.xml) to
determine if the promotion dates must be converted to or interpreted in
UTC (Coordinated Universal Time).
|
boolean |
currentState()
Returns the current schedule state
|
java.util.Date |
currentStateValidUntil()
Returns the time to next state shift point
|
static java.util.Date |
formatStringIntoDate(java.lang.String strFormat,
java.lang.String value)
This method uses the
SimpleDateFormat class to parse text from a
string to produce a Date . |
void |
fromXML(org.w3c.dom.Node node)
Transforms the XML node into its corresponding real Object.
|
java.util.Date |
getEndTime()
Returns the endTime.
|
java.util.Date |
getOverallEndDate()
returns the overall end date, in this case whatever the value of endTime
is, including the date portion
|
java.util.Date |
getOverallStartDate()
Returns the overall start Date, in this case whatever the value of
startTime is, including the date portion
|
java.util.Date |
getStartTime()
Returns the startTime.
|
boolean |
isActive()
Checks to see if a schedule is active or not
|
boolean |
isActiveAsOf(java.util.Date theTime)
Checks to see if a schedule is active at a certain time
|
boolean |
isIncludeEnd()
Returns if the end time is included.
|
boolean |
isIncludeStart()
Returns if the start time is included.
|
void |
setEndTime(java.util.Date anEndTime)
Sets the endTime.
|
void |
setIncludeEnd(boolean anIncludeEnd)
Sets the includeEnd.
|
void |
setIncludeStart(boolean anIncludeStart)
Sets the includeStart.
|
void |
setStartTime(java.util.Date aStartTime)
Sets the startTime.
|
java.lang.String |
toXML()
Converts the object into its corresponding XML format representation.
|
public static final java.lang.String COPYRIGHT
public static final boolean INCLUDE_START
public static final boolean INCLUDE_END
public TimeRangeSchedule(java.util.Date aStartTime, java.util.Date anEndTime)
aStartTime
- start time inclusiveanEndTime
- end time inclusivepublic TimeRangeSchedule()
public TimeRangeSchedule(java.util.Date aStartTime, java.util.Date anEndTime, boolean anIncludeStart, boolean anIncludeEnd)
aStartTime
- start timeanEndTime
- end timeanIncludeStart
- whether start time should be includedanIncludeEnd
- whether end time should be includedpublic static java.util.Date formatStringIntoDate(java.lang.String strFormat, java.lang.String value) throws java.text.ParseException
SimpleDateFormat
class to parse text from a
string to produce a Date
.strFormat
- The date and time pattern stringvalue
- The text string to parseDate
parsed from the string.java.text.ParseException
public boolean isActive()
Schedule
public boolean isActiveAsOf(java.util.Date theTime)
Schedule
isActiveAsOf
in interface Schedule
theTime
- the "certain time"com.ibm.commerce.discount.mixmatch.Schedule#isActiveAsOf(Date)
public void fromXML(org.w3c.dom.Node node) throws DeXMLizationException
XMLizable
fromXML
in interface XMLizable
node
- The node that represents an XMLizable objectDeXMLizationException
- when this process failsXMLizable.fromXML(Node)
public java.lang.String toXML() throws XMLizationException
XMLizable
toXML
in interface XMLizable
XMLizationException
- when this process failsXMLizable.toXML()
public int clockResolution()
clockResolution
in interface ScheduleLookAheadSupport
public boolean currentState()
currentState
in interface ScheduleLookAheadSupport
public java.util.Date currentStateValidUntil()
currentStateValidUntil
in interface ScheduleLookAheadSupport
ScheduleLookAheadSupport.currentStateValidUntil()
public void calculateNextStateAndExpirationTime()
calculateNextStateAndExpirationTime
in interface ScheduleLookAheadSupport
public java.util.Date getEndTime()
public boolean isIncludeEnd()
public boolean isIncludeStart()
public java.util.Date getStartTime()
public void setEndTime(java.util.Date anEndTime)
anEndTime
- The endTime to setpublic void setIncludeEnd(boolean anIncludeEnd)
anIncludeEnd
- The includeEnd to setpublic void setIncludeStart(boolean anIncludeStart)
anIncludeStart
- The includeStart to setpublic void setStartTime(java.util.Date aStartTime)
aStartTime
- The startTime to setpublic java.util.Date getOverallStartDate()
getOverallStartDate
in interface Schedule
public java.util.Date getOverallEndDate()
getOverallEndDate
in interface Schedule
public static boolean convertPromotionDatesToUTC()