@Beta @FunctionalInterface public interface OAuth2TokenServiceCache
OAuth2TokenService
according to ClientIdentity
.Modifier and Type | Interface and Description |
---|---|
static class |
OAuth2TokenServiceCache.Default
Default implementation of the interface.
|
Modifier and Type | Method and Description |
---|---|
static OAuth2TokenServiceCache |
create()
Create an empty cache.
|
static OAuth2TokenServiceCache |
create(Map<com.sap.cloud.security.config.ClientIdentity,com.sap.cloud.security.xsuaa.client.OAuth2TokenService> cache)
Create a new cache based on an existing
Map instance. |
com.sap.cloud.security.xsuaa.client.OAuth2TokenService |
getTokenService(com.sap.cloud.security.config.ClientIdentity identity)
Get the token service.
|
default void |
invalidateCache()
Invalidate the cache.
|
static OAuth2TokenServiceCache |
single(com.sap.cloud.security.xsuaa.client.OAuth2TokenService tokenService)
Create ab immutable cache instance, with a single entry that is being returned for any provided client identity.
|
@Nonnull com.sap.cloud.security.xsuaa.client.OAuth2TokenService getTokenService(@Nullable com.sap.cloud.security.config.ClientIdentity identity)
HttpClient
.identity
- The client identity of a service binding.OAuth2TokenService
.default void invalidateCache()
@Nonnull static OAuth2TokenServiceCache create()
OAuth2TokenServiceCache
.@Nonnull static OAuth2TokenServiceCache create(@Nonnull Map<com.sap.cloud.security.config.ClientIdentity,com.sap.cloud.security.xsuaa.client.OAuth2TokenService> cache)
Map
instance. Use this method for testing or customization.cache
- Custom data store for the cache.OAuth2TokenServiceCache
.@Nonnull static OAuth2TokenServiceCache single(@Nonnull com.sap.cloud.security.xsuaa.client.OAuth2TokenService tokenService)
tokenService
- A OAuth2TokenService
that will always be returned.OAuth2TokenServiceCache
.Copyright © 2021 SAP SE. All rights reserved.