jain.protocol.ip.sip.header
Class ExpiresHeader

java.lang.Object
  |
  +--jain.protocol.ip.sip.header.Header
        |
        +--jain.protocol.ip.sip.header.GeneralHeader
              |
              +--jain.protocol.ip.sip.header.ExpiresHeader

public final class ExpiresHeader
extends GeneralHeader

This class represents the Expires entity-header. The ExpiresHeader gives the date and time after which the message content expires.

The ExpiresHeader is currently defined only for RegisterMessages and InviteMessages and their corresponding ResponseMessages. In a RegisterMessage, the client indicates how long it wishes the registration to be valid. In the ResponseMessage, the server indicates the earliest expiration time of all registrations. The server may choose a shorter time interval than that requested by the client, but should not choose a longer one.

For InviteMessages the caller can limit the validity of an invitation, for example, if a client wants to limit the time duration of a search or a conference invitation. A user interface may take this as a hint to leave the invitation window on the screen even if the user is not currently at the workstation. This also limits the duration of a search. If the InviteMessage expires before the search completes, the proxy returns a REQUEST_TIMEOUT ResponseMessage. In a MOVED_TEMPORARILY ResponseMessage, a server can advise the client of the maximal duration of the redirection.

The value of this field can be either a date or an integer number of seconds (in decimal), measured from the receipt of the RequestMessage. The latter approach is preferable for short durations, as it does not depend on clients and servers sharing a synchronized clock. Implementations may treat values larger than 2**32-1 (4294967295 or 136 years) as equivalent to 2**32-1.

Version:
0.6

Field Summary
static java.lang.String token
          Token of ExpiresHeader
 
Fields inherited from class jain.protocol.ip.sip.header.Header
ENTITY_HEADER, GENERAL_HEADER, REQUEST_HEADER, RESPONSE_HEADER
 
Constructor Summary
ExpiresHeader(java.util.Date date)
          Creates an ExpiresHeader based on given date
ExpiresHeader(long deltaSeconds)
          Creates an ExpiresHeader based on given number of delta-seconds
 
Method Summary
 java.lang.Object clone()
          Creates and returns a copy of ExpiresHeader
 boolean equals(ExpiresHeader expiresHeader)
          Indicates whether some other ExpiresHeader is "equal to" this one
 java.util.Date getDate()
          Gets date of ExpiresHeader
 long getDeltaSeconds()
          Gets delta-seconds of ExpiresHeader
 java.lang.String getValue()
          Gets value of ExpiresHeader
 boolean hasDate()
          Returns boolean value to indicate if ExpiryHeader has its expiry value in date format
 void setDate(java.util.Date date)
          Sets date of ExpiresHeader
 void setDeltaSeconds(long deltaSeconds)
          Sets delta-seconds of Header
 
Methods inherited from class jain.protocol.ip.sip.header.Header
equals, getHeaderType, getToken, setValue, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

token

public static final java.lang.String token
Token of ExpiresHeader
Constructor Detail

ExpiresHeader

public ExpiresHeader(long deltaSeconds)
              throws java.lang.IllegalArgumentException
Creates an ExpiresHeader based on given number of delta-seconds
Parameters:
deltaSeconds - delta-seconds
Throws:
java.lang.IllegalArgumentException - if deltaSeconds is negative

ExpiresHeader

public ExpiresHeader(java.util.Date date)
              throws java.lang.IllegalArgumentException
Creates an ExpiresHeader based on given date
Parameters:
date - date
Throws:
java.lang.IllegalArgumentException - if date is null
Method Detail

hasDate

public boolean hasDate()
Returns boolean value to indicate if ExpiryHeader has its expiry value in date format
Returns:
boolean value to indicate if ExpiryHeader has its expiry value in date format

getDate

public java.util.Date getDate()
                       throws ParameterNotSetException
Gets date of ExpiresHeader
Returns:
date of ExpiresHeader
Throws:
ParameterNotSetException - if date does not exist

getDeltaSeconds

public long getDeltaSeconds()
                     throws ParameterNotSetException
Gets delta-seconds of ExpiresHeader
Returns:
delta-seconds of ExpiresHeader
Throws:
ParameterNotSetException - if delta-seconds does not exist

setDate

public void setDate(java.util.Date date)
             throws java.lang.IllegalArgumentException
Sets date of ExpiresHeader
Parameters:
date - date
Throws:
java.lang.IllegalArgumentException - if date is null

setDeltaSeconds

public void setDeltaSeconds(long deltaSeconds)
Sets delta-seconds of Header
Parameters:
deltaSeconds - delta-seconds
Throws:
java.lang.IllegalArgumentException - if deltaSeconds is negative

getValue

public java.lang.String getValue()
Gets value of ExpiresHeader
Overrides:
getValue in class Header
Returns:
value of ExpiresHeader

clone

public java.lang.Object clone()
Creates and returns a copy of ExpiresHeader
Overrides:
clone in class Header

equals

public boolean equals(ExpiresHeader expiresHeader)
Indicates whether some other ExpiresHeader is "equal to" this one
Parameters:
expiresHeader - the ExpiresHeader with which to compare


If you have any comments or queries, please mail them to JAIN-SIP-interest@sun.com


Copyright - 2000 Sun Microsystems