Class CaffeineCacheAccessTokenResolver.Builder
java.lang.Object
org.forgerock.openig.filter.oauth2.CaffeineCacheAccessTokenResolver.Builder
- Enclosing class:
- CaffeineCacheAccessTokenResolver
Builder of
CaffeineCacheAccessTokenResolver.-
Constructor Summary
ConstructorsConstructorDescriptionBuilder(com.github.benmanes.caffeine.cache.Caffeine<Object, Object> caffeine, AccessTokenResolver delegate, Clock clock, Duration defaultTimeout, Duration maximumTimeout) Creates aCaffeineCacheAccessTokenResolver.Builderdelegating to the givenAccessTokenResolverusing the given (pre-configured) cache. -
Method Summary
Modifier and TypeMethodDescriptionbuild()Returns a newCaffeineCacheAccessTokenResolverinstance.com.github.benmanes.caffeine.cache.AsyncCache<String,AccessTokenInfo> cache()Bind the various cache invalidation callbacks and return a cache based on the properties set on the builder.disconnectionStrategy(DisconnectionStrategy disconnectionStrategy) Bind aDisconnectionStrategyinstance to this builder.notificationService(NotificationService notificationService) Bind aNotificationServiceinstance to this builder.
-
Constructor Details
-
Builder
public Builder(com.github.benmanes.caffeine.cache.Caffeine<Object, Object> caffeine, AccessTokenResolver delegate, Clock clock, Duration defaultTimeout, Duration maximumTimeout) Creates aCaffeineCacheAccessTokenResolver.Builderdelegating to the givenAccessTokenResolverusing the given (pre-configured) cache.- Parameters:
caffeine- The caffeine cache to use. Notnull.delegate- The resolver to use. Notnull.clock- A clock providing access to the current instant, date and time using a time-zone, notnull.defaultTimeout- The default duration for which to cache AM access tokens. If an AM access token provides a valid expiresAt value to specify the time until which the access token remains valid, IG uses that value or the maxTimeout. Notnull.maximumTimeout- The maximum duration for which to cache AM access tokens. If the expiresAt value provided by the AM access token is after the current time plus the maxTimeout, IG uses the maxTimeout. Can benull.
-
-
Method Details
-
notificationService
public CaffeineCacheAccessTokenResolver.Builder notificationService(NotificationService notificationService) Bind aNotificationServiceinstance to this builder.- Parameters:
notificationService- the notificationService to be bound to this builder- Returns:
- this Builder
-
disconnectionStrategy
public CaffeineCacheAccessTokenResolver.Builder disconnectionStrategy(DisconnectionStrategy disconnectionStrategy) Bind aDisconnectionStrategyinstance to this builder.- Parameters:
disconnectionStrategy- the disconnectionStrategy to be bound to this builder- Returns:
- this Builder
-
cache
Bind the various cache invalidation callbacks and return a cache based on the properties set on the builder.- Returns:
- the
AsyncCacheto be used when caching anAccessTokenInfoagainst a particular token.
-
build
Returns a newCaffeineCacheAccessTokenResolverinstance.- Returns:
- a new
CaffeineCacheAccessTokenResolverinstance.
-