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