JSIP API v1.2
November 2006

javax.sip.header
Interface AcceptHeader

All Superinterfaces:
java.lang.Cloneable, Header, MediaType, Parameters, java.io.Serializable

public interface AcceptHeader
extends MediaType, Parameters, Header

This interface represents an Accept request-header. It can be used in to specify media-ranges which are acceptable for the response. AcceptHeaders can be used to indicate that the request is specifically limited to a small set of desired types. The specification of the acceptable media is split into type and subtype.

An AcceptHeader may be followed by one or more parameters applicable to the media-range. q-values allow the user to indicate the relative degree of preference for that media-range, using the qvalue scale from 0 to 1. (If no q-value is present, the media-range should be treated as having a q-value of 1.)

If no AcceptHeader is present in a Request, the server SHOULD assume a media of type "application" and subType "sdp". If an AcceptHeader is present, and if the server cannot send a response which is acceptable according to the combined Accept field value, then the server should send a Response message with a NOT_ACCEPTABLE status code.

For example:
Accept: application/sdp;level=1, application/x-private, text/html

Author:
BEA Systems, NIST

Field Summary
static java.lang.String NAME
          Name of AcceptHeader
 
Method Summary
 boolean allowsAllContentSubTypes()
          Gets boolean value to indicate if the AcceptHeader allows all media sub-types, that is the content sub-type is "*".
 boolean allowsAllContentTypes()
          Gets boolean value to indicate if the AcceptHeader allows all media types, that is the content type is "*".
 float getQValue()
          Gets q-value of media-range in AcceptHeader.
 void setQValue(float qValue)
          Sets q-value for media-range in AcceptHeader.
 
Methods inherited from interface javax.sip.header.MediaType
getContentSubType, getContentType, setContentSubType, setContentType
 
Methods inherited from interface javax.sip.header.Parameters
getParameter, getParameterNames, removeParameter, setParameter
 
Methods inherited from interface javax.sip.header.Header
clone, equals, getName, hashCode, toString
 

Field Detail

NAME

static final java.lang.String NAME
Name of AcceptHeader

See Also:
Constant Field Values
Method Detail

setQValue

void setQValue(float qValue)
               throws InvalidArgumentException
Sets q-value for media-range in AcceptHeader. Q-values allow the user to indicate the relative degree of preference for that media-range, using the qvalue scale from 0 to 1. If no q-value is present, the media-range should be treated as having a q-value of 1.

Parameters:
qValue - - the new float value of the q-value, a value of -1 resets the qValue.
Throws:
InvalidArgumentException - if the q parameter value is not -1 or between 0 and 1.

getQValue

float getQValue()
Gets q-value of media-range in AcceptHeader. A value of -1 indicates theq-value is not set.

Returns:
q-value of media-range, -1 if q-value is not set.

allowsAllContentSubTypes

boolean allowsAllContentSubTypes()
Gets boolean value to indicate if the AcceptHeader allows all media sub-types, that is the content sub-type is "*".

Returns:
true if all content sub-types are allowed, false otherwise.

allowsAllContentTypes

boolean allowsAllContentTypes()
Gets boolean value to indicate if the AcceptHeader allows all media types, that is the content type is "*".

Returns:
true if all contenet types are allowed, false otherwise.

JSIP API v1.2
November 2006

If you have any comments, please mail them to JAIN-SIP-INTEREST@java.sun.com after subscribing at http://archives.java.sun.com
Copyright - 2006 BEA Systems and Sun Microsystems