Class WebSocketClient
java.lang.Object
io.fluxzero.sdk.configuration.client.AbstractClient
io.fluxzero.sdk.configuration.client.WebSocketClient
- All Implemented Interfaces:
Namespaced<Client>, Client
A
Client implementation that connects to the Fluxzero Runtime using WebSocket connections.
This client enables full integration with the Fluxzero Runtime by delegating all gateway, tracking, and subsystem
communication to remote endpoints defined by the WebSocketClient.ClientConfig. It is typically used in production and testing
environments where communication with the Fluxzero Runtime is required.
Usage
WebSocketClient client = WebSocketClient.newInstance(
WebSocketClient.ClientConfig.builder()
.runtimeBaseUrl("wss://my.fluxzero.host")
.name("my-service")
.build());
Fluxzero fluxzero = Fluxzero.builder().build(client);
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classConfiguration class for creating aWebSocketClient.static classConfiguration for a tracking client assigned to a specificMessageType. -
Field Summary
Fields inherited from class AbstractClient
shutdownTasks -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the application ID under which this client instance is registered.protected EventStoreClientSubclasses must implement this method to return aEventStoreClient.protected GatewayClientcreateGatewayClient(MessageType messageType, String topic) Subclasses must implement this method to return aGatewayClientfor the given message type and topic.protected KeyValueClientSubclasses must implement this method to return aKeyValueClient.protected SchedulingClientSubclasses must implement this method to return aSchedulingClient.protected SearchClientSubclasses must implement this method to return aSearchClient.protected TrackingClientcreateTrackingClient(MessageType messageType, String topic) Subclasses must implement this method to return aTrackingClientfor the given message type and topic.forNamespace(String namespace) Creates and returns the resource scoped to the specified namespace.id()Returns the unique identifier of this client instance.name()Returns the name of this client as defined in its configuration.Returns the namespace associated with this client instance.static WebSocketClientnewInstance(WebSocketClient.ClientConfig clientConfig) voidshutDown()Shuts down this client instance, releasing any underlying resources.Methods inherited from class AbstractClient
beforeShutdown, getGatewayClient, getTrackingClient, monitorDispatchMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Client
getEventStoreClient, getGatewayClient, getKeyValueClient, getSchedulingClient, getSearchClient, getTrackingClient, unwrapMethods inherited from interface Namespaced
forDefaultNamespace
-
Constructor Details
-
WebSocketClient
public WebSocketClient()
-
-
Method Details
-
newInstance
-
name
-
id
-
applicationId
-
namespace
-
forNamespace
Description copied from interface:NamespacedCreates and returns the resource scoped to the specified namespace.- Parameters:
namespace- the namespace to which the returned resource is scoped- Returns:
- the resource associated with the specified namespace
-
createGatewayClient
Description copied from class:AbstractClientSubclasses must implement this method to return aGatewayClientfor the given message type and topic.- Specified by:
createGatewayClientin classAbstractClient
-
createTrackingClient
Description copied from class:AbstractClientSubclasses must implement this method to return aTrackingClientfor the given message type and topic.- Specified by:
createTrackingClientin classAbstractClient
-
createEventStoreClient
Description copied from class:AbstractClientSubclasses must implement this method to return aEventStoreClient.- Specified by:
createEventStoreClientin classAbstractClient
-
createSchedulingClient
Description copied from class:AbstractClientSubclasses must implement this method to return aSchedulingClient.- Specified by:
createSchedulingClientin classAbstractClient
-
createKeyValueClient
Description copied from class:AbstractClientSubclasses must implement this method to return aKeyValueClient.- Specified by:
createKeyValueClientin classAbstractClient
-
createSearchClient
Description copied from class:AbstractClientSubclasses must implement this method to return aSearchClient.- Specified by:
createSearchClientin classAbstractClient
-
shutDown
public void shutDown()Description copied from interface:ClientShuts down this client instance, releasing any underlying resources.This includes closing websocket sessions, stopping tracking, and executing registered shutdown hooks.
- Specified by:
shutDownin interfaceClient- Overrides:
shutDownin classAbstractClient
-