Package adaptlil.websocket
Class VisualizationWebsocket
java.lang.Object
org.glassfish.grizzly.websockets.WebSocketAdapter
org.glassfish.grizzly.websockets.WebSocketApplication
adaptlil.websocket.VisualizationWebsocket
- All Implemented Interfaces:
Component,org.glassfish.grizzly.websockets.WebSocketListener
public class VisualizationWebsocket
extends org.glassfish.grizzly.websockets.WebSocketApplication
implements Component
The composer handles analyzing and processing of gaze data and invocating adaptive changes. It keeps track
of current adaptovis.adaptations, classification results, and so on.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprivate AdaptationMediatorprivate final com.fasterxml.jackson.databind.ObjectMapper -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionSet<org.glassfish.grizzly.websockets.WebSocket>voidinvoke(InvokeRequestModelWs invokeRequest) Use this to send adaptovis.adaptations to the frontend Send an Invoke Adaptation Request model to the frontend.voidonClose(org.glassfish.grizzly.websockets.WebSocket socket, org.glassfish.grizzly.websockets.DataFrame frame) voidonConnect(org.glassfish.grizzly.websockets.WebSocket socket) Calls parent method onConnectvoidListener/method invoked when socket receives a message.voidSends a message to all connected websockets.voidsetMediator(Mediator mediator) Methods inherited from class org.glassfish.grizzly.websockets.WebSocketApplication
add, createSocket, createSocket, getSupportedExtensions, getSupportedProtocols, handshake, isApplicationRequest, onError, onExtensionNegotiation, remove, upgradeMethods inherited from class org.glassfish.grizzly.websockets.WebSocketAdapter
onFragment, onFragment, onMessage, onPing, onPong
-
Field Details
-
objectMapper
private final com.fasterxml.jackson.databind.ObjectMapper objectMapper -
hasResponded
protected boolean hasResponded -
mediator
-
-
Constructor Details
-
VisualizationWebsocket
public VisualizationWebsocket()Constructs websocket object.
-
-
Method Details
-
onConnect
public void onConnect(org.glassfish.grizzly.websockets.WebSocket socket) Calls parent method onConnect- Specified by:
onConnectin interfaceorg.glassfish.grizzly.websockets.WebSocketListener- Overrides:
onConnectin classorg.glassfish.grizzly.websockets.WebSocketApplication- Parameters:
socket- the newWebSocketconnection.
-
onMessage
Listener/method invoked when socket receives a message. When frontend sends a message over the socket, this method is invoked- Specified by:
onMessagein interfaceorg.glassfish.grizzly.websockets.WebSocketListener- Overrides:
onMessagein classorg.glassfish.grizzly.websockets.WebSocketAdapter- Parameters:
socket-msg-
-
invoke
Use this to send adaptovis.adaptations to the frontend Send an Invoke Adaptation Request model to the frontend.- Parameters:
invokeRequest-
-
send
Sends a message to all connected websockets.- Parameters:
msg-
-
onClose
public void onClose(org.glassfish.grizzly.websockets.WebSocket socket, org.glassfish.grizzly.websockets.DataFrame frame) - Specified by:
onClosein interfaceorg.glassfish.grizzly.websockets.WebSocketListener- Overrides:
onClosein classorg.glassfish.grizzly.websockets.WebSocketApplication
-
getWebSockets
- Overrides:
getWebSocketsin classorg.glassfish.grizzly.websockets.WebSocketApplication
-
setMediator
- Specified by:
setMediatorin interfaceComponent
-