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, 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, Replaces, RetryAfter, SecurityAgree, SessionExpires, SubscriptionState, Via

public abstract class ParametersHeader
extends SIPHeader
implements Parameters, Serializable

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

Version:
1.2 $Revision: 1.12 $ $Date: 2009/07/17 18:57:33 $
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.
 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<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 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, 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
equals, 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<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

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.