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 AuthTokengetToken()Obtain an authentication token as the first step of a two-step operation with a second step using the token.booleanprotected abstract com.fishlib.io.logger.Loggerlog()final voidtryActionUntil(Predicate<AuthToken> action) Execute the specified action until it returns true, or we can't retry anymore.final voidtryActionWithToken(Consumer<AuthToken> action) Execute the specified action with a token<R> RtryGetWithTokenUsingStartedBackoff(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, waitMethods 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.TokenFactoryTry 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:
tryGetWithTokenUsingStartedBackoffin interfaceTokenFactoryFactory.TokenFactory- Parameters:
action- The action to attempt with a token
-
isRetryable
- Specified by:
isRetryablein 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:
tryActionWithTokenin 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:
tryActionUntilin interfaceTokenFactoryFactory.TokenFactory
-