public class DatabaseCommandLineParser extends ApplicationCommandLineParser
getCredential()
,
Credential
Modifier and Type | Class and Description |
---|---|
protected static class |
DatabaseCommandLineParser.OptionCredDir |
protected static class |
DatabaseCommandLineParser.OptionCredFile |
protected static class |
DatabaseCommandLineParser.OptionDbPassword |
protected static class |
DatabaseCommandLineParser.OptionDbUrl |
protected static class |
DatabaseCommandLineParser.OptionDbUser |
protected static class |
DatabaseCommandLineParser.OptionJdbcDriver |
protected static class |
DatabaseCommandLineParser.OptionLoginTimeout |
protected static class |
DatabaseCommandLineParser.OptionMaxConns |
protected static class |
DatabaseCommandLineParser.OptionMinConns |
protected static class |
DatabaseCommandLineParser.OptionSchema |
Modifier and Type | Field and Description |
---|---|
protected DatabaseCommandLineParser.OptionCredDir |
optCredDir |
protected DatabaseCommandLineParser.OptionCredFile |
optCredFile |
protected DatabaseCommandLineParser.OptionJdbcDriver |
optDriver |
protected DatabaseCommandLineParser.OptionLoginTimeout |
optLoginTimeout |
protected DatabaseCommandLineParser.OptionMaxConns |
optMaxConns |
protected DatabaseCommandLineParser.OptionMinConns |
optMinConns |
protected DatabaseCommandLineParser.OptionDbPassword |
optPassword |
protected DatabaseCommandLineParser.OptionSchema |
optSchema |
protected DatabaseCommandLineParser.OptionDbUrl |
optUrl |
protected DatabaseCommandLineParser.OptionDbUser |
optUser |
optApplicationName
espritVersion, optDebug, optDemo, optHelp, optLocale, optLogDir, optLogToFile, optNoConsole, optTest, optVerbose, optVersion
Constructor and Description |
---|
DatabaseCommandLineParser(java.lang.Class mainClass,
java.lang.String... args) |
Modifier and Type | Method and Description |
---|---|
protected void |
checkForMissingCredentialOptions() |
protected void |
checkForMissingOption(CommandLineOption option) |
protected DatabaseConfig |
createConfig()
May be overridden to return a specific
ApplicationConfig derivation which contains
all data extracted from the command line. |
DBConnectionPool |
getConnectionPool()
Returns a ConnectionPool which is initialized according to the Credential
information found in the command line.
|
java.io.File |
getCredDir()
Returns the argument of the -credDir option which indicates the base
directory where credentials are stored.
|
Credential |
getCredential()
Asks for the command line parameter -credFile and returns a credential read
from the given credential file.
|
Credential |
getCredential(Credential defaultCred)
Same as
getCredential() but returns the defaultCred if the credential
could not be created from the command line. |
java.io.File |
getCredFile()
Returns the argument of the -credFile option which indicates the file
that contains the credential information.
|
java.lang.String |
getDriver() |
int |
getLoginTimeout() |
int |
getMaxConns() |
int |
getMinConns() |
java.lang.String |
getPassword() |
java.lang.String |
getSchema() |
java.lang.String |
getUrl() |
java.lang.String |
getUser() |
getApplicationName, getConfig, isPrintVersionOnly, setDefaultApplicationName
addOption, addOption, addSoftwareVersion, checkDependencies, createHelpText, createHelpText, createOptionList, createSyntaxLine, ensureParsed, fetchDefinedOptionFor, findDefinedOptionFor, getArgument, getArgumentCount, getArguments, getCustomVersion, getEspritVersion, getLogDir, getMainClass, getSoftwareVersions, getStartLogLevel, handleParsingError, hasArguments, isDebug, isDemoMode, isExitAfterParsing, isLogToFile, isNoConsoleLog, isParsed, isTestMode, isVerbose, parse, removeOption, removeOption
protected final DatabaseCommandLineParser.OptionCredDir optCredDir
protected final DatabaseCommandLineParser.OptionCredFile optCredFile
protected final DatabaseCommandLineParser.OptionJdbcDriver optDriver
protected final DatabaseCommandLineParser.OptionDbUrl optUrl
protected final DatabaseCommandLineParser.OptionDbUser optUser
protected final DatabaseCommandLineParser.OptionDbPassword optPassword
protected final DatabaseCommandLineParser.OptionMinConns optMinConns
protected final DatabaseCommandLineParser.OptionMaxConns optMaxConns
protected final DatabaseCommandLineParser.OptionLoginTimeout optLoginTimeout
protected final DatabaseCommandLineParser.OptionSchema optSchema
public DatabaseCommandLineParser(java.lang.Class mainClass, java.lang.String... args)
public int getLoginTimeout()
public java.lang.String getDriver()
public java.lang.String getUrl()
public java.lang.String getUser()
public java.lang.String getPassword()
public int getMinConns()
public int getMaxConns()
public Credential getCredential() throws java.lang.Exception
java.lang.Exception
Credential
protected void checkForMissingCredentialOptions() throws CommandLineParsingException
CommandLineParsingException
protected final void checkForMissingOption(CommandLineOption option) throws CommandLineParsingException
CommandLineParsingException
public Credential getCredential(Credential defaultCred)
getCredential()
but returns the defaultCred if the credential
could not be created from the command line.Credential
public DBConnectionPool getConnectionPool() throws java.lang.Exception
java.lang.Exception
public java.io.File getCredDir()
public java.io.File getCredFile()
protected DatabaseConfig createConfig() throws java.lang.Exception
ApplicationCommandLineParser
ApplicationConfig
derivation which contains
all data extracted from the command line.createConfig
in class ApplicationCommandLineParser
java.lang.Exception
public java.lang.String getSchema()
Copyright © 2014 EsprIT-Systems. All Rights Reserved.