public class ExecuteShellCommandChange extends AbstractChange
Modifier and Type | Class and Description |
---|---|
class |
ExecuteShellCommandChange.StreamGobbler |
LiquibaseSerializable.SerializationType
Modifier and Type | Field and Description |
---|---|
protected List<String> |
finalCommandArray |
protected Integer |
maxStreamGobblerOutput |
NODENAME_COLUMN
EMPTY_CHANGE
GENERIC_CHANGELOG_EXTENSION_NAMESPACE, GENERIC_SNAPSHOT_EXTENSION_NAMESPACE, STANDARD_CHANGELOG_NAMESPACE, STANDARD_SNAPSHOT_NAMESPACE
PRIORITY_DEFAULT, PRIORITY_NOT_APPLICABLE, PRIORITY_SPECIALIZED
Constructor and Description |
---|
ExecuteShellCommandChange() |
checkStatus, createChangeMetaData, createChangeParameterMetadata, createDescriptionMetaData, createEmptyColumnConfig, createExampleValueMetaData, createInverses, createMustEqualExistingMetaData, createRequiredDatabasesMetaData, createSerializationTypeMetaData, createSinceMetaData, createSupportedDatabasesMetaData, finishInitialization, generateCheckSum, generateRollbackStatements, getAffectedDatabaseObjects, getChangeSet, getDescription, getResourceAccessor, getSerializableFieldNamespace, getSerializableFields, getSerializableFieldType, getSerializableFieldValue, getSerializedObjectName, isInvalidProperty, load, serialize, serializeValue, setChangeSet, setResourceAccessor, supports, supportsRollback
clone, describe, equals, get, get, get, getAttributes, getFieldValue, getObjectMetaData, getValuePath, has, hashCode, set
finalize, getClass, notify, notifyAll, wait, wait, wait
clone, describe, get, get, getAttributes, getObjectMetaData, getValuePath, has, set
protected Integer maxStreamGobblerOutput
public boolean generateStatementsVolatile(Database database)
AbstractChange
SqlGenerator.generateStatementsIsVolatile(Database)
method on the
SqlStatement
objects returned by Change.generateStatements(liquibase.database.Database)
.
If zero or null SqlStatements are returned by generateStatements then this method returns false.generateStatementsVolatile
in interface Change
generateStatementsVolatile
in class AbstractChange
public boolean generateRollbackStatementsVolatile(Database database)
AbstractChange
SqlGenerator.generateRollbackStatementsIsVolatile(Database)
method on the SqlStatement
objects returned by Change.generateStatements(liquibase.database.Database)
If no or null SqlStatements are returned by generateRollbackStatements then this method returns false.generateRollbackStatementsVolatile
in interface Change
generateRollbackStatementsVolatile
in class AbstractChange
public String getExecutable()
public void setExecutable(String executable)
public void addArg(String arg)
public String getTimeout()
public void setTimeout(String timeout)
public void setOs(String os)
public ValidationErrors validate(Database database)
AbstractChange
SqlGenerator.validate(liquibase.statement.SqlStatement,
liquibase.database.Database, liquibase.sqlgenerator.SqlGeneratorChain)
method on the SqlStatement
objects returned by Change.generateStatements(liquibase.database.Database)
.
If no or null SqlStatements are returned by generateStatements then this method returns no errors.
If there are no parameters than this method returns no errorsvalidate
in interface Change
validate
in class AbstractChange
public Warnings warn(Database database)
AbstractChange
SqlGenerator.warn(liquibase.statement.SqlStatement, liquibase.database.Database,
liquibase.sqlgenerator.SqlGeneratorChain)
method on the SqlStatement
objects returned by
Change.generateStatements(liquibase.database.Database)
.
If a generated statement is not supported for the given database, no warning will be added since that is a
validation error. If no or null SqlStatements are returned by generateStatements then this method returns no
warnings.warn
in interface Change
warn
in class AbstractChange
public SqlStatement[] generateStatements(Database database)
Change
SqlStatement
objects required to run the change for the given database.
NOTE: This method may be called multiple times throughout the changelog execution process and may be called in documentation generation and other integration points as well.
If this method reads from the current database state or uses any other logic that will be affected by whether previous changeSets have ran or not, you must return true from Change.generateStatementsVolatile(liquibase.database.Database)
.protected void nonExecutedCleanup()
protected ExecuteShellCommandChange.StreamGobbler createErrorGobbler(InputStream processStream, OutputStream outputStream)
protected Integer getMaxStreamGobblerOutput()
processResult(int, String, String, Database)
. If null, process all output.protected long getTimeoutInMillis()
protected void processResult(int returnCode, String errorStreamOut, String infoStreamOut, Database database)
executeCommand(Database)
after running the command. Default implementation throws an error if returnCode != 0protected ProcessBuilder createProcessBuilder(Database database)
public String getConfirmationMessage()
Change
protected String getCommandString()
public String getSerializedObjectNamespace()
getSerializedObjectNamespace
in interface LiquibaseSerializable
getSerializedObjectNamespace
in class AbstractChange
protected void customLoadLogic(ParsedNode parsedNode, ResourceAccessor resourceAccessor) throws ParsedNodeException
customLoadLogic
in class AbstractChange
ParsedNodeException
public String toString()
toString
in class AbstractChange
Copyright © 2023 Liquibase.org. All rights reserved.