Package liquibase.command.core.helpers
Class DatabaseChangelogCommandStep
java.lang.Object
liquibase.command.AbstractCommandStep
liquibase.command.core.helpers.AbstractHelperCommandStep
liquibase.command.core.helpers.DatabaseChangelogCommandStep
- All Implemented Interfaces:
CleanUpCommandStep,CommandStep
public class DatabaseChangelogCommandStep
extends AbstractHelperCommandStep
implements CleanUpCommandStep
This helper class provides two objects: a valid and verified DatabaseChangeLog and the ChangeLogParameters
object used to instantiate it.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final CommandArgumentDefinition<DatabaseChangeLog> static final CommandArgumentDefinition<String> static final CommandArgumentDefinition<ChangeLogParameters> static final String[]static final CommandArgumentDefinition<String> static final CommandArgumentDefinition<String> static final CommandArgumentDefinition<Boolean> Fields inherited from class liquibase.command.AbstractCommandStep
coreBundleFields inherited from interface liquibase.command.CommandStep
ORDER_DEFAULT, ORDER_NOT_APPLICABLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddCommandFiltersMdc(LabelExpression labelExpression, Contexts contexts) Adds label and context filter values to the MDC for logging purposes.voidaddJavaProperties(ChangeLogParameters changeLogParameters) Deprecated.voidcleanUp(CommandResultsBuilder resultsBuilder) Cleans up resources held by this command step.String[][]Returns the command names defined by this step.static DatabaseChangeLoggetDatabaseChangeLog(String changeLogFile, ChangeLogParameters changeLogParameters, Database database) Parses and returns the database change log from the specified file.Returns the classes provided by this command step.Returns the classes required by this command step.voidrun(CommandResultsBuilder resultsBuilder) Executes the changelog command step.Methods inherited from class liquibase.command.core.helpers.AbstractHelperCommandStep
adjustCommandDefinition, isInternalMethods inherited from class liquibase.command.AbstractCommandStep
getOrder, handleOutput, validate
-
Field Details
-
COMMAND_NAME
-
CHANGELOG_FILE_ARG
-
CHANGELOG_ARG
-
LABEL_FILTER_ARG
-
CONTEXTS_ARG
-
CHANGELOG_PARAMETERS
-
UPDATE_NULL_CHECKSUMS
-
-
Constructor Details
-
DatabaseChangelogCommandStep
public DatabaseChangelogCommandStep()
-
-
Method Details
-
providedDependencies
Returns the classes provided by this command step.- Specified by:
providedDependenciesin interfaceCommandStep- Overrides:
providedDependenciesin classAbstractCommandStep- Returns:
- list of dependency classes
-
requiredDependencies
Returns the classes required by this command step.- Specified by:
requiredDependenciesin interfaceCommandStep- Overrides:
requiredDependenciesin classAbstractCommandStep- Returns:
- list of required dependency classes
-
run
Executes the changelog command step.- Specified by:
runin interfaceCommandStep- Parameters:
resultsBuilder- the command results builder- Throws:
Exception- if an error occurs during execution
-
addCommandFiltersMdc
Adds label and context filter values to the MDC for logging purposes.- Parameters:
labelExpression- the label expression to logcontexts- the contexts to log
-
getDatabaseChangeLog
public static DatabaseChangeLog getDatabaseChangeLog(String changeLogFile, ChangeLogParameters changeLogParameters, Database database) throws Exception Parses and returns the database change log from the specified file.- Parameters:
changeLogFile- the path to the changelog filechangeLogParameters- the parameters for parsingdatabase- the database context- Returns:
- the parsed DatabaseChangeLog
- Throws:
Exception- if parsing fails
-
defineCommandNames
Returns the command names defined by this step.- Specified by:
defineCommandNamesin interfaceCommandStep- Returns:
- array of command name arrays
-
cleanUp
Cleans up resources held by this command step.- Specified by:
cleanUpin interfaceCleanUpCommandStep- Parameters:
resultsBuilder- the command results builder
-
addJavaProperties
Deprecated.useChangeLogParameters.addJavaProperties()instead.Add java property arguments to changelog parameters- Parameters:
changeLogParameters- the changelog parameters to update
-
ChangeLogParameters.addJavaProperties()instead.