Package liquibase.executor
Class AbstractExecutor
- java.lang.Object
-
- liquibase.executor.AbstractExecutor
-
- Direct Known Subclasses:
JdbcExecutor
,LoggingExecutor
public abstract class AbstractExecutor extends Object implements Executor
Code common to all Executor services / blueprint for Executor service classes.
-
-
Field Summary
Fields Modifier and Type Field Description protected Database
database
protected ResourceAccessor
resourceAccessor
-
Fields inherited from interface liquibase.plugin.Plugin
PRIORITY_DATABASE, PRIORITY_DEFAULT, PRIORITY_NOT_APPLICABLE, PRIORITY_SPECIALIZED
-
-
Constructor Summary
Constructors Constructor Description AbstractExecutor()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected String[]
applyVisitors(SqlStatement statement, List<SqlVisitor> sqlVisitors)
void
execute(Change change)
Write methodsvoid
execute(Change change, List<SqlVisitor> sqlVisitors)
abstract String
getName()
Return the name of the Executorabstract int
getPriority()
Return the Executor priorityvoid
modifyChangeSet(ChangeSet changeSet)
Allow this Executor to make any needed changes to the changeset.void
setDatabase(Database database)
Configures the Executor for the Database to run statements/queries against.void
setResourceAccessor(ResourceAccessor resourceAccessor)
Sets aResourceAccessor
object on this Executor to be used for file access.ValidationErrors
validate(ChangeSet changeSet)
Validate if the changeset can be executed by this Executor-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface liquibase.executor.Executor
comment, execute, execute, queryForInt, queryForInt, queryForList, queryForList, queryForList, queryForList, queryForLong, queryForLong, queryForObject, queryForObject, supports, update, update, updatesDatabase
-
-
-
-
Field Detail
-
database
protected Database database
-
resourceAccessor
protected ResourceAccessor resourceAccessor
-
-
Method Detail
-
getName
public abstract String getName()
Return the name of the Executor
-
getPriority
public abstract int getPriority()
Return the Executor priority- Specified by:
getPriority
in interfaceExecutor
- Returns:
- int The Executor priority
-
validate
public ValidationErrors validate(ChangeSet changeSet)
Validate if the changeset can be executed by this Executor
-
modifyChangeSet
public void modifyChangeSet(ChangeSet changeSet)
Allow this Executor to make any needed changes to the changeset. The base class sets splitStatements to 'true' if it is not set- Specified by:
modifyChangeSet
in interfaceExecutor
- Parameters:
changeSet
- The changeset to operate on
-
setResourceAccessor
public void setResourceAccessor(ResourceAccessor resourceAccessor)
Sets aResourceAccessor
object on this Executor to be used for file access.- Specified by:
setResourceAccessor
in interfaceExecutor
- Parameters:
resourceAccessor
- theResourceAccessor
object to set
-
setDatabase
public void setDatabase(Database database)
Description copied from interface:Executor
Configures the Executor for the Database to run statements/queries against.- Specified by:
setDatabase
in interfaceExecutor
- Parameters:
database
- The database
-
applyVisitors
protected String[] applyVisitors(SqlStatement statement, List<SqlVisitor> sqlVisitors) throws DatabaseException
- Throws:
DatabaseException
-
execute
public void execute(Change change) throws DatabaseException
Description copied from interface:Executor
Write methods- Specified by:
execute
in interfaceExecutor
- Throws:
DatabaseException
-
execute
public void execute(Change change, List<SqlVisitor> sqlVisitors) throws DatabaseException
- Specified by:
execute
in interfaceExecutor
- Throws:
DatabaseException
-
-