Class EventSubscriptionProvider

java.lang.Object
dev.adlin.vts4j.event.EventSubscriptionProvider

public class EventSubscriptionProvider extends Object
Provider responsible for managing event subscriptions by sending subscribe or unsubscribe requests to the remote server via a request dispatcher.
  • Constructor Details

    • EventSubscriptionProvider

      public EventSubscriptionProvider()
  • Method Details

    • sendSubscribeRequest

      public @NonNull CompletableFuture<Response> sendSubscribeRequest(@NonNull Class<? extends Event> eventClass, @Nullable com.google.gson.JsonObject config, boolean subscribe)
      Sends an asynchronous event subscription or unsubscription request to the remote server.
      Parameters:
      eventClass - the class type of the event to subscribe or unsubscribe from
      config - optional configuration payload for the event subscription, can be null
      subscribe - true to subscribe, false to unsubscribe
      Returns:
      a CompletableFuture containing the server response acknowledgment
      Throws:
      IllegalArgumentException - if the provided event class is not registered in the EventRegistry