corda / net.corda.node.services.api / ServiceHubInternal

ServiceHubInternal

abstract class ServiceHubInternal : PluginServiceHub

Constructors

<init> ServiceHubInternal()

Properties

flowLogicRefFactory abstract val flowLogicRefFactory: FlowLogicRefFactory
monitoringService abstract val monitoringService: MonitoringService
networkService abstract val networkService: MessagingServiceInternal
schemaService abstract val schemaService: SchemaService

Functions

invokeFlowAsync open fun <T : Any> invokeFlowAsync(logicType: Class<out FlowLogic<T>>, vararg args: Any?): FlowStateMachine<T>

Will check logicType and args against a whitelist and if acceptable then construct and initiate the flow. Note that you must be on the server thread to call this method.

startFlow abstract fun <T> startFlow(logic: FlowLogic<T>): FlowStateMachine<T>

Starts an already constructed flow. Note that you must be on the server thread to call this method.

Inherited Functions

getFlowFactory abstract fun getFlowFactory(markerClass: Class<*>): (Party) -> FlowLogic<*>

Return the flow factory that has been registered with markerClass, or null if no factory is found.

registerFlowInitiator abstract fun registerFlowInitiator(markerClass: KClass<*>, flowFactory: (Party) -> FlowLogic<*>): Unit

Register the flow factory we wish to use when a initiating party attempts to communicate with us. The registration is done against a marker KClass which is sent in the session handshake by the other party. If this marker class has been registered then the corresponding factory will be used to create the flow which will communicate with the other side. If there is no mapping then the session attempt is rejected.

Extension Functions

fillWithSomeTestCash fun ServiceHub.fillWithSomeTestCash(howMuch: Amount<Currency>, outputNotary: Party = DUMMY_NOTARY, atLeastThisManyStates: Int = 3, atMostThisManyStates: Int = 10, rng: Random = Random(), ref: OpaqueBytes = OpaqueBytes(ByteArray(1, { 1 })), ownedBy: CompositeKey? = null, issuedBy: PartyAndReference = DUMMY_CASH_ISSUER, issuerKey: KeyPair = DUMMY_CASH_ISSUER_KEY): Vault<State>

Creates a random set of between (by default) 3 and 10 cash states that add up to the given amount and adds them to the vault. This is intended for unit tests. The cash is issued by DUMMY_CASH_ISSUER and owned by the legal identity key from the storage service.

fillWithSomeTestDeals fun ServiceHub.fillWithSomeTestDeals(dealIds: List<String>): Unit
fillWithSomeTestLinearStates fun ServiceHub.fillWithSomeTestLinearStates(numberToCreate: Int): Unit
recordTransactions fun ServiceHub.recordTransactions(vararg txs: SignedTransaction): Unit

Given some SignedTransactions, writes them to the local storage for validated transactions and then sends them to the vault for further processing.