Class CopilotSession

java.lang.Object
com.vaadin.copilot.CopilotSession

public class CopilotSession extends Object
The main code for Copilot for a given VaadinSession instance.

One instance of this class is created for each VaadinSession which mean it is ok to use and store VaadinSession specific data in this class and command classes it uses, and in project manager etc.

  • Constructor Details

    • CopilotSession

      public CopilotSession(VaadinSession vaadinSession, DevToolsInterface devToolsInterface) throws IOException
      Create a new CopilotSession for the given VaadinSession.
      Parameters:
      vaadinSession - the VaadinSession
      devToolsInterface - used to send messages back to the browser
      Throws:
      IOException - if an error occurs
  • Method Details

    • handleConnect

      public void handleConnect(DevToolsInterface devToolsInterface)
    • handleMessage

      public boolean handleMessage(String command, elemental.json.JsonObject data, DevToolsInterface devToolsInterface)
      Handle a message from the client.
      Parameters:
      command - the command
      data - the data, specific to the command
      devToolsInterface - used to send messages back to the browser
      Returns:
      true if the message was handled, false otherwise