Skip to content

Commit a6e2fec

Browse files
author
Stephane Landelle
committed
Change web socket package into ws
1 parent f2f5c8d commit a6e2fec

33 files changed

+109
-88
lines changed

src/main/java/com/ning/http/client/AsyncHttpClientConfig.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,8 @@ public int getConnectTimeout() {
183183
}
184184

185185
/**
186-
* Return the maximum time, in milliseconds, a {@link com.ning.http.client.websocket.WebSocket} may be idle before being timed out.
187-
* @return the maximum time, in milliseconds, a {@link com.ning.http.client.websocket.WebSocket} may be idle before being timed out.
186+
* Return the maximum time, in milliseconds, a {@link com.ning.http.client.ws.WebSocket} may be idle before being timed out.
187+
* @return the maximum time, in milliseconds, a {@link com.ning.http.client.ws.WebSocket} may be idle before being timed out.
188188
*/
189189
public int getWebSocketTimeout() {
190190
return webSocketTimeout;
@@ -546,10 +546,10 @@ public Builder setConnectTimeout(int connectTimeOut) {
546546
}
547547

548548
/**
549-
* Set the maximum time in millisecond an {@link com.ning.http.client.websocket.WebSocket} can stay idle.
549+
* Set the maximum time in millisecond an {@link com.ning.http.client.ws.WebSocket} can stay idle.
550550
*
551551
* @param webSocketTimeout
552-
* the maximum time in millisecond an {@link com.ning.http.client.websocket.WebSocket} can stay idle.
552+
* the maximum time in millisecond an {@link com.ning.http.client.ws.WebSocket} can stay idle.
553553
* @return a {@link Builder}
554554
*/
555555
public Builder setWebSocketTimeout(int webSocketTimeout) {

src/main/java/com/ning/http/client/UpgradeHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
package com.ning.http.client;
1414

1515
/**
16-
* Invoked when an {@link AsyncHandler.STATE#UPGRADE} is returned. Currently the library only support {@link com.ning.http.client.websocket.WebSocket}
16+
* Invoked when an {@link AsyncHandler.STATE#UPGRADE} is returned. Currently the library only support {@link com.ning.http.client.ws.WebSocket}
1717
* as type.
1818
*
1919
* @param <T>

src/main/java/com/ning/http/client/providers/grizzly/GrizzlyAsyncHttpProvider.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -107,14 +107,14 @@
107107
import com.ning.http.client.multipart.Part;
108108
import com.ning.http.client.ntlm.NTLMEngine;
109109
import com.ning.http.client.uri.Uri;
110-
import com.ning.http.client.websocket.WebSocket;
111-
import com.ning.http.client.websocket.WebSocketByteListener;
112-
import com.ning.http.client.websocket.WebSocketCloseCodeReasonListener;
113-
import com.ning.http.client.websocket.WebSocketListener;
114-
import com.ning.http.client.websocket.WebSocketPingListener;
115-
import com.ning.http.client.websocket.WebSocketPongListener;
116-
import com.ning.http.client.websocket.WebSocketTextListener;
117-
import com.ning.http.client.websocket.WebSocketUpgradeHandler;
110+
import com.ning.http.client.ws.WebSocket;
111+
import com.ning.http.client.ws.WebSocketByteListener;
112+
import com.ning.http.client.ws.WebSocketCloseCodeReasonListener;
113+
import com.ning.http.client.ws.WebSocketListener;
114+
import com.ning.http.client.ws.WebSocketPingListener;
115+
import com.ning.http.client.ws.WebSocketPongListener;
116+
import com.ning.http.client.ws.WebSocketTextListener;
117+
import com.ning.http.client.ws.WebSocketUpgradeHandler;
118118
import com.ning.http.util.AsyncHttpProviderUtils;
119119
import com.ning.http.util.AuthenticatorUtils;
120120
import com.ning.http.util.ProxyUtils;

src/main/java/com/ning/http/client/providers/netty/handler/WebSocketProtocol.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
import com.ning.http.client.providers.netty.response.NettyResponseHeaders;
4343
import com.ning.http.client.providers.netty.response.NettyResponseStatus;
4444
import com.ning.http.client.providers.netty.ws.NettyWebSocket;
45-
import com.ning.http.client.websocket.WebSocketUpgradeHandler;
45+
import com.ning.http.client.ws.WebSocketUpgradeHandler;
4646

4747
import java.io.IOException;
4848
import java.util.Locale;

src/main/java/com/ning/http/client/providers/netty/request/NettyRequestSender.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
import com.ning.http.client.providers.netty.request.timeout.RequestTimeoutTimerTask;
5555
import com.ning.http.client.providers.netty.request.timeout.TimeoutsHolder;
5656
import com.ning.http.client.uri.Uri;
57-
import com.ning.http.client.websocket.WebSocketUpgradeHandler;
57+
import com.ning.http.client.ws.WebSocketUpgradeHandler;
5858

5959
import java.io.IOException;
6060
import java.net.InetSocketAddress;

src/main/java/com/ning/http/client/providers/netty/ws/NettyWebSocket.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,15 @@
3131
import com.ning.http.client.HttpResponseBodyPart;
3232
import com.ning.http.client.providers.netty.NettyAsyncHttpProviderConfig;
3333
import com.ning.http.client.providers.netty.response.NettyResponseBodyPart;
34-
import com.ning.http.client.websocket.WebSocket;
35-
import com.ning.http.client.websocket.WebSocketByteFragmentListener;
36-
import com.ning.http.client.websocket.WebSocketByteListener;
37-
import com.ning.http.client.websocket.WebSocketCloseCodeReasonListener;
38-
import com.ning.http.client.websocket.WebSocketListener;
39-
import com.ning.http.client.websocket.WebSocketPingListener;
40-
import com.ning.http.client.websocket.WebSocketPongListener;
41-
import com.ning.http.client.websocket.WebSocketTextFragmentListener;
42-
import com.ning.http.client.websocket.WebSocketTextListener;
34+
import com.ning.http.client.ws.WebSocket;
35+
import com.ning.http.client.ws.WebSocketByteFragmentListener;
36+
import com.ning.http.client.ws.WebSocketByteListener;
37+
import com.ning.http.client.ws.WebSocketCloseCodeReasonListener;
38+
import com.ning.http.client.ws.WebSocketListener;
39+
import com.ning.http.client.ws.WebSocketPingListener;
40+
import com.ning.http.client.ws.WebSocketPongListener;
41+
import com.ning.http.client.ws.WebSocketTextFragmentListener;
42+
import com.ning.http.client.ws.WebSocketTextListener;
4343

4444
import java.util.ArrayList;
4545
import java.util.Collection;

src/main/java/com/ning/http/client/websocket/DefaultWebSocketListener.java renamed to src/main/java/com/ning/http/client/ws/DefaultWebSocketListener.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* See the Apache License Version 2.0 for the specific language governing permissions and limitations there under.
1212
*/
1313

14-
package com.ning.http.client.websocket;
14+
package com.ning.http.client.ws;
1515

1616
/**
1717
* Default WebSocketListener implementation. Most methods are no-ops. This

src/main/java/com/ning/http/client/websocket/WebSocket.java renamed to src/main/java/com/ning/http/client/ws/WebSocket.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1111
* See the Apache License Version 2.0 for the specific language governing permissions and limitations there under.
1212
*/
13-
package com.ning.http.client.websocket;
13+
package com.ning.http.client.ws;
1414

1515
import java.io.Closeable;
1616

src/main/java/com/ning/http/client/websocket/WebSocketByteFragmentListener.java renamed to src/main/java/com/ning/http/client/ws/WebSocketByteFragmentListener.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
* See the Apache License Version 2.0 for the specific language governing permissions and limitations there under.
1313
*/
14-
package com.ning.http.client.websocket;
14+
package com.ning.http.client.ws;
1515

1616
import com.ning.http.client.HttpResponseBodyPart;
1717

src/main/java/com/ning/http/client/websocket/WebSocketByteListener.java renamed to src/main/java/com/ning/http/client/ws/WebSocketByteListener.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1111
* See the Apache License Version 2.0 for the specific language governing permissions and limitations there under.
1212
*/
13-
package com.ning.http.client.websocket;
13+
package com.ning.http.client.ws;
1414

1515
/**
1616
* A {@link WebSocketListener} for bytes

src/main/java/com/ning/http/client/websocket/WebSocketCloseCodeReasonListener.java renamed to src/main/java/com/ning/http/client/ws/WebSocketCloseCodeReasonListener.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1111
* See the Apache License Version 2.0 for the specific language governing permissions and limitations there under.
1212
*/
13-
package com.ning.http.client.websocket;
13+
package com.ning.http.client.ws;
1414

1515
/**
1616
* Extend the normal close listener with one that support the WebSocket's code and reason.

src/main/java/com/ning/http/client/websocket/WebSocketListener.java renamed to src/main/java/com/ning/http/client/ws/WebSocketListener.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1111
* See the Apache License Version 2.0 for the specific language governing permissions and limitations there under.
1212
*/
13-
package com.ning.http.client.websocket;
13+
package com.ning.http.client.ws;
1414

1515
/**
1616
* A generic {@link WebSocketListener} for WebSocket events. Use the appropriate listener for receiving message bytes.

src/main/java/com/ning/http/client/websocket/WebSocketPingListener.java renamed to src/main/java/com/ning/http/client/ws/WebSocketPingListener.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1111
* See the Apache License Version 2.0 for the specific language governing permissions and limitations there under.
1212
*/
13-
package com.ning.http.client.websocket;
13+
package com.ning.http.client.ws;
1414

1515
/**
1616
* A WebSocket's Ping Listener

src/main/java/com/ning/http/client/websocket/WebSocketPongListener.java renamed to src/main/java/com/ning/http/client/ws/WebSocketPongListener.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1111
* See the Apache License Version 2.0 for the specific language governing permissions and limitations there under.
1212
*/
13-
package com.ning.http.client.websocket;
13+
package com.ning.http.client.ws;
1414

1515
/**
1616
* A WebSocket's Pong Listener

src/main/java/com/ning/http/client/websocket/WebSocketTextFragmentListener.java renamed to src/main/java/com/ning/http/client/ws/WebSocketTextFragmentListener.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
* See the Apache License Version 2.0 for the specific language governing permissions and limitations there under.
1313
*/
14-
package com.ning.http.client.websocket;
14+
package com.ning.http.client.ws;
1515

1616
import com.ning.http.client.HttpResponseBodyPart;
1717

src/main/java/com/ning/http/client/websocket/WebSocketTextListener.java renamed to src/main/java/com/ning/http/client/ws/WebSocketTextListener.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1111
* See the Apache License Version 2.0 for the specific language governing permissions and limitations there under.
1212
*/
13-
package com.ning.http.client.websocket;
13+
package com.ning.http.client.ws;
1414

1515
/**
1616
* A {@link WebSocketListener} for text message

src/main/java/com/ning/http/client/websocket/WebSocketUpgradeHandler.java renamed to src/main/java/com/ning/http/client/ws/WebSocketUpgradeHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1111
* See the Apache License Version 2.0 for the specific language governing permissions and limitations there under.
1212
*/
13-
package com.ning.http.client.websocket;
13+
package com.ning.http.client.ws;
1414

1515
import com.ning.http.client.AsyncHandler;
1616
import com.ning.http.client.HttpResponseBodyPart;

src/test/java/com/ning/http/client/websocket/AbstractBasicTest.java renamed to src/test/java/com/ning/http/client/ws/AbstractBasicTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1111
* See the Apache License Version 2.0 for the specific language governing permissions and limitations there under.
1212
*/
13-
package com.ning.http.client.websocket;
13+
package com.ning.http.client.ws;
1414

1515
import com.ning.http.client.AsyncHttpClient;
1616
import com.ning.http.client.AsyncHttpClientConfig;

src/test/java/com/ning/http/client/websocket/ByteMessageTest.java renamed to src/test/java/com/ning/http/client/ws/ByteMessageTest.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,16 @@
1010
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1111
* See the Apache License Version 2.0 for the specific language governing permissions and limitations there under.
1212
*/
13-
package com.ning.http.client.websocket;
13+
package com.ning.http.client.ws;
1414

1515
import static org.testng.Assert.assertEquals;
1616

1717
import org.testng.annotations.Test;
1818

1919
import com.ning.http.client.AsyncHttpClient;
20+
import com.ning.http.client.ws.WebSocket;
21+
import com.ning.http.client.ws.WebSocketByteListener;
22+
import com.ning.http.client.ws.WebSocketUpgradeHandler;
2023

2124
import javax.servlet.http.HttpServletRequest;
2225

src/test/java/com/ning/http/client/websocket/CloseCodeReasonMessageTest.java renamed to src/test/java/com/ning/http/client/ws/CloseCodeReasonMessageTest.java

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,15 @@
1010
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1111
* See the Apache License Version 2.0 for the specific language governing permissions and limitations there under.
1212
*/
13-
package com.ning.http.client.websocket;
13+
package com.ning.http.client.ws;
1414

1515
import com.ning.http.client.AsyncHttpClient;
16+
import com.ning.http.client.ws.WebSocket;
17+
import com.ning.http.client.ws.WebSocketCloseCodeReasonListener;
18+
import com.ning.http.client.ws.WebSocketListener;
19+
import com.ning.http.client.ws.WebSocketTextListener;
20+
import com.ning.http.client.ws.WebSocketUpgradeHandler;
21+
1622
import org.testng.annotations.Test;
1723

1824
import java.util.concurrent.CountDownLatch;
@@ -75,11 +81,11 @@ public Listener(CountDownLatch latch, AtomicReference<String> text) {
7581
}
7682

7783
@Override
78-
public void onOpen(com.ning.http.client.websocket.WebSocket websocket) {
84+
public void onOpen(com.ning.http.client.ws.WebSocket websocket) {
7985
}
8086

8187
@Override
82-
public void onClose(com.ning.http.client.websocket.WebSocket websocket) {
88+
public void onClose(com.ning.http.client.ws.WebSocket websocket) {
8389
}
8490

8591
public void onClose(WebSocket websocket, int code, String reason) {
@@ -108,11 +114,11 @@ public void onMessage(String message) {
108114
}
109115

110116
@Override
111-
public void onOpen(com.ning.http.client.websocket.WebSocket websocket) {
117+
public void onOpen(com.ning.http.client.ws.WebSocket websocket) {
112118
}
113119

114120
@Override
115-
public void onClose(com.ning.http.client.websocket.WebSocket websocket) {
121+
public void onClose(com.ning.http.client.ws.WebSocket websocket) {
116122
}
117123

118124
@Override
@@ -144,11 +150,11 @@ public void onMessage(String message) {
144150
}
145151

146152
@Override
147-
public void onOpen(com.ning.http.client.websocket.WebSocket websocket) {
153+
public void onOpen(com.ning.http.client.ws.WebSocket websocket) {
148154
}
149155

150156
@Override
151-
public void onClose(com.ning.http.client.websocket.WebSocket websocket) {
157+
public void onClose(com.ning.http.client.ws.WebSocket websocket) {
152158
}
153159

154160
@Override

src/test/java/com/ning/http/client/websocket/ProxyTunnellingTest.java renamed to src/test/java/com/ning/http/client/ws/ProxyTunnellingTest.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1111
* See the Apache License Version 2.0 for the specific language governing permissions and limitations there under.
1212
*/
13-
package com.ning.http.client.websocket;
13+
package com.ning.http.client.ws;
1414

1515
import static org.testng.Assert.assertEquals;
1616

@@ -25,7 +25,10 @@
2525
import com.ning.http.client.AsyncHttpClient;
2626
import com.ning.http.client.AsyncHttpClientConfig;
2727
import com.ning.http.client.ProxyServer;
28-
import com.ning.http.client.websocket.TextMessageTest.EchoTextWebSocket;
28+
import com.ning.http.client.ws.WebSocket;
29+
import com.ning.http.client.ws.WebSocketTextListener;
30+
import com.ning.http.client.ws.WebSocketUpgradeHandler;
31+
import com.ning.http.client.ws.TextMessageTest.EchoTextWebSocket;
2932

3033
import javax.servlet.http.HttpServletRequest;
3134

src/test/java/com/ning/http/client/websocket/RedirectTest.java renamed to src/test/java/com/ning/http/client/ws/RedirectTest.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* See the Apache License Version 2.0 for the specific language governing permissions and limitations there under.
1212
*/
1313

14-
package com.ning.http.client.websocket;
14+
package com.ning.http.client.ws;
1515

1616
import static org.testng.Assert.assertEquals;
1717

@@ -32,6 +32,9 @@
3232

3333
import com.ning.http.client.AsyncHttpClient;
3434
import com.ning.http.client.AsyncHttpClientConfig;
35+
import com.ning.http.client.ws.WebSocket;
36+
import com.ning.http.client.ws.WebSocketListener;
37+
import com.ning.http.client.ws.WebSocketUpgradeHandler;
3538

3639
public abstract class RedirectTest extends AbstractBasicTest {
3740

@@ -92,13 +95,13 @@ public void testRedirectToWSResource() throws Exception {
9295
WebSocket websocket = client.prepareGet(getRedirectURL()).execute(new WebSocketUpgradeHandler.Builder().addWebSocketListener(new WebSocketListener() {
9396

9497
@Override
95-
public void onOpen(com.ning.http.client.websocket.WebSocket websocket) {
98+
public void onOpen(com.ning.http.client.ws.WebSocket websocket) {
9699
text.set("OnOpen");
97100
latch.countDown();
98101
}
99102

100103
@Override
101-
public void onClose(com.ning.http.client.websocket.WebSocket websocket) {
104+
public void onClose(com.ning.http.client.ws.WebSocket websocket) {
102105
}
103106

104107
@Override

0 commit comments

Comments
 (0)