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