Top Description Fields Constructors Methods
liquibase.command.core.helpers

public Class DatabaseChangelogCommandStep

extends AbstractHelperCommandStep
implements CleanUpCommandStep
Class Inheritance
All Implemented Interfaces
liquibase.command.CleanUpCommandStep
Imports
liquibase.Beta, .Contexts, .LabelExpression, .Scope, liquibase.changelog.ChangeLogHistoryService, .ChangeLogHistoryServiceFactory, .ChangeLogParameters, .DatabaseChangeLog, liquibase.command.*, liquibase.configuration.ConfigurationValueProvider, .LiquibaseConfiguration, liquibase.configuration.core.DefaultsFileValueProvider, liquibase.database.Database, liquibase.exception.LiquibaseException, liquibase.lockservice.LockServiceFactory, liquibase.logging.mdc.MdcKey, liquibase.parser.ChangeLogParser, .ChangeLogParserFactory, liquibase.parser.core.xml.XMLChangeLogSAXParser, liquibase.resource.ResourceAccessor, liquibase.util.StringUtil, java.util.Arrays, .Collections, .HashMap, .List

This helper class provides two objects: a valid and verified DatabaseChangeLog and the ChangeLogParameters object used to instantiate it.

Field Summary

Modifier and TypeField and Description
public static final CommandArgumentDefinition<DatabaseChangeLog>
public static final CommandArgumentDefinition<String>
public static final CommandArgumentDefinition<ChangeLogParameters>
protected static final String[]
public static final CommandArgumentDefinition<String>
public static final CommandArgumentDefinition<String>
public static final CommandArgumentDefinition<Boolean>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static void
addCommandFiltersMdc(LabelExpression labelExpression, Contexts contexts)

private void
addDefaultFileProperties(ChangeLogParameters
the changelog parameters to update
changeLogParameters
)

Add default-file properties to changelog parameters

public void
addJavaProperties(ChangeLogParameters
the changelog parameters to update
changeLogParameters
)

Add java property arguments to changelog parameters

private void
checkLiquibaseTables(boolean updateExistingNullChecksums, DatabaseChangeLog databaseChangeLog, Contexts contexts, LabelExpression labelExpression, Database database)

public void
cleanUp(CommandResultsBuilder
builder used in this pipeline
resultsBuilder
)

Implements liquibase.command.CleanUpCommandStep.cleanUp.

Method invoked to execute the cleanup action.

public String[][]
defineCommandNames()

Implements liquibase.command.CommandStep.defineCommandNames.

Defines new command names For example, if it is part of `liquibase update`, this should return new String[][]{ new String[] {"update"}}.

private ChangeLogParameters
public static DatabaseChangeLog
getDatabaseChangeLog(String changeLogFile, ChangeLogParameters changeLogParameters, Database database)

public List<Class<?>>
providedDependencies()

Overrides liquibase.command.AbstractCommandStep.providedDependencies.

Implements liquibase.command.CommandStep.providedDependencies.

Returns a list of all the dependency Classes that this step provides

public List<Class<?>>
requiredDependencies()

Overrides liquibase.command.AbstractCommandStep.requiredDependencies.

Implements liquibase.command.CommandStep.requiredDependencies.

Return a list of configured Classes that this command requires to be passed as a dependency.

public void
run(CommandResultsBuilder resultsBuilder)

Implements liquibase.command.CommandStep.run.

Performs the business logic.

Inherited from liquibase.command.core.helpers.AbstractHelperCommandStep:
adjustCommandDefinition

Field Detail

CHANGELOG_ARGback to summary
public static final CommandArgumentDefinition<DatabaseChangeLog> CHANGELOG_ARG
CHANGELOG_FILE_ARGback to summary
public static final CommandArgumentDefinition<String> CHANGELOG_FILE_ARG
CHANGELOG_PARAMETERSback to summary
public static final CommandArgumentDefinition<ChangeLogParameters> CHANGELOG_PARAMETERS
COMMAND_NAMEback to summary
protected static final String[] COMMAND_NAME
CONTEXTS_ARGback to summary
public static final CommandArgumentDefinition<String> CONTEXTS_ARG
LABEL_FILTER_ARGback to summary
public static final CommandArgumentDefinition<String> LABEL_FILTER_ARG
UPDATE_NULL_CHECKSUMSback to summary
public static final CommandArgumentDefinition<Boolean> UPDATE_NULL_CHECKSUMS
Annotations
@Beta

Constructor Detail

DatabaseChangelogCommandStepback to summary
public DatabaseChangelogCommandStep()

Method Detail

addCommandFiltersMdcback to summary
public static void addCommandFiltersMdc(LabelExpression labelExpression, Contexts contexts)
addDefaultFilePropertiesback to summary
private void addDefaultFileProperties(ChangeLogParameters changeLogParameters)

Add default-file properties to changelog parameters

Parameters
changeLogParameters:ChangeLogParameters

the changelog parameters to update

addJavaPropertiesback to summary
public void addJavaProperties(ChangeLogParameters changeLogParameters)

Add java property arguments to changelog parameters

Parameters
changeLogParameters:ChangeLogParameters

the changelog parameters to update

checkLiquibaseTablesback to summary
private void checkLiquibaseTables(boolean updateExistingNullChecksums, DatabaseChangeLog databaseChangeLog, Contexts contexts, LabelExpression labelExpression, Database database) throws LiquibaseException
cleanUpback to summary
public void cleanUp(CommandResultsBuilder resultsBuilder)

Implements liquibase.command.CleanUpCommandStep.cleanUp.

Doc from liquibase.command.CleanUpCommandStep.cleanUp.

Method invoked to execute the cleanup action.

Parameters
resultsBuilder:CommandResultsBuilder

builder used in this pipeline

Annotations
@Override
defineCommandNamesback to summary
public String[][] defineCommandNames()

Implements liquibase.command.CommandStep.defineCommandNames.

Doc from liquibase.command.CommandStep.defineCommandNames.

Defines new command names For example, if it is part of `liquibase update`, this should return new String[][]{ new String[] {"update"}}. If it is a part of `liquibase example init`, this should return {"example", "init"}.

This is used to determine the available command names.

This can return null if this step is not defining a new command but "cross-cutting" existing commands

Annotations
@Override
getChangeLogParametersback to summary
private ChangeLogParameters getChangeLogParameters(CommandScope commandScope, Database database)
getDatabaseChangeLogback to summary
public static DatabaseChangeLog getDatabaseChangeLog(String changeLogFile, ChangeLogParameters changeLogParameters, Database database) throws Exception
providedDependenciesback to summary
public List<Class<?>> providedDependencies()

Overrides liquibase.command.AbstractCommandStep.providedDependencies.

Implements liquibase.command.CommandStep.providedDependencies.

Doc from liquibase.command.CommandStep.providedDependencies.

Returns a list of all the dependency Classes that this step provides

Returns:List<Class<?>>

list with the provided classes types

Annotations
@Override
requiredDependenciesback to summary
public List<Class<?>> requiredDependencies()

Overrides liquibase.command.AbstractCommandStep.requiredDependencies.

Implements liquibase.command.CommandStep.requiredDependencies.

Doc from liquibase.command.CommandStep.requiredDependencies.

Return a list of configured Classes that this command requires to be passed as a dependency.

Returns:List<Class<?>>

list with the required classes types

Annotations
@Override
runback to summary
public void run(CommandResultsBuilder resultsBuilder) throws Exception

Implements liquibase.command.CommandStep.run.

Doc from liquibase.command.CommandStep.run.

Performs the business logic. This method should not be called directly. It is called by the overall pipeline logic in the CommandScope#execute() order.

Annotations
@Override