NIST-SIP: The Reference Implementation for JAIN-SIP 1.2

gov.nist.javax.sip.header
Class SIPDate

java.lang.Object
  extended by gov.nist.javax.sip.header.SIPDate
All Implemented Interfaces:
Serializable, Cloneable

public class SIPDate
extends Object
implements Cloneable, Serializable

Implements a parser class for tracking expiration time when specified as a Date value.

 From the HTTP 1.1 spec
14.18 Date

   The Date general-header field represents the date and time at which
   the message was originated, having the same semantics as orig-date in
   RFC 822. The field value is an HTTP-date, as described in section
   3.3.1; it MUST be sent in RFC 1123 [8]-date format.

       Date  = "Date" ":" HTTP-date

   An example is

       Date: Tue, 15 Nov 1994 08:12:31 GMT

Version:
1.2 $Revision: 1.8 $ $Date: 2009/07/17 18:57:37 $
Author:
M. Ranganathan
See Also:
Serialized Form

Field Summary
static String APR
           
static String AUG
           
static String DEC
           
static String FEB
           
static String FRI
           
static String GMT
           
static String JAN
           
static String JUL
           
static String JUN
           
static String MAR
           
static String MAY
           
static String MON
           
static String NOV
           
static String OCT
           
static String SAT
           
static String SEP
           
static String SUN
           
static String THU
           
static String TUE
           
static String WED
           
 
Constructor Summary
SIPDate()
          Initializer, sets all the fields to invalid values.
SIPDate(long timeMillis)
          Construct a SIP date from the time offset given in miliseconds
 
Method Summary
 Object clone()
           
 String encode()
          Get canonical string representation.
 boolean equals(Object that)
          equality check.
 int getDeltaSeconds()
          Get the time offset from the current time.
 int getHour()
          get the hour
 Calendar getJavaCal()
          The only accessor we allow is to the java calendar record.
 int getMinute()
          get the minute
 String getMonth()
          get the month
 int getSecond()
          get the second
 String getWkday()
          get the WkDay field
 int getYear()
          Get the year member.
 void setDay(int d)
          Set the day member
 void setHour(int h)
          Set the hour member
 void setMinute(int m)
          Set the minute member
 void setMonth(String m)
          Set the month member
 void setSecond(int s)
          Set the second member
 void setWkday(String w)
          Set the wkday member
 void setYear(int y)
          Set the year member
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

GMT

public static final String GMT
See Also:
Constant Field Values

MON

public static final String MON
See Also:
Constant Field Values

TUE

public static final String TUE
See Also:
Constant Field Values

WED

public static final String WED
See Also:
Constant Field Values

THU

public static final String THU
See Also:
Constant Field Values

FRI

public static final String FRI
See Also:
Constant Field Values

SAT

public static final String SAT
See Also:
Constant Field Values

SUN

public static final String SUN
See Also:
Constant Field Values

JAN

public static final String JAN
See Also:
Constant Field Values

FEB

public static final String FEB
See Also:
Constant Field Values

MAR

public static final String MAR
See Also:
Constant Field Values

APR

public static final String APR
See Also:
Constant Field Values

MAY

public static final String MAY
See Also:
Constant Field Values

JUN

public static final String JUN
See Also:
Constant Field Values

JUL

public static final String JUL
See Also:
Constant Field Values

AUG

public static final String AUG
See Also:
Constant Field Values

SEP

public static final String SEP
See Also:
Constant Field Values

OCT

public static final String OCT
See Also:
Constant Field Values

NOV

public static final String NOV
See Also:
Constant Field Values

DEC

public static final String DEC
See Also:
Constant Field Values
Constructor Detail

SIPDate

public SIPDate()
Initializer, sets all the fields to invalid values.


SIPDate

public SIPDate(long timeMillis)
Construct a SIP date from the time offset given in miliseconds

Parameters:
timeMillis - long to set
Method Detail

equals

public boolean equals(Object that)
equality check.

Overrides:
equals in class Object
Returns:
true if the two date fields are equals

encode

public String encode()
Get canonical string representation.

Returns:
String

getJavaCal

public Calendar getJavaCal()
The only accessor we allow is to the java calendar record. All other fields are for this package only.

Returns:
Calendar

getWkday

public String getWkday()
get the WkDay field

Returns:
String

getMonth

public String getMonth()
get the month

Returns:
String

getHour

public int getHour()
get the hour

Returns:
int

getMinute

public int getMinute()
get the minute

Returns:
int

getSecond

public int getSecond()
get the second

Returns:
int

setWkday

public void setWkday(String w)
              throws IllegalArgumentException
Set the wkday member

Parameters:
w - String to set
Throws:
IllegalArgumentException - if w is not a valid day.

setDay

public void setDay(int d)
            throws IllegalArgumentException
Set the day member

Parameters:
d - int to set
Throws:
IllegalArgumentException - if d is not a valid day

setMonth

public void setMonth(String m)
              throws IllegalArgumentException
Set the month member

Parameters:
m - String to set.
Throws:
IllegalArgumentException - if m is not a valid month

setYear

public void setYear(int y)
             throws IllegalArgumentException
Set the year member

Parameters:
y - int to set
Throws:
IllegalArgumentException - if y is not a valid year.

getYear

public int getYear()
Get the year member.


setHour

public void setHour(int h)
             throws IllegalArgumentException
Set the hour member

Parameters:
h - int to set
Throws:
IllegalArgumentException - if h is not a valid hour.

setMinute

public void setMinute(int m)
               throws IllegalArgumentException
Set the minute member

Parameters:
m - int to set
Throws:
IllegalArgumentException - if m is not a valid minute

setSecond

public void setSecond(int s)
               throws IllegalArgumentException
Set the second member

Parameters:
s - int to set
Throws:
IllegalArgumentException - if s is not a valid second

getDeltaSeconds

public int getDeltaSeconds()
Get the time offset from the current time.

Returns:
offset from the current time.

clone

public Object clone()
Overrides:
clone in class Object

NIST-SIP: The Reference Implementation for JAIN-SIP 1.2

A product of the NIST/ITL Advanced Networking Technologies Division.
See conditions of use.
Submit a bug report or feature request.