jain.protocol.ip.sip.header
Class TimestampHeader

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

public final class TimestampHeader
extends GeneralHeader

This class represents the Timestamp general-header. The TimestampHeader describes when the client sent the RequestMessage to the server. The value of the timestamp is of significance only to the client and it may use any timescale. The server must echo the exact same value and may, if it has accurate information about this, add a floating point number indicating the number of seconds that have elapsed since it has received the RequestMessage. The TimestampHeader is used by the client to compute the round-trip time to the server so that it can adjust the timeout value for retransmissions.

Version:
0.6

Field Summary
static java.lang.String token
          Token of TimestampHeader
 
Fields inherited from class jain.protocol.ip.sip.header.Header
ENTITY_HEADER, GENERAL_HEADER, REQUEST_HEADER, RESPONSE_HEADER
 
Constructor Summary
TimestampHeader(float timestamp)
          Creates a TimestampHeader based on given timestamp
 
Method Summary
 java.lang.Object clone()
          Creates and returns a copy of TimestampHeader
 boolean equals(TimestampHeader timestampHeader)
          Indicates whether some other TimestampHeader is "equal to" this one
 float getDelay()
          Gets delay of TimestampHeader
 float getTimestamp()
          Gets timestamp of TimestampHeader
 java.lang.String getValue()
          Gets value of TimestampHeader
 boolean hasDelay()
          Returns boolean value indicating if TimestampHeader has delay
 void removeDelay()
          Removes delay from TimestampHeader
 void setDelay(float delay)
          Sets delay of TimestampHeader
 void setTimestamp(float timestamp)
          Sets timestamp of TimestampHeader
 
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 TimestampHeader
Constructor Detail

TimestampHeader

public TimestampHeader(float timestamp)
                throws java.lang.IllegalArgumentException
Creates a TimestampHeader based on given timestamp
Parameters:
timestamp - ntimestamp
Throws:
java.lang.IllegalArgumentException - if timestamp is negative
Method Detail

getTimestamp

public float getTimestamp()
Gets timestamp of TimestampHeader
Returns:
timestamp of TimestampHeader

getDelay

public float getDelay()
               throws ParameterNotSetException
Gets delay of TimestampHeader
Returns:
delay of TimestampHeader
Throws:
ParameterNotSetException - if delay does not exist

setTimestamp

public void setTimestamp(float timestamp)
                  throws java.lang.IllegalArgumentException
Sets timestamp of TimestampHeader
Parameters:
timestamp - timestamp
Throws:
java.lang.IllegalArgumentException - if timestamp is negative

setDelay

public void setDelay(float delay)
              throws java.lang.IllegalArgumentException
Sets delay of TimestampHeader
Parameters:
delay - delay
Throws:
java.lang.IllegalArgumentException - if delay is negative

hasDelay

public boolean hasDelay()
Returns boolean value indicating if TimestampHeader has delay
Returns:
boolean value indicating if TimestampHeader has delay

removeDelay

public void removeDelay()
Removes delay from TimestampHeader

getValue

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

clone

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

equals

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


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


Copyright - 2000 Sun Microsystems