Package com.nimbusds.jose.jwk.source
Class JWKSourceWithFailover<C extends SecurityContext>
java.lang.Object
com.nimbusds.jose.jwk.source.JWKSourceWithFailover<C>
- All Implemented Interfaces:
JWKSource<C>,Closeable,AutoCloseable
@ThreadSafe
public class JWKSourceWithFailover<C extends SecurityContext>
extends Object
implements JWKSource<C>, Closeable
JWK source with optional failover.
- Version:
- 2022-08-24
- Author:
- Thomas Rørvik Skjølberg, Vladimir Dzhuvinov
-
Constructor Summary
ConstructorsConstructorDescriptionJWKSourceWithFailover(JWKSource<C> jwkSource, JWKSource<C> failoverJWKSource) Creates a new JWK source with optional failover. -
Method Summary
-
Constructor Details
-
JWKSourceWithFailover
Creates a new JWK source with optional failover.- Parameters:
jwkSource- The primary JWK source. Must not benull.failoverJWKSource- Optional failover JWK source if retrieval from the primary JWK source fails,nullif no failover.
-
-
Method Details
-
get
Description copied from interface:JWKSourceRetrieves a list of JWKs matching the specified selector.- Specified by:
getin interfaceJWKSource<C extends SecurityContext>- Parameters:
jwkSelector- A JWK selector. Must not benull.context- Optional context,nullif not required.- Returns:
- The matching JWKs, empty list if no matches were found.
- Throws:
KeySourceException- If key sourcing failed.
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-