Class Connection<LT, RT extends io.aether.net.fastMeta.RemoteApi>

java.lang.Object
io.aether.cloud.client.Connection<LT,RT>
All Implemented Interfaces:
io.aether.utils.interfaces.Destroyable
Direct Known Subclasses:
ConnectionRegistration, ConnectionWork

public abstract class Connection<LT, RT extends io.aether.net.fastMeta.RemoteApi> extends Object implements io.aether.utils.interfaces.Destroyable
Abstract base class for handling connections in the Aether Cloud client. Manages the lifecycle of the underlying FastMetaClient and connection state.
  • Field Details

    • client

      protected final AetherCloudClient client
    • uri

      protected final URI uri
    • connectFuture

      protected final io.aether.utils.futures.ARFuture<RT extends io.aether.net.fastMeta.RemoteApi> connectFuture
    • fastMetaClient

      protected final io.aether.net.fastMeta.FastMetaClient<LT, RT extends io.aether.net.fastMeta.RemoteApi> fastMetaClient
    • rootApi

      protected volatile RT extends io.aether.net.fastMeta.RemoteApi rootApi
    • stateListeners

      public final io.aether.utils.slots.EventConsumer<Boolean> stateListeners
      Observable state listeners triggered when the connection writability or availability changes. The boolean value represents the current 'isWritable' status.
  • Constructor Details

    • Connection

      public Connection(AetherCloudClient client, URI uri, io.aether.net.fastMeta.FastMetaApi<LT,?> localApiMeta, io.aether.net.fastMeta.FastMetaApi<?,RT> remoteApiMeta)
  • Method Details

    • onConnectionStateChanged

      protected void onConnectionStateChanged(boolean isWritable)
      Hook method called when the underlying transport writability changes. Can be overridden by subclasses to react to reconnects (e.g., reset auth state).
      Parameters:
      isWritable - True if the connection is now writable (connected), false otherwise.
    • getRootApi

      public RT getRootApi()
    • getRootApiFuture

      public io.aether.utils.futures.ARFuture<RT> getRootApiFuture()
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • destroy

      public io.aether.utils.futures.AFuture destroy(boolean force)
      Specified by:
      destroy in interface io.aether.utils.interfaces.Destroyable