001: /**
002: * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
003: * Unpublished - rights reserved under the Copyright Laws of the United States.
004: * Copyright © 2003 Sun Microsystems, Inc. All rights reserved.
005: * Copyright © 2005 BEA Systems, Inc. All rights reserved.
006: *
007: * Use is subject to license terms.
008: *
009: * This distribution may include materials developed by third parties.
010: *
011: * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
012: *
013: * Module Name : JSIP Specification
014: * File Name : AcceptLanguageHeader.java
015: * Author : Phelim O'Doherty
016: *
017: * HISTORY
018: * Version Date Author Comments
019: * 1.1 08/10/2002 Phelim O'Doherty
020: *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
021: */package javax.sip.header;
022:
023: import javax.sip.InvalidArgumentException;
024: import java.util.Locale;
025:
026: /**
027:
028: * The Accept-Language header field is used in requests to indicate the
029:
030: * preferred languages for reason phrases, session descriptions, or
031:
032: * status responses carried as message bodies in the response. If no
033:
034: * Accept-Language header field is present, the server SHOULD assume all
035:
036: * languages are acceptable to the client. The q-value is used in a similar
037:
038: * manner to AcceptHeader to indicate degrees of preference.
039:
040: * <p>
041:
042: * For Example:<br>
043:
044: * <code>Accept-Language: da, en-gb;q=0.8, en;q=0.7</code>
045:
046: *
047:
048: * @see AcceptHeader
049:
050: *
051:
052: * @author BEA Systems, NIST
053: * @version 1.2
054:
055: *
056:
057: */
058:
059: public interface AcceptLanguageHeader extends Parameters, Header {
060:
061: /**
062:
063: * Gets q-value of the media-range in AcceptLanguageHeader. A value of
064:
065: * <code>-1</code> indicates the<code>q-value</code> is not set.
066:
067: *
068:
069: * @return q-value of media-range, -1 if q-value is not set.
070:
071: */
072:
073: public float getQValue();
074:
075: /**
076:
077: * Sets q-value for media-range in AcceptLanguageHeader. Q-values allow the
078:
079: * user to indicate the relative degree of preference for that media-range,
080:
081: * using the qvalue scale from 0 to 1. If no q-value is present, the
082:
083: * media-range should be treated as having a q-value of 1.
084:
085: *
086:
087: * @param qValue - the new float value of the q-value, a value of -1 resets
088:
089: * the qValue.
090:
091: * @throws InvalidArgumentException if the q parameter value is not
092:
093: * <code>-1</code> or between <code>0 and 1</code>.
094:
095: */
096:
097: public void setQValue(float qValue) throws InvalidArgumentException;
098:
099: /**
100:
101: * Gets the language value of the AcceptLanguageHeader.
102:
103: *
104:
105: * @return the language Locale value of this AcceptLanguageHeader
106:
107: */
108:
109: public Locale getAcceptLanguage();
110:
111: /**
112:
113: * Sets the language parameter of this AcceptLanguageHeader.
114:
115: *
116:
117: * @param language - the new Locale value of the language of
118:
119: * AcceptLanguageHeader
120: */
121:
122: public void setAcceptLanguage(Locale language);
123:
124: /**
125:
126: * Name of AcceptLanguageHeader
127:
128: */
129:
130: public final static String NAME = "Accept-Language";
131:
132: }
|