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

gov.nist.javax.sip.header
Class Contact

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.Contact
All Implemented Interfaces:
Cloneable, ContactHeader, Header, HeaderAddress, Parameters, Serializable, SIPHeaderNames

public final class Contact
extends AddressParametersHeader
implements ContactHeader

Contact Item.

Since:
1.1
Version:
1.2 $Revision: 1.8 $ $Date: 2006/11/12 21:52:38 $
Author:
M. Ranganathan
See Also:
ContactList, Serialized Form

Field Summary
static String ACTION
           
static String EXPIRES
           
static String PROXY
           
static String Q
           
static String REDIRECT
           
 
Fields inherited from interface javax.sip.header.ContactHeader
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, 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
Contact()
          Default constructor.
 
Method Summary
 Object clone()
          Creates and returns a deep copy of the Header.
 boolean equals(Object other)
          Compare this SIP Header for equality with another.
 Address getAddress()
          get the address field.
 ContactList getContactList()
          get the Contact list.
 gov.nist.core.NameValueList getContactParms()
          get the parameters List
 int getExpires()
          get Expires parameter.
 float getQValue()
          get the Q-value
 boolean getWildCardFlag()
          get the WildCardFlag field
 boolean isWildCard()
          Returns a boolean value that indicates if the contact header has the format of Contact: *.
 void setAddress(Address address)
          Set the address member
 void setContactList(ContactList cl)
          set the Contact List
 void setExpires(int expiryDeltaSeconds)
          Set the expiry time in seconds.
 void setParameter(String name, String value)
          Set a parameter.
 void setQValue(float qValue)
          set the Q-value parameter
 void setWildCard()
          Sets a wildcard on this contact address that is "*" is assigned to the contact header so that the header will have the format of Contact: *.
 void setWildCardFlag(boolean w)
          Set the wildCardFlag member
 
Methods inherited from class gov.nist.javax.sip.header.ParametersHeader
getNameValue, getParameter, getParameterNames, getParameters, getParameterValue, hasParameter, hasParameters, removeParameter, removeParameters, setParameter, setParameters, setQuotedParameter
 
Methods inherited from class gov.nist.javax.sip.header.SIPHeader
encode, 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.Parameters
getParameter, getParameterNames, removeParameter
 
Methods inherited from interface javax.sip.header.Header
getName, hashCode, toString
 

Field Detail

ACTION

public static final String ACTION
See Also:
Constant Field Values

PROXY

public static final String PROXY
See Also:
Constant Field Values

REDIRECT

public static final String REDIRECT
See Also:
Constant Field Values

EXPIRES

public static final String EXPIRES
See Also:
Constant Field Values

Q

public static final String Q
See Also:
Constant Field Values
Constructor Detail

Contact

public Contact()
Default constructor.

Method Detail

setParameter

public void setParameter(String name,
                         String value)
                  throws ParseException
Set a parameter.

Specified by:
setParameter in interface Parameters
Overrides:
setParameter in class ParametersHeader
Parameters:
name - - a String specifying the parameter name
value - - a String specifying the parameter value
Throws:
ParseException - which signals that an error has been reached unexpectedly while parsing the parameter name or value.

getContactList

public ContactList getContactList()
get the Contact list.

Returns:
ContactList

getWildCardFlag

public boolean getWildCardFlag()
get the WildCardFlag field

Returns:
boolean

getAddress

public Address getAddress()
get the address field.

Specified by:
getAddress in interface HeaderAddress
Overrides:
getAddress in class AddressParametersHeader
Returns:
Address

getContactParms

public gov.nist.core.NameValueList getContactParms()
get the parameters List

Returns:
NameValueList

getExpires

public int getExpires()
get Expires parameter.

Specified by:
getExpires in interface ContactHeader
Returns:
the Expires parameter.

setExpires

public void setExpires(int expiryDeltaSeconds)
Set the expiry time in seconds.

Specified by:
setExpires in interface ContactHeader
Parameters:
expiryDeltaSeconds - exipry time.

getQValue

public float getQValue()
get the Q-value

Specified by:
getQValue in interface ContactHeader
Returns:
float

setContactList

public void setContactList(ContactList cl)
set the Contact List

Parameters:
cl - ContactList to set

setWildCardFlag

public void setWildCardFlag(boolean w)
Set the wildCardFlag member

Parameters:
w - boolean to set

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

setQValue

public void setQValue(float qValue)
               throws InvalidArgumentException
set the Q-value parameter

Specified by:
setQValue in interface ContactHeader
Parameters:
qValue - float to set
Throws:
InvalidArgumentException - if the q-value parameter value is not -1 or between 0 and 1.

clone

public Object clone()
Description copied from interface: Header
Creates and returns a deep copy of the Header. This methods must ensure a deep copy of the Header, so that when a message is cloned the Header can be modified without effecting the original Header in the message. This provides useful functionality for proxying Requests and Responses, for example: This method overrides the clone method in java.lang.Object.

Specified by:
clone in interface Header
Overrides:
clone in class AddressParametersHeader
See Also:
Object#clone()

setWildCard

public void setWildCard()
Description copied from interface: ContactHeader
Sets a wildcard on this contact address that is "*" is assigned to the contact header so that the header will have the format of Contact: *.

Specified by:
setWildCard in interface ContactHeader

isWildCard

public boolean isWildCard()
Description copied from interface: ContactHeader
Returns a boolean value that indicates if the contact header has the format of Contact: *.

Specified by:
isWildCard in interface ContactHeader
Returns:
true if this is a wildcard address, false otherwise.

equals

public boolean equals(Object other)
Description copied from interface: Header
Compare this SIP Header for equality with another. This method overrides the equals method in java.lang.Object. This method is over-ridden further for each required header (To, From, CSeq, Call-ID, Max-Forwards, and Via) which object equality is outlined as specified by RFC3261. All optional headers are compared using object equality that is each field in the header is used for comparision. 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 Header
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.