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

gov.nist.javax.sip.header
Class ParametersHeader

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
All Implemented Interfaces:
Cloneable, Header, Parameters, Serializable, SIPHeaderNames
Direct Known Subclasses:
Accept, AcceptEncoding, AcceptLanguage, AccessNetworkInfo, AddressParametersHeader, AlertInfo, AssociatedURI, AuthenticationHeader, AuthenticationInfo, CallInfo, ChargingFunctionAddresses, ChargingVector, ContentDisposition, ContentType, ErrorInfo, Event, MinSE, Privacy, Reason, Replaces, RetryAfter, SessionExpires, SubscriptionState, Via, VisitedNetworkID

public abstract class ParametersHeader
extends SIPHeader
implements Parameters

Parameters header. Suitable for extension by headers that have parameters.

Version:
1.2 $Revision: 1.9 $ $Date: 2006/11/01 02:22:59 $
Author:
M. Ranganathan
See Also:
Serialized Form

Field Summary
 
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
 
Method Summary
 Object clone()
          Creates and returns a deep copy of the Header.
 gov.nist.core.NameValue getNameValue(String parameterName)
          This is for the benifit of the TCK.
 String getParameter(String name)
          Returns the value of the named parameter, or null if it is not set.
 Iterator getParameterNames()
          Returns an Iterator over the names (Strings) of all parameters present in this ParametersHeader.
 gov.nist.core.NameValueList getParameters()
          get the parameter list.
 Object getParameterValue(String name)
          Return the parameter as an object (dont convert to string).
 boolean hasParameter(String parameterName)
          Return true if has a parameter.
 boolean hasParameters()
          Return true if you have a parameter and false otherwise.
 void removeParameter(String name)
          Removes the specified parameter from Parameters of this ParametersHeader.
 void removeParameters()
          Remove all parameters.
 void setParameter(gov.nist.core.NameValue nameValue)
          Set the parameter given a name and value.
 void setParameter(String name, String value)
          Sets the value of the specified parameter.
 void setParameters(gov.nist.core.NameValueList parameters)
          Set the parameter list.
 void setQuotedParameter(String name, String value)
          Sets the value of the specified parameter.
 
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, equals, 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.Header
equals
 

Method Detail

getParameter

public String getParameter(String name)
Returns the value of the named parameter, or null if it is not set. A zero-length String indicates flag parameter.

Specified by:
getParameter in interface Parameters
Parameters:
name - name of parameter to retrieve
Returns:
the value of specified parameter

getParameterValue

public Object getParameterValue(String name)
Return the parameter as an object (dont convert to string).

Parameters:
name - is the name of the parameter to get.
Returns:
the object associated with the name.

getParameterNames

public Iterator getParameterNames()
Returns an Iterator over the names (Strings) of all parameters present in this ParametersHeader.

Specified by:
getParameterNames in interface Parameters
Returns:
an Iterator over all the parameter names

hasParameters

public boolean hasParameters()
Return true if you have a parameter and false otherwise.

Returns:
true if the parameters list is non-empty.

removeParameter

public void removeParameter(String name)
Removes the specified parameter from Parameters of this ParametersHeader. This method returns silently if the parameter is not part of the ParametersHeader.

Specified by:
removeParameter in interface Parameters
Parameters:
name - - a String specifying the parameter name

setParameter

public void setParameter(String name,
                         String value)
                  throws ParseException
Sets the value of the specified parameter. If the parameter already had a value it will be overwritten. A zero-length String indicates flag parameter.

Specified by:
setParameter in interface Parameters
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.

setQuotedParameter

public void setQuotedParameter(String name,
                               String value)
                        throws ParseException
Sets the value of the specified parameter. If the parameter already had a value it will be overwritten. A zero-length String indicates flag parameter.

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.

hasParameter

public boolean hasParameter(String parameterName)
Return true if has a parameter.

Parameters:
parameterName - is the name of the parameter.
Returns:
true if the parameter exists and false if not.

removeParameters

public void removeParameters()
Remove all parameters.


getParameters

public gov.nist.core.NameValueList getParameters()
get the parameter list.

Returns:
parameter list

setParameter

public void setParameter(gov.nist.core.NameValue nameValue)
Set the parameter given a name and value.

Parameters:
nameValue - - the name value of the parameter to set.

setParameters

public void setParameters(gov.nist.core.NameValueList parameters)
Set the parameter list.

Parameters:
parameters - The name value list to set as the parameter list.

getNameValue

public gov.nist.core.NameValue getNameValue(String parameterName)
This is for the benifit of the TCK.

Returns:
the name value pair for the given parameter name.

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

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.