Package org.eclipse.jetty.websocket.api
Class WebSocketAdapter
- java.lang.Object
-
- org.eclipse.jetty.websocket.api.WebSocketAdapter
-
- All Implemented Interfaces:
WebSocketConnectionListener
,WebSocketListener
- Direct Known Subclasses:
NoOpEndpoint
@Deprecated(since="2021-05-27") public class WebSocketAdapter extends Object implements WebSocketListener
Deprecated.The Eclipse Jetty and Apache Felix Http Jetty packages are no longer supported.Default implementation of theWebSocketListener
.Convenient abstract class to base standard WebSocket implementations off of.
-
-
Constructor Summary
Constructors Constructor Description WebSocketAdapter()
Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description RemoteEndpoint
getRemote()
Deprecated.Session
getSession()
Deprecated.boolean
isConnected()
Deprecated.boolean
isNotConnected()
Deprecated.void
onWebSocketBinary(byte[] payload, int offset, int len)
Deprecated.A WebSocket binary frame has been received.void
onWebSocketClose(int statusCode, String reason)
Deprecated.A Close Event was received.void
onWebSocketConnect(Session sess)
Deprecated.A WebSocketSession
has connected successfully and is ready to be used.void
onWebSocketError(Throwable cause)
Deprecated.A WebSocket exception has occurred.void
onWebSocketText(String message)
Deprecated.A WebSocket Text frame was received.
-
-
-
Method Detail
-
getRemote
public RemoteEndpoint getRemote()
Deprecated.
-
getSession
public Session getSession()
Deprecated.
-
isConnected
public boolean isConnected()
Deprecated.
-
isNotConnected
public boolean isNotConnected()
Deprecated.
-
onWebSocketBinary
public void onWebSocketBinary(byte[] payload, int offset, int len)
Deprecated.Description copied from interface:WebSocketListener
A WebSocket binary frame has been received.- Specified by:
onWebSocketBinary
in interfaceWebSocketListener
- Parameters:
payload
- the raw payload array receivedoffset
- the offset in the payload array where the data startslen
- the length of bytes in the payload
-
onWebSocketClose
public void onWebSocketClose(int statusCode, String reason)
Deprecated.Description copied from interface:WebSocketConnectionListener
A Close Event was received.The underlying Connection will be considered closed at this point.
- Specified by:
onWebSocketClose
in interfaceWebSocketConnectionListener
- Parameters:
statusCode
- the close status code. (SeeStatusCode
)reason
- the optional reason for the close.
-
onWebSocketConnect
public void onWebSocketConnect(Session sess)
Deprecated.Description copied from interface:WebSocketConnectionListener
A WebSocketSession
has connected successfully and is ready to be used.Note: It is a good idea to track this session as a field in your object so that you can write messages back via the
RemoteEndpoint
- Specified by:
onWebSocketConnect
in interfaceWebSocketConnectionListener
- Parameters:
sess
- the websocket session.
-
onWebSocketError
public void onWebSocketError(Throwable cause)
Deprecated.Description copied from interface:WebSocketConnectionListener
A WebSocket exception has occurred.This is a way for the internal implementation to notify of exceptions occurred during the processing of websocket.
Usually this occurs from bad / malformed incoming packets. (example: bad UTF8 data, frames that are too big, violations of the spec)
This will result in the
Session
being closed by the implementing side.- Specified by:
onWebSocketError
in interfaceWebSocketConnectionListener
- Parameters:
cause
- the error that occurred.
-
onWebSocketText
public void onWebSocketText(String message)
Deprecated.Description copied from interface:WebSocketListener
A WebSocket Text frame was received.- Specified by:
onWebSocketText
in interfaceWebSocketListener
- Parameters:
message
- the message
-
-