01: /**
02: * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
03: * Unpublished - rights reserved under the Copyright Laws of the United States.
04: * Copyright © 2003 Sun Microsystems, Inc. All rights reserved.
05: * Copyright © 2005 BEA Systems, Inc. All rights reserved.
06: *
07: * Use is subject to license terms.
08: *
09: * This distribution may include materials developed by third parties.
10: *
11: * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
12: *
13: * Module Name : JSIP Specification
14: * File Name : AcceptEncodingHeader.java
15: * Author : Phelim O'Doherty
16: *
17: * HISTORY
18: * Version Date Author Comments
19: * 1.1 08/10/2002 Phelim O'Doherty
20: *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
21: */package javax.sip.header;
22:
23: import javax.sip.InvalidArgumentException;
24:
25: /**
26: * This interface represents the Accept-Encoding request-header.
27: * A client includes an AcceptEncodingHeader in a Request to tell the server
28: * what coding schemes are acceptable in the Response e.g. compress, gzip.
29: * <p>
30: * If an AcceptEncodingHeader is present, and if the server cannot send a
31: * Response which is acceptable according to the AcceptEncodingHeader, then
32: * the server should return a Response with a status code of NOT_ACCEPTABLE.
33: * <p>
34: * An empty Accept-Encoding header field is permissible, it is equivalent to
35: * <code>Accept-Encoding: identity</code>, meaning no encoding is permissible.
36: * <p>
37: * If no Accept-Encoding header field is present, the server SHOULD assume a
38: * default value of identity.
39: * <p>
40: * For Example:<br>
41: * <code>Accept-Encoding: gzip</code>
42: *
43: * @author BEA Systems, NIST
44: * @version 1.2
45: *
46: */
47: public interface AcceptEncodingHeader extends Parameters, Encoding,
48: Header {
49:
50: /**
51: * Gets q-value of the encoding in this encoding value. A value of
52: * <code>-1</code> indicates the<code>q-value</code> is not set.
53: *
54: * @return q-value of encoding value, -1 if q-value is not set.
55: */
56: public float getQValue();
57:
58: /**
59: * Sets q-value for the encoding in this encoding value. Q-values allow the
60: * user to indicate the relative degree of preference for that encoding,
61: * using the qvalue scale from 0 to 1. If no q-value is present, the
62: * encoding should be treated as having a q-value of 1.
63: *
64: * @param qValue - the new float value of the q-value, a value of -1 resets
65: * the qValue.
66: * @throws InvalidArgumentException if the q parameter value is not
67: * <code>-1</code> or between <code>0 and 1</code>.
68: */
69: public void setQValue(float qValue) throws InvalidArgumentException;
70:
71: /**
72: * Name of AcceptEncodingHeader
73: */
74: public final static String NAME = "Accept-Encoding";
75:
76: }
|