NIST SIP Parser and Stack (v1.2) API

gov.nist.javax.sip.header
Class AcceptEncoding

java.lang.Object
  |
  +--gov.nist.core.GenericObject
        |
        +--gov.nist.javax.sip.header.SIPObject
              |
              +--gov.nist.javax.sip.header.SIPHeader
                    |
                    +--gov.nist.javax.sip.header.ParametersHeader
                          |
                          +--gov.nist.javax.sip.header.AcceptEncoding
All Implemented Interfaces:
AcceptEncodingHeader, Cloneable, Encoding, Header, Parameters, Serializable, SIPHeaderNames

public class AcceptEncoding
extends ParametersHeader
implements AcceptEncodingHeader

Accept-Encoding SIP (HTTP) Header.

Author:
M. Ranganathan , Olivier Deruelle
This code is in the public domain.
 From HTTP RFC 2616

 
   The Accept-Encoding request-header field is similar to Accept, but
   restricts the content-codings (section 3.5) that are acceptable in
   the response.

 
       Accept-Encoding  = "Accept-Encoding" ":"
 
 
                          1#( codings [ ";" "q" "=" qvalue ] )
       codings          = ( content-coding | "*" )
 
   Examples of its use are:
 
       Accept-Encoding: compress, gzip
       Accept-Encoding:
       Accept-Encoding: *
       Accept-Encoding: compress;q=0.5, gzip;q=1.0
       Accept-Encoding: gzip;q=1.0, identity; q=0.5, *;q=0
 
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface javax.sip.header.AcceptEncodingHeader
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, ORGANIZATION, PRIORITY, PROXY_AUTHENTICATE, PROXY_AUTHORIZATION, PROXY_REQUIRE, RACK, REASON, RECORD_ROUTE, REPLY_TO, REQUIRE, RETRY_AFTER, ROUTE, RSEQ, SERVER, SUBJECT, SUBSCRIPTION_STATE, SUPPORTED, TIMESTAMP, TO, UNSUPPORTED, USER_AGENT, VIA, WARNING, WWW_AUTHENTICATE
 
Constructor Summary
AcceptEncoding()
          default constructor
 
Method Summary
 String encode()
          Encode the header in canonical form.
 String getEncoding()
          get ContentEncoding field
 float getQValue()
          get QValue field
 void setEncoding(String encoding)
          Sets the encoding of an EncodingHeader.
 void setQValue(float q)
          Set the qvalue member
 
Methods inherited from class gov.nist.javax.sip.header.ParametersHeader
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, isHeaderList, setHeaderName
 
Methods inherited from class gov.nist.javax.sip.header.SIPObject
clone, dbgPrint, debugDump, debugDump, equals, match, merge, replace, replace, replace, replace, toString
 
Methods inherited from class gov.nist.core.GenericObject
getClassFromName, getMatcher, isMySubclass, setMatcher
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface javax.sip.header.Parameters
getParameter, getParameterNames, removeParameter, setParameter
 
Methods inherited from interface javax.sip.header.Header
clone, equals, getName, toString
 

Constructor Detail

AcceptEncoding

public AcceptEncoding()
default constructor

Method Detail

encode

public String encode()
Encode the header in canonical form.

Overrides:
encode in class SIPHeader
Returns:
encoded header.

getQValue

public float getQValue()
get QValue field

Specified by:
getQValue in interface AcceptEncodingHeader
Returns:
float

getEncoding

public String getEncoding()
get ContentEncoding field

Specified by:
getEncoding in interface Encoding
Returns:
String

setQValue

public void setQValue(float q)
               throws InvalidArgumentException
Set the qvalue member

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

setEncoding

public void setEncoding(String encoding)
                 throws ParseException
Sets the encoding of an EncodingHeader.

Specified by:
setEncoding in interface Encoding
Parameters:
encoding - - the new string value defining the encoding.
Throws:
ParseException - which signals that an error has been reached unexpectedly while parsing the encoding value.

NIST SIP Parser and Stack (v1.2) API

A product of the NIST/ITL Advanced Networking Technologies Division.
See conditions of use.
Get the latest distribution.
Submit a bug report or feature request.