@@ -59,7 +59,7 @@ public interface WebSocketListener {
5959 * @throws InvalidDataException
6060 * Throwing this exception will cause this handshake to be rejected
6161 */
62- public ServerHandshakeBuilder onWebsocketHandshakeReceivedAsServer ( WebSocket conn , Draft draft , ClientHandshake request ) throws InvalidDataException ;
62+ ServerHandshakeBuilder onWebsocketHandshakeReceivedAsServer ( WebSocket conn , Draft draft , ClientHandshake request ) throws InvalidDataException ;
6363
6464 /**
6565 * Called on the client side when the socket connection is first established, and the WebSocketImpl
@@ -74,7 +74,7 @@ public interface WebSocketListener {
7474 * @throws InvalidDataException
7575 * Allows the client to reject the connection with the server in respect of its handshake response.
7676 */
77- public void onWebsocketHandshakeReceivedAsClient ( WebSocket conn , ClientHandshake request , ServerHandshake response ) throws InvalidDataException ;
77+ void onWebsocketHandshakeReceivedAsClient ( WebSocket conn , ClientHandshake request , ServerHandshake response ) throws InvalidDataException ;
7878
7979 /**
8080 * Called on the client side when the socket connection is first established, and the WebSocketImpl
@@ -87,7 +87,7 @@ public interface WebSocketListener {
8787 * @throws InvalidDataException
8888 * Allows the client to stop the connection from progressing
8989 */
90- public void onWebsocketHandshakeSentAsClient ( WebSocket conn , ClientHandshake request ) throws InvalidDataException ;
90+ void onWebsocketHandshakeSentAsClient ( WebSocket conn , ClientHandshake request ) throws InvalidDataException ;
9191
9292 /**
9393 * Called when an entire text frame has been received. Do whatever you want
@@ -98,7 +98,7 @@ public interface WebSocketListener {
9898 * @param message
9999 * The UTF-8 decoded message that was received.
100100 */
101- public void onWebsocketMessage ( WebSocket conn , String message );
101+ void onWebsocketMessage ( WebSocket conn , String message );
102102
103103 /**
104104 * Called when an entire binary frame has been received. Do whatever you want
@@ -109,16 +109,18 @@ public interface WebSocketListener {
109109 * @param blob
110110 * The binary message that was received.
111111 */
112- public void onWebsocketMessage ( WebSocket conn , ByteBuffer blob );
112+ void onWebsocketMessage ( WebSocket conn , ByteBuffer blob );
113113
114114 /**
115115 * Called when a frame fragment has been recieved
116116 *
117+ * This method will be removed in a future version since the lib will also call the respective onWebsocketMessage method
117118 * @param conn
118119 * The <tt>WebSocket</tt> instance this event is occurring on.
119120 * @param frame The fragmented frame
120121 */
121- public void onWebsocketMessageFragment ( WebSocket conn , Framedata frame );
122+ @ Deprecated
123+ void onWebsocketMessageFragment ( WebSocket conn , Framedata frame );
122124
123125 /**
124126 * Called after <var>onHandshakeReceived</var> returns <var>true</var>.
@@ -128,7 +130,7 @@ public interface WebSocketListener {
128130 * @param conn The <tt>WebSocket</tt> instance this event is occuring on.
129131 * @param d The handshake of the websocket instance
130132 */
131- public void onWebsocketOpen ( WebSocket conn , Handshakedata d );
133+ void onWebsocketOpen ( WebSocket conn , Handshakedata d );
132134
133135 /**
134136 * Called after <tt>WebSocket#close</tt> is explicity called, or when the
@@ -139,7 +141,7 @@ public interface WebSocketListener {
139141 * @param reason Additional information string
140142 * @param remote Returns whether or not the closing of the connection was initiated by the remote host.
141143 */
142- public void onWebsocketClose ( WebSocket ws , int code , String reason , boolean remote );
144+ void onWebsocketClose ( WebSocket ws , int code , String reason , boolean remote );
143145
144146 /** Called as soon as no further frames are accepted
145147 *
@@ -148,15 +150,15 @@ public interface WebSocketListener {
148150 * @param reason Additional information string
149151 * @param remote Returns whether or not the closing of the connection was initiated by the remote host.
150152 */
151- public void onWebsocketClosing ( WebSocket ws , int code , String reason , boolean remote );
153+ void onWebsocketClosing ( WebSocket ws , int code , String reason , boolean remote );
152154
153155 /** send when this peer sends a close handshake
154156 *
155157 * @param ws The <tt>WebSocket</tt> instance this event is occuring on.
156158 * @param code The codes can be looked up here: {@link CloseFrame}
157159 * @param reason Additional information string
158160 */
159- public void onWebsocketCloseInitiated ( WebSocket ws , int code , String reason );
161+ void onWebsocketCloseInitiated ( WebSocket ws , int code , String reason );
160162
161163 /**
162164 * Called if an exception worth noting occurred.
@@ -167,7 +169,7 @@ public interface WebSocketListener {
167169 * The exception that occurred. <br>
168170 * Might be null if the exception is not related to any specific connection. For example if the server port could not be bound.
169171 */
170- public void onWebsocketError ( WebSocket conn , Exception ex );
172+ void onWebsocketError ( WebSocket conn , Exception ex );
171173
172174 /**
173175 * Called a ping frame has been received.
@@ -176,42 +178,43 @@ public interface WebSocketListener {
176178 * @param conn The <tt>WebSocket</tt> instance this event is occuring on.
177179 * @param f The ping frame. Control frames may contain payload.
178180 */
179- public void onWebsocketPing ( WebSocket conn , Framedata f );
181+ void onWebsocketPing ( WebSocket conn , Framedata f );
180182
181183 /**
182184 * Called when a pong frame is received.
183185 *
184186 * @param conn The <tt>WebSocket</tt> instance this event is occuring on.
185187 * @param f The pong frame. Control frames may contain payload.
186188 **/
187- public void onWebsocketPong ( WebSocket conn , Framedata f );
189+ void onWebsocketPong ( WebSocket conn , Framedata f );
188190
189191 /**
190192 * @see WebSocketAdapter#getFlashPolicy(WebSocket)
191193 * @param conn The <tt>WebSocket</tt> instance this event is occuring on.
192194 * @throws InvalidDataException thrown when some data that is required to generate the flash-policy like the websocket local port could not be obtained.
193195 * @return An XML String that comforts to Flash's security policy. You MUST not include the null char at the end, it is appended automatically.
194196 */
195- public String getFlashPolicy ( WebSocket conn ) throws InvalidDataException ;
197+ @ Deprecated
198+ String getFlashPolicy ( WebSocket conn ) throws InvalidDataException ;
196199
197200 /** This method is used to inform the selector thread that there is data queued to be written to the socket.
198201 * @param conn The <tt>WebSocket</tt> instance this event is occuring on.
199202 */
200- public void onWriteDemand ( WebSocket conn );
203+ void onWriteDemand ( WebSocket conn );
201204
202205 /**
203206 * @see WebSocket#getLocalSocketAddress()
204207 *
205208 * @param conn The <tt>WebSocket</tt> instance this event is occuring on.
206209 * @return Returns the address of the endpoint this socket is bound to.
207210 */
208- public InetSocketAddress getLocalSocketAddress ( WebSocket conn );
211+ InetSocketAddress getLocalSocketAddress ( WebSocket conn );
209212
210213 /**
211214 * @see WebSocket#getRemoteSocketAddress()
212215 *
213216 * @param conn The <tt>WebSocket</tt> instance this event is occuring on.
214217 * @return Returns the address of the endpoint this socket is connected to, or{@code null} if it is unconnected.
215218 */
216- public InetSocketAddress getRemoteSocketAddress ( WebSocket conn );
219+ InetSocketAddress getRemoteSocketAddress ( WebSocket conn );
217220}
0 commit comments