@@ -38,14 +38,14 @@ public interface WebSocket {
38
38
/**
39
39
* Enum which represents the states a websocket may be in
40
40
*/
41
- public enum Role {
41
+ enum Role {
42
42
CLIENT , SERVER
43
43
}
44
44
45
45
/**
46
46
* Enum which represents the state a websocket may be in
47
47
*/
48
- public enum READYSTATE {
48
+ enum READYSTATE {
49
49
NOT_YET_CONNECTED , CONNECTING , OPEN , CLOSING , CLOSED
50
50
}
51
51
@@ -54,48 +54,48 @@ public enum READYSTATE {
54
54
* constructor is used, DEFAULT_PORT will be the port the WebSocketServer
55
55
* is binded to. Note that ports under 1024 usually require root permissions.
56
56
*/
57
- public static final int DEFAULT_PORT = 80 ;
57
+ int DEFAULT_PORT = 80 ;
58
58
59
59
/**
60
60
* The default wss port of WebSockets, as defined in the spec. If the nullary
61
61
* constructor is used, DEFAULT_WSS_PORT will be the port the WebSocketServer
62
62
* is binded to. Note that ports under 1024 usually require root permissions.
63
63
*/
64
- public static final int DEFAULT_WSS_PORT = 443 ;
64
+ int DEFAULT_WSS_PORT = 443 ;
65
65
66
66
/**
67
67
* sends the closing handshake.
68
68
* may be send in response to an other handshake.
69
69
* @param code the closing code
70
70
* @param message the closing message
71
71
*/
72
- public void close ( int code , String message );
72
+ void close ( int code , String message );
73
73
74
74
/**
75
75
* sends the closing handshake.
76
76
* may be send in response to an other handshake.
77
77
* @param code the closing code
78
78
*/
79
- public void close ( int code );
79
+ void close ( int code );
80
80
81
81
/** Convenience function which behaves like close(CloseFrame.NORMAL) */
82
- public void close ();
82
+ void close ();
83
83
84
84
/**
85
85
* This will close the connection immediately without a proper close handshake.
86
86
* The code and the message therefore won't be transfered over the wire also they will be forwarded to onClose/onWebsocketClose.
87
87
* @param code the closing code
88
88
* @param message the closing message
89
89
**/
90
- public abstract void closeConnection ( int code , String message );
90
+ void closeConnection ( int code , String message );
91
91
92
92
/**
93
93
* Send Text data to the other end.
94
94
*
95
95
* @param text the text data to send
96
96
* @throws NotYetConnectedException websocket is not yet connected
97
97
*/
98
- public abstract void send ( String text ) throws NotYetConnectedException ;
98
+ void send ( String text ) throws NotYetConnectedException ;
99
99
100
100
/**
101
101
* Send Binary data (plain bytes) to the other end.
@@ -104,7 +104,7 @@ public enum READYSTATE {
104
104
* @throws IllegalArgumentException the data is null
105
105
* @throws NotYetConnectedException websocket is not yet connected
106
106
*/
107
- public abstract void send ( ByteBuffer bytes ) throws IllegalArgumentException , NotYetConnectedException ;
107
+ void send ( ByteBuffer bytes ) throws IllegalArgumentException , NotYetConnectedException ;
108
108
109
109
/**
110
110
* Send Binary data (plain bytes) to the other end.
@@ -113,7 +113,7 @@ public enum READYSTATE {
113
113
* @throws IllegalArgumentException the data is null
114
114
* @throws NotYetConnectedException websocket is not yet connected
115
115
*/
116
- public abstract void send ( byte [] bytes ) throws IllegalArgumentException , NotYetConnectedException ;
116
+ void send ( byte [] bytes ) throws IllegalArgumentException , NotYetConnectedException ;
117
117
118
118
/**
119
119
* Send a frame to the other end
@@ -146,64 +146,64 @@ public enum READYSTATE {
146
146
* @param fin
147
147
* true means the current frame is the last in the sequence.
148
148
**/
149
- public abstract void sendFragmentedFrame ( Opcode op , ByteBuffer buffer , boolean fin );
149
+ void sendFragmentedFrame ( Opcode op , ByteBuffer buffer , boolean fin );
150
150
151
151
/**
152
152
* Checks if the websocket has buffered data
153
153
* @return has the websocket buffered data
154
154
*/
155
- public abstract boolean hasBufferedData ();
155
+ boolean hasBufferedData ();
156
156
157
157
/**
158
158
* Returns the address of the endpoint this socket is connected to, or{@code null} if it is unconnected.
159
159
*
160
160
* @return never returns null
161
161
*/
162
- public abstract InetSocketAddress getRemoteSocketAddress ();
162
+ InetSocketAddress getRemoteSocketAddress ();
163
163
164
164
/**
165
165
* Returns the address of the endpoint this socket is bound to.
166
166
*
167
167
* @return never returns null
168
168
*/
169
- public abstract InetSocketAddress getLocalSocketAddress ();
169
+ InetSocketAddress getLocalSocketAddress ();
170
170
171
171
/**
172
172
* Is the websocket in the state CONNECTING
173
173
* @return state equals READYSTATE.CONNECTING
174
174
*/
175
- public abstract boolean isConnecting ();
175
+ boolean isConnecting ();
176
176
177
177
/**
178
178
* Is the websocket in the state OPEN
179
179
* @return state equals READYSTATE.OPEN
180
180
*/
181
- public abstract boolean isOpen ();
181
+ boolean isOpen ();
182
182
183
183
/**
184
184
* Is the websocket in the state CLOSING
185
185
* @return state equals READYSTATE.CLOSING
186
186
*/
187
- public abstract boolean isClosing ();
187
+ boolean isClosing ();
188
188
189
189
/**
190
190
* Returns true when no further frames may be submitted<br>
191
191
* This happens before the socket connection is closed.
192
192
* @return true when no further frames may be submitted
193
193
*/
194
- public abstract boolean isFlushAndClose ();
194
+ boolean isFlushAndClose ();
195
195
196
196
/**
197
197
* Is the websocket in the state CLOSED
198
198
* @return state equals READYSTATE.CLOSED
199
199
*/
200
- public abstract boolean isClosed ();
200
+ boolean isClosed ();
201
201
202
202
/**
203
203
* Getter for the draft
204
204
* @return the used draft
205
205
*/
206
- public abstract Draft getDraft ();
206
+ Draft getDraft ();
207
207
208
208
/**
209
209
* Retrieve the WebSocket 'readyState'.
@@ -212,12 +212,12 @@ public enum READYSTATE {
212
212
*
213
213
* @return Returns '0 = CONNECTING', '1 = OPEN', '2 = CLOSING' or '3 = CLOSED'
214
214
*/
215
- public abstract READYSTATE getReadyState ();
215
+ READYSTATE getReadyState ();
216
216
217
217
/**
218
218
* Returns the HTTP Request-URI as defined by http://tools.ietf.org/html/rfc2616#section-5.1.2<br>
219
219
* If the opening handshake has not yet happened it will return null.
220
220
* @return Returns the decoded path component of this URI.
221
221
**/
222
- public abstract String getResourceDescriptor ();
222
+ String getResourceDescriptor ();
223
223
}
0 commit comments