Package liquibase.command
Interface CommandStep
-
- All Known Implementing Classes:
AbstractArgumentCommandStep,AbstractChangelogCommandStep,AbstractCliWrapperCommandStep,AbstractCommandStep,AbstractDatabaseConnectionCommandStep,AbstractFutureRollbackCommandStep,AbstractHelperCommandStep,AbstractOutputWriterCommandStep,AbstractRollbackCommandStep,AbstractUpdateCommandStep,CalculateChecksumCommandStep,ChangeExecListenerCommandStep,ChangelogSyncCommandStep,ChangelogSyncSqlCommandStep,ChangelogSyncToTagCommandStep,ChangelogSyncToTagSqlCommandStep,ClearChecksumsCommandStep,DatabaseChangelogCommandStep,DbDocCommandStep,DbUrlConnectionArgumentsCommandStep,DbUrlConnectionCommandStep,DiffChangelogCommandStep,DiffCommandStep,DiffOutputControlCommandStep,DropAllCommandStep,ExecuteSqlCommandStep,FutureRollbackCountSqlCommandStep,FutureRollbackFromTagSqlCommandStep,FutureRollbackSqlCommandStep,GenerateChangelogCommandStep,HistoryCommandStep,InternalHistoryCommandStep,InternalSnapshotCommandStep,ListLocksCommandStep,LockServiceCommandStep,MarkNextChangesetRanCommandStep,MarkNextChangesetRanSqlCommandStep,OutputWriterCommandStep,PreCompareCommandStep,ReferenceDatabaseOutputWriterCommandStep,ReferenceDbUrlConnectionCommandStep,ReleaseLocksCommandStep,RollbackCommandStep,RollbackCountCommandStep,RollbackCountSqlCommandStep,RollbackSqlCommandStep,RollbackToDateCommandStep,RollbackToDateSqlCommandStep,ShowSummaryArgument,SnapshotCommandStep,SnapshotReferenceCommandStep,StartH2CommandStep,StatusCommandStep,TagCommandStep,TagExistsCommandStep,TestSystemDownCommand,TestSystemUpCommand,UnexpectedChangesetsCommandStep,UpdateCommandStep,UpdateCountCommandStep,UpdateCountSqlCommandStep,UpdateSqlCommandStep,UpdateTestingRollbackCommandStep,UpdateToTagCommandStep,UpdateToTagSqlCommandStep,ValidateCommandStep
public interface CommandStepDefines a particular step in a command pipeline. When a command is executed, Liquibase will find all the step whosedefineCommandNames()matches the command, add the dependencies and run the pipeline.- See Also:
CommandScope.execute()
-
-
Field Summary
Fields Modifier and Type Field Description static intORDER_DEFAULTDeprecated.static intORDER_NOT_APPLICABLEDeprecated.
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description voidadjustCommandDefinition(CommandDefinition commandDefinition)Called by the command pipeline setup to adjust theCommandDefinitionmetadata about the overall command.String[][]defineCommandNames()Defines new command names For example, if it is part of `liquibase update`, this should return new String[][]{ new String[] {"update"}}.intgetOrder(CommandDefinition commandDefinition)Deprecated.List<Class<?>>providedDependencies()Returns a list of all the dependency Classes that this step providesList<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.voidvalidate(CommandScope commandScope)Validates that theCommandScopeis correctly set up for this step to run.
-
-
-
Field Detail
-
ORDER_DEFAULT
@Deprecated static final int ORDER_DEFAULT
Deprecated.Returned bygetOrder(CommandDefinition)if you are unsure where in the pipeline your step should go, use this value.- See Also:
- Constant Field Values
-
ORDER_NOT_APPLICABLE
@Deprecated static final int ORDER_NOT_APPLICABLE
Deprecated.Returned bygetOrder(CommandDefinition)if this step should not be a part of the pipeline.- See Also:
- Constant Field Values
-
-
Method Detail
-
defineCommandNames
String[][] 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
-
getOrder
@Deprecated int getOrder(CommandDefinition commandDefinition)
Deprecated.The order in the pipeline that this step should be executed in. Logic is generally based offCommandDefinition.getName()but it can check other things in the definition such as arguments.- Returns:
- -1 if this step does not apply to the given command
-
adjustCommandDefinition
void adjustCommandDefinition(CommandDefinition commandDefinition)
Called by the command pipeline setup to adjust theCommandDefinitionmetadata about the overall command. This method should not be called directly. It is called by the overall pipeline logic in theCommandFactory.getCommandDefinition(String...).
-
validate
void validate(CommandScope commandScope) throws CommandValidationException
Validates that theCommandScopeis correctly set up for this step to run. Any validation inCommandArgumentDefinition.validate(CommandScope)will be checked previous to this method being called.- Throws:
CommandValidationException
-
run
void run(CommandResultsBuilder resultsBuilder) throws Exception
Performs the business logic. This method should not be called directly. It is called by the overall pipeline logic in theCommandScope.execute()order.- Throws:
Exception
-
requiredDependencies
List<Class<?>> requiredDependencies()
Return a list of configured Classes that this command requires to be passed as a dependency.- Returns:
- list with the required classes types
-
-