Interface SubscriptionService


public interface SubscriptionService
This manages subscriptions.
  • Method Details

    • getByApiAndClientIdAndPlan

      Optional<Subscription> getByApiAndClientIdAndPlan(String api, String clientId, String plan)
      Get subscription by its API, client ID, and plan.
      Parameters:
      api - Searched API
      clientId - Searched client ID
      plan - Searched plan ID
      Returns:
      Found subscription
    • getById

      Optional<Subscription> getById(String subscriptionId)
      Get subscription by its ID.
      Parameters:
      subscriptionId - Searched subscription ID
      Returns:
      Found subscription
    • getByApiAndSecurityToken

      Optional<Subscription> getByApiAndSecurityToken(String api, SecurityToken securityToken, String plan)
      Get subscription by its API, security token, and plan.
      Parameters:
      api - Searched API
      securityToken - Searched security token
      plan - Searched plan ID
      Returns:
      Found subscription
    • register

      void register(Subscription subscription)
      Register the given subscription. Will load it if active, or unload it otherwise.
      Parameters:
      subscription - the subscription to save
    • unregister

      void unregister(Subscription subscription)
    • unregisterByApiId

      void unregisterByApiId(String apiId)
      Unregister all subscriptions key from the given api id.
      Parameters:
      apiId - the api id attached to subscriptions to unregister