Class ConfigurationServiceGrpcImpl

java.lang.Object
io.deephaven.dhservice.client.ConfigurationServiceGrpcImpl
All Implemented Interfaces:
AuthenticatedService, ConfigurationService, AutoCloseable

public class ConfigurationServiceGrpcImpl extends Object implements ConfigurationService
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.
  • Method Details

    • about

      public String about()
      Specified by:
      about in interface ConfigurationService
    • getFile

      public Optional<byte[]> getFile(@NotNull @NotNull String filename)
      Description copied from interface: ConfigurationService
      Load the named configuration and return the contents as a ByteString.
      Specified by:
      getFile in interface ConfigurationService
      Parameters:
      filename - the "filename" to load
      Returns:
      the file contents as a byte array
    • getAllFiles

      @NotNull public @NotNull Map<String,byte[]> getAllFiles()
      Description copied from interface: ConfigurationService
      Load all known configuration files.
      Specified by:
      getAllFiles in interface ConfigurationService
      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: ConfigurationService
      Update the stored properties file with the given name with the new supplied contents.
      Specified by:
      updateFile in interface ConfigurationService
      Parameters:
      filename - the filename
      contents - the file contents
      updateOnSameContents - 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: ConfigurationService
      Atomically remove all properties files in the collection of names. Removing a file that does not exist is not considered an error.
      Specified by:
      deleteFiles in interface ConfigurationService
      Parameters:
      filenames - the file names to remove
      Throws:
      ConfigurationAccessException - for any errors removing the files.
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface ConfigurationService
    • authenticate

      public boolean authenticate()
      Description copied from interface: AuthenticatedService
      Attempt default authentication if this is not already authenticated.
      Specified by:
      authenticate in interface AuthenticatedService
      Returns:
      true if authentication succeeded, else false
    • authenticate

      public boolean authenticate(@NotNull @NotNull String keyFile)
      Description copied from interface: AuthenticatedService
      Authenticate, or re-authenticate using the given private key file.
      Specified by:
      authenticate in interface AuthenticatedService
      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: AuthenticatedService
      Authenticate, or re-authenticate using the given credentials.
      Specified by:
      authenticate in interface AuthenticatedService
      Parameters:
      user - user to authenticate
      password - password for authentication
      operateAsUser - optional operate-as user
      Returns:
      true if authentication succeeded, else false
    • authenticate

      public boolean authenticate(@NotNull @NotNull String user, @NotNull @NotNull String password)
      Description copied from interface: AuthenticatedService
      Authenticate, or re-authenticate using the given credentials.
      Specified by:
      authenticate in interface AuthenticatedService
      Parameters:
      user - user to authenticate
      password - password for authentication
      Returns:
      true if authentication succeeded, else false
    • setTokenFactoryFactory

      public boolean setTokenFactoryFactory(@Nullable @Nullable TokenFactoryFactory tokenAuthenticationManager)
      Description copied from interface: AuthenticatedService
      Set 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:
      setTokenFactoryFactory in interface AuthenticatedService
      Parameters:
      tokenAuthenticationManager - the authentication client manager to be used for future calls.
      Returns:
      true if authentication succeeded, else false
    • getAuthenticatedUser

      public UserContext getAuthenticatedUser()
      Specified by:
      getAuthenticatedUser in interface AuthenticatedService