jain.protocol.ip.sip.header
Class RetryAfterHeader

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

public final class RetryAfterHeader
extends GeneralHeader

This class represents the Retry-After general-header. The RetryAfterHeader can be used with a SERVICE_UNAVAILABLE ResponseMessage to indicate how long the service is expected to be unavailable to the requesting client and with a NOT_FOUND, BUSY, or DECLINE ResponseMessage to indicate when the called party anticipates being available again. The value of this field can be either a date or an integer number of seconds (in decimal) after the time of the ResponseMessage.

A RegisterMessage may include a RetryAfterHeader when deleting registrations with a wildcard ContactHeader. The value then indicates when the user might again be reachable. The registrar may then include this information in ResponseMessages to future calls.

An optional comment can be used to indicate additional information about the time of callback. An optional duration indicates how long the called party will be reachable starting at the initial time of availability. If no duration is given, the service is assumed to be available indefinitely.

Version:
0.6

Field Summary
static java.lang.String token
          Token of RetryAfterHeader
 
Fields inherited from class jain.protocol.ip.sip.header.Header
ENTITY_HEADER, GENERAL_HEADER, REQUEST_HEADER, RESPONSE_HEADER
 
Constructor Summary
RetryAfterHeader(java.util.Date date)
          Creates a RetryAfterHeader based on given date
RetryAfterHeader(long deltaSeconds)
          Creates a RetryAfterHeader based on given number of delta-seconds
 
Method Summary
 java.lang.Object clone()
          Creates and returns a copy of RetryAfterHeader
 boolean equals(RetryAfterHeader retryAfterHeader)
          Indicates whether some other RetryAfterHeader is "equal to" this one
 java.lang.String getComment()
          Gets comment of RetryAfterHeader
 java.util.Date getDate()
          Gets date of RetryAfterHeader
 long getDeltaSeconds()
          Gets delta-seconds of RetryAfterHeader
 long getDuration()
          Gets duration of RetryAfterHeader
 java.lang.String getValue()
          Gets value of RetryAfterHeader
 boolean hasComment()
          Returns boolean value to indicate if RetryAfterHeader has comment
 boolean hasDate()
          Returns boolean value to indicate if RetryAfterHeader has date
 boolean hasDuration()
          Returns boolean value to indicate if RetryAfterHeader has duration
 void removeComment()
          Removes comment from RetryAfterHeader
 void removeDuration()
          Removes duration from RetryAfterHeader
 void setComment(java.lang.String comment)
          Sets comment of RetryAfterHeader
 void setDate(java.util.Date date)
          Sets date of RetryAfterHeader
 void setDeltaSeconds(long deltaSeconds)
          Sets delta-seconds of RetryAfterHeader
 void setDuration(long duration)
          Sets duration of RetryAfterHeader
 
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 RetryAfterHeader
Constructor Detail

RetryAfterHeader

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

RetryAfterHeader

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

getDate

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

getDeltaSeconds

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

getComment

public java.lang.String getComment()
                            throws ParameterNotSetException
Gets comment of RetryAfterHeader
Returns:
comment of RetryAfterHeader
Throws:
ParameterNotSetException - if comment does not exist

hasDuration

public boolean hasDuration()
Returns boolean value to indicate if RetryAfterHeader has duration
Returns:
boolean value to indicate if RetryAfterHeader has duration

hasComment

public boolean hasComment()
Returns boolean value to indicate if RetryAfterHeader has comment
Returns:
boolean value to indicate if RetryAfterHeader has comment

hasDate

public boolean hasDate()
Returns boolean value to indicate if RetryAfterHeader has date
Returns:
boolean value to indicate if RetryAfterHeader has date

getDuration

public long getDuration()
                 throws ParameterNotSetException
Gets duration of RetryAfterHeader
Returns:
duration of RetryAfterHeader
Throws:
ParameterNotSetException - if duration does not exist

setDate

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

setDeltaSeconds

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

setComment

public void setComment(java.lang.String comment)
Sets comment of RetryAfterHeader
Parameters:
comment - comment
Throws:
java.lang.IllegalArgumentException - if comment is null or zero-length

setDuration

public void setDuration(long duration)
                 throws java.lang.IllegalArgumentException
Sets duration of RetryAfterHeader
Parameters:
duration - duration
Throws:
java.lang.IllegalArgumentException - if duration is negative

removeComment

public void removeComment()
Removes comment from RetryAfterHeader

removeDuration

public void removeDuration()
Removes duration from RetryAfterHeader

getValue

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

clone

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

equals

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


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


Copyright - 2000 Sun Microsystems