public class DatabaseCLP extends ApplicationCommandLineParser
getCredential()
,
Credential
Modifier and Type | Class and Description |
---|---|
protected static class |
DatabaseCLP.OptionCredDir |
protected static class |
DatabaseCLP.OptionCredFile |
protected static class |
DatabaseCLP.OptionDbPassword |
protected static class |
DatabaseCLP.OptionDbUrl |
protected static class |
DatabaseCLP.OptionDbUser |
protected static class |
DatabaseCLP.OptionJdbcDriver |
protected static class |
DatabaseCLP.OptionLoginTimeout |
protected static class |
DatabaseCLP.OptionMaxConns |
protected static class |
DatabaseCLP.OptionMinConns |
protected static class |
DatabaseCLP.OptionSchema |
Modifier and Type | Field and Description |
---|---|
protected DatabaseCLP.OptionCredDir |
optCredDir |
protected DatabaseCLP.OptionCredFile |
optCredFile |
protected DatabaseCLP.OptionJdbcDriver |
optDriver |
protected DatabaseCLP.OptionLoginTimeout |
optLoginTimeout |
protected DatabaseCLP.OptionMaxConns |
optMaxConns |
protected DatabaseCLP.OptionMinConns |
optMinConns |
protected DatabaseCLP.OptionDbPassword |
optPassword |
protected DatabaseCLP.OptionSchema |
optSchema |
protected DatabaseCLP.OptionDbUrl |
optUrl |
protected DatabaseCLP.OptionDbUser |
optUser |
optApplicationName
espritVersion, optDebug, optDemo, optHelp, optLocale, optLogDir, optLogToFile, optNoConsole, optTest, optVerbose, optVersion
Constructor and Description |
---|
DatabaseCLP(java.lang.Class mainClass,
java.lang.String... args) |
Modifier and Type | Method and Description |
---|---|
protected void |
checkForMissingCredentialOptions() |
protected void |
checkForMissingOption(CommandLineOption option) |
protected DatabaseCFG |
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 DatabaseCLP.OptionCredDir optCredDir
protected final DatabaseCLP.OptionCredFile optCredFile
protected final DatabaseCLP.OptionJdbcDriver optDriver
protected final DatabaseCLP.OptionDbUrl optUrl
protected final DatabaseCLP.OptionDbUser optUser
protected final DatabaseCLP.OptionDbPassword optPassword
protected final DatabaseCLP.OptionMinConns optMinConns
protected final DatabaseCLP.OptionMaxConns optMaxConns
protected final DatabaseCLP.OptionLoginTimeout optLoginTimeout
protected final DatabaseCLP.OptionSchema optSchema
public DatabaseCLP(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 DatabaseCFG 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 © 2013 EsprIT-Systems. All Rights Reserved.