Class WebsocketSchedulingClient

java.lang.Object
io.fluxcapacitor.javaclient.common.websocket.AbstractWebsocketClient
io.fluxcapacitor.javaclient.scheduling.client.WebsocketSchedulingClient
All Implemented Interfaces:
SchedulingClient, AutoCloseable

public class WebsocketSchedulingClient extends AbstractWebsocketClient implements SchedulingClient
WebSocket-based implementation of the SchedulingClient interface that communicates with the Flux Platform.

This client is responsible for scheduling, cancelling, and querying deferred messages (schedules) over a WebSocket connection. It acts as the transport layer for the MessageScheduler.

Usage is typically indirect via high-level APIs like FluxCapacitor.schedule(...) or the MessageScheduler. Direct interaction with this client is uncommon in most application code.

See Also:
  • Constructor Details

    • WebsocketSchedulingClient

      public WebsocketSchedulingClient(String endPointUrl, WebSocketClient client)
      Constructs a scheduling client connected to the given endpoint URL.
      Parameters:
      endPointUrl - The endpoint URL of the Flux Platform scheduling gateway.
      client - The Flux WebSocketClient configuration to use.
    • WebsocketSchedulingClient

      public WebsocketSchedulingClient(URI endpointUri, WebSocketClient client)
      Constructs a scheduling client connected to the given endpoint URI.
      Parameters:
      endpointUri - The URI of the scheduling gateway.
      client - The Flux WebSocketClient configuration to use.
    • WebsocketSchedulingClient

      public WebsocketSchedulingClient(URI endpointUri, WebSocketClient client, boolean sendMetrics)
      Constructs a scheduling client connected to the given endpoint URI with an option to enable or disable metrics tracking.
      Parameters:
      endpointUri - The URI of the scheduling gateway.
      client - The WebSocket client configuration.
      sendMetrics - Whether to send metrics about schedule operations.
  • Method Details

    • schedule

      public CompletableFuture<Void> schedule(Guarantee guarantee, SerializedSchedule... schedules)
      Description copied from interface: SchedulingClient
      Schedule one or more serialized schedules with a specified Guarantee.
      Specified by:
      schedule in interface SchedulingClient
      Parameters:
      guarantee - Delivery guarantee to apply (e.g., none, sent, stored).
      schedules - One or more schedules to register.
      Returns:
      A future that completes when the scheduling is acknowledged.
    • cancelSchedule

      public CompletableFuture<Void> cancelSchedule(String scheduleId, Guarantee guarantee)
      Description copied from interface: SchedulingClient
      Cancel a scheduled message using the provided delivery guarantee.
      Specified by:
      cancelSchedule in interface SchedulingClient
      Parameters:
      scheduleId - The identifier of the schedule to cancel.
      guarantee - Delivery guarantee for the cancellation request.
      Returns:
      A future that completes when the cancellation is processed.
    • getSchedule

      public SerializedSchedule getSchedule(String scheduleId)
      Description copied from interface: SchedulingClient
      Retrieves the serialized schedule associated with the given ID.
      Specified by:
      getSchedule in interface SchedulingClient
      Parameters:
      scheduleId - The ID of the schedule to retrieve.
      Returns:
      The matching SerializedSchedule, or null if none is found.