Interface EntitlementsService
public interface EntitlementsService
Manage fetching and caching of entitlements data
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiongetEntitlements(TenantContext tenant) Looks up automation entitlements data for the specified tenant.getEntitlements(TenantContext tenant, boolean bypassCache) Looks up automation entitlements data for the specified tenant.voidinvalidateEntitlementsCache(TenantContext tenant, long expectedEntitlementsVersion) This method will clear any cached entitlements data and re-fetch entitlements data from TCS, comparing the expected version of the data with what TCS currently holds.
-
Field Details
-
UNLIMITED_EXECUTIONS
static final long UNLIMITED_EXECUTIONS- See Also:
-
-
Method Details
-
getEntitlements
Looks up automation entitlements data for the specified tenant. The cache is first checked before issuing a request to the Tenant Context Service (TCS).- Parameters:
tenant- The context required to look up entitlements data- Returns:
- Optional
AutomationEntitlements. The Optional instance will be empty when there is nothing in the cache and the request to TCS either fails or returns an empty response.
-
getEntitlements
Looks up automation entitlements data for the specified tenant. If cache is bypassed, a request to the Tenant Context Service (TCS) is issued immediately. Otherwise, the cache is first checked before issuing the request.- Parameters:
tenant- The context required to look up entitlements data- Returns:
- Optional
AutomationEntitlements. If cache is bypassed, the optional instance will be empty when the request to TCS either fails or returns an empty response. Otherwise, the Optional instance will be empty when there is nothing in the cache and the request to TCS either fails or returns an empty response.
-
invalidateEntitlementsCache
This method will clear any cached entitlements data and re-fetch entitlements data from TCS, comparing the expected version of the data with what TCS currently holds. If the TCS records is older, this method should log an errorl.- Parameters:
tenant- The context required to look up entitlements data
-