com.r3corda.node.services.network / MockNetworkMapCache

# MockNetworkMapCache

`class MockNetworkMapCache : InMemoryNetworkMapCache`

Network map cache with no backing map service.

### Types

MockAddress | `data class MockAddress : SingleMessageRecipient`

### Constructors

<init> | `MockNetworkMapCache()` Network map cache with no backing map service.

### Inherited Properties

networkMapNodes | `open val networkMapNodes: List<NodeInfo>` A list of nodes that advertise a network map service
notaryNodes | `open val notaryNodes: List<NodeInfo>` A list of nodes that advertise a notary service
partyNodes | `open val partyNodes: List<NodeInfo>` A list of all nodes the cache is aware of
ratesOracleNodes | `open val ratesOracleNodes: List<NodeInfo>` A list of nodes that advertise a rates oracle service
registeredNodes | `var registeredNodes: MutableMap<Party, NodeInfo>`
regulators | `open val regulators: List<NodeInfo>` A list of nodes that advertise a regulatory service. Identifying the correct regulator for a trade is outside the scope of the network map service, and this is intended solely as a sanity check on configuration stored elsewhere.

### Functions

addRegistration | `fun addRegistration(node: NodeInfo): Unit` Directly add a registration to the internal cache. DOES NOT fire the change listeners, as its not a change being received.
deleteRegistration | `fun deleteRegistration(identity: Party): Boolean` Directly remove a registration from the internal cache. DOES NOT fire the change listeners, as its not a change being received.

### Inherited Functions

addMapService | `open fun addMapService(net: MessagingService, service: NodeInfo, subscribe: Boolean, ifChangedSinceVer: Int?): <ERROR CLASS><Unit>` Add a network map service; fetches a copy of the latest map from the service and subscribes to any further updates.
addNode | `open fun addNode(node: NodeInfo): Unit` Adds a node to the local cache (generally only used for adding ourselves)
deregisterForUpdates | `open fun deregisterForUpdates(net: MessagingService, service: NodeInfo): <ERROR CLASS><Unit>` Unsubscribes from updates from the given map service.
get | `open fun get(): <ERROR CLASS>` Get a copy of all nodes in the map. `open fun get(serviceType: ServiceType): <ERROR CLASS>` Get the collection of nodes which advertise a specific service.
getNodeByLegalName | `open fun getNodeByLegalName(name: String): <ERROR CLASS>` Look up the node info for a legal name.
getNodeByPublicKey | `open fun getNodeByPublicKey(publicKey: PublicKey): <ERROR CLASS>` Look up the node info for a public key.
getRecommended | `open fun getRecommended(type: ServiceType, contract: Contract, vararg party: Party): NodeInfo?` Get a recommended node that advertises a service, and is suitable for the specified contract and parties. Implementations might understand, for example, the correct regulator to use for specific contracts/parties, or the appropriate oracle for a contract.
processUpdatePush | `fun processUpdatePush(req: Update): Unit`
removeNode | `open fun removeNode(node: NodeInfo): Unit` Removes a node from the local cache