NetworkMapCacheBase
Keywords: net.corda.core.node.services.NetworkMapCacheBase interface
Date: 2023-09-18

net.corda.core.node.services

## Interface NetworkMapCacheBase

- All Known Subinterfaces:
    NetworkMapCache

      @DoNotImplement
      public NetworkMapCacheBase

  Subset of `interface NetworkMapCache` that doesn't depend on an `interface IdentityService`.

  See Also:
    `interface NetworkMapCache`, `interface IdentityService`

- - ### Constructor Detail

    - #### NetworkMapCacheBase

          public NetworkMapCacheBase()

  - ### Method Detail

    - #### getNotaryIdentities

          @NotNull
          java.util.List<net.corda.core.identity.Party> getNotaryIdentities()

      A list of notary services available on the network.

      Note that the identities are sorted based on legal name, and the ordering might change once new notaries are introduced.

    - #### getChanged

          @NotNull
          rx.Observable<net.corda.core.node.services.NetworkMapCache.MapChange> getChanged()

      Tracks changes to the network map cache.

    - #### getNodeReady

          @NotNull
          CordaFuture<java.lang.Void> getNodeReady()

      Future to track completion of the NetworkMapService registration.

    - #### track

          @NotNull
          DataFeed<java.util.List,net.corda.core.node.services.NetworkMapCache.MapChange> track()

      Atomically get the current party nodes and a stream of updates. Note that the Observable buffers updates until the first subscriber is registered so as to avoid racing with early updates.

    - #### getNodeByLegalName

          @Nullable
          NodeInfo getNodeByLegalName(@NotNull
                                                CordaX500Name name)

      Return a `class NodeInfo` which has the given legal name for one of its identities, or null if no such node is found.

      Throws:
        `IllegalArgumentException` - If more than one matching node is found, in the case of a distributed service identity (such as with a notary cluster). For such a scenerio use `getNodesByLegalName` instead.
      See Also:
        `class NodeInfo`

    - #### getNodesByLegalName

          @NotNull
          java.util.List<net.corda.core.node.NodeInfo> getNodesByLegalName(@NotNull
                                                                                    CordaX500Name name)

      Return a list of `class NodeInfo`s which have the given legal name for one of their identities, or an empty list if no such nodes are found.

      Normally there is at most one node for a legal name, but for distributed service identities (such as with a notary cluster) there can be multiple nodes sharing the same identity.

      See Also:
        `class NodeInfo`

    - #### getNodeByAddress

          @Nullable
          NodeInfo getNodeByAddress(@NotNull
                                              NetworkHostAndPort address)

      Look up the node info for a host and port.

    - #### getPeerCertificateByLegalName

          @Nullable
          PartyAndCertificate getPeerCertificateByLegalName(@NotNull
                                                                      CordaX500Name name)

      Look up a well known identity (including certificate path) of a legal name. This should be used in preference to well known identity lookup in the identity service where possible, as the network map is the authoritative source of well known identities.

    - #### getPeerByLegalName

          @Nullable
          Party getPeerByLegalName(@NotNull
                                             CordaX500Name name)

      Look up the well known identity of a legal name. This should be used in preference to well known identity lookup in the identity service where possible, as the network map is the authoritative source of well known identities.

    - #### getAllNodes

          @NotNull
          java.util.List<net.corda.core.node.NodeInfo> getAllNodes()

      Return all `class NodeInfo`s the node currently is aware of (including ourselves).

      See Also:
        `class NodeInfo`

    - #### getNodesByLegalIdentityKey

          @NotNull
          java.util.List<net.corda.core.node.NodeInfo> getNodesByLegalIdentityKey(@NotNull
                                                                                           java.security.PublicKey identityKey)

      Look up the node information entries for a specific identity key. Note that normally there will be only one node for a key, but for clusters of nodes or distributed services there can be multiple nodes.

    - #### getPartyInfo

          @Nullable
          PartyInfo getPartyInfo(@NotNull
                                           Party party)

      Returns information about the party, which may be a specific node or a service

    - #### getNotary

          @Nullable
          Party getNotary(@NotNull
                                    CordaX500Name name)

      Look up a well known identity of notary by legal name.

    - #### isNotary

          boolean isNotary(@NotNull
                           Party party)

      Returns true if and only if the given `class Party` is a notary, which is defined by the network parameters.

      See Also:
        `class Party`

    - #### isValidatingNotary

          boolean isValidatingNotary(@NotNull
                                     Party party)

      Returns true if and only if the given `class Party` is validating notary. For every party that is a validating notary, `isNotary` is also true.

      See Also:
        `class Party`, `isNotary`, `isNotary`

    - #### clearNetworkMapCache

          void clearNetworkMapCache()

      Clear all network map data from local node cache.