diff --git a/core/src/main/kotlin/net/corda/core/flows/FinalityRecoveryFlow.kt b/core/src/main/kotlin/net/corda/core/flows/FinalityRecoveryFlow.kt index e31f5b4fa8..02acd40a8e 100644 --- a/core/src/main/kotlin/net/corda/core/flows/FinalityRecoveryFlow.kt +++ b/core/src/main/kotlin/net/corda/core/flows/FinalityRecoveryFlow.kt @@ -21,6 +21,7 @@ class FinalityRecoveryFlow( private val matchingCriteria: FlowRecoveryQuery? = null, private val forceRecover: Boolean = false, private val recoverAll: Boolean = false, + private val forceRecoverFlowIds: Collection = emptySet(), override val progressTracker: ProgressTracker = ProgressTracker()) : FlowLogic>() { @CordaInternal @@ -28,16 +29,17 @@ class FinalityRecoveryFlow( val flowIds: Collection, val matchingCriteria: FlowRecoveryQuery?, val forceRecover: Boolean, - val recoverAll: Boolean) + val recoverAll: Boolean, + val forceRecoverFlowIds: Collection) @CordaInternal - fun getExtraConstructorArgs() = ExtraConstructorArgs(txIds, flowIds, matchingCriteria, forceRecover, recoverAll) + fun getExtraConstructorArgs() = ExtraConstructorArgs(txIds, flowIds, matchingCriteria, forceRecover, recoverAll, forceRecoverFlowIds) constructor(txId: SecureHash, forceRecover: Boolean = false) : this(setOf(txId), forceRecover) - constructor(txIds: Collection, forceRecover: Boolean = false, recoverAll: Boolean = false) : this(txIds, emptySet(), null, forceRecover, recoverAll, tracker()) + constructor(txIds: Collection, forceRecover: Boolean = false, recoverAll: Boolean = false) : this(txIds, emptySet(), null, forceRecover, recoverAll, emptySet(), tracker()) constructor(flowId: StateMachineRunId, forceRecover: Boolean = false) : this(emptySet(), setOf(flowId), null, forceRecover) - constructor(flowIds: Collection, forceRecover: Boolean = false) : this(emptySet(), flowIds, null, forceRecover, false, tracker()) - constructor(recoverAll: Boolean, forceRecover: Boolean = false) : this(emptySet(), emptySet(), null, forceRecover, recoverAll, tracker()) - constructor(matchingCriteria: FlowRecoveryQuery, forceRecover: Boolean = false) : this(emptySet(), emptySet(), matchingCriteria, forceRecover, false, tracker()) + constructor(flowIds: Collection, forceRecover: Boolean = false) : this(emptySet(), flowIds, null, forceRecover, false, emptySet(), tracker()) + constructor(recoverAll: Boolean, forceRecover: Boolean = false) : this(emptySet(), emptySet(), null, forceRecover, recoverAll, emptySet(), tracker()) + constructor(matchingCriteria: FlowRecoveryQuery, forceRecover: Boolean = false) : this(emptySet(), emptySet(), matchingCriteria, forceRecover, false, emptySet(), tracker()) @Suspendable @Throws(FlowRecoveryException::class) @@ -55,9 +57,10 @@ class FlowRecoveryException(message: String, cause: Throwable? = null) : FlowExc data class FlowRecoveryQuery( val timeframe: FlowTimeWindow? = null, val initiatedBy: CordaX500Name? = null, - val counterParties: List? = null) { + val counterParties: List? = null, + val excludeFlowIds: List? = null) { init { - require(timeframe != null || initiatedBy != null || counterParties != null) { + require(timeframe != null || initiatedBy != null || counterParties != null || excludeFlowIds != null) { "Must specify at least one recovery criteria" } }