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 Summary
FieldsModifier and TypeFieldDescriptionprotected final AetherCloudClientprotected final io.aether.net.fastMeta.MetaContextprotected RTfinal io.aether.utils.slots.EventConsumer<Boolean> Observable state listeners triggered when the connection writability or availability changes.protected final URI -
Constructor Summary
ConstructorsConstructorDescriptionConnection(AetherCloudClient client, URI uri, io.aether.net.fastMeta.FastMetaApi<LT, ?> localApiMeta, io.aether.net.fastMeta.FastMetaApi<?, RT> remoteApiMeta) -
Method Summary
Modifier and TypeMethodDescriptionio.aether.utils.futures.AFuturedestroy(boolean force) booleangetUri()inthashCode()protected booleanprotected voidMarks the connection as fully constructed.protected voidonConnectionStateChanged(boolean isWritable)
-
Field Details
-
stateListeners
Observable state listeners triggered when the connection writability or availability changes. -
client
-
uri
-
ctx
protected final io.aether.net.fastMeta.MetaContext ctx -
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
-
getUri
-
equals
-
hashCode
-
destroy
public io.aether.utils.futures.AFuture destroy(boolean force) - Specified by:
destroyin interfaceio.aether.utils.interfaces.Destroyable
-