Class WebSocketResource
- java.lang.Object
-
- org.apache.wicket.protocol.ws.api.WebSocketResource
-
- All Implemented Interfaces:
Serializable
,IResource
,IClusterable
public abstract class WebSocketResource extends Object implements IResource
An IResource that can be used as WebSocket endpoint- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.wicket.request.resource.IResource
IResource.Attributes
-
-
Constructor Summary
Constructors Constructor Description WebSocketResource()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
onAbort(AbortedMessage message)
A callback method called when the server has aborted the connectionprotected void
onClose(ClosedMessage message)
A callback method called when a WebSocket client has closed the connection to the endpoint handled by this WebSocketBehaviorprotected void
onConnect(ConnectedMessage message)
A callback method called when a WebSocket client has connected to the endpoint handled by this WebSocketBehaviorprotected void
onError(WebSocketRequestHandler handler, ErrorMessage message)
A callback method called when there is a communication errorprotected void
onMessage(WebSocketRequestHandler handler, BinaryMessage binaryMessage)
A callback method called when there is a binary message sent by the clientprotected void
onMessage(WebSocketRequestHandler handler, TextMessage message)
A callback method called when there is a text message sent by the clientprotected void
onPush(WebSocketRequestHandler handler, IWebSocketPushMessage message)
A callback method called when there is a message pushed/broadcasted by the server, e.g.void
respond(IResource.Attributes attributes)
Renders this resource to response using the provided attributes.
-
-
-
Constructor Detail
-
WebSocketResource
public WebSocketResource()
-
-
Method Detail
-
onPush
protected void onPush(WebSocketRequestHandler handler, IWebSocketPushMessage message)
A callback method called when there is a message pushed/broadcasted by the server, e.g. pushed by a backend service- Parameters:
handler
- The request handler that can be used to send messages to the clientmessage
- The message pushed/broadcasted by the server
-
onConnect
protected void onConnect(ConnectedMessage message)
A callback method called when a WebSocket client has connected to the endpoint handled by this WebSocketBehavior- Parameters:
message
- the connect message with the info about the client
-
onAbort
protected void onAbort(AbortedMessage message)
A callback method called when the server has aborted the connection- Parameters:
message
- the aborted message with the info about the server
-
onClose
protected void onClose(ClosedMessage message)
A callback method called when a WebSocket client has closed the connection to the endpoint handled by this WebSocketBehavior- Parameters:
message
- the close message with the info about the client
-
onError
protected void onError(WebSocketRequestHandler handler, ErrorMessage message)
A callback method called when there is a communication error- Parameters:
handler
- The request handler that can be used to send messages to the clientmessage
- The error message that that brings information about the communication error
-
onMessage
protected void onMessage(WebSocketRequestHandler handler, TextMessage message)
A callback method called when there is a text message sent by the client- Parameters:
handler
- The request handler that can be used to send messages back to the clientmessage
- The text message sent by the client
-
onMessage
protected void onMessage(WebSocketRequestHandler handler, BinaryMessage binaryMessage)
A callback method called when there is a binary message sent by the client- Parameters:
handler
- The request handler that can be used to send messages back to the clientbinaryMessage
- The binary message sent by the client
-
respond
public final void respond(IResource.Attributes attributes)
Description copied from interface:IResource
Renders this resource to response using the provided attributes.
-
-