Interface EntitlementsService


public interface EntitlementsService
Manage fetching and caching of entitlements data
  • Field Details

  • Method Details

    • getEntitlements

      Optional<AutomationEntitlements> getEntitlements(TenantContext tenant)
      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

      Optional<AutomationEntitlements> getEntitlements(TenantContext tenant, boolean bypassCache)
      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

      void invalidateEntitlementsCache(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. If the TCS records is older, this method should log an errorl.
      Parameters:
      tenant - The context required to look up entitlements data