Oracle Application Server Wireless Java API Reference
B10400-01

oracle.panama.presence.model
Class DeliveryPeriod

java.lang.Object
  |
  +--oracle.panama.presence.model.DeliveryPeriod

public abstract class DeliveryPeriod
extends java.lang.Object

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

MONDAY

public static final byte MONDAY
See Also:
Constant Field Values

TUESDAY

public static final byte TUESDAY
See Also:
Constant Field Values

WEDNESDAY

public static final byte WEDNESDAY
See Also:
Constant Field Values

THURSDAY

public static final byte THURSDAY
See Also:
Constant Field Values

FRIDAY

public static final byte FRIDAY
See Also:
Constant Field Values

SATURDAY

public static final byte SATURDAY
See Also:
Constant Field Values

SUNDAY

public static final byte SUNDAY
See Also:
Constant Field Values

WEEKDAYS

public static final byte WEEKDAYS
See Also:
Constant Field Values

WEEKEND

public static final byte WEEKEND
See Also:
Constant Field Values

EVERYDAY

public static final byte EVERYDAY
See Also:
Constant Field Values
Constructor Detail

DeliveryPeriod

public DeliveryPeriod()
Method Detail

getInstance

public static DeliveryPeriod getInstance()
Return a new instance of DeliveryPeriod.
Returns:
the new instance

getInstance

public static DeliveryPeriod getInstance(boolean isEntireDay,
                                         int startHour,
                                         int startMinute,
                                         int endHour,
                                         int endMinute,
                                         byte days)
Return a new instance of DeliveryPeriod.
Returns:
the new instance

isEntireDay

public abstract boolean isEntireDay()
Indicate whether the delivery period is the entire day or specific time period.
Returns:
true if the delivery period is the entire day, false otherwise.

setEntireDay

public abstract void setEntireDay(boolean entireDay)
Set the delivery period to be either entire day or specific time period.
Parameters:
entireDay - true for entire day delivery period.

getStartHour

public abstract int getStartHour()
Return the start hour of the delivery period.
Returns:
value between 0 and 23 (inclusive), or -1 if not set.

getStartMinute

public abstract int getStartMinute()
Return the start minute of the delivery period.
Returns:
value between 0 and 59 (inclusive), or -1 if not set.

getEndHour

public abstract int getEndHour()
Return the end hour of the delivery period.
Returns:
value between 0 and 23 (inclusive), or -1 if not set.

getEndMinute

public abstract int getEndMinute()
Return the end minute of the delivery period.
Returns:
value between 0 and 59 (inclusive), or -1 if not set.

setDeliveryTime

public abstract void setDeliveryTime(int startHour,
                                     int startMinute,
                                     int endHour,
                                     int endMinute)
Set the time window for the delivery period.

getDeliveryDays

public abstract byte getDeliveryDays()
Return the delivery days for which notifications can be delivered.
Returns:
the bit mappings for which days of the week belong to the delivery period.

setDeliveryDays

public abstract void setDeliveryDays(byte days)
Set the delivery days for this delivery period.
Parameters:
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

Copyright © 2003 Oracle Corporation. All Rights Reserved.