ENT-10110 Clean-up. (#7530)

This commit is contained in:
Jose Coll 2023-10-13 11:26:07 +01:00 committed by GitHub
parent a66042ec09
commit 1981334921
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2,8 +2,6 @@ package net.corda.core.flows
import co.paralleluniverse.fibers.Suspendable
import net.corda.core.CordaInternal
import net.corda.core.crypto.SecureHash
import net.corda.core.identity.CordaX500Name
import net.corda.core.identity.Party
import net.corda.core.serialization.CordaSerializable
import net.corda.core.utilities.ProgressTracker
@ -12,7 +10,6 @@ import net.corda.core.utilities.ProgressTracker
* Ledger Recovery Flow (available in Enterprise only).
*/
@StartableByRPC
@InitiatingFlow
class LedgerRecoveryFlow(
private val parameters: LedgerRecoveryParameters,
override val progressTracker: ProgressTracker = ProgressTracker()) : FlowLogic<LedgerRecoveryResult>() {
@ -29,14 +26,6 @@ class LedgerRecoveryFlow(
}
}
@InitiatedBy(LedgerRecoveryFlow::class)
class ReceiveLedgerRecoveryFlow constructor(private val otherSideSession: FlowSession) : FlowLogic<Unit>() {
@Suspendable
override fun call() {
throw NotImplementedError("Enterprise only feature")
}
}
@CordaSerializable
class LedgerRecoveryException(message: String) : FlowException("Ledger recovery failed: $message")
@ -45,9 +34,7 @@ data class LedgerRecoveryParameters(
val recoveryPeers: Collection<Party>,
val timeWindow: RecoveryTimeWindow? = null,
val useAllNetworkNodes: Boolean = false,
val transactionRole: TransactionRole = TransactionRole.ALL,
val dryRun: Boolean = false,
val optimisticInitiatorRecovery: Boolean = false,
val useTimeWindowNarrowing: Boolean = true,
val verboseLogging: Boolean = true,
val recoveryBatchSize: Int = 1000
@ -59,25 +46,3 @@ data class LedgerRecoveryResult(
val totalRecoveredTransactions: Long,
val totalErrors: Long
)
/**
* This specifies which type of transactions to recover based on the transaction role of the recovering node
*/
@CordaSerializable
enum class TransactionRole {
ALL,
INITIATOR, // only recover transactions that I initiated
PEER, // only recover transactions where I am a participant on a transaction
OBSERVER, // only recover transactions where I am an observer (but not participant) to a transaction
PEER_AND_OBSERVER // recovery transactions where I am either participant or observer
}
@CordaSerializable
data class RecoveryResult(
val transactionId: SecureHash,
val recoveryPeer: CordaX500Name,
val transactionRole: TransactionRole, // what role did I play in this transaction
val synchronised: Boolean, // whether the transaction was successfully synchronised (will always be false when dryRun option specified)
val synchronisedInitiated: Boolean = false, // only attempted if [optimisticInitiatorRecovery] option set to true and [TransactionRecoveryType.INITIATOR]
val failureCause: String? = null // reason why a transaction failed to synchronise
)