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

    Fields
    Modifier and Type
    Field
    Description
    protected boolean
     
     
    private final com.fasterxml.jackson.databind.ObjectMapper
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructs websocket object.
  • Method Summary

    Modifier and Type
    Method
    Description
    Set<org.glassfish.grizzly.websockets.WebSocket>
     
    void
    Use this to send adaptovis.adaptations to the frontend Send an Invoke Adaptation Request model to the frontend.
    void
    onClose(org.glassfish.grizzly.websockets.WebSocket socket, org.glassfish.grizzly.websockets.DataFrame frame)
     
    void
    onConnect(org.glassfish.grizzly.websockets.WebSocket socket)
    Calls parent method onConnect
    void
    onMessage(org.glassfish.grizzly.websockets.WebSocket socket, String msg)
    Listener/method invoked when socket receives a message.
    void
    send(String msg)
    Sends a message to all connected websockets.
    void
     

    Methods inherited from class org.glassfish.grizzly.websockets.WebSocketApplication

    add, createSocket, createSocket, getSupportedExtensions, getSupportedProtocols, handshake, isApplicationRequest, onError, onExtensionNegotiation, remove, upgrade

    Methods inherited from class org.glassfish.grizzly.websockets.WebSocketAdapter

    onFragment, onFragment, onMessage, onPing, onPong

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • objectMapper

      private final com.fasterxml.jackson.databind.ObjectMapper objectMapper
    • hasResponded

      protected boolean hasResponded
    • mediator

      private AdaptationMediator 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:
      onConnect in interface org.glassfish.grizzly.websockets.WebSocketListener
      Overrides:
      onConnect in class org.glassfish.grizzly.websockets.WebSocketApplication
      Parameters:
      socket - the new WebSocket connection.
    • onMessage

      public void onMessage(org.glassfish.grizzly.websockets.WebSocket socket, String msg)
      Listener/method invoked when socket receives a message. When frontend sends a message over the socket, this method is invoked
      Specified by:
      onMessage in interface org.glassfish.grizzly.websockets.WebSocketListener
      Overrides:
      onMessage in class org.glassfish.grizzly.websockets.WebSocketAdapter
      Parameters:
      socket -
      msg -
    • invoke

      public void invoke(InvokeRequestModelWs invokeRequest)
      Use this to send adaptovis.adaptations to the frontend Send an Invoke Adaptation Request model to the frontend.
      Parameters:
      invokeRequest -
    • send

      public void send(String msg)
      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:
      onClose in interface org.glassfish.grizzly.websockets.WebSocketListener
      Overrides:
      onClose in class org.glassfish.grizzly.websockets.WebSocketApplication
    • getWebSockets

      public Set<org.glassfish.grizzly.websockets.WebSocket> getWebSockets()
      Overrides:
      getWebSockets in class org.glassfish.grizzly.websockets.WebSocketApplication
    • setMediator

      public void setMediator(Mediator mediator)
      Specified by:
      setMediator in interface Component