Class ConnectionManager

    • Method Detail

      • getStateErrorInfo

        public ErrorInfo getStateErrorInfo()
      • isActive

        public boolean isActive()
      • getHost

        public java.lang.String getHost()
        host management
      • connect

        public void connect()
      • close

        public void close()
      • onAuthUpdated

        public void onAuthUpdated​(java.lang.String token,
                                  boolean waitForResponse)
                           throws AblyException
        (RTC8) For a realtime client, Auth.authorize instructs the library to obtain a token using the provided tokenParams and authOptions and upgrade the current connection to use that token; or if not currently connected, to connect with the token.
        Throws:
        AblyException
      • onAuthUpdatedAsync

        public void onAuthUpdatedAsync​(java.lang.String token,
                                       Auth.AuthUpdateResult authUpdateResult)
        Async version of onAuthUpdated that returns a Future that includes an option Ably exception
      • onAuthError

        public void onAuthError​(ErrorInfo errorInfo)
        Called when where was an error during authentication attempt
        Parameters:
        errorInfo - Error associated with unsuccessful authentication
      • onMessage

        public void onMessage​(ITransport transport,
                              ProtocolMessage message)
                       throws AblyException
        React on message from the transport
        Parameters:
        transport - transport instance or null to bypass transport correctness check (for testing)
        message -
        Throws:
        AblyException
      • checkConnectivity

        protected boolean checkConnectivity()
        Determine whether or not the client has connection to the network without reference to a specific ably host. This is to determine whether it is better to try a fallback host, or keep retrying with the default host.
        Returns:
        boolean, true if network is available
      • setLastActivity

        protected void setLastActivity​(long lastActivityTime)