Package io.deephaven.dhservice.client
Class ConfigurationServiceGrpcImpl
java.lang.Object
io.deephaven.dhservice.client.ConfigurationServiceGrpcImpl
- All Implemented Interfaces:
AuthenticatedService,ConfigurationService,AutoCloseable
This is a test framework at the moment - there isn't really a Configuration
interface to implement to make this parallel with the other "GrpcImpl" classes.
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.deephaven.dhservice.client.AuthenticatedService
AuthenticatedService.DefaultImpl -
Method Summary
Modifier and TypeMethodDescriptionabout()booleanAttempt 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) Authenticate, or re-authenticate using the given credentials.booleanauthenticate(@NotNull String user, @NotNull String password, @Nullable String operateAsUser) Authenticate, or re-authenticate using the given credentials.voidclose()voiddeleteFiles(@NotNull Collection<String> filenames) Atomically remove all properties files in the collection of names.Load all known configuration files.Optional<byte[]>Load the named configuration and return the contents as aByteString.booleansetTokenFactoryFactory(@Nullable TokenFactoryFactory tokenAuthenticationManager) Set the authentication client manager to use for token generation.voidupdateFile(@NotNull String filename, @org.jetbrains.annotations.NotNull byte[] contents, boolean updateOnSameContents) Update the stored properties file with the given name with the new supplied contents.
-
Method Details
-
about
- Specified by:
aboutin interfaceConfigurationService
-
getFile
Description copied from interface:ConfigurationServiceLoad the named configuration and return the contents as aByteString.- Specified by:
getFilein interfaceConfigurationService- Parameters:
filename- the "filename" to load- Returns:
- the file contents as a byte array
-
getAllFiles
Description copied from interface:ConfigurationServiceLoad all known configuration files.- Specified by:
getAllFilesin interfaceConfigurationService- Returns:
- a map of names to file contents. Caller must remember the starting filename.
-
updateFile
public void updateFile(@NotNull @NotNull String filename, @NotNull @org.jetbrains.annotations.NotNull byte[] contents, boolean updateOnSameContents) Description copied from interface:ConfigurationServiceUpdate the stored properties file with the given name with the new supplied contents.- Specified by:
updateFilein interfaceConfigurationService- Parameters:
filename- the filenamecontents- the file contentsupdateOnSameContents- whether the file should be updated even if the contents are the same
-
deleteFiles
public void deleteFiles(@NotNull @NotNull Collection<String> filenames) throws ConfigurationAccessException Description copied from interface:ConfigurationServiceAtomically remove all properties files in the collection of names. Removing a file that does not exist is not considered an error.- Specified by:
deleteFilesin interfaceConfigurationService- Parameters:
filenames- the file names to remove- Throws:
ConfigurationAccessException- for any errors removing the files.
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceConfigurationService
-
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
-
authenticate
Description copied from interface:AuthenticatedServiceAuthenticate, or re-authenticate using the given credentials.- Specified by:
authenticatein interfaceAuthenticatedService- Parameters:
user- user to authenticatepassword- password for authentication- Returns:
- true if authentication succeeded, else false
-
setTokenFactoryFactory
public boolean setTokenFactoryFactory(@Nullable @Nullable TokenFactoryFactory tokenAuthenticationManager) Description copied from interface:AuthenticatedServiceSet the authentication client manager to use for token generation. If tokenAuthenticationManager is null or is not already authenticated, this call will de-authenticate the connection.- Specified by:
setTokenFactoryFactoryin interfaceAuthenticatedService- Parameters:
tokenAuthenticationManager- the authentication client manager to be used for future calls.- Returns:
- true if authentication succeeded, else false
-
getAuthenticatedUser
- Specified by:
getAuthenticatedUserin interfaceAuthenticatedService
-