Oracle Application Server Wireless Java API Reference
B14043-01


oracle.panama.mp.privacy
Class AuthPeriod

java.lang.Object
  extended byoracle.panama.mp.privacy.AuthPeriod


public class AuthPeriod
extends java.lang.Object

The Authorization Period keeps a time range which is used when a user grants positioning rights to other users. An authorization period is composed of start date, end date, start time, end time and exclusions. The class also provides a method contains to check whether specific time falls in the time range represented by the AuthPeriod object.


Field Summary
static AuthPeriod ALL_THE_TIME
An AuthPeriod representing all time
static byte FRIDAY
A constant representing Friday
static byte MONDAY
A constant representing Monday
static AuthPeriod NEVER
An AuthPeriod representing never
static byte SATURDAY
A constant representing Saturday
static byte SUNDAY
A constant representing Sunday
static byte THURSDAY
A constant representing Thursday
static byte TUESDAY
A constant representing Tuesday
static byte WEDNESDAY
A constant representing Wednesday

Constructor Summary
AuthPeriod(java.util.Calendar startD, java.util.Calendar endD, java.util.Calendar startT, java.util.Calendar endT, int excl)
Construct an AuthPeriod which starts from a start day (startD), ends on a ending day (endD) and for each day, starts from start time (startT and ends at ending time (endT).

Method Summary
boolean contains(java.util.Calendar posTime)
This method is used to check whether the posTime falls in this AuthPeriod
boolean equals(java.lang.Object obj)
Returns true if the given object is equal to this period.
java.util.Calendar getEndDate()
Get the end date of the period
java.util.Calendar getEndTime()
Get the end time of the period
byte getExclusion()
Get the exclusions of the period
java.util.Calendar getNextTimeWithinPeriod(java.util.Calendar now)
Returns the overlap of this period and now.
java.util.Calendar getStartDate()
Get the start date of the period
java.util.Calendar getStartTime()
Get the start time of the period
java.lang.String toString()
Returns the string representation of this AuthPeriod object

Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait

Field Detail

ALL_THE_TIME

public static final AuthPeriod ALL_THE_TIME
An AuthPeriod representing all time

FRIDAY

public static final byte FRIDAY
A constant representing Friday
See Also:
Constant Field Values

MONDAY

public static final byte MONDAY
A constant representing Monday
See Also:
Constant Field Values

NEVER

public static final AuthPeriod NEVER
An AuthPeriod representing never

SATURDAY

public static final byte SATURDAY
A constant representing Saturday
See Also:
Constant Field Values

SUNDAY

public static final byte SUNDAY
A constant representing Sunday
See Also:
Constant Field Values

THURSDAY

public static final byte THURSDAY
A constant representing Thursday
See Also:
Constant Field Values

TUESDAY

public static final byte TUESDAY
A constant representing Tuesday
See Also:
Constant Field Values

WEDNESDAY

public static final byte WEDNESDAY
A constant representing Wednesday
See Also:
Constant Field Values

Constructor Detail

AuthPeriod

public AuthPeriod(java.util.Calendar startD,
                  java.util.Calendar endD,
                  java.util.Calendar startT,
                  java.util.Calendar endT,
                  int excl)
Construct an AuthPeriod which starts from a start day (startD), ends on a ending day (endD) and for each day, starts from start time (startT and ends at ending time (endT). startT and endT are with the accuracy of minute. To represent a full day, the startT should be set to 00:00 and the endT should be set to 23:59 The excl specifies the days of the week which are excluded from the period. For example to contruct an AnthPeriod which represents the period: from June 15,2001 to July 15, 2001, each day from 9:00am to 5:00pm and excluding Weekends, startD shoud be set to June 15,2001 endD should be set to July 15,2001 startT should be set to 9:00am endT should be set to 5:00pm excl should be set to AuthPeriod.SATURDAY | AuthPeriod.SUNDAY
Parameters:
startD - the starting date(inclusive). If startD is null, today's date is used
endD - the ending date(inclusive). If endD is null, today's date is used
startT - the starting time on each day (inclusive). If the startT is null, current time is used.
endT - the ending time on each day (inclusive). If the endT is null, current time is used.
excl - The exclusions.

Method Detail

contains

public boolean contains(java.util.Calendar posTime)
This method is used to check whether the posTime falls in this AuthPeriod
Parameters:
posTime - time to be checked
Returns:
if the posTime falls in the period, returns true, otherwise, false is returned.

equals

public boolean equals(java.lang.Object obj)
Returns true if the given object is equal to this period.
Parameters:
obj - the object to compare

getEndDate

public java.util.Calendar getEndDate()
Get the end date of the period
Returns:
the end date

getEndTime

public java.util.Calendar getEndTime()
Get the end time of the period
Returns:
the end time

getExclusion

public byte getExclusion()
Get the exclusions of the period
Returns:
the byte representing the exclusions. The excl specifies the days of the week which are excluded from the period.

getNextTimeWithinPeriod

public java.util.Calendar getNextTimeWithinPeriod(java.util.Calendar now)
Returns the overlap of this period and now.
Parameters:
now - the interval to use for the overlap

getStartDate

public java.util.Calendar getStartDate()
Get the start date of the period
Returns:
the start date

getStartTime

public java.util.Calendar getStartTime()
Get the start time of the period
Returns:
the start time

toString

public java.lang.String toString()
Returns the string representation of this AuthPeriod object

Oracle Application Server Wireless Java API Reference
B14043-01


Copyright © 2004 Oracle Corporation. All Rights Reserved.