Class ConfigurationTool

java.lang.Object
io.deephaven.configuration.ConfigurationTool

public class ConfigurationTool extends Object
Starting point for dhconfig actions operating on schemas, data routing, properties, and other configuration data.
  • Field Details

    • HELP_ARG

      protected static final String HELP_ARG
      The common help argument
      See Also:
    • HELP_ALIASES

      protected static final String[] HELP_ALIASES
  • Constructor Details

    • ConfigurationTool

      public ConfigurationTool()
      Constructor.
  • Method Details

    • getInfoMap

      @NotNull protected @NotNull Map<String,io.deephaven.configuration.ToolBase.Info> getInfoMap()
      Get a map of data types to configuration info about that type.
      Returns:
      map of data type to Info
    • getAppName

      @NotNull public @NotNull String getAppName()
    • getCanonicalDataTypes

      @NotNull public @NotNull Collection<String> getCanonicalDataTypes()
    • getActionsList

      @NotNull public @NotNull Collection<String> getActionsList()
    • getDataTypeAliasToCanonicalType

      @NotNull protected @NotNull Map<String,String> getDataTypeAliasToCanonicalType()
      Get a map of any data type aliases to their canonical names.
      Returns:
      map of alias to canonical data type
    • doMain

      public static int doMain(@NotNull @NotNull String[] commandLineArguments) throws Exception
      Main executor. Delegate to constructor and run so this can be invoked programmatically.
      Parameters:
      commandLineArguments - the command line arguments
      Returns:
      the exit code
      Throws:
      Exception - explicitly passes on any exception thrown by the tool implementation
    • main

      public static void main(@NotNull @NotNull String[] commandLineArguments)
      Main executor. Delegate to constructor and run so this can be invoked programmatically.
      Parameters:
      commandLineArguments - the command line arguments
    • getSupportedActions

      @NotNull public @NotNull Collection<String> getSupportedActions(@NotNull @NotNull String datatype)
      All actions supported by the given data type
      Parameters:
      datatype - get actions supported by this data type
      Returns:
      collection of actions supported by the given data type
    • parseCommandLine

      protected io.deephaven.configuration.ToolImplBase parseCommandLine(@NotNull @NotNull String[] commandLineArguments) throws HelpExceptions.HelpException, HelpExceptions.CommandLineException
      Parse the command line. The first two arguments are positional and must be a known data type and action. An implementation class for the data type is created and used to parse the rest of the command line. Returns the implementation class.
      Parameters:
      commandLineArguments - the command line to parse
      Returns:
      an implementation class that will handle the command
      Throws:
      HelpExceptions.HelpException - contains a help message with as much detail as possible
      HelpExceptions.CommandLineException - contains a usage message with as much detail as possible, when there is a problem with the command line
    • doMainThrowing

      public static int doMainThrowing(@NotNull @NotNull io.deephaven.configuration.ToolBase invoker, @NotNull @NotNull String[] commandLineArguments) throws Exception
      Main executor. Does not handle exceptions - so that the interactive test program can handle them differently than an independent execution, with as much commonality as possible.
      Parameters:
      invoker - the implementation of ToolBase in use
      commandLineArguments - the command line arguments
      Returns:
      the exit code
      Throws:
      Exception - explicitly passes on any exception thrown by the tool implementation
    • doMain

      public static int doMain(@NotNull @NotNull io.deephaven.configuration.ToolBase invoker, @NotNull @NotNull String[] commandLineArguments) throws Exception
      Main executor. Delegate to constructor and run so this can be invoked programmatically.
      Parameters:
      invoker - the implementation of ToolBase in use
      commandLineArguments - the command line arguments
      Returns:
      the exit code
      Throws:
      Exception - explicitly passes on any exception thrown by the tool implementation