Package io.permazen.cli.config
Class CoreApiCliConfig
java.lang.Object
io.permazen.cli.config.CliConfig
io.permazen.cli.config.KeyValueCliConfig
io.permazen.cli.config.CoreApiCliConfig
- Direct Known Subclasses:
PermazenCliConfig
Configuration for a CLI application supporting Core API database interaction.
-
Field Summary
Modifier and TypeFieldDescriptionprotected Database
protected boolean
protected EncodingRegistry
protected joptsimple.OptionSpec<String>
protected joptsimple.OptionSpec<Void>
protected joptsimple.OptionSpec<File>
protected SchemaModel
protected TransactionConfig.SchemaRemoval
protected joptsimple.OptionSpec<TransactionConfig.SchemaRemoval>
protected SessionMode
protected joptsimple.OptionSpec<SessionMode>
Fields inherited from class io.permazen.cli.config.KeyValueCliConfig
kvdb, kvdbDescription, kvi, kvis, nestedKVDatabase, nestedKVStore
Fields inherited from class io.permazen.cli.config.CliConfig
helpOption, loader, log, readOnlyOption, setReadOnly, setVerbose, verboseOption
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
addCoreApiOptions
(joptsimple.OptionParser parser) Add Core API layer command line flags to the given option parser.void
addOptions
(joptsimple.OptionParser parser) Configure anOptionParser
with the comand line flags supported by this instance.protected void
addSessionModeOption
(joptsimple.OptionParser parser) Add the--session-mode
command line option.protected void
configureSession
(Session session) Configure a newSession
.protected TransactionConfig.SchemaRemoval
Get the defaultTransactionConfig.SchemaRemoval
.protected SessionMode
Get the defaultSessionMode
.protected void
processOptions
(joptsimple.OptionSet options) Review parsed options and do any preprocessing before starting database.void
Shutdown the database.void
startupDatabase
(joptsimple.OptionSet options) Configure and start up the database based on the parsed command line options.Methods inherited from class io.permazen.cli.config.KeyValueCliConfig
addKeyValueImplementationOptions, getDatabaseDescription, getKVDatabase
Methods inherited from class io.permazen.cli.config.CliConfig
addGenericOptions, createOptionParser, getPermazen, instantiateClass, loadClass, newPermazenExec, newPermazenShell, showHelp, startup
-
Field Details
-
schemaFileOption
-
sessionModeOption
-
noNewSchemaOption
-
schemaRemovalOption
-
encodingRegistryOption
-
db
-
schemaModel
-
encodingRegistry
-
sessionMode
-
disableNewSchema
protected boolean disableNewSchema -
schemaRemoval
-
-
Constructor Details
-
CoreApiCliConfig
public CoreApiCliConfig()
-
-
Method Details
-
addOptions
public void addOptions(joptsimple.OptionParser parser) Configure anOptionParser
with the comand line flags supported by this instance.- Overrides:
addOptions
in classKeyValueCliConfig
- Parameters:
parser
- command line flag parser- Throws:
IllegalArgumentException
- ifparser
is null
-
addSessionModeOption
protected void addSessionModeOption(joptsimple.OptionParser parser) Add the--session-mode
command line option.- Parameters:
parser
- command line flag parser- Throws:
IllegalArgumentException
- ifparser
is nullIllegalStateException
- if option has already been added
-
getDefaultSessionMode
Get the defaultSessionMode
. -
getDefaultSchemaRemoval
Get the defaultTransactionConfig.SchemaRemoval
. -
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
- ifparser
is nullIllegalStateException
- 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 classKeyValueCliConfig
- 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 classKeyValueCliConfig
- Parameters:
options
- parsed command line options
-
shutdownDatabase
public void shutdownDatabase()Description copied from class:CliConfig
Shutdown the database.- Overrides:
shutdownDatabase
in classKeyValueCliConfig
-
getDatabase
- Overrides:
getDatabase
in classCliConfig
-
configureSession
Description copied from class:CliConfig
Configure a newSession
.- Overrides:
configureSession
in classKeyValueCliConfig
- Parameters:
session
- new session to configure
-