com.r3corda.node.services.api / ServiceHubInternal

# ServiceHubInternal

`abstract class ServiceHubInternal : ServiceHub`

### Constructors

<init> | `ServiceHubInternal()`

### Properties

monitoringService | `abstract val monitoringService: MonitoringService`
networkService | `abstract val networkService: MessagingServiceInternal`
protocolLogicRefFactory | `abstract val protocolLogicRefFactory: ProtocolLogicRefFactory`
schemaService | `abstract val schemaService: SchemaService`

### Inherited Properties

clock | `abstract val clock: Clock`
identityService | `abstract val identityService: IdentityService`
keyManagementService | `abstract val keyManagementService: KeyManagementService`
legalIdentityKey | `open val legalIdentityKey: KeyPair` Helper property to shorten code for fetching the Nodes KeyPair associated with the public legalIdentity Party from the key management service. Typical use is during signing in protocols and for unit test signing.
myInfo | `abstract val myInfo: NodeInfo`
networkMapCache | `abstract val networkMapCache: NetworkMapCache`
notaryIdentityKey | `open val notaryIdentityKey: KeyPair` Helper property to shorten code for fetching the Nodes KeyPair associated with the public notaryIdentity Party from the key management service. It is assumed that this is only used in contexts where the Node knows it is hosting a Notary Service. Otherwise, it will throw an IllegalArgumentException. Typical use is during signing in protocols and for unit test signing.
schedulerService | `abstract val schedulerService: SchedulerService`
storageService | `abstract val storageService: StorageService`
vaultService | `abstract val vaultService: VaultService`

### Functions

getProtocolFactory | `abstract fun getProtocolFactory(markerClass: Class<*>): (Party) -> ProtocolLogic<*>` Return the protocol factory that has been registered with markerClass, or null if no factory is found.
invokeProtocolAsync | `open fun <T : Any> invokeProtocolAsync(logicType: Class<out ProtocolLogic<T>>, vararg args: Any?): <ERROR CLASS><T>` Will check logicType and args against a whitelist and if acceptable then construct and initiate the protocol.
registerProtocolInitiator | `abstract fun registerProtocolInitiator(markerClass: KClass<*>, protocolFactory: (Party) -> ProtocolLogic<*>): Unit` Register the protocol 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 protocol which will communicate with the other side. If there is no mapping then the session attempt is rejected.
startProtocol | `abstract fun <T> startProtocol(logic: ProtocolLogic<T>): <ERROR CLASS><T>` TODO: borrowing this method from service manager work in another branch. Its required to avoid circular dependency between SMM and the scheduler. That particular problem should also be resolved by the service manager work itself, at which point this method would not be needed (by the scheduler).

### Inherited Functions

loadState | `open fun loadState(stateRef: StateRef): TransactionState<*>` Given a StateRef loads the referenced transaction and looks up the specified output ContractState.
recordTransactions | `abstract fun recordTransactions(txs: Iterable<SignedTransaction>): Unit` Given a list of SignedTransactions, writes them to the local storage for validated transactions and then sends them to the vault for further processing.

### 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: PublicKey? = null): Vault` 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.
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.