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.BatchMode;
27 import org.eclipse.jetty.websocket.api.WebSocketPolicy;
28 import org.eclipse.jetty.websocket.api.extensions.Frame;
29 import org.eclipse.jetty.websocket.api.extensions.IncomingFrames;
30 import org.eclipse.jetty.websocket.common.CloseInfo;
31 import org.eclipse.jetty.websocket.common.WebSocketSession;
32
33 public interface EventDriver extends IncomingFrames
34 {
35 public WebSocketPolicy getPolicy();
36
37 public WebSocketSession getSession();
38
39 public BatchMode getBatchMode();
40
41 public void onBinaryFrame(ByteBuffer buffer, boolean fin) throws IOException;
42
43 public void onBinaryMessage(byte[] data);
44
45 public void onClose(CloseInfo close);
46
47 public void onConnect();
48
49 public void onContinuationFrame(ByteBuffer buffer, boolean fin) throws IOException;
50
51 public void onError(Throwable t);
52
53 public void onFrame(Frame frame);
54
55 public void onInputStream(InputStream stream) throws IOException;
56
57 public void onPing(ByteBuffer buffer);
58
59 public void onPong(ByteBuffer buffer);
60
61 public void onReader(Reader reader) throws IOException;
62
63 public void onTextFrame(ByteBuffer buffer, boolean fin) throws IOException;
64
65 public void onTextMessage(String message);
66
67 public void openSession(WebSocketSession session);
68 }