Class WebSocketSession
- java.lang.Object
-
- org.eclipse.jetty.util.component.AbstractLifeCycle
-
- org.eclipse.jetty.util.component.ContainerLifeCycle
-
- org.eclipse.jetty.websocket.common.WebSocketSession
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
,Connection.Listener
,Container
,Destroyable
,Dumpable
,Dumpable.DumpableContainer
,LifeCycle
,IncomingFrames
,OutgoingFrames
,Session
,RemoteEndpointFactory
,WebSocketSessionScope
@ManagedObject("A Jetty WebSocket Session") @Deprecated(since="2021-05-27") public class WebSocketSession extends ContainerLifeCycle implements Session, RemoteEndpointFactory, WebSocketSessionScope, IncomingFrames, OutgoingFrames, Connection.Listener
Deprecated.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
AbstractLifeCycle.AbstractLifeCycleListener
-
Nested classes/interfaces inherited from interface org.eclipse.jetty.io.Connection.Listener
Connection.Listener.Adapter
-
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Container
Container.InheritedListener, Container.Listener
-
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Dumpable
Dumpable.DumpableContainer
-
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle
LifeCycle.Listener
-
-
Constructor Summary
Constructors Constructor Description WebSocketSession(WebSocketContainerScope containerScope, java.net.URI requestURI, EventDriver websocket, LogicalConnection connection)
Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
callApplicationOnClose(CloseInfo closeInfo)
Deprecated.void
callApplicationOnError(java.lang.Throwable cause)
Deprecated.void
close()
Deprecated.Request a close of the current conversation with a normal status code and no reason phrase.void
close(int statusCode, java.lang.String reason)
Deprecated.Send a websocket Close frame, with status code.void
close(java.lang.Throwable cause)
Deprecated.Close the active session based on the throwablevoid
close(CloseStatus closeStatus)
Deprecated.Request Close the current conversation, giving a reason for the closure.void
disconnect()
Deprecated.Harsh disconnectvoid
dispatch(java.lang.Runnable runnable)
Deprecated.java.lang.String
dumpSelf()
Deprecated.The description of this/self found in the dump.BatchMode
getBatchMode()
Deprecated.ByteBufferPool
getBufferPool()
Deprecated.java.lang.ClassLoader
getClassLoader()
Deprecated.LogicalConnection
getConnection()
Deprecated.WebSocketContainerScope
getContainerScope()
Deprecated.The parentWebSocketContainerScope
for this session scope.ExtensionFactory
getExtensionFactory()
Deprecated.long
getIdleTimeout()
Deprecated.The idle timeout in millisecondsIncomingFrames
getIncomingHandler()
Deprecated.java.net.InetSocketAddress
getLocalAddress()
Deprecated.Get the address of the local side.OutgoingFrames
getOutgoingHandler()
Deprecated.WebSocketPolicy
getPolicy()
Deprecated.Access the (now read-only)WebSocketPolicy
in use for this connection.java.lang.String
getProtocolVersion()
Deprecated.Returns the version of the websocket protocol currently being used.RemoteEndpoint
getRemote()
Deprecated.Return a reference to the RemoteEndpoint object representing the other end of this conversation.java.net.InetSocketAddress
getRemoteAddress()
Deprecated.Get the address of the remote side.java.net.URI
getRequestURI()
Deprecated.UpgradeRequest
getUpgradeRequest()
Deprecated.Get the UpgradeRequest used to create this sessionUpgradeResponse
getUpgradeResponse()
Deprecated.Get the UpgradeResponse used to create this sessionWebSocketSession
getWebSocketSession()
Deprecated.ActiveWebSocketSession
associated with this scope.void
incomingFrame(Frame frame)
Deprecated.Incoming Raw Frames from Parserboolean
isOpen()
Deprecated.Return true if and only if the underlying socket is open.boolean
isSecure()
Deprecated.Return true if and only if the underlying socket is using a secure transport.WebSocketRemoteEndpoint
newRemoteEndpoint(LogicalConnection connection, OutgoingFrames outgoingFrames, BatchMode batchMode)
Deprecated.void
onClosed(Connection connection)
Deprecated.Jetty Connection onSessionClosed eventvoid
onOpened(Connection connection)
Deprecated.Jetty Connection onOpen eventvoid
open()
Deprecated.Open/Activate the sessionvoid
outgoingFrame(Frame frame, WriteCallback callback, BatchMode batchMode)
Deprecated.A frame, and optional callback, intended for the network layer.void
setExtensionFactory(ExtensionFactory extensionFactory)
Deprecated.void
setFuture(java.util.concurrent.CompletableFuture<Session> fut)
Deprecated.void
setIdleTimeout(long ms)
Deprecated.Set the timeout in millisecondsvoid
setOutgoingHandler(OutgoingFrames outgoing)
Deprecated.void
setPolicy(WebSocketPolicy policy)
Deprecated.void
setUpgradeRequest(UpgradeRequest request)
Deprecated.void
setUpgradeResponse(UpgradeResponse response)
Deprecated.SuspendToken
suspend()
Deprecated.Suspend the incoming read events on the connection.java.lang.String
toString()
Deprecated.-
Methods inherited from class org.eclipse.jetty.util.component.ContainerLifeCycle
addBean, addBean, addEventListener, addManaged, contains, destroy, dump, dump, dump, dump, dump, dumpObject, dumpStdErr, getBean, getBeans, getBeans, getContainedBeans, isAuto, isManaged, isUnmanaged, manage, removeBean, removeBeans, removeEventListener, setBeans, setStopTimeout, unmanage, updateBean, updateBean, updateBeans
-
Methods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
addLifeCycleListener, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.eclipse.jetty.util.component.Dumpable.DumpableContainer
isDumpable
-
-
-
-
Constructor Detail
-
WebSocketSession
public WebSocketSession(WebSocketContainerScope containerScope, java.net.URI requestURI, EventDriver websocket, LogicalConnection connection)
Deprecated.
-
-
Method Detail
-
close
public void close(java.lang.Throwable cause)
Deprecated.Close the active session based on the throwable- Parameters:
cause
- the cause for closing the connection
-
close
public void close()
Deprecated.Description copied from interface:Session
Request a close of the current conversation with a normal status code and no reason phrase.This will enqueue a graceful close to the remote endpoint.
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Specified by:
close
in interfaceSession
- See Also:
Session.close(CloseStatus)
,Session.close(int, String)
,Session.disconnect()
-
close
public void close(CloseStatus closeStatus)
Deprecated.Description copied from interface:Session
Request Close the current conversation, giving a reason for the closure. Note the websocket spec defines the acceptable uses of status codes and reason phrases.This will enqueue a graceful close to the remote endpoint.
- Specified by:
close
in interfaceSession
- Parameters:
closeStatus
- the reason for the closure- See Also:
Session.close()
,Session.close(int, String)
,Session.disconnect()
-
close
public void close(int statusCode, java.lang.String reason)
Deprecated.Description copied from interface:Session
Send a websocket Close frame, with status code.This will enqueue a graceful close to the remote endpoint.
- Specified by:
close
in interfaceSession
- Parameters:
statusCode
- the status codereason
- the (optional) reason. (can be null for no reason)- See Also:
StatusCode
,Session.close()
,Session.close(CloseStatus)
,Session.disconnect()
-
disconnect
public void disconnect()
Deprecated.Harsh disconnect- Specified by:
disconnect
in interfaceSession
- See Also:
Session.close()
,Session.close(CloseStatus)
,Session.close(int, String)
,Session.disconnect()
-
dispatch
public void dispatch(java.lang.Runnable runnable)
Deprecated.
-
dumpSelf
public java.lang.String dumpSelf()
Deprecated.Description copied from interface:Dumpable
The description of this/self found in the dump. Allows for alternative representation of Object other then .toString() where the long form output of toString() is represented in a cleaner way within the dump infrastructure.
-
getBufferPool
public ByteBufferPool getBufferPool()
Deprecated.
-
getClassLoader
public java.lang.ClassLoader getClassLoader()
Deprecated.
-
getConnection
public LogicalConnection getConnection()
Deprecated.
-
getContainerScope
public WebSocketContainerScope getContainerScope()
Deprecated.Description copied from interface:WebSocketSessionScope
The parentWebSocketContainerScope
for this session scope.- Specified by:
getContainerScope
in interfaceWebSocketSessionScope
- Returns:
- the websocket container scope
-
getExtensionFactory
public ExtensionFactory getExtensionFactory()
Deprecated.
-
getIdleTimeout
public long getIdleTimeout()
Deprecated.The idle timeout in milliseconds- Specified by:
getIdleTimeout
in interfaceSession
- Returns:
- the timeout in milliseconds.
-
getIncomingHandler
@ManagedAttribute(readonly=true) public IncomingFrames getIncomingHandler()
Deprecated.
-
getLocalAddress
public java.net.InetSocketAddress getLocalAddress()
Deprecated.Description copied from interface:Session
Get the address of the local side.- Specified by:
getLocalAddress
in interfaceSession
- Returns:
- the local side address
-
getOutgoingHandler
@ManagedAttribute(readonly=true) public OutgoingFrames getOutgoingHandler()
Deprecated.
-
getPolicy
public WebSocketPolicy getPolicy()
Deprecated.Description copied from interface:Session
Access the (now read-only)WebSocketPolicy
in use for this connection.
-
getProtocolVersion
public java.lang.String getProtocolVersion()
Deprecated.Description copied from interface:Session
Returns the version of the websocket protocol currently being used. This is taken as the value of the Sec-WebSocket-Version header used in the opening handshake. i.e. "13".- Specified by:
getProtocolVersion
in interfaceSession
- Returns:
- the protocol version
-
getRemote
public RemoteEndpoint getRemote()
Deprecated.Description copied from interface:Session
Return a reference to the RemoteEndpoint object representing the other end of this conversation.
-
getRemoteAddress
public java.net.InetSocketAddress getRemoteAddress()
Deprecated.Description copied from interface:Session
Get the address of the remote side.- Specified by:
getRemoteAddress
in interfaceSession
- Returns:
- the remote side address
-
getRequestURI
public java.net.URI getRequestURI()
Deprecated.
-
getUpgradeRequest
public UpgradeRequest getUpgradeRequest()
Deprecated.Description copied from interface:Session
Get the UpgradeRequest used to create this session- Specified by:
getUpgradeRequest
in interfaceSession
- Returns:
- the UpgradeRequest used to create this session
-
getUpgradeResponse
public UpgradeResponse getUpgradeResponse()
Deprecated.Description copied from interface:Session
Get the UpgradeResponse used to create this session- Specified by:
getUpgradeResponse
in interfaceSession
- Returns:
- the UpgradeResponse used to create this session
-
getWebSocketSession
public WebSocketSession getWebSocketSession()
Deprecated.Description copied from interface:WebSocketSessionScope
ActiveWebSocketSession
associated with this scope.- Specified by:
getWebSocketSession
in interfaceWebSocketSessionScope
- Returns:
- the websocket session
-
incomingFrame
public void incomingFrame(Frame frame)
Deprecated.Incoming Raw Frames from Parser- Specified by:
incomingFrame
in interfaceIncomingFrames
- Parameters:
frame
- the frame to process
-
outgoingFrame
public void outgoingFrame(Frame frame, WriteCallback callback, BatchMode batchMode)
Deprecated.Description copied from interface:OutgoingFrames
A 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:
outgoingFrame
in interfaceOutgoingFrames
- Parameters:
frame
- the frame to eventually write to the network layer.callback
- the callback to notify when the frame is written.batchMode
- the batch mode requested by the sender.
-
isOpen
public boolean isOpen()
Deprecated.Description copied from interface:Session
Return true if and only if the underlying socket is open.
-
isSecure
public boolean isSecure()
Deprecated.Description copied from interface:Session
Return true if and only if the underlying socket is using a secure transport.
-
callApplicationOnClose
public void callApplicationOnClose(CloseInfo closeInfo)
Deprecated.
-
callApplicationOnError
public void callApplicationOnError(java.lang.Throwable cause)
Deprecated.
-
onClosed
public void onClosed(Connection connection)
Deprecated.Jetty Connection onSessionClosed event- Specified by:
onClosed
in interfaceConnection.Listener
- Parameters:
connection
- the connection that was closed
-
onOpened
public void onOpened(Connection connection)
Deprecated.Jetty Connection onOpen event- Specified by:
onOpened
in interfaceConnection.Listener
- Parameters:
connection
- the connection that was opened
-
newRemoteEndpoint
public WebSocketRemoteEndpoint newRemoteEndpoint(LogicalConnection connection, OutgoingFrames outgoingFrames, BatchMode batchMode)
Deprecated.- Specified by:
newRemoteEndpoint
in interfaceRemoteEndpointFactory
-
open
public void open()
Deprecated.Open/Activate the session
-
setExtensionFactory
public void setExtensionFactory(ExtensionFactory extensionFactory)
Deprecated.
-
setFuture
public void setFuture(java.util.concurrent.CompletableFuture<Session> fut)
Deprecated.
-
setIdleTimeout
public void setIdleTimeout(long ms)
Deprecated.Set the timeout in milliseconds- Specified by:
setIdleTimeout
in interfaceSession
- Parameters:
ms
- the number of milliseconds.
-
setOutgoingHandler
public void setOutgoingHandler(OutgoingFrames outgoing)
Deprecated.
-
setPolicy
@Deprecated public void setPolicy(WebSocketPolicy policy)
Deprecated.
-
setUpgradeRequest
public void setUpgradeRequest(UpgradeRequest request)
Deprecated.
-
setUpgradeResponse
public void setUpgradeResponse(UpgradeResponse response)
Deprecated.
-
suspend
public SuspendToken suspend()
Deprecated.Description copied from interface:Session
Suspend the incoming read events on the connection.
-
getBatchMode
public BatchMode getBatchMode()
Deprecated.- Returns:
- the default (initial) value for the batching mode.
-
toString
public java.lang.String toString()
Deprecated.- Overrides:
toString
in classAbstractLifeCycle
-
-