com.ibm.commerce.marketing.promotion.schedule

Class PromotionSchedule

  • java.lang.Object
    • com.ibm.commerce.marketing.promotion.schedule.PromotionSchedule
  • All Implemented Interfaces:
    Schedule, XMLizable, java.io.Serializable


    public class PromotionSchedule
    extends java.lang.Object
    implements Schedule
    This class represents the promotion schedule. A promotion can have a start and end date associated with it. This promotion will only be active within that period of time. The end time could be set to a very large number e.g. 11:59:59 PM, December 31, 9999, which effectively makes the promotion active all the time after the start date. Between the start and end date, additional constraints can be added so that promotion can be further restricted and made alive during only certain weekdays and certain time period in a day. Both additional constraints are optional.

    XML Snippet for PromotionSchedule:

       <Schedule impl="com.ibm.commerce.marketing.promotion.schedule.PromotionSchedule">
            <DateRange impl="com.ibm.commerce.marketing.promotion.schedule.DateRangeSchedule">
                    <Start inclusive="true">01-09-2003</Start>
                    <End inclusive="true">31-12-2004</End>
            </DateRange>
            <TimeWithinADay impl="com.ibm.commerce.marketing.promotion.schedule.TimeRangeWithinADaySchedule">
                    <Start inclusive="true">00:00:00</Start>
                    <End inclusive="false">23:59:59</End>
            </TimeWithinADay>
            <Week impl= "com.ibm.commerce.marketing.promotion.schedule.WeekDaySchedule">
                    <WeekDay>Sunday</WeekDay>
                    <WeekDay>Monday</WeekDay>
                    <WeekDay>Tuesday</WeekDay>
                    <WeekDay>Wednesday</WeekDay>
                    <WeekDay>Thursday</WeekDay>
                    <WeekDay>Friday</WeekDay>
                    <WeekDay>Saturday</WeekDay>
            </Week>
       </Schedule>
      
     
    See Also:
    Serialized Form
    • Field Detail

      • COPYRIGHT

        public static final java.lang.String COPYRIGHT
        IBM Copyright
        See Also:
        Constant Field Values
    • Constructor Detail

      • PromotionSchedule

        public PromotionSchedule()
        Constructor
      • PromotionSchedule

        public PromotionSchedule(java.util.Date startDate,
                                 java.util.Date endDate,
                                 java.util.Date startTime,
                                 java.util.Date endTime,
                                 int[] activeWeekdays)
        Constructor
        Parameters:
        startDate - start date, inclusive
        endDate - end date, inclusive
        startTime - start time in each day, inclusive
        endTime - end time in each day, inclusive
        activeWeekdays - active weekdays, 0: Sunday, 1: Monday..... 5: Friday, 6: Saturday
    • Method Detail

      • isActive

        public boolean isActive()
        Description copied from interface: Schedule
        Checks to see if a schedule is active or not
        Specified by:
        isActive in interface Schedule
        Returns:
        true if the schedule is active, false otherwise
        See Also:
        com.ibm.commerce.discount.mixmatch.Schedule#isActive()
      • isActiveAsOf

        public boolean isActiveAsOf(java.util.Date theTime)
        Description copied from interface: Schedule
        Checks to see if a schedule is active at a certain time
        Specified by:
        isActiveAsOf in interface Schedule
        Parameters:
        theTime - the "certain time"
        Returns:
        true, if the schedule is active at that time, false otherwise
        See Also:
        com.ibm.commerce.discount.mixmatch.Schedule#isActiveAsOf(Date)
      • getOverallStartDate

        public java.util.Date getOverallStartDate()
        Returns overall start date
        Specified by:
        getOverallStartDate in interface Schedule
        Returns:
        overall start date, usually the start date of the date range schedule that's part of this schedule
      • getOverallEndDate

        public java.util.Date getOverallEndDate()
        Returns overall end date
        Specified by:
        getOverallEndDate in interface Schedule
        Returns:
        overall end date, usually the end date of the date range schedule that's part of this schedule
      • getDateSchedule

        public DateRangeSchedule getDateSchedule()
        Gets the DateRangeSchedule for promotion
        Returns:
        the DateRangeSchedule for promotion
      • setDateSchedule

        public void setDateSchedule(DateRangeSchedule aDateRangeSchedule)
        Sets the DateRangeSchedule for promotion
        Parameters:
        aDateRangeSchedule - the dateSchedule for promotion to set
      • getTimeWithinADaySchedule

        public TimeRangeWithinADaySchedule getTimeWithinADaySchedule()
        Gets the TimeRangeWithinADaySchedule
        Returns:
        the TimeRangeWithinADaySchedule
      • setTimeWithinADaySchedule

        public void setTimeWithinADaySchedule(TimeRangeWithinADaySchedule aTimeRangeWithinADaySchedule)
        Sets the TimeRangeWithinADaySchedule
        Parameters:
        aTimeRangeWithinADaySchedule - the timeWithinADaySchedule to set
      • getWeekdaySchedule

        public WeekDaySchedule getWeekdaySchedule()
        Gets WeekDaySchedule
        Returns:
        the WeekDaySchedule
      • setWeekdaySchedule

        public void setWeekdaySchedule(WeekDaySchedule aWeekDaySchedule)
        Sets WeekDaySchedule
        Parameters:
        aWeekDaySchedule - the weekdaySchedule to set