Class ChatConnection

  • All Implemented Interfaces:
    org.signal.libsignal.internal.NativeHandleGuard.Owner

    
    public abstract class ChatConnection
    extends NativeHandleGuard.SimpleOwner
                        

    Represents an established connection to the Chat Service.

    When a new ChatConnection is created, it is connected but not yet active. The registered listener will not receive any events until start is called.

    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      void start() Starts a created, but not yet active, chat connection.
      CompletableFuture<Void> disconnect() Initiates termination of the underlying connection to the Chat Service.
      CompletableFuture<ChatConnection.Response> send(ChatConnection.Request req) Sends request to the Chat Service over this channel.
      • Methods inherited from class org.signal.libsignal.internal.NativeHandleGuard.SimpleOwner

        unsafeNativeHandleWithoutGuard
      • Methods inherited from class org.signal.libsignal.internal.NativeHandleGuard.Owner

        guard, guardedMap, guardedMapChecked, guardedRun, guardedRunChecked
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • start

         void start()

        Starts a created, but not yet active, chat connection.

        This must be called on a new ChatConnection before it can start receiving incoming messages from the server. It is an error to call this method more than once on a ChatConnection.

      • disconnect

         CompletableFuture<Void> disconnect()

        Initiates termination of the underlying connection to the Chat Service. After the service is disconnected, it cannot be reconnected.

        Returns:

        a future that completes when the underlying connection is terminated.