Filter implementation, which supposed to be placed into a FilterChain right after HTTP
Filter: HttpServerFilter, HttpClientFilter; depending whether it's server or client side. The
BaseWebSocketFilter handles websocket connection, handshake phases and, when receives a websocket frame -
redirects it to appropriate connection (WebSocketApplication, WebSocket) for processing.
| Modifier and Type | Field and Description |
|---|---|
| private static final long | |
| private static final Logger | |
| private final long |
| Access | Constructor and Description |
|---|---|
| public | BaseWebSocketFilter()
Constructs a new |
| public | BaseWebSocketFilter(final long wsTimeoutInSeconds)
Constructs a new |
| Modifier and Type | Method and Description |
|---|---|
| private static WebSocket | |
| public NextAction | handleClose(FilterChainContext ctx)
Overrides org. Implements org. Method handles Grizzly |
| protected abstract NextAction | |
| public NextAction | handleRead(FilterChainContext ctx)
Overrides org. Implements org. Handle Grizzly |
| public NextAction | handleWrite(FilterChainContext ctx)
Overrides org. Implements org. Handle Grizzly |
| protected void | onHandshakeFailure(final Connection<L> connection, final HandshakeException e)
The method is called when WebSocket handshake fails for the |
| protected void | |
| protected static boolean |
| DEFAULT_WS_IDLE_TIMEOUT_IN_SECONDS | back to summary |
|---|---|
| private static final long DEFAULT_WS_IDLE_TIMEOUT_IN_SECONDS | |
| LOGGER | back to summary |
|---|---|
| private static final Logger LOGGER | |
| wsTimeoutMS | back to summary |
|---|---|
| private final long wsTimeoutMS | |
| BaseWebSocketFilter | back to summary |
|---|---|
| public BaseWebSocketFilter() Constructs a new | |
| BaseWebSocketFilter | back to summary |
|---|---|
| public BaseWebSocketFilter(final long wsTimeoutInSeconds) Constructs a new | |
| getWebSocket | back to summary |
|---|---|
| private static WebSocket getWebSocket(final Connection<L> connection) | |
| handleClose | back to summary |
|---|---|
| public NextAction handleClose(FilterChainContext ctx) throws IOException Overrides org. Implements org. Method handles Grizzly
| |
| handleHandshake | back to summary |
|---|---|
| protected abstract NextAction handleHandshake(FilterChainContext ctx, HttpContent content) throws IOException Handle websocket handshake
| |
| handleRead | back to summary |
|---|---|
| public NextAction handleRead(FilterChainContext ctx) throws IOException Overrides org. Implements org. Handle Grizzly
| |
| handleWrite | back to summary |
|---|---|
| public NextAction handleWrite(FilterChainContext ctx) throws IOException Overrides org. Implements org. Handle Grizzly
| |
| onHandshakeFailure | back to summary |
|---|---|
| protected void onHandshakeFailure(final Connection<L> connection, final HandshakeException e) The method is called when WebSocket handshake fails for the | |
| setIdleTimeout | back to summary |
|---|---|
| protected void setIdleTimeout(final FilterChainContext ctx) | |
| webSocketInProgress | back to summary |
|---|---|
| protected static boolean webSocketInProgress(final Connection<L> connection) | |