jain.protocol.ip.sip.header
Class FromHeader

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

public final class FromHeader
extends GeneralHeader

This class represents the From general-header. RequestMessages and ResponseMessages must contain a FromHeader, indicating the initiator of the RequestMessage in its NameAddress. The FromHeader may contain a tag. The server copies the FromHeader from the RequestMessage to the ResponseMessage. The optional "display-name" of the NameAddress is meant to be rendered by a human-user interface. A system should use the display name "Anonymous" if the identity of the client is to remain hidden.

The SipURL of the NameAddress must not contain the transport, maddr, ttl, or headers elements. A server that receives a SipURL with these elements removes them before further processing.

The tag may appear in the FromHeader of a RequestMessage. It must be present when it is possible that two instances of a user sharing a address can make call invitations with the same CallIdHeader. The tag value must be globally unique and cryptographically random with at least 32 bits of randomness. A single user maintains the same tag throughout the call identified by the CallIdHeader.

The CallIdHeader, ToHeader and FromHeader are needed to identify a call leg. The distinction between call and call leg matters in calls with multiple ResponseMessages to a forked RequestMessage.

Version:
0.6

Field Summary
static java.lang.String token
          Token of FromHeader
 
Fields inherited from class jain.protocol.ip.sip.header.Header
ENTITY_HEADER, GENERAL_HEADER, REQUEST_HEADER, RESPONSE_HEADER
 
Constructor Summary
FromHeader(NameAddress nameAddress)
          Creates a FromHeader based on given NameAddress
 
Method Summary
 java.lang.Object clone()
          Creates and returns a copy of FromHeader
 boolean equals(FromHeader fromHeader)
          Indicates whether some other FromHeader is "equal to" this one
 NameAddress getNameAddress()
          Gets NameAddress of FromHeader
 java.lang.String getTag()
          Gets tag of FromHeader
 java.lang.String getValue()
          Gets value of FromHeader
 boolean hasTag()
          Returns boolean value to indicate if FromHeader has tag
 void removeTag()
          Removes tag from FromHeader
 void setNameAddress(NameAddress nameAddress)
          Set NameAddress of FromHeader
 void setTag(java.lang.String tag)
          Set tag of FromHeader
 
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 FromHeader
Constructor Detail

FromHeader

public FromHeader(NameAddress nameAddress)
           throws java.lang.IllegalArgumentException
Creates a FromHeader based on given NameAddress
Parameters:
nameAddress - NameAddress
Throws:
java.lang.IllegalArgumentException - if nameAddress is null
Method Detail

getNameAddress

public NameAddress getNameAddress()
Gets NameAddress of FromHeader
Returns:
NameAddress of FromHeader

getTag

public java.lang.String getTag()
                        throws ParameterNotSetException
Gets tag of FromHeader
Returns:
tag of FromHeader
Throws:
ParameterNotSetException - if tag does not exist

removeTag

public void removeTag()
Removes tag from FromHeader

setNameAddress

public void setNameAddress(NameAddress nameAddress)
                    throws java.lang.IllegalArgumentException
Set NameAddress of FromHeader
Parameters:
nameAddress - NameAddress
Throws:
java.lang.IllegalArgumentException - if nameAddress is null

setTag

public void setTag(java.lang.String tag)
Set tag of FromHeader
Parameters:
tag - tag
Throws:
java.lang.IllegalArgumentException - if tag is null or zero-length

hasTag

public boolean hasTag()
Returns boolean value to indicate if FromHeader has tag
Returns:
boolean value to indicate if FromHeader has tag

getValue

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

clone

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

equals

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


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


Copyright - 2000 Sun Microsystems