Module org.neo4j.driver
Class ExpirationBasedAuthTokenManager
java.lang.Object
org.neo4j.driver.internal.security.ExpirationBasedAuthTokenManager
- All Implemented Interfaces:
AuthTokenManager
-
Constructor Summary
ConstructorsConstructorDescriptionExpirationBasedAuthTokenManager(Supplier<CompletionStage<AuthTokenAndExpiration>> freshTokenSupplier, Clock clock) -
Method Summary
Modifier and TypeMethodDescriptiongetToken()Returns aCompletionStagefor a validAuthToken.voidHandles an error notification emitted by the server if the token is expired.
-
Constructor Details
-
ExpirationBasedAuthTokenManager
public ExpirationBasedAuthTokenManager(Supplier<CompletionStage<AuthTokenAndExpiration>> freshTokenSupplier, Clock clock)
-
-
Method Details
-
getToken
Description copied from interface:AuthTokenManagerReturns aCompletionStagefor a validAuthToken.Driver invokes this method often to check if token has changed.
Failures will surface via the driver API, like
Session.beginTransaction()method and others.- Specified by:
getTokenin interfaceAuthTokenManager- Returns:
- a stage for a valid token, must not be
nullor complete withnull - See Also:
-
onExpired
Description copied from interface:AuthTokenManagerHandles an error notification emitted by the server if the token is expired.This will be called when driver emits the
TokenExpiredRetryableException.- Specified by:
onExpiredin interfaceAuthTokenManager- Parameters:
authToken- the expired token
-