Package io.gravitee.gateway.api.service
Interface SubscriptionService
public interface SubscriptionService
This manages subscriptions.
-
Method Summary
Modifier and TypeMethodDescriptiongetByApiAndClientIdAndPlan(String api, String clientId, String plan) Get subscription by its API, client ID, and plan.getByApiAndSecurityToken(String api, SecurityToken securityToken, String plan) Get subscription by its API, security token, and plan.Get subscription by its ID.voidregister(Subscription subscription) Register the given subscription.voidunregister(Subscription subscription) voidunregisterByApiId(String apiId) Unregister all subscriptions key from the given api id.
-
Method Details
-
getByApiAndClientIdAndPlan
Get subscription by its API, client ID, and plan.- Parameters:
api- Searched APIclientId- Searched client IDplan- Searched plan ID- Returns:
- Found subscription
-
getById
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 APIsecurityToken- Searched security tokenplan- Searched plan ID- Returns:
- Found subscription
-
register
Register the given subscription. Will load it if active, or unload it otherwise.- Parameters:
subscription- the subscription to save
-
unregister
-
unregisterByApiId
Unregister all subscriptions key from the given api id.- Parameters:
apiId- the api id attached to subscriptions to unregister
-