Package liquibase.command.core
Class AbstractUpdateCommandStep
- java.lang.Object
-
- liquibase.command.AbstractCommandStep
-
- liquibase.command.core.AbstractUpdateCommandStep
-
- All Implemented Interfaces:
CleanUpCommandStep,CommandStep
- Direct Known Subclasses:
UpdateCommandStep,UpdateCountCommandStep,UpdateSqlCommandStep,UpdateToTagCommandStep
public abstract class AbstractUpdateCommandStep extends AbstractCommandStep implements CleanUpCommandStep
-
-
Field Summary
Fields Modifier and Type Field Description static StringDEFAULT_CHANGE_EXEC_LISTENER_RESULT_KEY-
Fields inherited from class liquibase.command.AbstractCommandStep
coreBundle
-
Fields inherited from interface liquibase.command.CommandStep
ORDER_DEFAULT, ORDER_NOT_APPLICABLE
-
-
Constructor Summary
Constructors Constructor Description AbstractUpdateCommandStep()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidcleanUp(CommandResultsBuilder resultsBuilder)Method invoked to execute the cleanup action.protected voidcustomMdcLogging(CommandScope commandScope)abstract StringgetChangelogFileArg(CommandScope commandScope)abstract String[]getCommandName()abstract StringgetContextsArg(CommandScope commandScope)abstract StringgetLabelFilterArg(CommandScope commandScope)abstract UpdateSummaryEnumgetShowSummary(CommandScope commandScope)UpdateSummaryOutputEnumgetShowSummaryOutput(CommandScope commandScope)ChangeLogIteratorgetStandardChangelogIterator(CommandScope commandScope, Database database, Contexts contexts, LabelExpression labelExpression, DatabaseChangeLog changeLog)protected List<ChangeSetFilter>getStandardChangelogIteratorFilters(Database database, Contexts contexts, LabelExpression labelExpression)ChangeLogIteratorgetStatusChangelogIterator(CommandScope commandScope, Database database, Contexts contexts, LabelExpression labelExpression, DatabaseChangeLog changeLog)booleanisUpToDate(CommandScope commandScope, Database database, DatabaseChangeLog databaseChangeLog, Contexts contexts, LabelExpression labelExpression, OutputStream outputStream)Checks if the database is up-to-date.booleanisUpToDateFastCheck(CommandScope commandScope, Database database, DatabaseChangeLog databaseChangeLog, Contexts contexts, LabelExpression labelExpression)voidpostUpdateLog(int rowsAffected)Logprotected voidpreRun(CommandScope commandScope, ChangeLogIterator runChangeLogIterator, ChangeLogParameters changeLogParameters)Executed before running any updates against the database.List<Class<?>>requiredDependencies()Return a list of configured Classes that this command requires to be passed as a dependency.voidrun(CommandResultsBuilder resultsBuilder)Performs the business logic.protected voidsetDBLock(boolean locked)voidsetFastCheckEnabled(boolean fastCheckEnabled)-
Methods inherited from class liquibase.command.AbstractCommandStep
adjustCommandDefinition, getOrder, providedDependencies, validate
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface liquibase.command.CommandStep
defineCommandNames
-
-
-
-
Field Detail
-
DEFAULT_CHANGE_EXEC_LISTENER_RESULT_KEY
public static final String DEFAULT_CHANGE_EXEC_LISTENER_RESULT_KEY
- See Also:
- Constant Field Values
-
-
Method Detail
-
getChangelogFileArg
public abstract String getChangelogFileArg(CommandScope commandScope)
-
getContextsArg
public abstract String getContextsArg(CommandScope commandScope)
-
getLabelFilterArg
public abstract String getLabelFilterArg(CommandScope commandScope)
-
getCommandName
public abstract String[] getCommandName()
-
getShowSummary
public abstract UpdateSummaryEnum getShowSummary(CommandScope commandScope)
-
getShowSummaryOutput
public UpdateSummaryOutputEnum getShowSummaryOutput(CommandScope commandScope)
-
requiredDependencies
public List<Class<?>> requiredDependencies()
Description copied from interface:CommandStepReturn a list of configured Classes that this command requires to be passed as a dependency.- Specified by:
requiredDependenciesin interfaceCommandStep- Overrides:
requiredDependenciesin classAbstractCommandStep- Returns:
- list with the required classes types
-
run
public void run(CommandResultsBuilder resultsBuilder) throws Exception
Description copied from interface:CommandStepPerforms the business logic. This method should not be called directly. It is called by the overall pipeline logic in theCommandScope.execute()order.- Specified by:
runin interfaceCommandStep- Throws:
Exception
-
preRun
protected void preRun(CommandScope commandScope, ChangeLogIterator runChangeLogIterator, ChangeLogParameters changeLogParameters) throws LiquibaseException
Executed before running any updates against the database.- Throws:
LiquibaseException
-
customMdcLogging
protected void customMdcLogging(CommandScope commandScope)
-
cleanUp
public void cleanUp(CommandResultsBuilder resultsBuilder)
Description copied from interface:CleanUpCommandStepMethod invoked to execute the cleanup action.- Specified by:
cleanUpin interfaceCleanUpCommandStep- Parameters:
resultsBuilder- builder used in this pipeline
-
getStandardChangelogIterator
@Beta public ChangeLogIterator getStandardChangelogIterator(CommandScope commandScope, Database database, Contexts contexts, LabelExpression labelExpression, DatabaseChangeLog changeLog) throws LiquibaseException
- Throws:
LiquibaseException
-
getStatusChangelogIterator
@Beta public ChangeLogIterator getStatusChangelogIterator(CommandScope commandScope, Database database, Contexts contexts, LabelExpression labelExpression, DatabaseChangeLog changeLog) throws LiquibaseException
- Throws:
LiquibaseException
-
getStandardChangelogIteratorFilters
protected List<ChangeSetFilter> getStandardChangelogIteratorFilters(Database database, Contexts contexts, LabelExpression labelExpression)
-
isUpToDateFastCheck
public boolean isUpToDateFastCheck(CommandScope commandScope, Database database, DatabaseChangeLog databaseChangeLog, Contexts contexts, LabelExpression labelExpression) throws LiquibaseException
- Throws:
LiquibaseException
-
isUpToDate
@Beta public boolean isUpToDate(CommandScope commandScope, Database database, DatabaseChangeLog databaseChangeLog, Contexts contexts, LabelExpression labelExpression, OutputStream outputStream) throws LiquibaseException, IOException
Checks if the database is up-to-date.- Parameters:
commandScope-database- the database to checkdatabaseChangeLog- the databaseChangeLog of the databasecontexts- the command contextslabelExpression- the command label expressionsoutputStream- the current global OutputStream- Returns:
- true if there are no additional changes to execute, otherwise false
- Throws:
LiquibaseException- if there was a problem running any queriesIOException- if there was a problem handling the update summary
-
setFastCheckEnabled
public void setFastCheckEnabled(boolean fastCheckEnabled)
-
postUpdateLog
@Beta public void postUpdateLog(int rowsAffected)
Log
-
setDBLock
protected void setDBLock(boolean locked)
-
-