Package io.deephaven.dhservice.client
Class AuthenticatedService.DefaultImpl
java.lang.Object
io.deephaven.dhservice.client.AuthenticatedService.DefaultImpl
- All Implemented Interfaces:
AuthenticatedService
- Direct Known Subclasses:
UnifiedServiceGrpcImpl
- Enclosing interface:
- AuthenticatedService
public abstract static class AuthenticatedService.DefaultImpl
extends Object
implements AuthenticatedService
Provide some common implementation for the authentication methods.
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.deephaven.dhservice.client.AuthenticatedService
AuthenticatedService.DefaultImpl -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanAttempt default authentication if this is not already authenticated.booleanauthenticate(@NotNull String keyFile) Authenticate, or re-authenticate using the given private key file.booleanauthenticate(@NotNull String user, @NotNull String password, @Nullable String operateAsUser) Authenticate, or re-authenticate using the given credentials.protected abstract @NotNull com.fishlib.io.logger.LoggergetLog()Get a Logger from the implementation (which probably has one)protected abstract @Nullable TokenFactoryFactoryGet the current TokenFactoryFactory from the implementation, for use in the authenticate method implementationsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.deephaven.dhservice.client.AuthenticatedService
authenticate, setTokenFactoryFactory
-
Constructor Details
-
DefaultImpl
public DefaultImpl()
-
-
Method Details
-
getLog
@NotNull protected abstract @NotNull com.fishlib.io.logger.Logger getLog()Get a Logger from the implementation (which probably has one)- Returns:
- a Logger
-
getTokenFactoryFactory
Get the current TokenFactoryFactory from the implementation, for use in the authenticate method implementations- Returns:
- the current auth client manager, may be null
-
authenticate
public boolean authenticate()Description copied from interface:AuthenticatedServiceAttempt default authentication if this is not already authenticated.- Specified by:
authenticatein interfaceAuthenticatedService- Returns:
- true if authentication succeeded, else false
-
authenticate
Description copied from interface:AuthenticatedServiceAuthenticate, or re-authenticate using the given private key file.- Specified by:
authenticatein interfaceAuthenticatedService- Returns:
- true if authentication succeeded, else false
-
authenticate
public boolean authenticate(@NotNull @NotNull String user, @NotNull @NotNull String password, @Nullable @Nullable String operateAsUser) Description copied from interface:AuthenticatedServiceAuthenticate, or re-authenticate using the given credentials.- Specified by:
authenticatein interfaceAuthenticatedService- Parameters:
user- user to authenticatepassword- password for authenticationoperateAsUser- optional operate-as user- Returns:
- true if authentication succeeded, else false
-
getAuthenticatedUser
- Specified by:
getAuthenticatedUserin interfaceAuthenticatedService
-