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 37 * codes a server may send to a client. 38 * <P> 39 * <STRONG>IMPORTANT NOTE</STRONG> 40 * <P> 41 * The values in this interface represent the values defined in the IrOBEX 42 * specification, which is different with the HTTP specification. 43 * <P> 44 * <code>OBEX_DATABASE_FULL</code> and <code>OBEX_DATABASE_LOCKED</code> require 45 * further description since they are not defined in HTTP. The server will send 46 * an <code>OBEX_DATABASE_FULL</code> message when the client requests that 47 * something be placed into a database but the database is full (cannot take 48 * more data). <code>OBEX_DATABASE_LOCKED</code> will be returned when the 49 * client wishes to access a database, database table, or database record that 50 * has been locked. 51 */ 52 public final class ResponseCodes { 53 54 /** 55 * Defines the OBEX CONTINUE response code. 56 * <P> 57 * The value of <code>OBEX_HTTP_CONTINUE</code> is 0x90 (144). 58 */ 59 public static final int OBEX_HTTP_CONTINUE = 0x90; 60 61 /** 62 * Defines the OBEX SUCCESS response code. 63 * <P> 64 * The value of <code>OBEX_HTTP_OK</code> is 0xA0 (160). 65 */ 66 public static final int OBEX_HTTP_OK = 0xA0; 67 68 /** 69 * Defines the OBEX CREATED response code. 70 * <P> 71 * The value of <code>OBEX_HTTP_CREATED</code> is 0xA1 (161). 72 * 73 * @hide 74 */ 75 public static final int OBEX_HTTP_CREATED = 0xA1; 76 77 /** 78 * Defines the OBEX ACCEPTED response code. 79 * <P> 80 * The value of <code>OBEX_HTTP_ACCEPTED</code> is 0xA2 (162). 81 * 82 * @hide 83 */ 84 public static final int OBEX_HTTP_ACCEPTED = 0xA2; 85 86 /** 87 * Defines the OBEX NON-AUTHORITATIVE INFORMATION response code. 88 * <P> 89 * The value of <code>OBEX_HTTP_NOT_AUTHORITATIVE</code> is 0xA3 (163). 90 * 91 * @hide 92 */ 93 public static final int OBEX_HTTP_NOT_AUTHORITATIVE = 0xA3; 94 95 /** 96 * Defines the OBEX NO CONTENT response code. 97 * <P> 98 * The value of <code>OBEX_HTTP_NO_CONTENT</code> is 0xA4 (164). 99 * 100 * @hide 101 */ 102 public static final int OBEX_HTTP_NO_CONTENT = 0xA4; 103 104 /** 105 * Defines the OBEX RESET CONTENT response code. 106 * <P> 107 * The value of <code>OBEX_HTTP_RESET</code> is 0xA5 (165). 108 * 109 * @hide 110 */ 111 public static final int OBEX_HTTP_RESET = 0xA5; 112 113 /** 114 * Defines the OBEX PARTIAL CONTENT response code. 115 * <P> 116 * The value of <code>OBEX_HTTP_PARTIAL</code> is 0xA6 (166). 117 * 118 * @hide 119 */ 120 public static final int OBEX_HTTP_PARTIAL = 0xA6; 121 122 /** 123 * Defines the OBEX MULTIPLE_CHOICES response code. 124 * <P> 125 * The value of <code>OBEX_HTTP_MULT_CHOICE</code> is 0xB0 (176). 126 * 127 * @hide 128 */ 129 public static final int OBEX_HTTP_MULT_CHOICE = 0xB0; 130 131 /** 132 * Defines the OBEX MOVED PERMANENTLY response code. 133 * <P> 134 * The value of <code>OBEX_HTTP_MOVED_PERM</code> is 0xB1 (177). 135 * 136 * @hide 137 */ 138 public static final int OBEX_HTTP_MOVED_PERM = 0xB1; 139 140 /** 141 * Defines the OBEX MOVED TEMPORARILY response code. 142 * <P> 143 * The value of <code>OBEX_HTTP_MOVED_TEMP</code> is 0xB2 (178). 144 * 145 * @hide 146 */ 147 public static final int OBEX_HTTP_MOVED_TEMP = 0xB2; 148 149 /** 150 * Defines the OBEX SEE OTHER response code. 151 * <P> 152 * The value of <code>OBEX_HTTP_SEE_OTHER</code> is 0xB3 (179). 153 * 154 * @hide 155 */ 156 public static final int OBEX_HTTP_SEE_OTHER = 0xB3; 157 158 /** 159 * Defines the OBEX NOT MODIFIED response code. 160 * <P> 161 * The value of <code>OBEX_HTTP_NOT_MODIFIED</code> is 0xB4 (180). 162 * 163 * @hide 164 */ 165 public static final int OBEX_HTTP_NOT_MODIFIED = 0xB4; 166 167 /** 168 * Defines the OBEX USE PROXY response code. 169 * <P> 170 * The value of <code>OBEX_HTTP_USE_PROXY</code> is 0xB5 (181). 171 * 172 * @hide 173 */ 174 public static final int OBEX_HTTP_USE_PROXY = 0xB5; 175 176 /** 177 * Defines the OBEX BAD REQUEST response code. 178 * <P> 179 * The value of <code>OBEX_HTTP_BAD_REQUEST</code> is 0xC0 (192). 180 */ 181 public static final int OBEX_HTTP_BAD_REQUEST = 0xC0; 182 183 /** 184 * Defines the OBEX UNAUTHORIZED response code. 185 * <P> 186 * The value of <code>OBEX_HTTP_UNAUTHORIZED</code> is 0xC1 (193). 187 * 188 * @hide 189 */ 190 public static final int OBEX_HTTP_UNAUTHORIZED = 0xC1; 191 192 /** 193 * Defines the OBEX PAYMENT REQUIRED response code. 194 * <P> 195 * The value of <code>OBEX_HTTP_PAYMENT_REQUIRED</code> is 0xC2 (194). 196 * 197 * @hide 198 */ 199 public static final int OBEX_HTTP_PAYMENT_REQUIRED = 0xC2; 200 201 /** 202 * Defines the OBEX FORBIDDEN response code. 203 * <P> 204 * The value of <code>OBEX_HTTP_FORBIDDEN</code> is 0xC3 (195). 205 */ 206 public static final int OBEX_HTTP_FORBIDDEN = 0xC3; 207 208 /** 209 * Defines the OBEX NOT FOUND response code. 210 * <P> 211 * The value of <code>OBEX_HTTP_NOT_FOUND</code> is 0xC4 (196). 212 */ 213 public static final int OBEX_HTTP_NOT_FOUND = 0xC4; 214 215 /** 216 * Defines the OBEX METHOD NOT ALLOWED response code. 217 * <P> 218 * The value of <code>OBEX_HTTP_BAD_METHOD</code> is 0xC5 (197). 219 * 220 * @hide 221 */ 222 public static final int OBEX_HTTP_BAD_METHOD = 0xC5; 223 224 /** 225 * Defines the OBEX NOT ACCEPTABLE response code. 226 * <P> 227 * The value of <code>OBEX_HTTP_NOT_ACCEPTABLE</code> is 0xC6 (198). 228 */ 229 public static final int OBEX_HTTP_NOT_ACCEPTABLE = 0xC6; 230 231 /** 232 * Defines the OBEX PROXY AUTHENTICATION REQUIRED response code. 233 * <P> 234 * The value of <code>OBEX_HTTP_PROXY_AUTH</code> is 0xC7 (199). 235 * 236 * @hide 237 */ 238 public static final int OBEX_HTTP_PROXY_AUTH = 0xC7; 239 240 /** 241 * Defines the OBEX REQUEST TIME OUT response code. 242 * <P> 243 * The value of <code>OBEX_HTTP_TIMEOUT</code> is 0xC8 (200). 244 * 245 * @hide 246 */ 247 public static final int OBEX_HTTP_TIMEOUT = 0xC8; 248 249 /** 250 * Defines the OBEX METHOD CONFLICT response code. 251 * <P> 252 * The value of <code>OBEX_HTTP_CONFLICT</code> is 0xC9 (201). 253 * 254 * @hide 255 */ 256 public static final int OBEX_HTTP_CONFLICT = 0xC9; 257 258 /** 259 * Defines the OBEX METHOD GONE response code. 260 * <P> 261 * The value of <code>OBEX_HTTP_GONE</code> is 0xCA (202). 262 * 263 * @hide 264 */ 265 public static final int OBEX_HTTP_GONE = 0xCA; 266 267 /** 268 * Defines the OBEX METHOD LENGTH REQUIRED response code. 269 * <P> 270 * The value of <code>OBEX_HTTP_LENGTH_REQUIRED</code> is 0xCB (203). 271 */ 272 public static final int OBEX_HTTP_LENGTH_REQUIRED = 0xCB; 273 274 /** 275 * Defines the OBEX PRECONDITION FAILED response code. 276 * <P> 277 * The value of <code>OBEX_HTTP_PRECON_FAILED</code> is 0xCC (204). 278 */ 279 public static final int OBEX_HTTP_PRECON_FAILED = 0xCC; 280 281 /** 282 * Defines the OBEX REQUESTED ENTITY TOO LARGE response code. 283 * <P> 284 * The value of <code>OBEX_HTTP_ENTITY_TOO_LARGE</code> is 0xCD (205). 285 * 286 * @hide 287 */ 288 public static final int OBEX_HTTP_ENTITY_TOO_LARGE = 0xCD; 289 290 /** 291 * Defines the OBEX REQUESTED URL TOO LARGE response code. 292 * <P> 293 * The value of <code>OBEX_HTTP_REQ_TOO_LARGE</code> is 0xCE (206). 294 * 295 * @hide 296 */ 297 public static final int OBEX_HTTP_REQ_TOO_LARGE = 0xCE; 298 299 /** 300 * Defines the OBEX UNSUPPORTED MEDIA TYPE response code. 301 * <P> 302 * The value of <code>OBEX_HTTP_UNSUPPORTED_TYPE</code> is 0xCF (207). 303 */ 304 public static final int OBEX_HTTP_UNSUPPORTED_TYPE = 0xCF; 305 306 /** 307 * Defines the OBEX INTERNAL SERVER ERROR response code. 308 * <P> 309 * The value of <code>OBEX_HTTP_INTERNAL_ERROR</code> is 0xD0 (208). 310 */ 311 public static final int OBEX_HTTP_INTERNAL_ERROR = 0xD0; 312 313 /** 314 * Defines the OBEX NOT IMPLEMENTED response code. 315 * <P> 316 * The value of <code>OBEX_HTTP_NOT_IMPLEMENTED</code> is 0xD1 (209). 317 */ 318 public static final int OBEX_HTTP_NOT_IMPLEMENTED = 0xD1; 319 320 /** 321 * Defines the OBEX BAD GATEWAY response code. 322 * <P> 323 * The value of <code>OBEX_HTTP_BAD_GATEWAY</code> is 0xD2 (210). 324 * 325 * @hide 326 */ 327 public static final int OBEX_HTTP_BAD_GATEWAY = 0xD2; 328 329 /** 330 * Defines the OBEX SERVICE UNAVAILABLE response code. 331 * <P> 332 * The value of <code>OBEX_HTTP_UNAVAILABLE</code> is 0xD3 (211). 333 */ 334 public static final int OBEX_HTTP_UNAVAILABLE = 0xD3; 335 336 /** 337 * Defines the OBEX GATEWAY TIMEOUT response code. 338 * <P> 339 * The value of <code>OBEX_HTTP_GATEWAY_TIMEOUT</code> is 0xD4 (212). 340 * 341 * @hide 342 */ 343 public static final int OBEX_HTTP_GATEWAY_TIMEOUT = 0xD4; 344 345 /** 346 * Defines the OBEX HTTP VERSION NOT SUPPORTED response code. 347 * <P> 348 * The value of <code>OBEX_HTTP_VERSION</code> is 0xD5 (213). 349 * 350 * @hide 351 */ 352 public static final int OBEX_HTTP_VERSION = 0xD5; 353 354 /** 355 * Defines the OBEX DATABASE FULL response code. 356 * <P> 357 * The value of <code>OBEX_DATABASE_FULL</code> is 0xE0 (224). 358 * 359 * @hide 360 */ 361 public static final int OBEX_DATABASE_FULL = 0xE0; 362 363 /** 364 * Defines the OBEX DATABASE LOCKED response code. 365 * <P> 366 * The value of <code>OBEX_DATABASE_LOCKED</code> is 0xE1 (225). 367 * 368 * @hide 369 */ 370 public static final int OBEX_DATABASE_LOCKED = 0xE1; 371 372 /** 373 * Constructor does nothing. 374 */ ResponseCodes()375 private ResponseCodes() { 376 } 377 } 378