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 CommandStep
Defines a particular step in a command pipeline. When a command is executed, Liquibase will find all the step whose defineCommandNames() matches the command, add the dependencies and run the pipeline.
See Also:
  • Field Details

  • Method Details

    • 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 off CommandDefinition.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 the CommandDefinition metadata about the overall command. This method should not be called directly. It is called by the overall pipeline logic in the CommandFactory.getCommandDefinition(String...).
    • validate

      void validate(CommandScope commandScope) throws CommandValidationException
      Validates that the CommandScope is correctly set up for this step to run. Any validation in CommandArgumentDefinition.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 the CommandScope.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
    • providedDependencies

      List<Class<?>> providedDependencies()
      Returns a list of all the dependency Classes that this step provides
      Returns:
      list with the provided classes types