javaextensions/bluetooth/bluecove/javasrc/javax/obex/ServerRequestHandler.java
branchRCL_3
changeset 19 04becd199f91
equal deleted inserted replaced
16:f5050f1da672 19:04becd199f91
       
     1 /**
       
     2  *  BlueCove - Java library for Bluetooth
       
     3  * 
       
     4  *  Java docs licensed under the Apache License, Version 2.0
       
     5  *  http://www.apache.org/licenses/LICENSE-2.0 
       
     6  *   (c) Copyright 2001, 2002 Motorola, Inc.  ALL RIGHTS RESERVED.
       
     7  *
       
     8  *  Licensed to the Apache Software Foundation (ASF) under one
       
     9  *  or more contributor license agreements.  See the NOTICE file
       
    10  *  distributed with this work for additional information
       
    11  *  regarding copyright ownership.  The ASF licenses this file
       
    12  *  to you under the Apache License, Version 2.0 (the
       
    13  *  "License"); you may not use this file except in compliance
       
    14  *  with the License.  You may obtain a copy of the License at
       
    15  *
       
    16  *    http://www.apache.org/licenses/LICENSE-2.0
       
    17  *
       
    18  *  Unless required by applicable law or agreed to in writing,
       
    19  *  software distributed under the License is distributed on an
       
    20  *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
       
    21  *  KIND, either express or implied.  See the License for the
       
    22  *  specific language governing permissions and limitations
       
    23  *  under the License.
       
    24  *
       
    25  *  @version $Id: ServerRequestHandler.java 2532 2008-12-09 20:23:14Z skarzhevskyy $  
       
    26  */
       
    27 package javax.obex;
       
    28 
       
    29 import com.intel.bluetooth.obex.OBEXClientSessionImpl;
       
    30 
       
    31 /**
       
    32  * Please refer JSR-82
       
    33  */
       
    34 public class ServerRequestHandler {
       
    35 
       
    36     private long connectionID;
       
    37 
       
    38     /**
       
    39      * Please refer JSR-82
       
    40      */
       
    41     protected ServerRequestHandler() {
       
    42         connectionID = -1;
       
    43     }
       
    44 
       
    45     /**
       
    46      * Please refer JSR-82
       
    47      */
       
    48     public final HeaderSet createHeaderSet() {
       
    49         return OBEXClientSessionImpl.createOBEXHeaderSet();
       
    50     }
       
    51 
       
    52     /**
       
    53      * Please refer JSR-82
       
    54      */
       
    55     public void setConnectionID(long id) {
       
    56         if ((id != -1) && ((id < 0 || id > 0xffffffffl))) {
       
    57             throw new IllegalArgumentException("Invalid connectionID " + id);
       
    58         }
       
    59         this.connectionID = id;
       
    60     }
       
    61 
       
    62     /**
       
    63      * Please refer JSR-82
       
    64      */
       
    65     public long getConnectionID() {
       
    66         return this.connectionID;
       
    67     }
       
    68 
       
    69     /**
       
    70      * Please refer JSR-82
       
    71      */
       
    72     public int onConnect(HeaderSet request, HeaderSet reply) {
       
    73         return ResponseCodes.OBEX_HTTP_OK;
       
    74     }
       
    75 
       
    76     /**
       
    77      * Please refer JSR-82
       
    78      */
       
    79     public void onDisconnect(HeaderSet request, HeaderSet reply) {
       
    80     }
       
    81 
       
    82     /**
       
    83      * Please refer JSR-82
       
    84      */
       
    85     public int onSetPath(HeaderSet request, HeaderSet reply, boolean backup, boolean create) {
       
    86         return ResponseCodes.OBEX_HTTP_NOT_IMPLEMENTED;
       
    87     }
       
    88 
       
    89     /**
       
    90      * Please refer JSR-82
       
    91      */
       
    92     public int onDelete(HeaderSet request, HeaderSet reply) {
       
    93         return ResponseCodes.OBEX_HTTP_NOT_IMPLEMENTED;
       
    94     }
       
    95 
       
    96     /**
       
    97      * Please refer JSR-82
       
    98      */
       
    99     public int onPut(Operation op) {
       
   100         return ResponseCodes.OBEX_HTTP_NOT_IMPLEMENTED;
       
   101     }
       
   102 
       
   103     /**
       
   104      * Please refer JSR-82
       
   105      */
       
   106     public int onGet(Operation op) {
       
   107         return ResponseCodes.OBEX_HTTP_NOT_IMPLEMENTED;
       
   108     }
       
   109 
       
   110     /**
       
   111      * Please refer JSR-82
       
   112      */
       
   113     public void onAuthenticationFailure(byte[] userName) {
       
   114     }
       
   115 }