Class ServiceUrlBuilder
java.lang.Object
io.fluxzero.sdk.common.websocket.ServiceUrlBuilder
Utility class for constructing fully qualified service endpoint URLs for various Fluxzero Runtime features
based on the client's configuration.
This class supports generating URLs for services such as message production and consumption, event sourcing,
key-value storage, search, and scheduling. It combines static path segments (from ServicePathBuilder)
with dynamic query parameters like client ID, name, compression settings, and topic filters from the provided
WebSocketClient.ClientConfig.
This class is typically used internally by WebSocket-based gateway clients to determine which Runtime endpoint to connect to.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringbuildUrl(WebSocketClient.ClientConfig clientConfig, String path) Constructs a base URL for a Fluxzero client for a given service path.static StringeventSourcingUrl(WebSocketClient.ClientConfig clientConfig) Constructs the URL for accessing the event sourcing stream.static StringgatewayUrl(MessageType messageType, String topic, WebSocketClient.ClientConfig clientConfig) Builds the URL to send messages to a gateway endpoint for the specified message type and topic.static StringkeyValueUrl(WebSocketClient.ClientConfig clientConfig) Constructs the URL for accessing the distributed key-value store service.static StringschedulingUrl(WebSocketClient.ClientConfig clientConfig) Constructs the URL for accessing the time-based message scheduling service.static StringsearchUrl(WebSocketClient.ClientConfig clientConfig) Constructs the URL for accessing the document and handler state search service.static StringtrackingUrl(MessageType messageType, String topic, WebSocketClient.ClientConfig clientConfig) Builds the URL to subscribe to messages from a tracking endpoint for the specified message type and topic.
-
Constructor Details
-
ServiceUrlBuilder
public ServiceUrlBuilder()
-
-
Method Details
-
gatewayUrl
public static String gatewayUrl(MessageType messageType, String topic, WebSocketClient.ClientConfig clientConfig) Builds the URL to send messages to a gateway endpoint for the specified message type and topic.- Parameters:
messageType- the type of message (e.g., COMMAND, EVENT, QUERY)topic- the topic name (optional, may be null)clientConfig- the WebSocket client configuration- Returns:
- the complete gateway URL with query parameters
-
trackingUrl
public static String trackingUrl(MessageType messageType, String topic, WebSocketClient.ClientConfig clientConfig) Builds the URL to subscribe to messages from a tracking endpoint for the specified message type and topic.- Parameters:
messageType- the type of message (e.g., COMMAND, EVENT, QUERY)topic- the topic to subscribe to (optional)clientConfig- the WebSocket client configuration- Returns:
- the complete tracking URL with query parameters
-
eventSourcingUrl
Constructs the URL for accessing the event sourcing stream.- Parameters:
clientConfig- the WebSocket client configuration- Returns:
- the complete URL for the event sourcing service
-
keyValueUrl
Constructs the URL for accessing the distributed key-value store service.- Parameters:
clientConfig- the WebSocket client configuration- Returns:
- the complete URL for the key-value service
-
searchUrl
Constructs the URL for accessing the document and handler state search service.- Parameters:
clientConfig- the WebSocket client configuration- Returns:
- the complete URL for the search service
-
schedulingUrl
Constructs the URL for accessing the time-based message scheduling service.- Parameters:
clientConfig- the WebSocket client configuration- Returns:
- the complete URL for the scheduling service
-
buildUrl
Constructs a base URL for a Fluxzero client for a given service path.- Parameters:
clientConfig- the WebSocket client configurationpath- the service-specific path fromServicePathBuilder- Returns:
- the constructed base URL with encoded query parameters
-