public class TransactionalTargetSystemOpsImpl extends TargetSystemOpsImpl implements TransactionalTargetSystemOps
| Constructor and Description |
|---|
TransactionalTargetSystemOpsImpl(TransactionalTargetSystem<?> targetSystem,
AbstractTargetSystem<?> auditStoreTargetSystem) |
| 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.
|
void |
clearMark(java.lang.String changeId)
Removes the local audit mark for the given change identifier.
|
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.
|
java.lang.String |
getId() |
io.flamingock.internal.common.core.targets.OperationType |
getOperationType()
Returns the type of operations supported by this target system.
|
java.util.Set<TargetSystemAuditMark> |
listAll()
Returns all known local audit marks for the Target System.
|
void |
mark(TargetSystemAuditMark auditMark)
Creates or updates a local audit mark.
|
applyChange, rollbackChangeclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitapplyChange, rollbackChangemarkAppliedpublic TransactionalTargetSystemOpsImpl(TransactionalTargetSystem<?> targetSystem, AbstractTargetSystem<?> auditStoreTargetSystem)
public io.flamingock.internal.common.core.targets.OperationType getOperationType()
TargetSystemOpsgetOperationType in interface TargetSystemOpsgetOperationType in class TargetSystemOpsImplpublic final <T> T applyChangeTransactional(java.util.function.Function<ExecutionRuntime,T> changeApplier, ExecutionRuntime executionRuntime)
TransactionalTargetSystemOpsThis method coordinates transactional execution by:
applyChangeTransactional in interface TransactionalTargetSystemOpsT - the return type of the change operationchangeApplier - the function that executes the actual changeexecutionRuntime - the runtime context for dependency resolutionpublic java.util.Optional<io.flamingock.internal.common.core.audit.AuditHistoryReader> getAuditAuditReader(io.flamingock.internal.common.core.audit.AuditReaderType type)
TransactionalTargetSystemOpsThis 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.
getAuditAuditReader in interface TransactionalTargetSystemOpstype - 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,
AuditReaderTypepublic java.lang.String getId()
getId in interface io.flamingock.api.external.ExternalSystemgetId in class TargetSystemOpsImplpublic java.util.Set<TargetSystemAuditMark> listAll()
TargetSystemAuditMarkerlistAll in interface TargetSystemAuditMarkerTargetSystemAuditMark.public void clearMark(java.lang.String changeId)
TargetSystemAuditMarker
This is a hygienic cleanup step that should be invoked after the remote Audit Store has
acknowledged the change, but not critical. It is idempotent: if no mark exists for changeId, the call
completes without error.
clearMark in interface TargetSystemAuditMarkerchangeId - the identifier of the change whose local mark should be removed.public void mark(TargetSystemAuditMark auditMark)
TargetSystemAuditMarkerImplementations should ensure this operation is idempotent. The write operation must participate in the same transaction as the Target System operation that is being confirmed.
mark in interface TargetSystemAuditMarkerauditMark - the mark to persist.