Class CoreApiCliConfig

Direct Known Subclasses:
PermazenCliConfig

public class CoreApiCliConfig extends KeyValueCliConfig
Configuration for a CLI application supporting Core API database interaction.
  • Field Details

    • schemaFileOption

      protected joptsimple.OptionSpec<File> schemaFileOption
    • sessionModeOption

      protected joptsimple.OptionSpec<SessionMode> sessionModeOption
    • noNewSchemaOption

      protected joptsimple.OptionSpec<Void> noNewSchemaOption
    • gcSchemasOption

      protected joptsimple.OptionSpec<Void> gcSchemasOption
    • encodingRegistryOption

      protected joptsimple.OptionSpec<String> encodingRegistryOption
    • db

      protected Database db
    • schemaModel

      protected SchemaModel schemaModel
    • encodingRegistry

      protected EncodingRegistry encodingRegistry
    • sessionMode

      protected SessionMode sessionMode
    • disableNewSchema

      protected boolean disableNewSchema
    • enableGcScemas

      protected boolean enableGcScemas
  • Constructor Details

    • CoreApiCliConfig

      public CoreApiCliConfig()
  • Method Details

    • addOptions

      public void addOptions(joptsimple.OptionParser parser)
      Configure an OptionParser with the comand line flags supported by this instance.
      Overrides:
      addOptions in class KeyValueCliConfig
      Parameters:
      parser - command line flag parser
      Throws:
      IllegalArgumentException - if parser is null
    • addSessionModeOption

      protected void addSessionModeOption(joptsimple.OptionParser parser)
      Add the --session-mode command line option.
      Parameters:
      parser - command line flag parser
      Throws:
      IllegalArgumentException - if parser is null
      IllegalStateException - if option has already been added
    • getDefaultSessionMode

      protected SessionMode getDefaultSessionMode()
      Get the default SessionMode.
    • addCoreApiOptions

      protected void addCoreApiOptions(joptsimple.OptionParser parser)
      Add Core API layer command line flags to the given option parser.
      Parameters:
      parser - command line flag parser
      Throws:
      IllegalArgumentException - if parser is null
      IllegalStateException - if an option being added has already been added
    • processOptions

      protected void processOptions(joptsimple.OptionSet options)
      Description copied from class: CliConfig
      Review parsed options and do any preprocessing before starting database.
      Overrides:
      processOptions in class KeyValueCliConfig
      Parameters:
      options - parsed command line options
    • startupDatabase

      public void startupDatabase(joptsimple.OptionSet options)
      Description copied from class: CliConfig
      Configure and start up the database based on the parsed command line options.
      Overrides:
      startupDatabase in class KeyValueCliConfig
      Parameters:
      options - parsed command line options
    • shutdownDatabase

      public void shutdownDatabase()
      Description copied from class: CliConfig
      Shutdown the database.
      Overrides:
      shutdownDatabase in class KeyValueCliConfig
    • getDatabase

      public Database getDatabase()
      Overrides:
      getDatabase in class CliConfig
    • configureSession

      protected void configureSession(Session session)
      Description copied from class: CliConfig
      Configure a new Session.
      Overrides:
      configureSession in class KeyValueCliConfig
      Parameters:
      session - new session to configure