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

gov.nist.javax.sip.header
Class From

java.lang.Object
  extended bygov.nist.core.GenericObject
      extended bygov.nist.javax.sip.header.SIPObject
          extended bygov.nist.javax.sip.header.SIPHeader
              extended bygov.nist.javax.sip.header.ParametersHeader
                  extended bygov.nist.javax.sip.header.AddressParametersHeader
                      extended bygov.nist.javax.sip.header.From
All Implemented Interfaces:
Cloneable, FromHeader, Header, HeaderAddress, Parameters, Serializable, SIPHeaderNames

public final class From
extends AddressParametersHeader
implements FromHeader

From SIP Header.

Since:
1.1
Version:
1.2 $Revision: 1.6 $ $Date: 2006/07/13 09:01:23 $
Author:
M. Ranganathan
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface javax.sip.header.FromHeader
NAME
 
Fields inherited from interface gov.nist.javax.sip.header.SIPHeaderNames
ACCEPT, ACCEPT_ENCODING, ACCEPT_LANGUAGE, ALERT_INFO, ALLOW, ALLOW_EVENTS, AUTHENTICATION_INFO, AUTHORIZATION, CALL_ID, CALL_INFO, CONTACT, CONTENT_DISPOSITION, CONTENT_ENCODING, CONTENT_LANGUAGE, CONTENT_LENGTH, CONTENT_TYPE, CSEQ, DATE, ERROR_INFO, EVENT, EXPIRES, FROM, IN_REPLY_TO, MAX_FORWARDS, MIME_VERSION, MIN_EXPIRES, MIN_SE, ORGANIZATION, PRIORITY, PROXY_AUTHENTICATE, PROXY_AUTHORIZATION, PROXY_REQUIRE, RACK, REASON, RECORD_ROUTE, REFERRED_BY, REPLACES, REPLY_TO, REQUIRE, RETRY_AFTER, ROUTE, RSEQ, SERVER, SESSION_EXPIRES, SIP_ETAG, SIP_IF_MATCH, SUBJECT, SUBSCRIPTION_STATE, SUPPORTED, TIMESTAMP, TO, UNSUPPORTED, USER_AGENT, VIA, WARNING, WWW_AUTHENTICATE
 
Constructor Summary
From()
          Default constructor
From(To to)
          Generate a FROM header from a TO header
 
Method Summary
 String encode()
          Encode the header into a String.
 boolean equals(Object other)
          Compare this FromHeader for equality with another.
 String getDisplayName()
          Get the display name from the address.
 gov.nist.core.HostPort getHostPort()
          Conveniance accessor function to get the hostPort field from the address.
 String getTag()
          Get the tag parameter from the address parm list.
 String getUserAtHostPort()
          Get the user@host port string.
 boolean hasTag()
          Boolean function
 void removeTag()
          remove Tag member
 void setAddress(Address address)
          Set the address member
 void setTag(String t)
          Set the tag member
 
Methods inherited from class gov.nist.javax.sip.header.AddressParametersHeader
clone, getAddress
 
Methods inherited from class gov.nist.javax.sip.header.ParametersHeader
getNameValue, getParameter, getParameterNames, getParameters, getParameterValue, hasParameter, hasParameters, removeParameter, removeParameters, setParameter, setParameter, setParameters, setQuotedParameter
 
Methods inherited from class gov.nist.javax.sip.header.SIPHeader
getHeaderName, getHeaderValue, getName, getValue, hashCode, isHeaderList, setHeaderName, toString
 
Methods inherited from class gov.nist.javax.sip.header.SIPObject
dbgPrint, debugDump, debugDump, match
 
Methods inherited from class gov.nist.core.GenericObject
getClassFromName, getMatcher, isMySubclass, makeClone, merge, setMatcher
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface javax.sip.header.HeaderAddress
getAddress
 
Methods inherited from interface javax.sip.header.Parameters
getParameter, getParameterNames, removeParameter, setParameter
 
Methods inherited from interface javax.sip.header.Header
clone, getName, hashCode, toString
 

Constructor Detail

From

public From()
Default constructor


From

public From(To to)
Generate a FROM header from a TO header

Method Detail

encode

public String encode()
Encode the header into a String.

Overrides:
encode in class SIPHeader
Returns:
String

getHostPort

public gov.nist.core.HostPort getHostPort()
Conveniance accessor function to get the hostPort field from the address. Warning -- this assumes that the embedded URI is a SipURL.

Returns:
hostport field

getDisplayName

public String getDisplayName()
Get the display name from the address.

Returns:
Display name

getTag

public String getTag()
Get the tag parameter from the address parm list.

Specified by:
getTag in interface FromHeader
Returns:
tag field

hasTag

public boolean hasTag()
Boolean function

Returns:
true if the Tag exist

removeTag

public void removeTag()
remove Tag member


setAddress

public void setAddress(Address address)
Set the address member

Specified by:
setAddress in interface HeaderAddress
Overrides:
setAddress in class AddressParametersHeader
Parameters:
address - Address to set

setTag

public void setTag(String t)
            throws ParseException
Set the tag member

Specified by:
setTag in interface FromHeader
Parameters:
t - tag to set. From tags are mandatory.
Throws:
ParseException - which signals that an error has been reached unexpectedly while parsing the Tag value.

getUserAtHostPort

public String getUserAtHostPort()
Get the user@host port string.


equals

public boolean equals(Object other)
Description copied from interface: FromHeader
Compare this FromHeader for equality with another. This method overrides the equals method in javax.sip.Header. This method specifies object equality as outlined by RFC3261. Two From header fields are equivalent if their URIs match, and their parameters match. Extension parameters in one header field, not present in the other are ignored for the purposes of comparison. This means that the display name and presence or absence of angle brackets do not affect matching. When comparing header fields, field names are always case-insensitive. Unless otherwise stated in the definition of a particular header field, field values, parameter names, and parameter values are case-insensitive. Tokens are always case-insensitive. Unless specified otherwise, values expressed as quoted strings are case-sensitive.

Specified by:
equals in interface FromHeader
Overrides:
equals in class AddressParametersHeader
Parameters:
other - Object to compare with
Returns:
true if the two headers are the same.
See Also:
Object.equals(java.lang.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.