Package-level declarations

Types

Link copied to clipboard

Abstract flow to be used for replacing one state with another, for example when changing the notary of a state. Notably this requires a one to one replacement of states, states cannot be split, merged or issued as part of these flows.

Link copied to clipboard
class CollectSignatureFlow(val partiallySignedTx: SignedTransaction, val session: FlowSession, val signingKeys: List<PublicKey>) : FlowLogic<List<TransactionSignature>>

Get and check the required signature.

Link copied to clipboard
class CollectSignaturesFlow constructor(val partiallySignedTx: SignedTransaction, val sessionsToCollectFrom: Collection<FlowSession>, val myOptionalKeys: Iterable<PublicKey>?, val progressTracker: ProgressTracker = tracker()) : FlowLogic<SignedTransaction>

The CollectSignaturesFlow is used to automate the collection of counterparty signatures for a given transaction.

Link copied to clipboard
data class ComparableRecoveryTimeWindow(val fromTime: Instant, val fromTimestampDiscriminator: Int, val untilTime: Instant, val untilTimestampDiscriminator: Int)
Link copied to clipboard

A flow to be used for authorising and upgrading state objects of an old contract to a new contract.

Link copied to clipboard
open class DataVendingFlow(val otherSessions: Set<FlowSession>, val payload: Any, txnMetadata: TransactionMetadata? = null) : FlowLogic<Void?>
Link copied to clipboard

An abstraction for flow session destinations. A flow can send to and receive from objects which implement this interface. The specifics of how the messages are routed depend on the implementation.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
data class DistributionRecordKey(val txnId: SecureHash, val timestamp: Instant, val timestampDiscriminator: Int)
Link copied to clipboard
class DistributionRecords(val senderRecords: List<SenderDistributionRecord> = emptyList(), val receiverRecords: List<ReceiverDistributionRecord> = emptyList())
Link copied to clipboard

Verifies the given transaction, then sends it to the named notary. If the notary agrees that the transaction is acceptable then it is from that point onwards committed to the ledger, and will be written through to the vault. Additionally, it will be distributed to the parties reflected in the participants list of the states.

Link copied to clipboard
class FinalityRecoveryFlow(txIds: Collection<SecureHash> = emptySet(), flowIds: Collection<StateMachineRunId> = emptySet(), matchingCriteria: FlowRecoveryQuery? = null, forceRecover: Boolean = false, recoverAll: Boolean = false, forceRecoverFlowIds: Collection<StateMachineRunId> = emptySet(), val progressTracker: ProgressTracker = ProgressTracker()) : FlowLogic<Map<FlowTransactionInfo, Boolean>>

TWO_PHASE_FINALITY Recovery Flow This flow is exposed via the Core API for use by any CorDapp but its implementation is available in Enterprise only.

Link copied to clipboard
open class FlowException(message: String?, cause: Throwable?, var originalErrorId: Long? = null) : CordaException

Exception which can be thrown by a FlowLogic at any point in its logic to unexpectedly bring it to a permanent end. The exception will propagate to all counterparty flows and will be thrown on their end the next time they wait on a FlowSession.receive or FlowSession.sendAndReceive. Any flow which no longer needs to do a receive, or has already ended, will not receive the exception (if this is required then have them wait for a confirmation message).

Link copied to clipboard

FlowExternalAsyncOperation represents an external future that blocks a flow from continuing until the future returned by FlowExternalAsyncOperation.execute has completed. Examples of external processes where FlowExternalAsyncOperation would be useful include, triggering a long running process on an external system or retrieving information from a service that might be down.

Link copied to clipboard

FlowExternalOperation represents an external process that blocks a flow from continuing until the result of execute has been retrieved. Examples of external processes where FlowExternalOperation would be useful include, triggering a long running process on an external system or retrieving information from a service that might be down.

Link copied to clipboard
data class FlowInfo(val flowVersion: Int, val appName: String)

Version and name of the CorDapp hosting the other side of the flow.

Link copied to clipboard
sealed class FlowInitiator : Principal

Please note that FlowInitiator has been superceded by net.corda.core.context.InvocationContext, which offers more detail for the same event.

Link copied to clipboard
abstract class FlowLogic<out T>

A sub-class of FlowLogic implements a flow using direct, straight line blocking code. Thus you can write complex flow logic in an ordinary fashion, without having to think about callbacks, restarting after a node crash, how many instances of your flow there are running and so on.

Link copied to clipboard

A handle interface representing a FlowLogic instance which would be possible to safely pass out of the contract sandbox. Use FlowLogicRefFactory to construct a concrete security checked instance.

Link copied to clipboard

The public factory interface for creating validated FlowLogicRef instances as part of the scheduling framework.

Link copied to clipboard
class FlowRecoveryException(message: String, cause: Throwable? = null) : FlowException
Link copied to clipboard
data class FlowRecoveryQuery(val timeframe: FlowTimeWindow? = null, val initiatedBy: List<CordaX500Name>? = null, val counterParties: List<CordaX500Name>? = null)
Link copied to clipboard

A FlowSession is a handle on a communication sequence between two paired flows, possibly running on separate nodes. It is used to send and receive messages between the flows as well as to query information about the counter-flow.

Link copied to clipboard
data class FlowStackSnapshot(val time: Instant, val flowClass: String, val stackFrames: List<FlowStackSnapshot.Frame>)

Main data object representing snapshot of the flow stack, extracted from the Quasar stack.

Link copied to clipboard
data class FlowTimeWindow(val fromTime: Instant? = null, val untilTime: Instant? = null)
Link copied to clipboard
data class FlowTransactionInfo(val stateMachineRunId: StateMachineRunId, val txId: String, val status: TransactionStatus, val timestamp: Instant, val metadata: TransactionMetadata?)

Transaction recovery type information.

Link copied to clipboard

This exception allows a flow to pass itself to the flow hospital. Once the flow reaches the hospital it will determine how to progress depending on what causes the exception wraps. Assuming there are no important wrapped exceptions, throwing a HospitalizeFlowException will place the flow in overnight observation, where it will be replayed at a later time.

Link copied to clipboard

Thrown if the structure of a class implementing a flow is not correct. There can be several causes for this such as not inheriting from FlowLogic, not having a valid constructor and so on.

Link copied to clipboard
@Target(allowedTargets = [AnnotationTarget.CLASS])
annotation class InitiatedBy(val value: KClass<out FlowLogic<*>>)

This annotation is required by any FlowLogic that is designed to be initiated by a counterparty flow. The class must have at least a constructor which takes in a single net.corda.core.identity.Party parameter which represents the initiating counterparty. The FlowLogic that does the initiating is specified by the value property and itself must be annotated with InitiatingFlow.

Link copied to clipboard
annotation class InitiatingFlow(val version: Int = 1)

This annotation is required by any FlowLogic which has been designated to initiate communication with a counterparty and request they start their side of the flow communication.

Link copied to clipboard

An exception that is thrown when a flow has been killed.

Link copied to clipboard
Link copied to clipboard
class LedgerRecoveryFlow(parameters: LedgerRecoveryParameters, val progressTracker: ProgressTracker = ProgressTracker()) : FlowLogic<LedgerRecoveryResult>

Ledger Recovery Flow (available in Enterprise only).

Link copied to clipboard
data class LedgerRecoveryParameters(val recoveryPeers: Collection<Party>, val timeWindow: RecoveryTimeWindow? = null, val useAllNetworkNodes: Boolean = false, val dryRun: Boolean = false, val useTimeWindowNarrowing: Boolean = true, val verboseLogging: Boolean = false, val recoveryBatchSize: Int = 1000, val alsoFinalize: Boolean = false)
Link copied to clipboard
data class LedgerRecoveryResult(val totalRecoveredRecords: Long, val totalRecoveredTransactions: Long, val totalRecoveredInFlightTransactions: Long, val totalErrors: Long)
Link copied to clipboard
class MaybeSerializedSignedTransaction(val id: SecureHash, val serialized: SerializedBytes<SignedTransaction>?, val nonSerialised: SignedTransaction?, val inFlight: Boolean) : NamedByHash

In the words of Matt working code is more important then pretty code. This class that contains code that may be serialized. If it were always serialized then the local disk fetch would need to serialize then de-serialize which wastes time. However over the wire we get batch fetch items serialized. This is because we need to get the exact length of the objects to pack them into the 10MB max message size buffer. We do not want to serialize them multiple times so it's a lot more efficient to send the byte stream.

Link copied to clipboard
data class NotarisationPayload(val transaction: Any, val requestSignature: NotarisationRequestSignature)

Container for the transaction and notarisation request signature. This is the payload that gets sent by a client to a notary service for committing the input states of the transaction.

Link copied to clipboard
class NotarisationRequest(statesToConsume: List<StateRef>, val transactionId: SecureHash)

A notarisation request specifies a list of states to consume and the id of the consuming transaction. Its primary purpose is for notarisation traceability – a signature over the notarisation request, NotarisationRequestSignature, allows a notary to prove that a certain party requested the consumption of a particular state.

Link copied to clipboard
data class NotarisationRequestSignature(val digitalSignature: DigitalSignature.WithKey, val platformVersion: Int)

A wrapper around a digital signature used for notarisation requests.

Link copied to clipboard
data class NotarisationResponse(val signatures: List<TransactionSignature>)

Payload returned by the notary service flow to the client.

Link copied to clipboard
class NotaryChangeFlow<out T : ContractState>(originalState: StateAndRef<T>, newNotary: Party, progressTracker: ProgressTracker = AbstractStateReplacementFlow.Instigator.tracker()) : AbstractStateReplacementFlow.Instigator<T, T, Party>

A flow to be used for changing a state's Notary. This is required since all input states to a transaction must point to the same notary.

Link copied to clipboard
sealed class NotaryError

Specifies the cause for notarisation request failure.

Link copied to clipboard
class NotaryException(val error: NotaryError, val txId: SecureHash? = null) : FlowException

Exception thrown by the notary service if any issues are encountered while trying to commit a transaction. The underlying error specifies the cause of failure.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
class ReceiveFinalityFlow(otherSideSession: FlowSession, expectedTxId: SecureHash? = null, statesToRecord: StatesToRecord = ONLY_RELEVANT, handlePropagatedNotaryError: Boolean? = null) : FlowLogic<SignedTransaction>

The receiving counterpart to FinalityFlow.

Link copied to clipboard
data class ReceiverDistributionRecord(val txId: SecureHash, val peerPartyId: SecureHash, val timestamp: Instant, val timestampDiscriminator: Int, val encryptedDistributionList: OpaqueBytes, val receiverStatesToRecord: StatesToRecord) : DistributionRecord
Link copied to clipboard

The ReceiveStateAndRefFlow should be called in response to the SendStateAndRefFlow.

Link copied to clipboard
open class ReceiveTransactionFlow(otherSideSession: FlowSession, checkSufficientSignatures: Boolean = true, statesToRecord: StatesToRecord = StatesToRecord.NONE, handlePropagatedNotaryError: Boolean? = null) : FlowLogic<SignedTransaction>

The ReceiveTransactionFlow should be called in response to the SendTransactionFlow.

Link copied to clipboard
data class RecoveryTimeWindow(val fromTime: Instant, val untilTime: Instant = Instant.now())
Link copied to clipboard

Thrown whenever a flow result cannot be serialized when attempting to save it in the database

Link copied to clipboard
annotation class SchedulableFlow

Any FlowLogic which is schedulable and is designed to be invoked by a net.corda.core.contracts.SchedulableState must have this annotation. If it's missing FlowLogicRefFactory.create will throw an exception when it comes time to schedule the next activity in net.corda.core.contracts.SchedulableState.nextScheduledActivity.

Link copied to clipboard
data class SenderDistributionRecord(val txId: SecureHash, val peerPartyId: SecureHash, val timestamp: Instant, val timestampDiscriminator: Int, val senderStatesToRecord: StatesToRecord, val receiverStatesToRecord: StatesToRecord) : DistributionRecord
Link copied to clipboard
open class SendStateAndRefFlow(otherSideSession: FlowSession, stateAndRefs: List<StateAndRef<*>>) : DataVendingFlow

The SendStateAndRefFlow should be used to send a list of input StateAndRef to another peer that wishes to verify the input's integrity by resolving and checking the dependencies as well. The other side should invoke ReceiveStateAndRefFlow at the right point in the conversation to receive the input state and ref and perform the resolution back-and-forth required to check the dependencies.

Link copied to clipboard
open class SendTransactionFlow(val stx: SignedTransaction, val participantSessions: Set<FlowSession>, val observerSessions: Set<FlowSession>, val senderStatesToRecord: StatesToRecord, recordMetaDataEvenIfNotFullySigned: Boolean = false) : DataVendingFlow

The SendTransactionFlow should be used to send a transaction to another peer that wishes to verify that transaction's integrity by resolving and checking the dependencies as well. The other side should invoke ReceiveTransactionFlow at the right point in the conversation to receive the sent transaction and perform the resolution back-and-forth required to check the dependencies and download any missing attachments.

Link copied to clipboard
data class SignedTransactionWithDistributionList(val stx: SignedTransaction, val distributionList: ByteArray, val isFinality: Boolean)
Link copied to clipboard
abstract class SignTransactionFlow constructor(val otherSideSession: FlowSession, val progressTracker: ProgressTracker = tracker()) : FlowLogic<SignedTransaction>

The SignTransactionFlow should be called in response to the CollectSignaturesFlow. It automates the signing of a transaction providing the transaction:

Link copied to clipboard
data class StackFrameDataToken(val className: String)

Token class, used to indicate stack presence of the corda internal data. Since this data is of no use for a CordApp developer, it is skipped from serialisation and its presence is only marked by this token.

Link copied to clipboard
@Target(allowedTargets = [AnnotationTarget.CLASS])
annotation class StartableByRPC

Any FlowLogic which is to be started by the RPC interface (net.corda.core.messaging.CordaRPCOps.startFlowDynamic and net.corda.core.messaging.CordaRPCOps.startTrackedFlowDynamic) must have this annotation. If it's missing the flow will not be allowed to start and an exception will be thrown.

Link copied to clipboard
@Target(allowedTargets = [AnnotationTarget.CLASS])
annotation class StartableByService

Any FlowLogic which is to be started by the AppServiceHub interface from within a CordaService must have this annotation. If it's missing the flow will not be allowed to start and an exception will be thrown.

Link copied to clipboard
data class StateConsumptionDetails(val hashOfTransactionId: SecureHash, val type: StateConsumptionDetails.ConsumedStateType)

Contains information about the consuming transaction for a particular state.

Link copied to clipboard
data class StateMachineRunId(val uuid: UUID)

A unique identifier for a single state machine run, valid across node restarts. Note that a single run always has at least one flow, but that flow may also invoke sub-flows: they all share the same run id.

Link copied to clipboard
open class StateReplacementException constructor(message: String? = null, cause: Throwable? = null) : FlowException
Link copied to clipboard
data class TransactionMetadata(val initiator: CordaX500Name, val distributionList: DistributionList)
Link copied to clipboard
class UnexpectedFlowEndException(message: String, cause: Throwable?, val originalErrorId: Long?) : CordaRuntimeException

Thrown when a flow session ends unexpectedly due to a type mismatch (the other side sent an object of a type that we were not expecting), or the other side had an internal error, or the other side terminated when we were waiting for a response.

Link copied to clipboard
data class WaitTimeUpdate(val waitTime: Duration)

Sent by the notary when the notary detects it will unlikely respond before the client retries.

Link copied to clipboard
class WithReferencedStatesFlow<T : Any> constructor(val progressTracker: ProgressTracker = tracker(), flowLogicProducer: () -> FlowLogic<T>) : FlowLogic<T>

Given a flow which uses reference states, the WithReferencedStatesFlow will execute the flow as a subFlow. If the flow fails due to a NotaryError.Conflict for a reference state, then WithReferencedStatesFlow will be suspended until the state refs for the reference states are consumed. In this case, a consumption means that: