Interface CacheService
- All Known Implementing Classes:
CacheServiceImpl,DisabledCacheServiceImpl
public interface CacheService
A cache facade that handles the consistent conversion between
CredentialRecords and cache entries.- Since:
- 1.3.0
-
Method Summary
Modifier and TypeMethodDescriptiongetIfPresent(com.yubico.webauthn.data.ByteArray key) Returns the value associated with key in this cache, ornullif there is no cached value.voidinvalidate(com.yubico.webauthn.data.ByteArray key) Removes any cached value for the key.voidRemoves all entries in the cache.voidput(CredentialRecord registration) Associates the registration with the username in this cache.
-
Method Details
-
getIfPresent
Returns the value associated with key in this cache, ornullif there is no cached value.- Parameters:
key- the key to use- Returns:
- the username associated with key in the cache, or
nullif no mapping is found.
-
put
Associates the registration with the username in this cache. If the cache previously contained a value associated with this registration, the old value is replaced by the username in the registration.- Parameters:
registration- the registration to extract the mapping from.
-
invalidate
void invalidate(@Nonnull com.yubico.webauthn.data.ByteArray key) Removes any cached value for the key.- Parameters:
key- the key
-
invalidateAll
void invalidateAll()Removes all entries in the cache.
-