001: /*
002: *
003: *
004: * Portions Copyright 2000-2007 Sun Microsystems, Inc. All Rights
005: * Reserved. Use is subject to license terms.
006: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
007: *
008: * This program is free software; you can redistribute it and/or
009: * modify it under the terms of the GNU General Public License version
010: * 2 only, as published by the Free Software Foundation.
011: *
012: * This program is distributed in the hope that it will be useful, but
013: * WITHOUT ANY WARRANTY; without even the implied warranty of
014: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
015: * General Public License version 2 for more details (a copy is
016: * included at /legal/license.txt).
017: *
018: * You should have received a copy of the GNU General Public License
019: * version 2 along with this work; if not, write to the Free Software
020: * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
021: * 02110-1301 USA
022: *
023: * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
024: * Clara, CA 95054 or visit www.sun.com if you need additional
025: * information or have any questions.
026: */
027:
028: /*
029: * (c) Copyright 2001, 2002 Motorola, Inc. ALL RIGHTS RESERVED.
030: */
031: package javax.obex;
032:
033: import com.sun.kvem.jsr082.obex.HeaderSetImpl;
034:
035: /**
036: * This class is defined by the JSR-82 specification
037: * <em>Java™ APIs for Bluetooth™ Wireless Technology,
038: * Version 1.1.</em>
039: */
040: // JAVADOC COMMENT ELIDED
041: public class ServerRequestHandler {
042:
043: // JAVADOC COMMENT ELIDED
044: private long connId;
045:
046: // JAVADOC COMMENT ELIDED
047: protected ServerRequestHandler() {
048: connId = -1;
049: }
050:
051: // JAVADOC COMMENT ELIDED
052: public final HeaderSet createHeaderSet() {
053: return new HeaderSetImpl(HeaderSetImpl.OWNER_SERVER_USER);
054: }
055:
056: // JAVADOC COMMENT ELIDED
057: public void setConnectionID(long id) {
058: if (id < -1L || id > 0xFFFFFFFFL) {
059: throw new IllegalArgumentException("invalid id");
060: }
061: connId = id;
062: }
063:
064: // JAVADOC COMMENT ELIDED
065: public long getConnectionID() {
066: return connId;
067: }
068:
069: // JAVADOC COMMENT ELIDED
070: public int onConnect(HeaderSet request, HeaderSet reply) {
071: return ResponseCodes.OBEX_HTTP_OK;
072: }
073:
074: // JAVADOC COMMENT ELIDED
075: public void onDisconnect(HeaderSet request, HeaderSet reply) {
076: // do nothing
077: }
078:
079: // JAVADOC COMMENT ELIDED
080: public int onSetPath(HeaderSet request, HeaderSet reply,
081: boolean backup, boolean create) {
082: return ResponseCodes.OBEX_HTTP_NOT_IMPLEMENTED;
083: }
084:
085: // JAVADOC COMMENT ELIDED
086: public int onDelete(HeaderSet request, HeaderSet reply) {
087: return ResponseCodes.OBEX_HTTP_NOT_IMPLEMENTED;
088: }
089:
090: // JAVADOC COMMENT ELIDED
091: public int onPut(Operation op) {
092: return ResponseCodes.OBEX_HTTP_NOT_IMPLEMENTED;
093: }
094:
095: // JAVADOC COMMENT ELIDED
096: public int onGet(Operation op) {
097: return ResponseCodes.OBEX_HTTP_NOT_IMPLEMENTED;
098: }
099:
100: // JAVADOC COMMENT ELIDED
101: public void onAuthenticationFailure(byte[] userName) {
102: // do nothing
103: }
104: }
|