Top Description Inners Fields Constructors Methods
io.netty.handler.codec.http.websocketx

public final Class WebSocketServerProtocolConfig

extends Object
Class Inheritance
Imports
io.netty.handler.codec.http.websocketx.WebSocketClientProtocolHandler.ClientHandshakeStateEvent, io.netty.util.internal.ObjectUtil

WebSocket server configuration.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class

Field Summary

Modifier and TypeField and Description
private final boolean
private final WebSocketDecoderConfig
pack-priv static final long
private final boolean
private final long
private final boolean
private final long
private final WebSocketCloseStatus
private final String
private final String

Constructor Summary

AccessConstructor and Description
private
WebSocketServerProtocolConfig(String websocketPath, String subprotocols, boolean checkStartsWith, long handshakeTimeoutMillis, long forceCloseTimeoutMillis, boolean handleCloseFrames, WebSocketCloseStatus sendCloseFrame, boolean dropPongFrames, WebSocketDecoderConfig decoderConfig)

Method Summary

Modifier and TypeMethod and Description
public boolean
public WebSocketDecoderConfig
public boolean
public long
public boolean
public long
public static WebSocketServerProtocolConfig.Builder
public WebSocketCloseStatus
public String
public WebSocketServerProtocolConfig.Builder
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
public String
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

checkStartsWithback to summary
private final boolean checkStartsWith
decoderConfigback to summary
private final WebSocketDecoderConfig decoderConfig
DEFAULT_HANDSHAKE_TIMEOUT_MILLISback to summary
pack-priv static final long DEFAULT_HANDSHAKE_TIMEOUT_MILLIS
dropPongFramesback to summary
private final boolean dropPongFrames
forceCloseTimeoutMillisback to summary
private final long forceCloseTimeoutMillis
handleCloseFramesback to summary
private final boolean handleCloseFrames
handshakeTimeoutMillisback to summary
private final long handshakeTimeoutMillis
sendCloseFrameback to summary
private final WebSocketCloseStatus sendCloseFrame
subprotocolsback to summary
private final String subprotocols
websocketPathback to summary
private final String websocketPath

Constructor Detail

WebSocketServerProtocolConfigback to summary
private WebSocketServerProtocolConfig(String websocketPath, String subprotocols, boolean checkStartsWith, long handshakeTimeoutMillis, long forceCloseTimeoutMillis, boolean handleCloseFrames, WebSocketCloseStatus sendCloseFrame, boolean dropPongFrames, WebSocketDecoderConfig decoderConfig)

Method Detail

checkStartsWithback to summary
public boolean checkStartsWith()
decoderConfigback to summary
public WebSocketDecoderConfig decoderConfig()
dropPongFramesback to summary
public boolean dropPongFrames()
forceCloseTimeoutMillisback to summary
public long forceCloseTimeoutMillis()
handleCloseFramesback to summary
public boolean handleCloseFrames()
handshakeTimeoutMillisback to summary
public long handshakeTimeoutMillis()
newBuilderback to summary
public static WebSocketServerProtocolConfig.Builder newBuilder()
sendCloseFrameback to summary
public WebSocketCloseStatus sendCloseFrame()
subprotocolsback to summary
public String subprotocols()
toBuilderback to summary
public WebSocketServerProtocolConfig.Builder toBuilder()
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override
websocketPathback to summary
public String websocketPath()
io.netty.handler.codec.http.websocketx back to summary

public final Class WebSocketServerProtocolConfig.Builder

extends Object
Class Inheritance
  • java.lang.Object
  • io.netty.handler.codec.http.websocketx.WebSocketServerProtocolConfig.Builder

Field Summary

Modifier and TypeField and Description
private boolean
private WebSocketDecoderConfig
private WebSocketDecoderConfig.Builder
private boolean
private long
private boolean
private long
private WebSocketCloseStatus
private String
private String

Constructor Summary

AccessConstructor and Description
private
private
Builder(String websocketPath, String subprotocols, boolean checkStartsWith, long handshakeTimeoutMillis, long forceCloseTimeoutMillis, boolean handleCloseFrames, WebSocketCloseStatus sendCloseFrame, boolean dropPongFrames, WebSocketDecoderConfig decoderConfig)

Method Summary

Modifier and TypeMethod and Description
public WebSocketServerProtocolConfig.Builder
allowExtensions(boolean allowExtensions)

public WebSocketServerProtocolConfig.Builder
allowMaskMismatch(boolean allowMaskMismatch)

public WebSocketServerProtocolConfig
build()

Build unmodifiable server protocol configuration.

public WebSocketServerProtocolConfig.Builder
checkStartsWith(boolean checkStartsWith)

true to handle all requests, where URI path component starts from WebSocketServerProtocolConfig#websocketPath(), false for exact match (default).

public WebSocketServerProtocolConfig.Builder
closeOnProtocolViolation(boolean closeOnProtocolViolation)

public WebSocketServerProtocolConfig.Builder
decoderConfig(WebSocketDecoderConfig decoderConfig)

Frames decoder configuration.

private WebSocketDecoderConfig.Builder
public WebSocketServerProtocolConfig.Builder
dropPongFrames(boolean dropPongFrames)

true if pong frames should not be forwarded

public WebSocketServerProtocolConfig.Builder
expectMaskedFrames(boolean expectMaskedFrames)

public WebSocketServerProtocolConfig.Builder
forceCloseTimeoutMillis(long forceCloseTimeoutMillis)

Close the connection if it was not closed by the client after timeout specified

public WebSocketServerProtocolConfig.Builder
handleCloseFrames(boolean handleCloseFrames)

true if close frames should not be forwarded and just close the channel

public WebSocketServerProtocolConfig.Builder
handshakeTimeoutMillis(long handshakeTimeoutMillis)

Handshake timeout in mills, when handshake timeout, will trigger user event ClientHandshakeStateEvent#HANDSHAKE_TIMEOUT

public WebSocketServerProtocolConfig.Builder
maxFramePayloadLength(int maxFramePayloadLength)

public WebSocketServerProtocolConfig.Builder
sendCloseFrame(WebSocketCloseStatus sendCloseFrame)

Close frame to send, when close frame was not send manually.

public WebSocketServerProtocolConfig.Builder
subprotocols(String subprotocols)

CSV of supported protocols

public WebSocketServerProtocolConfig.Builder
websocketPath(String websocketPath)

URI path component to handle websocket upgrade requests on.

public WebSocketServerProtocolConfig.Builder
withUTF8Validator(boolean withUTF8Validator)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

checkStartsWithback to summary
private boolean checkStartsWith
decoderConfigback to summary
private WebSocketDecoderConfig decoderConfig
decoderConfigBuilderback to summary
private WebSocketDecoderConfig.Builder decoderConfigBuilder
dropPongFramesback to summary
private boolean dropPongFrames
forceCloseTimeoutMillisback to summary
private long forceCloseTimeoutMillis
handleCloseFramesback to summary
private boolean handleCloseFrames
handshakeTimeoutMillisback to summary
private long handshakeTimeoutMillis
sendCloseFrameback to summary
private WebSocketCloseStatus sendCloseFrame
subprotocolsback to summary
private String subprotocols
websocketPathback to summary
private String websocketPath

Constructor Detail

Builderback to summary
private Builder(WebSocketServerProtocolConfig serverConfig)
Builderback to summary
private Builder(String websocketPath, String subprotocols, boolean checkStartsWith, long handshakeTimeoutMillis, long forceCloseTimeoutMillis, boolean handleCloseFrames, WebSocketCloseStatus sendCloseFrame, boolean dropPongFrames, WebSocketDecoderConfig decoderConfig)

Method Detail

allowExtensionsback to summary
public WebSocketServerProtocolConfig.Builder allowExtensions(boolean allowExtensions)
allowMaskMismatchback to summary
public WebSocketServerProtocolConfig.Builder allowMaskMismatch(boolean allowMaskMismatch)
buildback to summary
public WebSocketServerProtocolConfig build()

Build unmodifiable server protocol configuration.

checkStartsWithback to summary
public WebSocketServerProtocolConfig.Builder checkStartsWith(boolean checkStartsWith)

true to handle all requests, where URI path component starts from WebSocketServerProtocolConfig#websocketPath(), false for exact match (default).

closeOnProtocolViolationback to summary
public WebSocketServerProtocolConfig.Builder closeOnProtocolViolation(boolean closeOnProtocolViolation)
decoderConfigback to summary
public WebSocketServerProtocolConfig.Builder decoderConfig(WebSocketDecoderConfig decoderConfig)

Frames decoder configuration.

decoderConfigBuilderback to summary
private WebSocketDecoderConfig.Builder decoderConfigBuilder()
dropPongFramesback to summary
public WebSocketServerProtocolConfig.Builder dropPongFrames(boolean dropPongFrames)

true if pong frames should not be forwarded

expectMaskedFramesback to summary
public WebSocketServerProtocolConfig.Builder expectMaskedFrames(boolean expectMaskedFrames)
forceCloseTimeoutMillisback to summary
public WebSocketServerProtocolConfig.Builder forceCloseTimeoutMillis(long forceCloseTimeoutMillis)

Close the connection if it was not closed by the client after timeout specified

handleCloseFramesback to summary
public WebSocketServerProtocolConfig.Builder handleCloseFrames(boolean handleCloseFrames)

true if close frames should not be forwarded and just close the channel

handshakeTimeoutMillisback to summary
public WebSocketServerProtocolConfig.Builder handshakeTimeoutMillis(long handshakeTimeoutMillis)

Handshake timeout in mills, when handshake timeout, will trigger user event ClientHandshakeStateEvent#HANDSHAKE_TIMEOUT

maxFramePayloadLengthback to summary
public WebSocketServerProtocolConfig.Builder maxFramePayloadLength(int maxFramePayloadLength)
sendCloseFrameback to summary
public WebSocketServerProtocolConfig.Builder sendCloseFrame(WebSocketCloseStatus sendCloseFrame)

Close frame to send, when close frame was not send manually. Or null to disable proper close.

subprotocolsback to summary
public WebSocketServerProtocolConfig.Builder subprotocols(String subprotocols)

CSV of supported protocols

websocketPathback to summary
public WebSocketServerProtocolConfig.Builder websocketPath(String websocketPath)

URI path component to handle websocket upgrade requests on.

withUTF8Validatorback to summary
public WebSocketServerProtocolConfig.Builder withUTF8Validator(boolean withUTF8Validator)