HOLDER - the concrete target system type for fluent API supportpublic abstract class TransactionalTargetSystem<HOLDER extends TransactionalTargetSystem<HOLDER>> extends AbstractTargetSystem<HOLDER> implements io.flamingock.internal.common.core.context.ContextInitializable
Extends AbstractTargetSystem to add transaction management capabilities,
including transaction wrapping, audit marking, etc.
Subclasses must provide:
TransactionWrapper for managing transactions| Modifier and Type | Field and Description |
|---|---|
protected boolean |
autoCreate |
protected TargetSystemAuditMarker |
markerRepository |
protected java.lang.String |
onGoingTasksRepositoryName |
targetSystemContext| Constructor and Description |
|---|
TransactionalTargetSystem(java.lang.String id) |
| Modifier and Type | Method and Description |
|---|---|
<T> T |
applyChangeTransactional(java.util.function.Function<ExecutionRuntime,T> changeApplier,
ExecutionRuntime executionRuntime)
Applies a change operation within a transaction.
|
java.util.Optional<io.flamingock.internal.common.core.audit.AuditHistoryReader> |
getAuditAuditReader(io.flamingock.internal.common.core.audit.AuditReaderType type)
Returns an audit history reader for importing audit entries from external migration sources.
|
TargetSystemAuditMarker |
getOnGoingTaskStatusRepository()
Returns the audit marker for tracking execution state.
|
abstract TransactionWrapper |
getTxWrapper()
Returns the transaction wrapper for this target system.
|
boolean |
hasMarker() |
addDependency, addDependency, addDependency, addDependency, applyChange, enhanceExecutionRuntime, getContext, getId, getSelf, rollbackChange, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setPropertyprotected java.lang.String onGoingTasksRepositoryName
protected boolean autoCreate
protected TargetSystemAuditMarker markerRepository
public boolean hasMarker()
public final <T> T applyChangeTransactional(java.util.function.Function<ExecutionRuntime,T> changeApplier, ExecutionRuntime executionRuntime)
This method orchestrates transactional change execution by:
AbstractTargetSystem.enhanceExecutionRuntime(ExecutionRuntime, boolean) with
isTransactional=true for session-scoped dependency injectionTransactionWrapper for transaction management
and potential injection of transaction-scoped dependenciesT - the return type of the change operationchangeApplier - the function that executes the actual changeexecutionRuntime - the runtime context for dependency resolutionpublic TargetSystemAuditMarker getOnGoingTaskStatusRepository()
In Community Edition, this typically returns a NoOpTargetSystemAuditMarker.
In Cloud Edition, it returns an implementation that persists execution state.
public abstract TransactionWrapper getTxWrapper()
The wrapper is responsible for starting, committing, and rolling back transactions, as well as injecting transaction-scoped dependencies into the execution runtime.
public java.util.Optional<io.flamingock.internal.common.core.audit.AuditHistoryReader> getAuditAuditReader(io.flamingock.internal.common.core.audit.AuditReaderType type)
This method enables Flamingock to import audit history from legacy migration tools or other Flamingock installations, preventing re-execution of already-applied changes. The returned reader provides access to historical audit entries that can be written to Flamingock's audit store.
Common use cases include:
The default implementation returns Optional.empty(), indicating no audit reader is available.
Target system implementations should override this method to provide database-specific readers when
migration support is needed.
type - the type of audit reader to retrieve (e.g., AuditReaderType.MONGOCK)Optional containing the audit history reader if supported for the given type,
or Optional.empty() if this target system does not support audit reading for the specified typeAuditHistoryReader,
AuditReaderType