Package io.deephaven.enterprise.auth
Class AuthenticationClientManagerBase.TokenFactoryBase
java.lang.Object
io.deephaven.enterprise.auth.AuthenticationClientManagerBase.TokenFactoryBase
- All Implemented Interfaces:
TokenFactoryFactory.TokenFactory
- Direct Known Subclasses:
AuthenticationClientManagerBase.SingleClientTokenFactory
- Enclosing class:
- AuthenticationClientManagerBase
public abstract static class AuthenticationClientManagerBase.TokenFactoryBase
extends Object
implements TokenFactoryFactory.TokenFactory
Partial implementation of
TokenFactoryFactory.TokenFactory
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract AuthToken
getToken()
Obtain an authentication token as the first step of a two-step operation with a second step using the token.boolean
protected abstract com.fishlib.io.logger.Logger
log()
final void
tryActionUntil
(Predicate<AuthToken> action) Execute the specified action until it returns true, or we can't retry anymore.final void
tryActionWithToken
(Consumer<AuthToken> action) Execute the specified action with a token<R> R
tryGetWithTokenUsingStartedBackoff
(Function<AuthToken, R> action, Predicate<Exception> isRetryablePredicate, RetryBackoffContext backoffContext) Try to get the result of action, retrying each time there is a recoverable exception.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.deephaven.enterprise.auth.TokenFactoryFactory.TokenFactory
tryGetWithToken, tryGetWithToken, tryGetWithTokenUsingStartedBackoff
-
Constructor Details
-
TokenFactoryBase
public TokenFactoryBase()
-
-
Method Details
-
tryGetWithTokenUsingStartedBackoff
public <R> R tryGetWithTokenUsingStartedBackoff(Function<AuthToken, R> action, Predicate<Exception> isRetryablePredicate, RetryBackoffContext backoffContext) Description copied from interface:TokenFactoryFactory.TokenFactory
Try to get the result of action, retrying each time there is a recoverable exception. If any other exception is found it is rethrown.- Specified by:
tryGetWithTokenUsingStartedBackoff
in interfaceTokenFactoryFactory.TokenFactory
- Parameters:
action
- The action to attempt with a token
-
isRetryable
- Specified by:
isRetryable
in interfaceTokenFactoryFactory.TokenFactory
-
log
protected abstract com.fishlib.io.logger.Logger log() -
getToken
Obtain an authentication token as the first step of a two-step operation with a second step using the token.- Returns:
- an authentication token.
-
tryActionWithToken
Execute the specified action with a token- Specified by:
tryActionWithToken
in interfaceTokenFactoryFactory.TokenFactory
- See Also:
-
tryActionUntil
Execute the specified action until it returns true, or we can't retry anymore.
In the context of the gRPC authentication server, tryActionUntil is not very meaningful; a single RPC attempt should retry over a load balanced channel to other servers if the RPC fails to a particular one; if the RPC does make it to a server and the server answers false, the answer is authoritative. Still, we preserve the existing semantics to avoid rewriting code.
- Specified by:
tryActionUntil
in interfaceTokenFactoryFactory.TokenFactory
-