Class SimpleContext
java.lang.Object
migratedb.v1.core.internal.callback.SimpleContext
- All Implemented Interfaces:
Context
-
Constructor Summary
ConstructorsConstructorDescriptionSimpleContext(Configuration configuration, Connection<?> connection, MigrationInfo migrationInfo, String sql, List<Warning> warnings, List<Error> errors) -
Method Summary
Modifier and TypeMethodDescription
-
Constructor Details
-
SimpleContext
public SimpleContext(Configuration configuration, Connection<?> connection, MigrationInfo migrationInfo, String sql, List<Warning> warnings, List<Error> errors)
-
-
Method Details
-
getConfiguration
- Specified by:
getConfigurationin interfaceContext- Returns:
- The configuration currently in use.
-
getConnection
- Specified by:
getConnectionin interfaceContext- Returns:
- The JDBC connection being used. Transaction are managed by MigrateDB. When the context is passed to the
Callback.handle(Event, Context)method, a transaction will already have been started if required and will be automatically committed or rolled back afterwards.
-
getMigrationInfo
- Specified by:
getMigrationInfoin interfaceContext- Returns:
- The info about the migration being handled. Only relevant for the BEFORE_EACH_* and AFTER_EACH_* events.
nullin all other cases.
-
getStatement
- Specified by:
getStatementin interfaceContext- Returns:
- The info about the statement being handled. Only relevant for the statement-level events.
nullin all other cases.
-
getOperationResult
- Specified by:
getOperationResultin interfaceContext- Returns:
- The OperationResult object for the finished operation. Only relevant for the AFTER_*_OPERATION_FINISH events.
-