Class ServerConnection

java.lang.Object
com.levigo.jadice.web.conn.client.ServerConnection

public abstract class ServerConnection extends Object
This is the abstract connection to the server. Over a WebtoolkitConnection services can be called, checked if they are available and the current connection state can be requested.
  • Constructor Details

    • ServerConnection

      public ServerConnection()
  • Method Details

    • get

      public static ServerConnection get()
      Returns the previous created ServerConnection using the ServerConnectionBuilder if one was created or null if no connection was created.
      Returns:
      the ServerConnection
    • set

      protected static void set(ServerConnection connection)
      Sets a ServerConnection created by the ServerConnectionBuilder. The connection is automatically set by the constructor of the implementation.
      Parameters:
      connection - the created ServerConnection
    • reset

      protected static void reset()
      Reset the provided ServerConnection instance for tests.
    • getTransportClient

      public abstract TransportClient getTransportClient()
      Returns the underlying network implementation. See: TransportClient.
      Returns:
      the TransportClient
    • getServerAddress

      public abstract String getServerAddress()
      Returns server address currently in use.
      Returns:
      the address of the server the client is connected to
    • setAuthenticationInfo

      public abstract void setAuthenticationInfo(String authenticationInfo)
      Set or update the information provided by the client used to authenticate document accesses in the backend. The actual information is integration specific. It could, for example, be a JWT/OAuth token, a session-based token, some form of encoded user-id and credentials etc.

      For authentication information with a limited validity period care must be taken to re-set/update the information with renewed

      Parameters:
      authenticationInfo - the authentication info to send
    • send

      public abstract void send(Message message, boolean highPriority)
    • send

      public abstract ServerConnection.Cancelable send(Message message, boolean highPriority, ConversationMessageListener.ConversationListener convListener)