Class Main
- java.lang.Object
-
- liquibase.integration.commandline.Main
-
public class Main extends Object
Deprecated.use liquibase.integration.commandline.LiquibaseCommandLine.Class for executing Liquibase via the command line.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classMain.CodePointCheckDeprecated.
-
Field Summary
Fields Modifier and Type Field Description protected StringchangeExecListenerClassDeprecated.protected StringchangeExecListenerPropertiesFileDeprecated.protected StringchangeLogFileDeprecated.protected Map<String,Object>changeLogParametersDeprecated.protected StringchangeSetAuthorDeprecated.protected StringchangeSetContextDeprecated.protected ClassLoaderclassLoaderDeprecated.protected StringclasspathDeprecated.protected StringcommandDeprecated.protected Set<String>commandParamsDeprecated.protected StringcontextsDeprecated.protected StringcurrentDateTimeFunctionDeprecated.protected StringdatabaseChangeLogLockTableNameDeprecated.protected StringdatabaseChangeLogTableNameDeprecated.protected StringdatabaseChangeLogTablespaceNameDeprecated.protected StringdatabaseClassDeprecated.protected StringdataOutputDirectoryDeprecated.protected BooleandeactivateDeprecated.protected StringdefaultCatalogNameDeprecated.protected StringdefaultSchemaNameDeprecated.protected StringdefaultsFileDeprecated.protected StringdelimiterDeprecated.protected StringdiffTypesDeprecated.protected StringdriverDeprecated.protected StringdriverPropertiesFileDeprecated.protected StringexcludeObjectsDeprecated.protected StringformatDeprecated.protected BooleanincludeCatalogDeprecated.protected StringincludeObjectsDeprecated.protected BooleanincludeSchemaDeprecated.protected BooleanincludeSystemClasspathDeprecated.protected BooleanincludeTablespaceDeprecated.protected StringlabelFilterDeprecated.protected StringlabelsDeprecated.protected StringliquibaseCatalogNameDeprecated.protected StringliquibaseProLicenseKeyDeprecated.protected StringliquibaseSchemaNameDeprecated.protected StringlogFileDeprecated.protected StringlogLevelDeprecated.static Map<String,String>newCliChangelogParametersDeprecated.protected StringoutputDefaultCatalogDeprecated.protected StringoutputDefaultSchemaDeprecated.protected StringoutputFileDeprecated.protected StringoutputSchemasAsDeprecated.protected StringoverwriteOutputFileDeprecated.protected StringpasswordDeprecated.protected BooleanpromptForNonLocalDatabaseDeprecated.protected StringpropertyProviderClassDeprecated.protected StringreferenceDefaultCatalogNameDeprecated.protected StringreferenceDefaultSchemaNameDeprecated.protected StringreferenceDriverDeprecated.protected StringreferencePasswordDeprecated.protected StringreferenceSchemasDeprecated.protected StringreferenceUrlDeprecated.protected StringreferenceUsernameDeprecated.protected BooleanrollbackOnErrorDeprecated.protected StringrollbackScriptDeprecated.static booleanrunningFromNewCliDeprecated.protected List<CatalogAndSchema>schemaListDeprecated.protected StringschemasDeprecated.protected StringshowSummaryDeprecated.protected StringsnapshotFormatDeprecated.protected StringsqlFileDeprecated.protected StringurlDeprecated.protected StringusernameDeprecated.
-
Constructor Summary
Constructors Constructor Description Main()Deprecated.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected voidapplyDefaults()Deprecated.protected static Main.CodePointCheckcheckArg(String arg)Deprecated.Check the string for known characters which cannot be handledprotected List<String>checkSetup()Deprecated.After parsing, checks if the given combination of main command and can be executed.protected ClassLoaderconfigureClassLoader()Deprecated.protected voiddoMigration()Deprecated.Do the actual database migration, i.e.protected String[]fixupArgs(String[] args)Deprecated.On windows machines, it splits args on '=' signs.booleanisWindows()Deprecated.Determines if this program is executed on a Microsoft Windows-type of operating system.static voidmain(String[] args)Deprecated.Entry point.protected voidparseDefaultPropertyFiles()Deprecated.Search for both liquibase.properties (or whatever the name of the current defaultsFile is) and the "local" variant liquibase.local.properties.protected voidparseOptions(String[] paramArgs)Deprecated.Parses the command line options.protected voidparsePropertiesFile(InputStream propertiesInputStream)Deprecated.Reads various execution parameters from an InputStream and sets our internal state according to the values found.protected voidprintHelp(PrintStream stream)Deprecated.Print instructions on how to use this program from the command line.protected voidprintHelp(List<String> errorMessages, PrintStream stream)Deprecated.If any errors have been found, print the list of errors first, then print the command line help text.static intrun(String[] args)Deprecated.Process the command line arguments and perform the appropriate main action (update, rollback etc.)protected static voidsetLogLevel(LogService logService, Logger rootLogger, Logger liquibaseLogger, Level level)Deprecated.static PrintStreamsetOutputStream(PrintStream outputStream)Deprecated.Sets the default outputstream to use.
-
-
-
Field Detail
-
runningFromNewCli
public static boolean runningFromNewCli
Deprecated.
-
classLoader
protected ClassLoader classLoader
Deprecated.
-
driver
protected String driver
Deprecated.
-
username
protected String username
Deprecated.
-
password
protected String password
Deprecated.
-
url
protected String url
Deprecated.
-
databaseClass
protected String databaseClass
Deprecated.
-
defaultSchemaName
protected String defaultSchemaName
Deprecated.
-
outputDefaultSchema
protected String outputDefaultSchema
Deprecated.
-
outputDefaultCatalog
protected String outputDefaultCatalog
Deprecated.
-
liquibaseCatalogName
protected String liquibaseCatalogName
Deprecated.
-
liquibaseSchemaName
protected String liquibaseSchemaName
Deprecated.
-
databaseChangeLogTableName
protected String databaseChangeLogTableName
Deprecated.
-
databaseChangeLogLockTableName
protected String databaseChangeLogLockTableName
Deprecated.
-
databaseChangeLogTablespaceName
protected String databaseChangeLogTablespaceName
Deprecated.
-
defaultCatalogName
protected String defaultCatalogName
Deprecated.
-
changeLogFile
protected String changeLogFile
Deprecated.
-
overwriteOutputFile
protected String overwriteOutputFile
Deprecated.
-
classpath
protected String classpath
Deprecated.
-
contexts
protected String contexts
Deprecated.
-
labels
protected String labels
Deprecated.
-
labelFilter
protected String labelFilter
Deprecated.
-
driverPropertiesFile
protected String driverPropertiesFile
Deprecated.
-
propertyProviderClass
protected String propertyProviderClass
Deprecated.
-
changeExecListenerClass
protected String changeExecListenerClass
Deprecated.
-
changeExecListenerPropertiesFile
protected String changeExecListenerPropertiesFile
Deprecated.
-
promptForNonLocalDatabase
protected Boolean promptForNonLocalDatabase
Deprecated.
-
includeSystemClasspath
protected Boolean includeSystemClasspath
Deprecated.
-
defaultsFile
protected String defaultsFile
Deprecated.
-
diffTypes
protected String diffTypes
Deprecated.
-
changeSetAuthor
protected String changeSetAuthor
Deprecated.
-
changeSetContext
protected String changeSetContext
Deprecated.
-
dataOutputDirectory
protected String dataOutputDirectory
Deprecated.
-
referenceDriver
protected String referenceDriver
Deprecated.
-
referenceUrl
protected String referenceUrl
Deprecated.
-
referenceUsername
protected String referenceUsername
Deprecated.
-
referencePassword
protected String referencePassword
Deprecated.
-
referenceDefaultCatalogName
protected String referenceDefaultCatalogName
Deprecated.
-
referenceDefaultSchemaName
protected String referenceDefaultSchemaName
Deprecated.
-
currentDateTimeFunction
protected String currentDateTimeFunction
Deprecated.
-
command
protected String command
Deprecated.
-
logLevel
protected String logLevel
Deprecated.
-
logFile
protected String logFile
Deprecated.
-
outputFile
protected String outputFile
Deprecated.
-
excludeObjects
protected String excludeObjects
Deprecated.
-
includeCatalog
protected Boolean includeCatalog
Deprecated.
-
includeObjects
protected String includeObjects
Deprecated.
-
includeSchema
protected Boolean includeSchema
Deprecated.
-
includeTablespace
protected Boolean includeTablespace
Deprecated.
-
deactivate
protected Boolean deactivate
Deprecated.
-
outputSchemasAs
protected String outputSchemasAs
Deprecated.
-
referenceSchemas
protected String referenceSchemas
Deprecated.
-
schemas
protected String schemas
Deprecated.
-
snapshotFormat
protected String snapshotFormat
Deprecated.
-
liquibaseProLicenseKey
protected String liquibaseProLicenseKey
Deprecated.
-
sqlFile
protected String sqlFile
Deprecated.
-
delimiter
protected String delimiter
Deprecated.
-
rollbackScript
protected String rollbackScript
Deprecated.
-
rollbackOnError
protected Boolean rollbackOnError
Deprecated.
-
schemaList
protected List<CatalogAndSchema> schemaList
Deprecated.
-
format
protected String format
Deprecated.
-
showSummary
protected String showSummary
Deprecated.
-
-
Method Detail
-
main
public static void main(String[] args)
Deprecated.Entry point. This is what gets executes when starting this program from the command line. This is actually a simple wrapper so that an errorlevel of != 0 is guaranteed in case of an uncaught exception.- Parameters:
args- the command line arguments
-
run
public static int run(String[] args) throws Exception
Deprecated.Process the command line arguments and perform the appropriate main action (update, rollback etc.)- Parameters:
args- the command line arguments- Returns:
- the errorlevel to be returned to the operating system, e.g. for further processing by scripts
- Throws:
LiquibaseException- a runtime exceptionException
-
setLogLevel
protected static void setLogLevel(LogService logService, Logger rootLogger, Logger liquibaseLogger, Level level)
Deprecated.
-
parseDefaultPropertyFiles
protected void parseDefaultPropertyFiles() throws CommandLineParsingExceptionDeprecated.Search for both liquibase.properties (or whatever the name of the current defaultsFile is) and the "local" variant liquibase.local.properties. The contents of the local variant overwrite parameters with the same name in the regular properties file.- Throws:
CommandLineParsingException- if an error occurs during parsing
-
fixupArgs
protected String[] fixupArgs(String[] args)
Deprecated.On windows machines, it splits args on '=' signs. Put it back like it was.
-
checkSetup
protected List<String> checkSetup()
Deprecated.After parsing, checks if the given combination of main command and can be executed.- Returns:
- an empty List if successful, or a list of error messages
-
parsePropertiesFile
protected void parsePropertiesFile(InputStream propertiesInputStream) throws IOException, CommandLineParsingException
Deprecated.Reads various execution parameters from an InputStream and sets our internal state according to the values found.- Parameters:
propertiesInputStream- an InputStream from a Java properties file- Throws:
IOException- if there is a problem reading the InputStreamCommandLineParsingException- if an invalid property is encountered
-
printHelp
protected void printHelp(List<String> errorMessages, PrintStream stream)
Deprecated.If any errors have been found, print the list of errors first, then print the command line help text.- Parameters:
errorMessages- List of error messagesstream- the output stream to write the text to
-
printHelp
protected void printHelp(PrintStream stream)
Deprecated.Print instructions on how to use this program from the command line.- Parameters:
stream- the output stream to write the help text to
-
checkArg
protected static Main.CodePointCheck checkArg(String arg)
Deprecated.Check the string for known characters which cannot be handled- Parameters:
arg- Input parameter to check- Returns:
- int A CodePointCheck object, or null to indicate all good
-
parseOptions
protected void parseOptions(String[] paramArgs) throws CommandLineParsingException
Deprecated.Parses the command line options. If an invalid argument is given, a CommandLineParsingException is thrown.- Parameters:
paramArgs- the arguments to parse- Throws:
CommandLineParsingException- thrown if an invalid argument is passed
-
applyDefaults
protected void applyDefaults()
Deprecated.
-
configureClassLoader
protected ClassLoader configureClassLoader() throws CommandLineParsingException
Deprecated.- Throws:
CommandLineParsingException
-
doMigration
protected void doMigration() throws ExceptionDeprecated.Do the actual database migration, i.e. apply the ChangeSets.- Throws:
Exception
-
setOutputStream
public static PrintStream setOutputStream(PrintStream outputStream)
Deprecated.Sets the default outputstream to use. Mainly useful for testing and the Command wrappers.
-
isWindows
public boolean isWindows()
Deprecated.Determines if this program is executed on a Microsoft Windows-type of operating system.- Returns:
- true if running under some variant of MS Windows, false otherwise.
-
-