• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2008-2009, Motorola, Inc.
3  *
4  * All rights reserved.
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions are met:
8  *
9  * - Redistributions of source code must retain the above copyright notice,
10  * this list of conditions and the following disclaimer.
11  *
12  * - Redistributions in binary form must reproduce the above copyright notice,
13  * this list of conditions and the following disclaimer in the documentation
14  * and/or other materials provided with the distribution.
15  *
16  * - Neither the name of the Motorola, Inc. nor the names of its contributors
17  * may be used to endorse or promote products derived from this software
18  * without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
24  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30  * POSSIBILITY OF SUCH DAMAGE.
31  */
32 
33 package com.android.obex;
34 
35 /**
36  * The <code>ResponseCodes</code> class contains the list of valid response codes a server may send
37  * to a client.
38  *
39  * <p><STRONG>IMPORTANT NOTE</STRONG>
40  *
41  * <p>The values in this interface represent the values defined in the IrOBEX specification, which
42  * is different with the HTTP specification.
43  *
44  * <p><code>OBEX_DATABASE_FULL</code> and <code>OBEX_DATABASE_LOCKED</code> require further
45  * description since they are not defined in HTTP. The server will send an <code>OBEX_DATABASE_FULL
46  * </code> message when the client requests that something be placed into a database but the
47  * database is full (cannot take more data). <code>OBEX_DATABASE_LOCKED</code> will be returned when
48  * the client wishes to access a database, database table, or database record that has been locked.
49  */
50 public final class ResponseCodes {
51 
52     /**
53      * Defines the OBEX CONTINUE response code.
54      *
55      * <p>The value of <code>OBEX_HTTP_CONTINUE</code> is 0x90 (144).
56      */
57     public static final int OBEX_HTTP_CONTINUE = 0x90;
58 
59     /**
60      * Defines the OBEX SUCCESS response code.
61      *
62      * <p>The value of <code>OBEX_HTTP_OK</code> is 0xA0 (160).
63      */
64     public static final int OBEX_HTTP_OK = 0xA0;
65 
66     /**
67      * Defines the OBEX CREATED response code.
68      *
69      * <p>The value of <code>OBEX_HTTP_CREATED</code> is 0xA1 (161).
70      *
71      * @hide
72      */
73     public static final int OBEX_HTTP_CREATED = 0xA1;
74 
75     /**
76      * Defines the OBEX ACCEPTED response code.
77      *
78      * <p>The value of <code>OBEX_HTTP_ACCEPTED</code> is 0xA2 (162).
79      *
80      * @hide
81      */
82     public static final int OBEX_HTTP_ACCEPTED = 0xA2;
83 
84     /**
85      * Defines the OBEX NON-AUTHORITATIVE INFORMATION response code.
86      *
87      * <p>The value of <code>OBEX_HTTP_NOT_AUTHORITATIVE</code> is 0xA3 (163).
88      *
89      * @hide
90      */
91     public static final int OBEX_HTTP_NOT_AUTHORITATIVE = 0xA3;
92 
93     /**
94      * Defines the OBEX NO CONTENT response code.
95      *
96      * <p>The value of <code>OBEX_HTTP_NO_CONTENT</code> is 0xA4 (164).
97      *
98      * @hide
99      */
100     public static final int OBEX_HTTP_NO_CONTENT = 0xA4;
101 
102     /**
103      * Defines the OBEX RESET CONTENT response code.
104      *
105      * <p>The value of <code>OBEX_HTTP_RESET</code> is 0xA5 (165).
106      *
107      * @hide
108      */
109     public static final int OBEX_HTTP_RESET = 0xA5;
110 
111     /**
112      * Defines the OBEX PARTIAL CONTENT response code.
113      *
114      * <p>The value of <code>OBEX_HTTP_PARTIAL</code> is 0xA6 (166).
115      *
116      * @hide
117      */
118     public static final int OBEX_HTTP_PARTIAL = 0xA6;
119 
120     /**
121      * Defines the OBEX MULTIPLE_CHOICES response code.
122      *
123      * <p>The value of <code>OBEX_HTTP_MULT_CHOICE</code> is 0xB0 (176).
124      *
125      * @hide
126      */
127     public static final int OBEX_HTTP_MULT_CHOICE = 0xB0;
128 
129     /**
130      * Defines the OBEX MOVED PERMANENTLY response code.
131      *
132      * <p>The value of <code>OBEX_HTTP_MOVED_PERM</code> is 0xB1 (177).
133      *
134      * @hide
135      */
136     public static final int OBEX_HTTP_MOVED_PERM = 0xB1;
137 
138     /**
139      * Defines the OBEX MOVED TEMPORARILY response code.
140      *
141      * <p>The value of <code>OBEX_HTTP_MOVED_TEMP</code> is 0xB2 (178).
142      *
143      * @hide
144      */
145     public static final int OBEX_HTTP_MOVED_TEMP = 0xB2;
146 
147     /**
148      * Defines the OBEX SEE OTHER response code.
149      *
150      * <p>The value of <code>OBEX_HTTP_SEE_OTHER</code> is 0xB3 (179).
151      *
152      * @hide
153      */
154     public static final int OBEX_HTTP_SEE_OTHER = 0xB3;
155 
156     /**
157      * Defines the OBEX NOT MODIFIED response code.
158      *
159      * <p>The value of <code>OBEX_HTTP_NOT_MODIFIED</code> is 0xB4 (180).
160      *
161      * @hide
162      */
163     public static final int OBEX_HTTP_NOT_MODIFIED = 0xB4;
164 
165     /**
166      * Defines the OBEX USE PROXY response code.
167      *
168      * <p>The value of <code>OBEX_HTTP_USE_PROXY</code> is 0xB5 (181).
169      *
170      * @hide
171      */
172     public static final int OBEX_HTTP_USE_PROXY = 0xB5;
173 
174     /**
175      * Defines the OBEX BAD REQUEST response code.
176      *
177      * <p>The value of <code>OBEX_HTTP_BAD_REQUEST</code> is 0xC0 (192).
178      */
179     public static final int OBEX_HTTP_BAD_REQUEST = 0xC0;
180 
181     /**
182      * Defines the OBEX UNAUTHORIZED response code.
183      *
184      * <p>The value of <code>OBEX_HTTP_UNAUTHORIZED</code> is 0xC1 (193).
185      *
186      * @hide
187      */
188     public static final int OBEX_HTTP_UNAUTHORIZED = 0xC1;
189 
190     /**
191      * Defines the OBEX PAYMENT REQUIRED response code.
192      *
193      * <p>The value of <code>OBEX_HTTP_PAYMENT_REQUIRED</code> is 0xC2 (194).
194      *
195      * @hide
196      */
197     public static final int OBEX_HTTP_PAYMENT_REQUIRED = 0xC2;
198 
199     /**
200      * Defines the OBEX FORBIDDEN response code.
201      *
202      * <p>The value of <code>OBEX_HTTP_FORBIDDEN</code> is 0xC3 (195).
203      */
204     public static final int OBEX_HTTP_FORBIDDEN = 0xC3;
205 
206     /**
207      * Defines the OBEX NOT FOUND response code.
208      *
209      * <p>The value of <code>OBEX_HTTP_NOT_FOUND</code> is 0xC4 (196).
210      */
211     public static final int OBEX_HTTP_NOT_FOUND = 0xC4;
212 
213     /**
214      * Defines the OBEX METHOD NOT ALLOWED response code.
215      *
216      * <p>The value of <code>OBEX_HTTP_BAD_METHOD</code> is 0xC5 (197).
217      *
218      * @hide
219      */
220     public static final int OBEX_HTTP_BAD_METHOD = 0xC5;
221 
222     /**
223      * Defines the OBEX NOT ACCEPTABLE response code.
224      *
225      * <p>The value of <code>OBEX_HTTP_NOT_ACCEPTABLE</code> is 0xC6 (198).
226      */
227     public static final int OBEX_HTTP_NOT_ACCEPTABLE = 0xC6;
228 
229     /**
230      * Defines the OBEX PROXY AUTHENTICATION REQUIRED response code.
231      *
232      * <p>The value of <code>OBEX_HTTP_PROXY_AUTH</code> is 0xC7 (199).
233      *
234      * @hide
235      */
236     public static final int OBEX_HTTP_PROXY_AUTH = 0xC7;
237 
238     /**
239      * Defines the OBEX REQUEST TIME OUT response code.
240      *
241      * <p>The value of <code>OBEX_HTTP_TIMEOUT</code> is 0xC8 (200).
242      *
243      * @hide
244      */
245     public static final int OBEX_HTTP_TIMEOUT = 0xC8;
246 
247     /**
248      * Defines the OBEX METHOD CONFLICT response code.
249      *
250      * <p>The value of <code>OBEX_HTTP_CONFLICT</code> is 0xC9 (201).
251      *
252      * @hide
253      */
254     public static final int OBEX_HTTP_CONFLICT = 0xC9;
255 
256     /**
257      * Defines the OBEX METHOD GONE response code.
258      *
259      * <p>The value of <code>OBEX_HTTP_GONE</code> is 0xCA (202).
260      *
261      * @hide
262      */
263     public static final int OBEX_HTTP_GONE = 0xCA;
264 
265     /**
266      * Defines the OBEX METHOD LENGTH REQUIRED response code.
267      *
268      * <p>The value of <code>OBEX_HTTP_LENGTH_REQUIRED</code> is 0xCB (203).
269      */
270     public static final int OBEX_HTTP_LENGTH_REQUIRED = 0xCB;
271 
272     /**
273      * Defines the OBEX PRECONDITION FAILED response code.
274      *
275      * <p>The value of <code>OBEX_HTTP_PRECON_FAILED</code> is 0xCC (204).
276      */
277     public static final int OBEX_HTTP_PRECON_FAILED = 0xCC;
278 
279     /**
280      * Defines the OBEX REQUESTED ENTITY TOO LARGE response code.
281      *
282      * <p>The value of <code>OBEX_HTTP_ENTITY_TOO_LARGE</code> is 0xCD (205).
283      *
284      * @hide
285      */
286     public static final int OBEX_HTTP_ENTITY_TOO_LARGE = 0xCD;
287 
288     /**
289      * Defines the OBEX REQUESTED URL TOO LARGE response code.
290      *
291      * <p>The value of <code>OBEX_HTTP_REQ_TOO_LARGE</code> is 0xCE (206).
292      *
293      * @hide
294      */
295     public static final int OBEX_HTTP_REQ_TOO_LARGE = 0xCE;
296 
297     /**
298      * Defines the OBEX UNSUPPORTED MEDIA TYPE response code.
299      *
300      * <p>The value of <code>OBEX_HTTP_UNSUPPORTED_TYPE</code> is 0xCF (207).
301      */
302     public static final int OBEX_HTTP_UNSUPPORTED_TYPE = 0xCF;
303 
304     /**
305      * Defines the OBEX INTERNAL SERVER ERROR response code.
306      *
307      * <p>The value of <code>OBEX_HTTP_INTERNAL_ERROR</code> is 0xD0 (208).
308      */
309     public static final int OBEX_HTTP_INTERNAL_ERROR = 0xD0;
310 
311     /**
312      * Defines the OBEX NOT IMPLEMENTED response code.
313      *
314      * <p>The value of <code>OBEX_HTTP_NOT_IMPLEMENTED</code> is 0xD1 (209).
315      */
316     public static final int OBEX_HTTP_NOT_IMPLEMENTED = 0xD1;
317 
318     /**
319      * Defines the OBEX BAD GATEWAY response code.
320      *
321      * <p>The value of <code>OBEX_HTTP_BAD_GATEWAY</code> is 0xD2 (210).
322      *
323      * @hide
324      */
325     public static final int OBEX_HTTP_BAD_GATEWAY = 0xD2;
326 
327     /**
328      * Defines the OBEX SERVICE UNAVAILABLE response code.
329      *
330      * <p>The value of <code>OBEX_HTTP_UNAVAILABLE</code> is 0xD3 (211).
331      */
332     public static final int OBEX_HTTP_UNAVAILABLE = 0xD3;
333 
334     /**
335      * Defines the OBEX GATEWAY TIMEOUT response code.
336      *
337      * <p>The value of <code>OBEX_HTTP_GATEWAY_TIMEOUT</code> is 0xD4 (212).
338      *
339      * @hide
340      */
341     public static final int OBEX_HTTP_GATEWAY_TIMEOUT = 0xD4;
342 
343     /**
344      * Defines the OBEX HTTP VERSION NOT SUPPORTED response code.
345      *
346      * <p>The value of <code>OBEX_HTTP_VERSION</code> is 0xD5 (213).
347      *
348      * @hide
349      */
350     public static final int OBEX_HTTP_VERSION = 0xD5;
351 
352     /**
353      * Defines the OBEX DATABASE FULL response code.
354      *
355      * <p>The value of <code>OBEX_DATABASE_FULL</code> is 0xE0 (224).
356      *
357      * @hide
358      */
359     public static final int OBEX_DATABASE_FULL = 0xE0;
360 
361     /**
362      * Defines the OBEX DATABASE LOCKED response code.
363      *
364      * <p>The value of <code>OBEX_DATABASE_LOCKED</code> is 0xE1 (225).
365      *
366      * @hide
367      */
368     public static final int OBEX_DATABASE_LOCKED = 0xE1;
369 
370     /** Constructor does nothing. */
ResponseCodes()371     private ResponseCodes() {}
372 }
373