net.corda.node.services.network

## Class AbstractNetworkMapService

- SingletonSerializeAsToken
- - net.corda.node.services.api.AbstractNodeService
  - - net.corda.node.services.network.AbstractNetworkMapService

- All Implemented Interfaces:
    NetworkMapService, SerializeAsToken
  Direct Known Subclasses:
    InMemoryNetworkMapService, PersistentNetworkMapService

      public class AbstractNetworkMapService
      extends AbstractNodeService
      implements NetworkMapService

  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.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface net.corda.node.services.network.NetworkMapService

      `NetworkMapService.Companion, NetworkMapService.FetchMapRequest, NetworkMapService.FetchMapResponse, NetworkMapService.QueryIdentityRequest, NetworkMapService.QueryIdentityResponse, NetworkMapService.RegistrationRequest, NetworkMapService.RegistrationResponse, NetworkMapService.SubscribeRequest, NetworkMapService.SubscribeResponse, NetworkMapService.Update, NetworkMapService.UpdateAcknowledge`

  - ### Field Summary

    - ### Fields inherited from interface net.corda.node.services.network.NetworkMapService

      `Companion`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AbstractNetworkMapService(ServiceHubInternal services)` Abstracted out core functionality as the basis for a persistent implementation, as well as existing in-memory implementation.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `getMapVersion()`
    `int` | `getMaxSizeRegistrationRequestBytes()` Maximum credible size for a registration request. Generally requests are around 500-600 bytes, so this gives a 10 times overhead.
    `int` | `getMaxUnacknowledgedUpdates()` Maximum number of unacknowledged updates to send to a node before automatically unregistering them for updates
    `java.util.List<net.corda.core.node.NodeInfo>` | `getNodes()`
    `java.util.Map<net.corda.core.crypto.Party,net.corda.node.services.network.NodeRegistrationInfo>` | `getRegisteredNodes()`
    `ThreadBox<java.util.Map>` | `getSubscribers()`
    `java.lang.Integer` | `getUnacknowledgedCount(SingleMessageRecipient subscriber, int mapVersion)`
    `java.util.concurrent.atomic.AtomicInteger` | `get_mapVersion()`
    `void` | `notifySubscribers(WireNodeRegistration wireReg, int mapVersion)`
    `void` | `processAcknowledge(NetworkMapService.UpdateAcknowledge req)`
    `NetworkMapService.FetchMapResponse` | `processFetchAllRequest(NetworkMapService.FetchMapRequest req)`
    `NetworkMapService.QueryIdentityResponse` | `processQueryRequest(NetworkMapService.QueryIdentityRequest req)`
    `NetworkMapService.RegistrationResponse` | `processRegistrationChangeRequest(NetworkMapService.RegistrationRequest req)`
    `NetworkMapService.SubscribeResponse` | `processSubscriptionRequest(NetworkMapService.SubscribeRequest req)`
    `void` | `setup()`
    `void` | `unregisterNetworkHandlers()`

    - ### Methods inherited from class net.corda.node.services.api.AbstractNodeService

      `getNet, getServices`

    - ### Methods inherited from class net.corda.core.serialization.SingletonSerializeAsToken

      `toToken`

    - ### Methods inherited from interface net.corda.node.services.network.NetworkMapService

      `getNodes`

    - ### Methods inherited from interface net.corda.core.serialization.SerializeAsToken

      `toToken`

- - ### Constructor Detail

    - #### AbstractNetworkMapService

          public AbstractNetworkMapService(ServiceHubInternal services)

      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.

  - ### Method Detail

    - #### getRegisteredNodes

          public java.util.Map<net.corda.core.crypto.Party,net.corda.node.services.network.NodeRegistrationInfo> getRegisteredNodes()

    - #### getSubscribers

          public ThreadBox<java.util.Map> getSubscribers()

    - #### get_mapVersion

          public java.util.concurrent.atomic.AtomicInteger get_mapVersion()

    - #### getMapVersion

          public int getMapVersion()

    - #### getMaxUnacknowledgedUpdates

          public int getMaxUnacknowledgedUpdates()

      Maximum number of unacknowledged updates to send to a node before automatically unregistering them for updates

    - #### getMaxSizeRegistrationRequestBytes

          public int getMaxSizeRegistrationRequestBytes()

      Maximum credible size for a registration request. Generally requests are around 500-600 bytes, so this gives a 10 times overhead.

    - #### getNodes

          public java.util.List<net.corda.core.node.NodeInfo> getNodes()

    - #### setup

          public void setup()

    - #### unregisterNetworkHandlers

          public void unregisterNetworkHandlers()

    - #### getUnacknowledgedCount

          public java.lang.Integer getUnacknowledgedCount(SingleMessageRecipient subscriber,
                                                          int mapVersion)

    - #### notifySubscribers

          public void notifySubscribers(WireNodeRegistration wireReg,
                                        int mapVersion)

    - #### processAcknowledge

          public void processAcknowledge(NetworkMapService.UpdateAcknowledge req)

    - #### processFetchAllRequest

          public NetworkMapService.FetchMapResponse processFetchAllRequest(NetworkMapService.FetchMapRequest req)

    - #### processQueryRequest

          public NetworkMapService.QueryIdentityResponse processQueryRequest(NetworkMapService.QueryIdentityRequest req)

    - #### processRegistrationChangeRequest

          public NetworkMapService.RegistrationResponse processRegistrationChangeRequest(NetworkMapService.RegistrationRequest req)

    - #### processSubscriptionRequest

          public NetworkMapService.SubscribeResponse processSubscriptionRequest(NetworkMapService.SubscribeRequest req)