java.lang.Object
swim.io.ws.AbstractWebSocket<I,O>
- All Implemented Interfaces:
FlowContext
,IpContext
,WebSocket<I,
O>
public abstract class AbstractWebSocket<I,O>
extends Object
implements WebSocket<I,O>, IpContext, FlowContext
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Returns the cryptographic cipher suite used by the underlying network connection.void
close()
void
void
void
void
void
void
void
void
didUpgrade
(HttpRequest<?> httpRequest, HttpResponse<?> httpResponse) void
void
doRead()
void
doWrite()
Returns the currentFlowControl
state of the underlying network channel.void
flowControl
(FlowControl flowControl) Enqueues an atomic replacement of the underlying network channel's flow control state with a newflowControl
.flowControl
(FlowModifier flowModifier) Enqueues an atomic modification to the underlying network channel's flow control state by applying aflowModifier
delta.long
boolean
isClient()
Returnstrue
if the underlying network channel initiated an outgoing connection.boolean
Returnstrue
if the underlying network channel is currently connected.boolean
isSecure()
Returnstrue
if the underlying network transport is encrypted.boolean
isServer()
Returnstrue
if the underlying network channel accepted an incoming connection.Returns the IP address and port of the local endpoint of the underlying network connection.Returns the certificate chain used to authenticate the local endpoint of the underlying network connection.Returns the authenticated identity of the local endpoint of the underlying network connection.<I2 extends I>
void<I2 extends I>
voidReturns the IP address and port of the remote endpoint of the underlying network connection.Returns the certificate chain used to authenticate the remote endpoint of the underlying network connection.Returns the authenticated identity of the remote endpoint of the underlying network connection.Returns the name of the transport-layer security protocol used by the underlying network connection.void
setWebSocketContext
(WebSocketContext<I, O> context) void
willBecome
(IpSocket socket) void
void
<O2 extends O>
voidwrite
(WsControlFrame<?, O2> frame) <O2 extends O>
voidwrite
(WsDataFrame<O2> frame)
-
Field Details
-
context
-
-
Constructor Details
-
AbstractWebSocket
public AbstractWebSocket()
-
-
Method Details
-
webSocketContext
- Specified by:
webSocketContext
in interfaceWebSocket<I,
O>
-
setWebSocketContext
- Specified by:
setWebSocketContext
in interfaceWebSocket<I,
O>
-
idleTimeout
public long idleTimeout()- Specified by:
idleTimeout
in interfaceWebSocket<I,
O>
-
doRead
public void doRead() -
didRead
-
doWrite
public void doWrite() -
didWrite
-
didUpgrade
- Specified by:
didUpgrade
in interfaceWebSocket<I,
O>
-
willConnect
public void willConnect()- Specified by:
willConnect
in interfaceWebSocket<I,
O>
-
didConnect
public void didConnect()- Specified by:
didConnect
in interfaceWebSocket<I,
O>
-
willSecure
public void willSecure()- Specified by:
willSecure
in interfaceWebSocket<I,
O>
-
didSecure
public void didSecure() -
willBecome
- Specified by:
willBecome
in interfaceWebSocket<I,
O>
-
didBecome
-
didTimeout
public void didTimeout()- Specified by:
didTimeout
in interfaceWebSocket<I,
O>
-
didDisconnect
public void didDisconnect()- Specified by:
didDisconnect
in interfaceWebSocket<I,
O>
-
didFail
-
isConnected
public boolean isConnected()Description copied from interface:IpContext
Returnstrue
if the underlying network channel is currently connected.- Specified by:
isConnected
in interfaceIpContext
-
isClient
public boolean isClient()Description copied from interface:IpContext
Returnstrue
if the underlying network channel initiated an outgoing connection. -
isServer
public boolean isServer()Description copied from interface:IpContext
Returnstrue
if the underlying network channel accepted an incoming connection. -
isSecure
public boolean isSecure()Description copied from interface:IpContext
Returnstrue
if the underlying network transport is encrypted. -
securityProtocol
Description copied from interface:IpContext
Returns the name of the transport-layer security protocol used by the underlying network connection. Returnsnull
if the underlying network channel is not currently connected, or if the underlying network connection is not secure.- Specified by:
securityProtocol
in interfaceIpContext
-
cipherSuite
Description copied from interface:IpContext
Returns the cryptographic cipher suite used by the underlying network connection. Returnsnull
if the underlying network channel is not currently connected, or if the underlying network connection is not secure.- Specified by:
cipherSuite
in interfaceIpContext
-
localAddress
Description copied from interface:IpContext
Returns the IP address and port of the local endpoint of the underlying network connection. Returnsnull
if the underlying network channel is not currently connected.- Specified by:
localAddress
in interfaceIpContext
-
localPrincipal
Description copied from interface:IpContext
Returns the authenticated identity of the local endpoint of the underlying network connection. Returnsnull
if the underlying network channel is not currently connected, or if the underlying network connection is not authenticated.- Specified by:
localPrincipal
in interfaceIpContext
-
localCertificates
Description copied from interface:IpContext
Returns the certificate chain used to authenticate the local endpoint of the underlying network connection. Returnsnull
if the underlying network channel is not currently connected, or if the underlying network connection is not authenticated.- Specified by:
localCertificates
in interfaceIpContext
-
remoteAddress
Description copied from interface:IpContext
Returns the IP address and port of the remote endpoint of the underlying network connection. Returnsnull
if the underlying network channel is not currently connected.- Specified by:
remoteAddress
in interfaceIpContext
-
remotePrincipal
Description copied from interface:IpContext
Returns the authenticated identity of the remote endpoint of the underlying network connection. Returnsnull
if the underlying network channel is not currently connected, or if the underlying network connection is not authenticated.- Specified by:
remotePrincipal
in interfaceIpContext
-
remoteCertificates
Description copied from interface:IpContext
Returns the certificate chain used to authenticate the remote endpoint of the underlying network connection. Returnsnull
if the underlying network channel is not currently connected, or if the underlying network connection is not authenticated.- Specified by:
remoteCertificates
in interfaceIpContext
-
flowControl
Description copied from interface:FlowContext
Returns the currentFlowControl
state of the underlying network channel.- Specified by:
flowControl
in interfaceFlowContext
-
flowControl
Description copied from interface:FlowContext
Enqueues an atomic replacement of the underlying network channel's flow control state with a newflowControl
.- Specified by:
flowControl
in interfaceFlowContext
-
flowControl
Description copied from interface:FlowContext
Enqueues an atomic modification to the underlying network channel's flow control state by applying aflowModifier
delta.- Specified by:
flowControl
in interfaceFlowContext
-
wsSettings
-
read
-
read
-
write
-
write
-
become
-
close
public void close()
-