Package org.flywaydb.core.api.callback
Interface Context
public interface Context
The context relevant to an event.
-
Method Summary
Modifier and TypeMethodDescriptiondefault org.flywaydb.core.internal.reports.ReportDetails
-
Method Details
-
getConfiguration
Configuration getConfiguration()- Returns:
- The configuration currently in use.
-
getConnection
Connection getConnection()- Returns:
- The JDBC connection being used. Transaction are managed by Flyway. When the context is passed to the
GenericCallback.handle(CallbackEvent, Context)method, a transaction will already have been started if required and will be automatically committed or rolled back afterward.
-
getMigrationInfo
MigrationInfo getMigrationInfo()- Returns:
- The info about the migration being handled. Only relevant for the BEFORE_EACH_* and AFTER_EACH_* events.
nullin all other cases.
-
getStatement
Statement getStatement()- Returns:
- The info about the statement being handled. Only relevant for the statement-level events.
nullin all other cases.
-
getOperationResult
OperationResult getOperationResult()- Returns:
- The OperationResult object for the finished operation. Only relevant for the AFTER_*_OPERATION_FINISH events.
-
getReportDetails
default org.flywaydb.core.internal.reports.ReportDetails getReportDetails()- Returns:
- The report generated. Only relevant for the AFTER_REPORT_GENERATED event. Default:
null
-