Skip to content

Commit

Permalink
Deprecate methods in ReactorNettyWebSocketClient
Browse files Browse the repository at this point in the history
  • Loading branch information
izeye authored and kenny5he committed Jun 21, 2020
1 parent 6098fb2 commit 00571ad
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
Expand Up @@ -34,7 +34,6 @@
import org.springframework.web.reactive.socket.HandshakeInfo;
import org.springframework.web.reactive.socket.WebSocketHandler;
import org.springframework.web.reactive.socket.WebSocketSession;
import org.springframework.web.reactive.socket.adapter.NettyWebSocketSessionSupport;
import org.springframework.web.reactive.socket.adapter.ReactorNettyWebSocketSession;

/**
Expand All @@ -53,7 +52,7 @@ public class ReactorNettyWebSocketClient implements WebSocketClient {
private final Supplier<WebsocketClientSpec.Builder> specBuilderSupplier;

@Nullable
private Integer maxFramePayloadLength = NettyWebSocketSessionSupport.DEFAULT_FRAME_MAX_SIZE;
private Integer maxFramePayloadLength;

@Nullable
private Boolean handlePing;
Expand All @@ -67,16 +66,17 @@ public ReactorNettyWebSocketClient() {
}

/**
* Constructor that accepts an existing {@link HttpClient}.
* Constructor that accepts an existing {@link HttpClient} builder
* with a default {@link WebsocketClientSpec.Builder}.
* @since 5.1
*/
public ReactorNettyWebSocketClient(HttpClient httpClient) {
this(httpClient, WebsocketClientSpec.builder());
}

/**
* Constructor with an {@link HttpClient} and a supplier for the
* {@link WebsocketClientSpec.Builder} to use.
* Constructor that accepts an existing {@link HttpClient} builder
* and a pre-configured {@link WebsocketClientSpec.Builder}.
* @since 5.3
*/
public ReactorNettyWebSocketClient(
Expand Down Expand Up @@ -131,15 +131,20 @@ private WebsocketClientSpec buildSpec(@Nullable String protocols) {
* <p>By default set to 65536 (64K).
* @param maxFramePayloadLength the max length for frames.
* @since 5.2
* @deprecated as of 5.3 in favor of providing a supplier of
* {@link WebsocketClientSpec.Builder} with a constructor argument.
*/
@Deprecated
public void setMaxFramePayloadLength(int maxFramePayloadLength) {
this.maxFramePayloadLength = maxFramePayloadLength;
}

/**
* Return the configured {@link #setMaxFramePayloadLength(int) maxFramePayloadLength}.
* @since 5.2
* @deprecated as of 5.3 in favor of {@link #getWebsocketClientSpec()}
*/
@Deprecated
public int getMaxFramePayloadLength() {
return getWebsocketClientSpec().maxFramePayloadLength();
}
Expand All @@ -154,15 +159,20 @@ public int getMaxFramePayloadLength() {
* frames will be passed through to the {@link WebSocketHandler}.
* @param handlePing whether to let Ping frames through for handling
* @since 5.2.4
* @deprecated as of 5.3 in favor of providing a supplier of
* {@link WebsocketClientSpec.Builder} with a constructor argument.
*/
@Deprecated
public void setHandlePing(boolean handlePing) {
this.handlePing = handlePing;
}

/**
* Return the configured {@link #setHandlePing(boolean)}.
* @since 5.2.4
* @deprecated as of 5.3 in favor of {@link #getWebsocketClientSpec()}
*/
@Deprecated
public boolean getHandlePing() {
return getWebsocketClientSpec().handlePing();
}
Expand Down
Expand Up @@ -108,7 +108,7 @@ private WebsocketServerSpec buildSpec(@Nullable String subProtocol) {
* @param maxFramePayloadLength the max length for frames.
* @since 5.1
* @deprecated as of 5.2.6 in favor of providing a supplier of
* {@link WebsocketServerSpec.Builder} wiht a constructor argument.
* {@link WebsocketServerSpec.Builder} with a constructor argument.
*/
@Deprecated
public void setMaxFramePayloadLength(Integer maxFramePayloadLength) {
Expand Down Expand Up @@ -136,7 +136,7 @@ public int getMaxFramePayloadLength() {
* @param handlePing whether to let Ping frames through for handling
* @since 5.2.4
* @deprecated as of 5.2.6 in favor of providing a supplier of
* {@link WebsocketServerSpec.Builder} wiht a constructor argument.
* {@link WebsocketServerSpec.Builder} with a constructor argument.
*/
@Deprecated
public void setHandlePing(boolean handlePing) {
Expand Down

0 comments on commit 00571ad

Please sign in to comment.