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 |
optApplicationNameespritVersion, 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, setDefaultApplicationNameaddOption, 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, removeOptionprotected 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.ExceptionCredentialprotected void checkForMissingCredentialOptions()
throws CommandLineParsingException
CommandLineParsingExceptionprotected final void checkForMissingOption(CommandLineOption option) throws CommandLineParsingException
CommandLineParsingExceptionpublic Credential getCredential(Credential defaultCred)
getCredential() but returns the defaultCred if the credential
could not be created from the command line.Credentialpublic DBConnectionPool getConnectionPool() throws java.lang.Exception
java.lang.Exceptionpublic java.io.File getCredDir()
public java.io.File getCredFile()
protected DatabaseConfig createConfig() throws java.lang.Exception
ApplicationCommandLineParserApplicationConfig derivation which contains
all data extracted from the command line.createConfig in class ApplicationCommandLineParserjava.lang.Exceptionpublic java.lang.String getSchema()
Copyright © 2014 EsprIT-Systems. All Rights Reserved.