com.r3corda.node.services.network / AbstractNetworkMapService

# AbstractNetworkMapService

`abstract class AbstractNetworkMapService : NetworkMapService, AbstractNodeService`

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

Design is slightly refactored to track time and map version of last acknowledge per subscriber to facilitate subscriber clean up and is simpler to persist than the previous implementation based on a set of missing messages acks.

### Constructors

<init> | `AbstractNetworkMapService(services: ServiceHubInternal)` Abstracted out core functionality as the basis for a persistent implementation, as well as existing in-memory implementation.

### Properties

_mapVersion | `val _mapVersion: AtomicInteger`
mapVersion | `val mapVersion: Int`
maxSizeRegistrationRequestBytes | `val maxSizeRegistrationRequestBytes: Int` Maximum credible size for a registration request. Generally requests are around 500-600 bytes, so this gives a 10 times overhead.
maxUnacknowledgedUpdates | `val maxUnacknowledgedUpdates: Int` Maximum number of unacknowledged updates to send to a node before automatically unregistering them for updates
nodes | `open val nodes: List<NodeInfo>`
registeredNodes | `abstract val registeredNodes: MutableMap<Party, NodeRegistrationInfo>`
subscribers | `abstract val subscribers: ThreadBox<MutableMap<SingleMessageRecipient, LastAcknowledgeInfo>>`

### Inherited Properties

net | `val net: MessagingServiceInternal`
services | `val services: ServiceHubInternal`

### Functions

getUnacknowledgedCount | `fun getUnacknowledgedCount(subscriber: SingleMessageRecipient, mapVersion: Int): Int?`
notifySubscribers | `fun notifySubscribers(wireReg: WireNodeRegistration, mapVersion: Int): Unit`
processAcknowledge | `fun processAcknowledge(req: UpdateAcknowledge): Unit`
processFetchAllRequest | `fun processFetchAllRequest(req: FetchMapRequest): FetchMapResponse`
processQueryRequest | `fun processQueryRequest(req: QueryIdentityRequest): QueryIdentityResponse`
processRegistrationChangeRequest | `fun processRegistrationChangeRequest(req: RegistrationRequest): RegistrationResponse`
processSubscriptionRequest | `fun processSubscriptionRequest(req: SubscribeRequest): SubscribeResponse`
setup | `fun setup(): Unit`
unregisterNetworkHandlers | `fun unregisterNetworkHandlers(): Unit`

### Inherited 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.

### Inheritors

InMemoryNetworkMapService | `class InMemoryNetworkMapService : AbstractNetworkMapService`
PersistentNetworkMapService | `class PersistentNetworkMapService : AbstractNetworkMapService` A network map service backed by a database to survive restarts of the node hosting it.