|
Oracle Application Server Wireless Java API Reference B10400-01 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--oracle.panama.presence.model.DeliveryPeriod
DeliveryPeriod represents a delivery period window for notifications for a contact rule.
Delivery period may be either entire day or specific time window, which can be checked using the isEntireDay method. If a window is specified, the start/end hour/minute can be retrieved as well as set using the provided methods. In addition, DeliveryPeriod contains delivery days specifying which days of the week belong to this delivery period. Delivery days can be retrieved and set using the getDeliveryDays and setDeliveryDays methods, together with the constants defined for days of the week. To define a combination of days, we can just add together the constants for the corresponding days, since each of these constants represents the bit mapping for the day.
For example, to specify delivery days to be weekdays, we can either
setDeliveryDays(DeliveryPeriod.WEEKDAYS);
or, equivalently,
setDeliveryDays(DeliveryPeriod.MONDAY + DeliveryPeriod.TUESDAY + DeliveryPeriod.WEDNESDAY + DeliveryPeriod.THURSDAY + DeliveryPeriod.FRIDAY);
To check whether a particular day is in the delivery period, we can use the bitwise and operator. For example, (getDeliveryDays() & DeliveryPeriod.FRIDAY) would equate to zero if Friday is not in the delivery period, while it equates to constant FRIDAY if Friday is in the delivery period.
Note that delivery period window is always assumed to be in the user?s default time zone setting.
In the delivery period window specification, the start time is allowed to be greater than then end time (e.g., 21:00 to 05:00). In this case, the time window spans midnight. When it spans midnight and the delivery days (effective days) are specified, the window will be cut at midnight if it falls over to the next day that is not part of the delivery days. For example, if we set the window to (21:00 to 05:00) and delivery days to weekdays, the person may receive messages on Friday night (from 21:00 to 23:59) and Monday morning (before 05:00), but will not receive any messages on Saturday morning nor Sunday night.
Field Summary | |
static byte |
EVERYDAY |
static byte |
FRIDAY |
static byte |
MONDAY |
static byte |
SATURDAY |
static byte |
SUNDAY |
static byte |
THURSDAY |
static byte |
TUESDAY |
static byte |
WEDNESDAY |
static byte |
WEEKDAYS |
static byte |
WEEKEND |
Constructor Summary | |
DeliveryPeriod() |
Method Summary | |
abstract byte |
getDeliveryDays() Return the delivery days for which notifications can be delivered. |
abstract int |
getEndHour() Return the end hour of the delivery period. |
abstract int |
getEndMinute() Return the end minute of the delivery period. |
static DeliveryPeriod |
getInstance() Return a new instance of DeliveryPeriod. |
static DeliveryPeriod |
getInstance(boolean isEntireDay, int startHour, int startMinute, int endHour, int endMinute, byte days) Return a new instance of DeliveryPeriod. |
abstract int |
getStartHour() Return the start hour of the delivery period. |
abstract int |
getStartMinute() Return the start minute of the delivery period. |
abstract boolean |
isEntireDay() Indicate whether the delivery period is the entire day or specific time period. |
abstract void |
setDeliveryDays(byte days) Set the delivery days for this delivery period. |
abstract void |
setDeliveryTime(int startHour, int startMinute, int endHour, int endMinute) Set the time window for the delivery period. |
abstract void |
setEntireDay(boolean entireDay) Set the delivery period to be either entire day or specific time period. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final byte MONDAY
public static final byte TUESDAY
public static final byte WEDNESDAY
public static final byte THURSDAY
public static final byte FRIDAY
public static final byte SATURDAY
public static final byte SUNDAY
public static final byte WEEKDAYS
public static final byte WEEKEND
public static final byte EVERYDAY
Constructor Detail |
public DeliveryPeriod()
Method Detail |
public static DeliveryPeriod getInstance()
public static DeliveryPeriod getInstance(boolean isEntireDay, int startHour, int startMinute, int endHour, int endMinute, byte days)
public abstract boolean isEntireDay()
public abstract void setEntireDay(boolean entireDay)
entireDay
- true for entire day delivery period.public abstract int getStartHour()
public abstract int getStartMinute()
public abstract int getEndHour()
public abstract int getEndMinute()
public abstract void setDeliveryTime(int startHour, int startMinute, int endHour, int endMinute)
public abstract byte getDeliveryDays()
public abstract void setDeliveryDays(byte days)
days
- the bit mapping for days of the week. For example, to specify that Monday and Wednesday only are in the delivery period, pass in (MONDAY + WEDNESDAY) for days parameter here.
|
Oracle Application Server Wireless Java API Reference B10400-01 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |