Package org.entur.jwt.client
Class AbstractAccessTokenHealthProvider
java.lang.Object
org.entur.jwt.client.BaseAccessTokenProvider
org.entur.jwt.client.AbstractAccessTokenHealthProvider
- All Implemented Interfaces:
Closeable,AutoCloseable,AccessTokenHealthProvider,AccessTokenProvider
- Direct Known Subclasses:
DefaultAccessTokenHealthProvider,EagerAccessTokenHealthProvider
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected AccessTokenHealthThe state of the below providerprotected AccessTokenProviderProvider to invoke when refreshing state.protected AccessTokenHealthThe state of the top level providerFields inherited from class org.entur.jwt.client.BaseAccessTokenProvider
logger, provider -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetAccessToken(boolean forceRefresh) getHealth(boolean refresh) Get health.protected abstract AccessTokenHealthvoidbooleanMethods inherited from class org.entur.jwt.client.BaseAccessTokenProvider
close, getProvider
-
Field Details
-
providerStatus
The state of the below provider -
status
The state of the top level provider -
refreshProvider
Provider to invoke when refreshing state. This should be the top level provider, so that caches are actually populated and so on.
-
-
Constructor Details
-
AbstractAccessTokenHealthProvider
-
-
Method Details
-
getAccessToken
- Throws:
AccessTokenException
-
getHealth
Description copied from interface:AccessTokenHealthProviderGet health. An implementation is expected to refresh the health status if there is no current status, or if the last status was unsuccessful.- Specified by:
getHealthin interfaceAccessTokenHealthProvider- Overrides:
getHealthin classBaseAccessTokenProvider- Parameters:
refresh- true if the provider (optionally) can refresh the state before returning (typically if the health is missing or bad)- Returns:
- health status, or null if none is available.
-
getRefreshHealth
-
setRefreshProvider
-
supportsHealth
public boolean supportsHealth()- Specified by:
supportsHealthin interfaceAccessTokenHealthProvider- Overrides:
supportsHealthin classBaseAccessTokenProvider
-