Class DefaultCallbackExecutor
- java.lang.Object
-
- migratedb.v1.core.internal.callback.DefaultCallbackExecutor
-
- All Implemented Interfaces:
CallbackExecutor
public class DefaultCallbackExecutor extends Object implements CallbackExecutor
Executes the callbacks for a specific event.
-
-
Constructor Summary
Constructors Constructor Description DefaultCallbackExecutor(Configuration configuration, Database database, Schema schema, Collection<Callback> callbacks)Creates a new callback executor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidonEachMigrateEvent(Event event)Executes the callbacks for an "each" event within the same transaction (if any) as the main operation.voidonEvent(Event event)Executes the callbacks for this event on the main connection, within a separate transaction per callback if possible.voidonMigrateEvent(Event event)Executes the callbacks for this event on the migration connection, within a separate transaction per callback if possible.voidonOperationFinishEvent(Event event, OperationResult operationResult)Executes the callbacks for an operation finish event.voidsetMigrationInfo(MigrationInfo migrationInfo)Sets the current migration info.
-
-
-
Constructor Detail
-
DefaultCallbackExecutor
public DefaultCallbackExecutor(Configuration configuration, Database database, Schema schema, Collection<Callback> callbacks)
Creates a new callback executor.- Parameters:
configuration- The configuration.database- The database.schema- The current schema to use for the connection.callbacks- The callbacks to execute.
-
-
Method Detail
-
onEvent
public void onEvent(Event event)
Description copied from interface:CallbackExecutorExecutes the callbacks for this event on the main connection, within a separate transaction per callback if possible.- Specified by:
onEventin interfaceCallbackExecutor- Parameters:
event- The event to handle.
-
onMigrateEvent
public void onMigrateEvent(Event event)
Description copied from interface:CallbackExecutorExecutes the callbacks for this event on the migration connection, within a separate transaction per callback if possible.- Specified by:
onMigrateEventin interfaceCallbackExecutor- Parameters:
event- The event to handle.
-
setMigrationInfo
public void setMigrationInfo(MigrationInfo migrationInfo)
Description copied from interface:CallbackExecutorSets the current migration info.- Specified by:
setMigrationInfoin interfaceCallbackExecutor- Parameters:
migrationInfo- The current migration.
-
onEachMigrateEvent
public void onEachMigrateEvent(Event event)
Description copied from interface:CallbackExecutorExecutes the callbacks for an "each" event within the same transaction (if any) as the main operation.- Specified by:
onEachMigrateEventin interfaceCallbackExecutor- Parameters:
event- The event to handle.
-
onOperationFinishEvent
public void onOperationFinishEvent(Event event, OperationResult operationResult)
Description copied from interface:CallbackExecutorExecutes the callbacks for an operation finish event.- Specified by:
onOperationFinishEventin interfaceCallbackExecutor- Parameters:
event- The event to handle.operationResult- The operation result.
-
-