Class OAuth2Options.TokenCacheParameters
java.lang.Object
com.sap.cloud.sdk.cloudplatform.connectivity.OAuth2Options.TokenCacheParameters
- All Implemented Interfaces:
ServiceBindingDestinationOptions.OptionsEnhancer<OAuth2Options.TokenCacheParameters>
- Enclosing class:
- OAuth2Options
@Beta
public static class OAuth2Options.TokenCacheParameters
extends Object
implements ServiceBindingDestinationOptions.OptionsEnhancer<OAuth2Options.TokenCacheParameters>
Configuration for the token response cache used by
OAuth2Service.
Important: These values are passed to
TokenCacheConfiguration used by XSUAAs
DefaultOAuth2TokenService. This cache stores the HTTP token response (including the token) and it governs
the cache entry, not the token's lifetime.
Expired (or almost expired) tokens are never served, regardless of cacheDuration as xsuaa checks
exp - before returning a cached entry.tokenExpirationDelta
- Since:
- 5.21.0
-
Method Summary
Modifier and TypeMethodDescriptionUpper bound for how long a successful token response may remain cached.The maximum number of tokens to cache.The delta to be subtracted from the token expiration time to determine how early should a token be refreshed before it expires.getValue()Get the value of the option.Creates a newTokenCacheParametersinstance.
-
Method Details
-
getValue
Description copied from interface:ServiceBindingDestinationOptions.OptionsEnhancerGet the value of the option.- Specified by:
getValuein interfaceServiceBindingDestinationOptions.OptionsEnhancer<OAuth2Options.TokenCacheParameters>- Returns:
- The value of the option.
-
getCacheDuration
Upper bound for how long a successful token response may remain cached. A cached entry is ignored earlier if the token would be (almost) expired. -
getCacheSize
The maximum number of tokens to cache. -
getTokenExpirationDelta
The delta to be subtracted from the token expiration time to determine how early should a token be refreshed before it expires. -
of
@Nonnull public static OAuth2Options.TokenCacheParameters of(@Nonnull Duration cacheDuration, @Nonnull Integer cacheSize, @Nonnull Duration tokenExpirationDelta) Creates a newTokenCacheParametersinstance.- Parameters:
cacheDuration- Upper bound for how long a successful token response may remain cached. A cached entry is ignored earlier if the token would be (almost) expired.cacheSize- The maximum number of tokens to cache.tokenExpirationDelta- The delta to be subtracted from the token expiration time to determine how early should a token be refreshed before it expires.
-