1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.eclipse.jetty.websocket.common.events;
20
21 import java.io.IOException;
22 import java.io.InputStream;
23 import java.io.Reader;
24 import java.nio.ByteBuffer;
25
26 import org.eclipse.jetty.websocket.api.WebSocketPolicy;
27 import org.eclipse.jetty.websocket.api.extensions.Frame;
28 import org.eclipse.jetty.websocket.api.extensions.IncomingFrames;
29 import org.eclipse.jetty.websocket.common.CloseInfo;
30 import org.eclipse.jetty.websocket.common.WebSocketSession;
31
32 public interface EventDriver extends IncomingFrames
33 {
34 public WebSocketPolicy getPolicy();
35
36 public WebSocketSession getSession();
37
38 public void onBinaryFrame(ByteBuffer buffer, boolean fin) throws IOException;
39
40 public void onBinaryMessage(byte[] data);
41
42 public void onClose(CloseInfo close);
43
44 public void onConnect();
45
46 public void onContinuationFrame(ByteBuffer buffer, boolean fin) throws IOException;
47
48 public void onError(Throwable t);
49
50 public void onFrame(Frame frame);
51
52 public void onInputStream(InputStream stream);
53
54 public void onPing(ByteBuffer buffer);
55
56 public void onPong(ByteBuffer buffer);
57
58 public void onReader(Reader reader);
59
60 public void onTextFrame(ByteBuffer buffer, boolean fin) throws IOException;
61
62 public void onTextMessage(String message);
63
64 public void openSession(WebSocketSession session);
65 }