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 connection and connection state.
  • Field Details

    • stateListeners

      public final io.aether.utils.slots.EventConsumer<Boolean> stateListeners
      Observable state listeners triggered when the connection writability or availability changes.
    • client

      protected final AetherCloudClient client
    • uri

      protected final URI uri
    • ctx

      protected final io.aether.net.fastMeta.MetaContext ctx
    • rootApi

      protected volatile RT extends io.aether.net.fastMeta.RemoteApi rootApi
  • 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

    • markReady

      protected void markReady()
      Marks the connection as fully constructed. Must be called at the very end of the subclass constructor so that deferred writability state can be delivered once all subclass fields are initialised.
    • isWritable

      protected boolean isWritable()
    • onConnectionStateChanged

      protected void onConnectionStateChanged(boolean isWritable)
    • getRootApi

      public RT getRootApi()
    • getUri

      public URI getUri()
    • 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