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

public Class ReferenceDbUrlConnectionCommandStep

extends AbstractDatabaseConnectionCommandStep
implements CleanUpCommandStep
Class Inheritance
All Implemented Interfaces
liquibase.command.CleanUpCommandStep
Imports
liquibase.Scope, liquibase.command.*, liquibase.command.providers.ReferenceDatabase, liquibase.configuration.ConfigurationValueObfuscator, liquibase.database.Database, liquibase.database.jvm.JdbcConnection, liquibase.exception.DatabaseException, liquibase.logging.mdc.MdcKey, liquibase.util.StringUtil, java.util.Collections, .List

Internal command step to be used on pipeline to manage the database connection to the reference database.

Field Summary

Modifier and TypeField and Description
protected static final String[]
public static final CommandArgumentDefinition<Database>
public static final CommandArgumentDefinition<String>
public static final CommandArgumentDefinition<String>
public static final CommandArgumentDefinition<String>
public static final CommandArgumentDefinition<String>
public static final CommandArgumentDefinition<String>
public static final CommandArgumentDefinition<String>
public static final CommandArgumentDefinition<String>
public static final CommandArgumentDefinition<String>
public static final CommandArgumentDefinition<String>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
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"}}.

public static void
logMdc(String url, String username, String defaultSchemaName, String defaultCatalogName)

private Database
obtainDatabase(CommandScope
current command scope
commandScope
)

Try to retrieve and set the database object from the command scope, otherwise creates a new one .

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 void
run(CommandResultsBuilder resultsBuilder)

Implements liquibase.command.CommandStep.run.

Performs the business logic.

Inherited from liquibase.command.core.helpers.AbstractDatabaseConnectionCommandStep:
cleanUpcreateDatabaseObject

Field Detail

COMMAND_NAMEback to summary
protected static final String[] COMMAND_NAME

Hides liquibase.command.core.helpers.AbstractDatabaseConnectionCommandStep.COMMAND_NAME.

REFERENCE_DATABASE_ARGback to summary
public static final CommandArgumentDefinition<Database> REFERENCE_DATABASE_ARG
REFERENCE_DEFAULT_CATALOG_NAME_ARGback to summary
public static final CommandArgumentDefinition<String> REFERENCE_DEFAULT_CATALOG_NAME_ARG
REFERENCE_DEFAULT_SCHEMA_NAME_ARGback to summary
public static final CommandArgumentDefinition<String> REFERENCE_DEFAULT_SCHEMA_NAME_ARG
REFERENCE_DRIVER_ARGback to summary
public static final CommandArgumentDefinition<String> REFERENCE_DRIVER_ARG
REFERENCE_DRIVER_PROPERTIES_FILE_ARGback to summary
public static final CommandArgumentDefinition<String> REFERENCE_DRIVER_PROPERTIES_FILE_ARG
REFERENCE_LIQUIBASE_CATALOG_NAME_ARGback to summary
public static final CommandArgumentDefinition<String> REFERENCE_LIQUIBASE_CATALOG_NAME_ARG
REFERENCE_LIQUIBASE_SCHEMA_NAME_ARGback to summary
public static final CommandArgumentDefinition<String> REFERENCE_LIQUIBASE_SCHEMA_NAME_ARG
REFERENCE_PASSWORD_ARGback to summary
public static final CommandArgumentDefinition<String> REFERENCE_PASSWORD_ARG
REFERENCE_URL_ARGback to summary
public static final CommandArgumentDefinition<String> REFERENCE_URL_ARG
REFERENCE_USERNAME_ARGback to summary
public static final CommandArgumentDefinition<String> REFERENCE_USERNAME_ARG

Constructor Detail

ReferenceDbUrlConnectionCommandStepback to summary
public ReferenceDbUrlConnectionCommandStep()

Method Detail

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
logMdcback to summary
public static void logMdc(String url, String username, String defaultSchemaName, String defaultCatalogName)
obtainDatabaseback to summary
private Database obtainDatabase(CommandScope commandScope) throws DatabaseException

Try to retrieve and set the database object from the command scope, otherwise creates a new one .

Parameters
commandScope:CommandScope

current command scope

Exceptions
DatabaseException:
Thrown when there is a connection error
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
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