Class CachingRelyingPartyRegistrationRepository
java.lang.Object
org.springframework.security.saml2.provider.service.registration.CachingRelyingPartyRegistrationRepository
- All Implemented Interfaces:
Iterable<RelyingPartyRegistration>
,IterableRelyingPartyRegistrationRepository
,RelyingPartyRegistrationRepository
public final class CachingRelyingPartyRegistrationRepository
extends Object
implements IterableRelyingPartyRegistrationRepository
An
IterableRelyingPartyRegistrationRepository
that lazily queries and caches
metadata from a backing IterableRelyingPartyRegistrationRepository
. Delegates
caching policies to Spring Cache.- Since:
- 6.4
-
Constructor Summary
ConstructorsConstructorDescriptionCachingRelyingPartyRegistrationRepository
(Callable<IterableRelyingPartyRegistrationRepository> loader) -
Method Summary
Modifier and TypeMethodDescriptionfindByRegistrationId
(String registrationId) Returns the relying party registration identified by the providedregistrationId
, ornull
if not found.findUniqueByAssertingPartyEntityId
(String entityId) Returns the unique relying party registration associated with the asserting party'sentityId
ornull
if there is no unique match.void
forEach
(Consumer<? super RelyingPartyRegistration> action) iterator()
void
setCache
(org.springframework.cache.Cache cache) Use this cache for the completedRelyingPartyRegistration
instances.
-
Constructor Details
-
CachingRelyingPartyRegistrationRepository
public CachingRelyingPartyRegistrationRepository(Callable<IterableRelyingPartyRegistrationRepository> loader)
-
-
Method Details
-
iterator
- Specified by:
iterator
in interfaceIterable<RelyingPartyRegistration>
-
findByRegistrationId
Returns the relying party registration identified by the providedregistrationId
, ornull
if not found.- Specified by:
findByRegistrationId
in interfaceRelyingPartyRegistrationRepository
- Parameters:
registrationId
- the registration identifier- Returns:
- the
RelyingPartyRegistration
if found, otherwisenull
-
findUniqueByAssertingPartyEntityId
Description copied from interface:RelyingPartyRegistrationRepository
Returns the unique relying party registration associated with the asserting party'sentityId
ornull
if there is no unique match.- Specified by:
findUniqueByAssertingPartyEntityId
in interfaceRelyingPartyRegistrationRepository
- Parameters:
entityId
- the asserting party's entity id- Returns:
- the unique
RelyingPartyRegistration
associated the given asserting party;null
of there is no unique match asserting party
-
forEach
- Specified by:
forEach
in interfaceIterable<RelyingPartyRegistration>
-
spliterator
- Specified by:
spliterator
in interfaceIterable<RelyingPartyRegistration>
-
setCache
public void setCache(org.springframework.cache.Cache cache) Use this cache for the completedRelyingPartyRegistration
instances.Defaults to
ConcurrentMapCache
, meaning that the registrations are cached without expiry. To turn off the cache, useNoOpCache
.- Parameters:
cache
- theCache
to use
-