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 Summary
FieldsModifier and TypeFieldDescriptionprotected final AetherCloudClientprotected final io.aether.utils.futures.ARFuture<RT> protected 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) booleanio.aether.utils.futures.ARFuture<RT> inthashCode()protected voidonConnectionStateChanged(boolean isWritable) Hook method called when the underlying transport writability changes.
-
Field Details
-
client
-
uri
-
connectFuture
protected final io.aether.utils.futures.ARFuture<RT extends io.aether.net.fastMeta.RemoteApi> connectFuture -
fastMetaClient
-
rootApi
-
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
-
getRootApiFuture
-
equals
-
hashCode
-
destroy
public io.aether.utils.futures.AFuture destroy(boolean force) - Specified by:
destroyin interfaceio.aether.utils.interfaces.Destroyable
-