Package net.shibboleth.idp.plugin.authn.webauthn.storage.impl

# Interface CacheService

All Known Implementing Classes:
  `CacheServiceImpl`, `DisabledCacheServiceImpl`

public interface CacheService
A cache facade that handles the consistent conversion between `CredentialRecord`s and cache entries.

Since:
  1.3.0

## Method Summary

Modifier and Type
Method
Description
`String`
`getIfPresent(com.yubico.webauthn.data.ByteArray key)`
Returns the value associated with key in this cache, or `null` if there is no cached value.
`void`
`invalidate(com.yubico.webauthn.data.ByteArray key)`
Removes any cached value for the key.
`void`
`invalidateAll()`
Removes all entries in the cache.
`void`
`put(CredentialRecord registration)`
Associates the registration with the username in this cache.

## Method Details

### getIfPresent

@Nullable String getIfPresent(@Nonnull com.yubico.webauthn.data.ByteArray key)
Returns the value associated with key in this cache, or `null` if there is no cached value.

Parameters:
  `key` - the key to use
Returns:
  the username associated with key in the cache, or `null` if no mapping is found.

### put

void put(@Nonnull CredentialRecord registration)
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.