Class CoreSession.Empty
- All Implemented Interfaces:
Configuration,Configuration.Customizer,CoreSession,OutgoingFrames
- Enclosing interface:
- CoreSession
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.eclipse.jetty.websocket.core.Configuration
Configuration.ConfigurationCustomizer, Configuration.CustomizerNested classes/interfaces inherited from interface org.eclipse.jetty.websocket.core.CoreSession
CoreSession.Empty -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidabort()Issue a harsh abort of the underlying connection.voidInitiate close handshake with provide status code and optional reason phrase.voidInitiate close handshake, no payload (no declared status code or reason phrase)voiddemand(long n) Manage flow control by indicating demand for handling Frames.voidIf using BatchMode.ON or BatchMode.AUTO, trigger a flush of enqueued / batched frames.The Local Socket Address for the connectionThe negotiated WebSocket Extension Configurations for this session.The negotiated WebSocket Sub-Protocol for this session.The parameter map (from URI Query) for the active session.The activeSec-WebSocket-Version(protocol version) in use.The Remote Socket Address for the connectionThe active connection's Request URI.booleanbooleanbooleanbooleanbooleanbooleanisSecure()The active connection's Secure status indicator.voidA frame, and optional callback, intended for the network layer.Methods inherited from class org.eclipse.jetty.websocket.core.Configuration.ConfigurationCustomizer
customize, getIdleTimeout, getInputBufferSize, getMaxBinaryMessageSize, getMaxFrameSize, getMaxOutgoingFrames, getMaxTextMessageSize, getOutputBufferSize, getWriteTimeout, isAutoFragment, setAutoFragment, setIdleTimeout, setInputBufferSize, setMaxBinaryMessageSize, setMaxFrameSize, setMaxOutgoingFrames, setMaxTextMessageSize, setOutputBufferSize, setWriteTimeout, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.jetty.websocket.core.Configuration
getIdleTimeout, getInputBufferSize, getMaxBinaryMessageSize, getMaxFrameSize, getMaxOutgoingFrames, getMaxTextMessageSize, getOutputBufferSize, getWriteTimeout, isAutoFragment, setAutoFragment, setIdleTimeout, setInputBufferSize, setMaxBinaryMessageSize, setMaxFrameSize, setMaxOutgoingFrames, setMaxTextMessageSize, setOutputBufferSize, setWriteTimeout
-
Constructor Details
-
Empty
public Empty()
-
-
Method Details
-
getNegotiatedSubProtocol
Description copied from interface:CoreSessionThe negotiated WebSocket Sub-Protocol for this session.- Specified by:
getNegotiatedSubProtocolin interfaceCoreSession- Returns:
- the negotiated WebSocket Sub-Protocol for this session.
-
getNegotiatedExtensions
Description copied from interface:CoreSessionThe negotiated WebSocket Extension Configurations for this session.- Specified by:
getNegotiatedExtensionsin interfaceCoreSession- Returns:
- the list of Negotiated Extension Configurations for this session.
-
getParameterMap
Description copied from interface:CoreSessionThe parameter map (from URI Query) for the active session.- Specified by:
getParameterMapin interfaceCoreSession- Returns:
- the immutable map of parameters
-
getProtocolVersion
Description copied from interface:CoreSessionThe activeSec-WebSocket-Version(protocol version) in use.- Specified by:
getProtocolVersionin interfaceCoreSession- Returns:
- the protocol version in use.
-
getRequestURI
Description copied from interface:CoreSessionThe active connection's Request URI. This is the URI of the upgrade request and is typically http: or https: rather than the ws: or wss: scheme.- Specified by:
getRequestURIin interfaceCoreSession- Returns:
- the absolute URI (including Query string)
-
isSecure
public boolean isSecure()Description copied from interface:CoreSessionThe active connection's Secure status indicator.- Specified by:
isSecurein interfaceCoreSession- Returns:
- true if connection is secure (similar in role to
HttpServletRequest.isSecure())
-
abort
public void abort()Description copied from interface:CoreSessionIssue a harsh abort of the underlying connection.This will terminate the connection, without sending a websocket close frame. No WebSocket Protocol close handshake will be performed.
Once called, any read/write activity on the websocket from this point will be indeterminate. This can result in the
FrameHandler.onError(Throwable, Callback)event being called indicating any issue that arises.Once the underlying connection has been determined to be closed, the
FrameHandler.onClosed(CloseStatus, Callback)event will be called.- Specified by:
abortin interfaceCoreSession
-
getBehavior
- Specified by:
getBehaviorin interfaceCoreSession- Returns:
- Client or Server behaviour
-
getWebSocketComponents
- Specified by:
getWebSocketComponentsin interfaceCoreSession- Returns:
- the WebSocketComponents instance in use for this Connection.
-
getByteBufferPool
- Specified by:
getByteBufferPoolin interfaceCoreSession- Returns:
- The shared ByteBufferPool
-
getLocalAddress
Description copied from interface:CoreSessionThe Local Socket Address for the connectionDo not assume that this will return a
InetSocketAddressin all cases. Use of various proxies, and even UnixSockets can result a SocketAddress being returned without supportingInetSocketAddress- Specified by:
getLocalAddressin interfaceCoreSession- Returns:
- the SocketAddress for the local connection, or null if not supported by Session
-
getRemoteAddress
Description copied from interface:CoreSessionThe Remote Socket Address for the connectionDo not assume that this will return a
InetSocketAddressin all cases. Use of various proxies, and even UnixSockets can result a SocketAddress being returned without supportingInetSocketAddress- Specified by:
getRemoteAddressin interfaceCoreSession- Returns:
- the SocketAddress for the remote connection, or null if not supported by Session
-
isInputOpen
public boolean isInputOpen()- Specified by:
isInputOpenin interfaceCoreSession- Returns:
- True if the websocket is open inbound
-
isOutputOpen
public boolean isOutputOpen()- Specified by:
isOutputOpenin interfaceCoreSession- Returns:
- True if the websocket is open outbound
-
flush
Description copied from interface:CoreSessionIf using BatchMode.ON or BatchMode.AUTO, trigger a flush of enqueued / batched frames.- Specified by:
flushin interfaceCoreSession- Parameters:
callback- the callback to track close frame sent (or failed)
-
close
Description copied from interface:CoreSessionInitiate close handshake, no payload (no declared status code or reason phrase)- Specified by:
closein interfaceCoreSession- Parameters:
callback- the callback to track close frame sent (or failed)
-
close
Description copied from interface:CoreSessionInitiate close handshake with provide status code and optional reason phrase.- Specified by:
closein interfaceCoreSession- Parameters:
statusCode- the status code (should be a valid status code that can be sent)reason- optional reason phrase (will be truncated automatically by implementation to fit within limits of protocol)callback- the callback to track close frame sent (or failed)
-
demand
public void demand(long n) Description copied from interface:CoreSessionManage flow control by indicating demand for handling Frames. A call toFrameHandler.onFrame(Frame, Callback)will only be made if a corresponding demand has been signaled. It is an error to call this method ifFrameHandler.isDemanding()returns false.- Specified by:
demandin interfaceCoreSession- Parameters:
n- The number of frames that can be handled (in sequential calls toFrameHandler.onFrame(Frame, Callback)). May not be negative.
-
sendFrame
Description copied from interface:OutgoingFramesA frame, and optional callback, intended for the network layer.Note: the frame can undergo many transformations in the various layers and extensions present in the implementation.
If you are implementing a mutation, you are obliged to handle the incoming WriteCallback appropriately.
- Specified by:
sendFramein interfaceOutgoingFrames- Parameters:
frame- the frame to eventually write to the network layer.callback- the callback to notify when the frame is written.batch- the batch mode requested by the sender.
-
isRsv1Used
public boolean isRsv1Used()- Specified by:
isRsv1Usedin interfaceCoreSession- Returns:
- true if an extension has been negotiated which uses the RSV1 bit.
-
isRsv2Used
public boolean isRsv2Used()- Specified by:
isRsv2Usedin interfaceCoreSession- Returns:
- true if an extension has been negotiated which uses the RSV2 bit.
-
isRsv3Used
public boolean isRsv3Used()- Specified by:
isRsv3Usedin interfaceCoreSession- Returns:
- true if an extension has been negotiated which uses the RSV3 bit.
-