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

gov.nist.javax.sip.header
Class ParametersHeader

java.lang.Object
  extended by gov.nist.core.GenericObject
      extended by gov.nist.javax.sip.header.SIPObject
          extended by gov.nist.javax.sip.header.SIPHeader
              extended by gov.nist.javax.sip.header.ParametersHeader
All Implemented Interfaces:
HeaderExt, ParametersExt, SIPHeaderNames, Serializable, Cloneable, Header, Parameters
Direct Known Subclasses:
Accept, AcceptEncoding, AcceptLanguage, AddressParametersHeader, AlertInfo, AuthenticationHeader, AuthenticationInfo, CallInfo, ContentDisposition, ContentType, ErrorInfo, Event, Join, MinSE, PAccessNetworkInfo, PChargingFunctionAddresses, PChargingVector, PUserDatabase, PVisitedNetworkID, Reason, References, Replaces, RetryAfter, SecurityAgree, SessionExpires, SubscriptionState, Via

public abstract class ParametersHeader
extends SIPHeader
implements Parameters, ParametersExt, Serializable

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

Version:
1.2 $Revision: 1.17 $ $Date: 2010-07-28 08:39:26 $
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, JOIN, 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()
          Clones this object.
 String getMultiParameter(String name)
          Returns the parameter name
 Iterator<String> getMultiParameterNames()
          Returns an Iterator over the names (Strings) of all parameters present in this ParametersHeader.
 gov.nist.core.DuplicateNameValueList getMultiParameters()
           
 Object getMultiParameterValue(String name)
          Return the parameter as an object (dont convert to string).
 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.
 String getParameter(String name, boolean stripQuotes)
          Returns the value of the named parameter, or null if it is not set.
 Iterator<String> 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 hasMultiParameter(String parameterName)
          Return true if has a parameter.
 boolean hasMultiParameters()
          Return true if you have a parameter and false otherwise.
 boolean hasParameter(String parameterName)
          Return true if has a parameter.
 boolean hasParameters()
          Return true if you have a parameter and false otherwise.
 void removeMultiParameter(String name)
          Removes the specified parameter from Parameters of this ParametersHeader.
 void removeMultiParameters()
          Remove all parameters.
 void removeParameter(String name)
          Removes the specified parameter from Parameters of this ParametersHeader.
 void removeParameters()
          Remove all parameters.
 void setMultiParameter(gov.nist.core.NameValue nameValue)
          Set the parameter given a name and value.
 void setMultiParameter(String name, String value)
          Introduced specifically for the P-Charging-Function-Addresses Header and all other headers that may have multiple header parameters of the same name, but with multiple possible values.
 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, 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
 

Method Detail

getParameter

public String getParameter(String name)
Description copied from interface: Parameters
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

getParameter

public String getParameter(String name,
                           boolean stripQuotes)
Description copied from interface: ParametersExt
Returns the value of the named parameter, or null if it is not set. A zero-length String indicates flag parameter. The stack remove the undeeded quotes that are imposed by SIP encoding rules to ensure unambiguous parsing.
The stripQuotes parameter can be used to get the original value as it has been received by the stack ie with the quotes

Specified by:
getParameter in interface ParametersExt
Parameters:
name - name of parameter to retrieve
stripQuotes - will return the value of the parameter as it has been received when the message came into the stack
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<String> 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 class: gov.nist.core.GenericObject
Clones this object.

Specified by:
clone in interface Header
Overrides:
clone in class gov.nist.core.GenericObject
Returns:
a deep copy of Header

setMultiParameter

public void setMultiParameter(String name,
                              String value)
Introduced specifically for the P-Charging-Function-Addresses Header and all other headers that may have multiple header parameters of the same name, but with multiple possible values. Example: P-Charging-Function-Addresses: ccf=[5555::b99:c88:d77:e66]; ccf=[5555::a55:b44:c33:d22]; ecf=[5555::1ff:2ee:3dd:4cc]; ecf=[5555::6aa:7bb:8cc:9dd]

Parameters:
name - of the parameter
value - of the parameter

setMultiParameter

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

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

getMultiParameter

public String getMultiParameter(String name)
Returns the parameter name

Parameters:
name -
Returns:

getMultiParameters

public gov.nist.core.DuplicateNameValueList getMultiParameters()

getMultiParameterValue

public Object getMultiParameterValue(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.

getMultiParameterNames

public Iterator<String> getMultiParameterNames()
Returns an Iterator over the names (Strings) of all parameters present in this ParametersHeader.

Returns:
an Iterator over all the parameter names

hasMultiParameters

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

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

removeMultiParameter

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

Parameters:
name - - a String specifying the parameter name

hasMultiParameter

public boolean hasMultiParameter(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.

removeMultiParameters

public void removeMultiParameters()
Remove all parameters.


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.