|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--jain.protocol.ip.sip.header.Header
|
+--jain.protocol.ip.sip.header.GeneralHeader
|
+--jain.protocol.ip.sip.header.AcceptHeader
This class 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 RequestMessage, then it is assumed that the client accepts 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 ResponseMessage with a CLIENT_ERROR_NOT_ACCEPTABLE response code.
| Field Summary | |
static java.lang.String |
token
Token of AcceptHeader |
| Fields inherited from class jain.protocol.ip.sip.header.Header |
ENTITY_HEADER,
GENERAL_HEADER,
REQUEST_HEADER,
RESPONSE_HEADER |
| Constructor Summary | |
AcceptHeader(java.lang.String type,
java.lang.String subType)
Creates an AcceptHeader based on the specified type and subType |
|
| Method Summary | |
boolean |
allowsAllSubTypes()
Gets boolean value to indicate if the AcceptHeader allows all media sub-types |
boolean |
allowsAllTypes()
Gets boolean value to indicate if the AcceptHeader allows all media types |
java.lang.Object |
clone()
Creates and returns a copy of AcceptHeader |
boolean |
equals(AcceptHeader acceptHeader)
Indicates whether some other AcceptHeader is "equal to" this one |
java.lang.String |
getExtension(java.lang.String extension)
Gets the value of specified extension parameter in AcceptHeader |
java.lang.String[] |
getExtensions()
Gets an array of the names of AcceptHeader's extension parameters |
java.lang.String |
getMediaRange()
Gets string representation of media-range of AcceptHeader |
float |
getQValue()
Gets q-value of media-range in AcceptHeader |
java.lang.String |
getSubType()
Gets the media sub-type of AcceptHeader |
java.lang.String |
getType()
Gets the media type of AcceptHeader |
java.lang.String |
getValue()
Gets value of AcceptHeader |
boolean |
hasExtension(java.lang.String extension)
Gets boolean value to indicate if the AcceptHeader has specified extension parameter |
boolean |
hasExtensions()
Gets boolean value to indicate if the AcceptHeader has extension parameters |
boolean |
hasQValue()
Gets boolean value to indicate if the AcceptHeader has a q-value |
void |
removeExtension(java.lang.String extension)
Removes specified extension parameter from AcceptHeader |
void |
removeExtensions()
Removes all extension parameters from AcceptHeader |
void |
removeQValue()
Removes q-value of media-range in AcceptHeader |
void |
setExtension(java.lang.String extension,
java.lang.String value)
Sets value of extension parameter to value in AcceptHeader |
void |
setQValue(float qValue)
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. |
void |
setSubType(java.lang.String subType)
Sets value of media sub-type in AcceptHeader |
void |
setType(java.lang.String type)
Sets value of media type in AcceptHeader |
| Methods inherited from class jain.protocol.ip.sip.header.Header |
equals,
getHeaderType,
getToken,
setValue,
toString |
| Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
| Field Detail |
public static final java.lang.String token
| Constructor Detail |
public AcceptHeader(java.lang.String type,
java.lang.String subType)
throws java.lang.IllegalArgumentException
type - media typesubType - media sub-type| Method Detail |
public java.lang.String getType()
public java.lang.String getSubType()
public java.lang.String getExtension(java.lang.String extension)
throws ParameterNotSetException
extension - extension parameter to retrieve
public java.lang.String[] getExtensions()
throws ParameterNotSetException
public java.lang.String getMediaRange()
public boolean hasExtensions()
public boolean hasExtension(java.lang.String extension)
public boolean hasQValue()
public boolean allowsAllTypes()
public boolean allowsAllSubTypes()
public void setSubType(java.lang.String subType)
throws java.lang.IllegalArgumentException
subType - media sub-type
public void setType(java.lang.String type)
throws java.lang.IllegalArgumentException
type - media type
public void setExtension(java.lang.String extension,
java.lang.String value)
extension - name of extension parametervalue - value of extension parameter
public void setQValue(float qValue)
throws java.lang.IllegalArgumentException
qValue - q-value betwwen 0 and 1
public float getQValue()
throws ParameterNotSetException
public void removeExtension(java.lang.String extension)
extension - extension parameter to remove from AcceptHeaderpublic void removeExtensions()
public void removeQValue()
public java.lang.String getValue()
public java.lang.Object clone()
public boolean equals(AcceptHeader acceptHeader)
acceptHeader - the AcceptHeader with which to compare
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Copyright - 2000 Sun Microsystems