jdk/src/java.httpclient/share/classes/java/net/http/WSMessageConsumer.java
author prappo
Tue, 07 Jun 2016 12:29:19 +0100
changeset 38856 cc3a0d1e96e0
parent 37874 02589df0999a
child 39730 196f4e25d9f5
permissions -rw-r--r--
8156650: Simplify Text message support in WebSocket API Reviewed-by: rriggs
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
37874
02589df0999a 8087113: Websocket API and implementation
prappo
parents:
diff changeset
     1
/*
02589df0999a 8087113: Websocket API and implementation
prappo
parents:
diff changeset
     2
 * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
02589df0999a 8087113: Websocket API and implementation
prappo
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
02589df0999a 8087113: Websocket API and implementation
prappo
parents:
diff changeset
     4
 *
02589df0999a 8087113: Websocket API and implementation
prappo
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
02589df0999a 8087113: Websocket API and implementation
prappo
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
02589df0999a 8087113: Websocket API and implementation
prappo
parents:
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
02589df0999a 8087113: Websocket API and implementation
prappo
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
02589df0999a 8087113: Websocket API and implementation
prappo
parents:
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
02589df0999a 8087113: Websocket API and implementation
prappo
parents:
diff changeset
    10
 *
02589df0999a 8087113: Websocket API and implementation
prappo
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
02589df0999a 8087113: Websocket API and implementation
prappo
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
02589df0999a 8087113: Websocket API and implementation
prappo
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
02589df0999a 8087113: Websocket API and implementation
prappo
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
02589df0999a 8087113: Websocket API and implementation
prappo
parents:
diff changeset
    15
 * accompanied this code).
02589df0999a 8087113: Websocket API and implementation
prappo
parents:
diff changeset
    16
 *
02589df0999a 8087113: Websocket API and implementation
prappo
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
02589df0999a 8087113: Websocket API and implementation
prappo
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
02589df0999a 8087113: Websocket API and implementation
prappo
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
02589df0999a 8087113: Websocket API and implementation
prappo
parents:
diff changeset
    20
 *
02589df0999a 8087113: Websocket API and implementation
prappo
parents:
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
02589df0999a 8087113: Websocket API and implementation
prappo
parents:
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
02589df0999a 8087113: Websocket API and implementation
prappo
parents:
diff changeset
    23
 * questions.
02589df0999a 8087113: Websocket API and implementation
prappo
parents:
diff changeset
    24
 */
02589df0999a 8087113: Websocket API and implementation
prappo
parents:
diff changeset
    25
package java.net.http;
02589df0999a 8087113: Websocket API and implementation
prappo
parents:
diff changeset
    26
02589df0999a 8087113: Websocket API and implementation
prappo
parents:
diff changeset
    27
import java.net.http.WebSocket.CloseCode;
02589df0999a 8087113: Websocket API and implementation
prappo
parents:
diff changeset
    28
import java.net.http.WebSocket.MessagePart;
02589df0999a 8087113: Websocket API and implementation
prappo
parents:
diff changeset
    29
import java.nio.ByteBuffer;
38856
cc3a0d1e96e0 8156650: Simplify Text message support in WebSocket API
prappo
parents: 37874
diff changeset
    30
import java.nio.CharBuffer;
37874
02589df0999a 8087113: Websocket API and implementation
prappo
parents:
diff changeset
    31
02589df0999a 8087113: Websocket API and implementation
prappo
parents:
diff changeset
    32
interface WSMessageConsumer {
02589df0999a 8087113: Websocket API and implementation
prappo
parents:
diff changeset
    33
38856
cc3a0d1e96e0 8156650: Simplify Text message support in WebSocket API
prappo
parents: 37874
diff changeset
    34
    void onText(MessagePart part, WSShared<CharBuffer> data);
37874
02589df0999a 8087113: Websocket API and implementation
prappo
parents:
diff changeset
    35
02589df0999a 8087113: Websocket API and implementation
prappo
parents:
diff changeset
    36
    void onBinary(MessagePart part, WSShared<ByteBuffer> data);
02589df0999a 8087113: Websocket API and implementation
prappo
parents:
diff changeset
    37
02589df0999a 8087113: Websocket API and implementation
prappo
parents:
diff changeset
    38
    void onPing(WSShared<ByteBuffer> data);
02589df0999a 8087113: Websocket API and implementation
prappo
parents:
diff changeset
    39
02589df0999a 8087113: Websocket API and implementation
prappo
parents:
diff changeset
    40
    void onPong(WSShared<ByteBuffer> data);
02589df0999a 8087113: Websocket API and implementation
prappo
parents:
diff changeset
    41
02589df0999a 8087113: Websocket API and implementation
prappo
parents:
diff changeset
    42
    void onClose(CloseCode code, CharSequence reason);
02589df0999a 8087113: Websocket API and implementation
prappo
parents:
diff changeset
    43
}