Top Description Inners Fields Constructors Methods
org.eclipse.jetty.websocket.core

public Class WebSocketCoreSession

extends Object
implements CoreSession, Dumpable
Class Inheritance
All Implemented Interfaces
org.eclipse.jetty.util.component.Dumpable, org.eclipse.jetty.websocket.core.CoreSession, org.eclipse.jetty.websocket.core.Configuration, org.eclipse.jetty.websocket.core.IncomingFrames, org.eclipse.jetty.websocket.core.OutgoingFrames
Imports
java.io.IOException, java.net.SocketAddress, .SocketTimeoutException, .URI, java.nio.channels.ClosedChannelException, .WritePendingException, java.time.Duration, java.util.List, .Map, java.util.concurrent.Executor, .TimeoutException, java.util.concurrent.atomic.AtomicInteger, org.eclipse.jetty.io.ByteBufferPool, org.eclipse.jetty.util.Callback, org.eclipse.jetty.util.component.Dumpable, org.eclipse.jetty.websocket.core.exception.CloseException, .ProtocolException, .WebSocketTimeoutException, .WebSocketWriteTimeoutException, org.eclipse.jetty.websocket.core.internal.FrameFlusher, .WebSocketSessionState, org.eclipse.jetty.websocket.core.util.FragmentingFlusher, .FrameValidation, org.slf4j.Logger, .LoggerFactory

The Core WebSocket Session.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class
private class
private class

Field Summary

Modifier and TypeField and Description
private boolean
private final Behavior
private ClassLoader
private final WebSocketComponents
private WebSocketConnection
private final ExtensionStack
private final WebSocketCoreSession.Flusher
private final FrameHandler
private Duration
private int
private static final Logger
private long
private long
private int
private long
private final Negotiated
private static final CloseStatus
private final AtomicInteger
private int
private final WebSocketSessionState
private Duration

Constructor Summary

AccessConstructor and Description
public
WebSocketCoreSession(FrameHandler handler, Behavior behavior, Negotiated negotiated, WebSocketComponents components)

Method Summary

Modifier and TypeMethod and Description
public void
abort()

Implements org.eclipse.jetty.websocket.core.CoreSession.abort.

Issue a harsh abort of the underlying connection.

public void
close(Callback
the callback to track close frame sent (or failed).
callback
)

Implements org.eclipse.jetty.websocket.core.CoreSession.close.

Initiate close handshake, no payload (no declared status code or reason phrase).

public void
close(int
the status code (should be a valid status code that can be sent).
statusCode
,
String
optional reason phrase (will be truncated automatically by implementation to fit within limits of protocol).
reason
,
Callback
the callback to track close frame sent (or failed).
callback
)

Implements org.eclipse.jetty.websocket.core.CoreSession.close.

Initiate close handshake with provided status code and optional reason phrase.

public void
close(CloseStatus
the close status containing (statusCode, reason, and optional Throwable cause).
closeStatus
,
Callback
the callback to track close frame sent (or failed).
callback
)

Overrides default org.eclipse.jetty.websocket.core.CoreSession.close.

Initiate close handshake with a provided CloseStatus.

private void
closeConnection(CloseStatus closeStatus, Callback callback)

public void
demand()

Implements org.eclipse.jetty.websocket.core.CoreSession.demand.

Manages flow control by indicating demand for a WebSocket frame.

public String
public void
dump(Appendable
The appendable to dump to
out
,
String
The indent to apply after any new lines.
indent
)

Implements org.eclipse.jetty.util.component.Dumpable.dump.

Dump this object (and children) into an Appendable using the provided indent after any new lines.

public void
public Behavior
public ByteBufferPool
public ClassLoader
public WebSocketConnection
public Executor
public ExtensionStack
public FrameHandler
public Duration
public int
public SocketAddress
getLocalAddress()

Implements org.eclipse.jetty.websocket.core.CoreSession.getLocalAddress.

The Local Socket Address for the connection

Do not assume that this will return a InetSocketAddress in all cases.

public long
public long
public int
getMaxOutgoingFrames()

Implements org.eclipse.jetty.websocket.core.Configuration.getMaxOutgoingFrames.

Get the maximum number of data frames allowed to be waiting to be sent at any one time.

public long
public List<ExtensionConfig>
getNegotiatedExtensions()

Implements org.eclipse.jetty.websocket.core.CoreSession.getNegotiatedExtensions.

The negotiated WebSocket Extension Configurations for this session.

public String
public int
public Map<String, List<String>>
getParameterMap()

Implements org.eclipse.jetty.websocket.core.CoreSession.getParameterMap.

The parameter map (from URI Query) for the active session.

public String
getProtocolVersion()

Implements org.eclipse.jetty.websocket.core.CoreSession.getProtocolVersion.

The active Sec-WebSocket-Version (protocol version) in use.

public SocketAddress
getRemoteAddress()

Implements org.eclipse.jetty.websocket.core.CoreSession.getRemoteAddress.

The Remote Socket Address for the connection

Do not assume that this will return a InetSocketAddress in all cases.

public URI
getRequestURI()

Implements org.eclipse.jetty.websocket.core.CoreSession.getRequestURI.

The active connection's Request URI.

public WebSocketComponents
public Duration
protected void
handle(Runnable
the runnable to execute.
runnable
)

Can be overridden to scope into the correct classloader before calling application code.

public boolean
public boolean
public boolean
public boolean
public boolean
public boolean
public boolean
public boolean
isSecure()

Implements org.eclipse.jetty.websocket.core.CoreSession.isSecure.

The active connection's Secure status indicator.

public void
onEof()

Used to notify the WebSocketCoreSession that EOF has been read or the connection has been closed.

public void
onFrame(Frame
the frame to process.
frame
,
Callback
the read completion.
callback
)

Implements org.eclipse.jetty.websocket.core.IncomingFrames.onFrame.

Process the incoming frame.

public void
onOpen()

Used to notify the WebSocketCoreSession that the connection has been opened.

public void
processConnectionError(Throwable
the cause
cause
,
Callback
the callback on completion of error handling
callback
)

Process an Error that originated from the connection.

public void
processHandlerError(Throwable
the cause
cause
,
Callback
the callback on completion of error handling
callback
)

Process an Error that originated from the handler.

public void
sendFrame(Frame
the frame to eventually write to the network layer.
frame
,
Callback
the callback to notify when the frame is written.
callback
,
boolean
the batch mode requested by the sender.
batch
)

Implements org.eclipse.jetty.websocket.core.OutgoingFrames.sendFrame.

A frame, and optional callback, intended for the network layer.

public void
public void
public void
setIdleTimeout(Duration
the timeout duration (timeout <= 0 implies an infinite timeout)
timeout
)

Implements org.eclipse.jetty.websocket.core.Configuration.setIdleTimeout.

Set the Idle Timeout.

public void
public void
public void
public void
setMaxOutgoingFrames(int
the max number of frames.
maxOutgoingFrames
)

Implements org.eclipse.jetty.websocket.core.Configuration.setMaxOutgoingFrames.

Set the maximum number of data frames allowed to be waiting to be sent at any one time.

public void
public void
public void
setWebSocketConnection(WebSocketConnection
the websocket connection.
connection
)

Used to set the WebSocketConnection on this WebSocketCoreSession.

public void
setWriteTimeout(Duration
the timeout duration (timeout <= 0 implies an infinite timeout)
timeout
)

Implements org.eclipse.jetty.websocket.core.Configuration.setWriteTimeout.

Set the Write Timeout.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait