com.r3corda.node.services.api / AbstractNodeService

AbstractNodeService

abstract class AbstractNodeService : SingletonSerializeAsToken

Abstract superclass for services that a node can host, which provides helper functions.



Constructors

<init> AbstractNodeService(services: ServiceHubInternal)

Abstract superclass for services that a node can host, which provides helper functions.

Properties

net val net: MessagingServiceInternal
services val services: ServiceHubInternal

Functions

addMessageHandler fun <Q : ServiceRequestMessage, R : Any> addMessageHandler(topic: String, handler: (Q) -> R, exceptionConsumer: (Message, Exception) -> Unit): MessageHandlerRegistration

Register a handler for a message topic. In comparison to using net.addMessageHandler() this manages a lot of common boilerplate code. Exceptions are caught and passed to the provided consumer. If you just want a simple acknowledgement response with no content, use com.r3corda.core.messaging.Ack.

fun <Q : ServiceRequestMessage, R : Any> addMessageHandler(topic: String, handler: (Q) -> R): MessageHandlerRegistration

Register a handler for a message topic. In comparison to using net.addMessageHandler() this manages a lot of common boilerplate code. Exceptions are propagated to the messaging layer. If you just want a simple acknowledgement response with no content, use com.r3corda.core.messaging.Ack.

addProtocolHandler fun <H : HandshakeMessage, R : Any> addProtocolHandler(topic: String, loggerName: String, protocolFactory: (H) -> ProtocolLogic<R>, onResultFuture: (<ERROR CLASS><R>, H) -> Unit): Unit

Register a handler to kick-off a protocol when a HandshakeMessage is received by the node. This performs the necessary steps to enable communication between the two protocols, including calling ProtocolLogic.registerSession.

fun <H : HandshakeMessage, R : Any> addProtocolHandler(topic: String, loggerName: String, protocolFactory: (H) -> ProtocolLogic<R>): Unit

Inherited Functions

toToken open fun toToken(context: SerializeAsTokenContext): SerializationToken

Companion Object Properties

logger val logger: <ERROR CLASS>

Inheritors

AbstractNetworkMapService abstract class AbstractNetworkMapService : NetworkMapService, AbstractNodeService

Abstracted out core functionality as the basis for a persistent implementation, as well as existing in-memory implementation.

NodeMonitorService class NodeMonitorService : AbstractNodeService

Service which allows external clients to monitor the nodes vault and state machine manager, as well as trigger actions within the node. The service also sends requests for user input back to clients, for example to enter additional information while a protocol runs, or confirm an action.

NotaryService abstract class NotaryService : AbstractNodeService

A Notary service acts as the final signer of a transaction ensuring two things:

Service class Service : AbstractNodeService
Service class Service : AbstractNodeService

A service that monitors the network for requests for changing the notary of a state, and immediately runs the NotaryChangeProtocol if the auto-accept criteria are met.

Service class Service : AbstractNodeService

This class sets up network message handlers for requests from peers for data keyed by hash. It is a piece of simple glue that sits between the network layer and the database layer.

Service class Service : AcceptsFileUpload, AbstractNodeService

The Service that wraps Oracle and handles messages/network interaction/request scrubbing.

Service class Service : AbstractNodeService