public class NodeInfo
Information about a network node that acts on behalf of some party. NodeInfos can be found via the network map
cache, accessible from a interface NetworkMapCache
. They are also available via RPC
using the net.corda.core.messaging.CordaRPCOps.networkMapSnapshot
method.
public NodeInfo(@NotNull java.util.List<net.corda.core.utilities.NetworkHostAndPort> addresses, @NotNull java.util.List<net.corda.core.identity.PartyAndCertificate> legalIdentitiesAndCerts, int platformVersion, long serial)
Information about a network node that acts on behalf of some party. NodeInfos can be found via the network map
cache, accessible from a interface NetworkMapCache
. They are also available via RPC
using the net.corda.core.messaging.CordaRPCOps.networkMapSnapshot
method.
addresses
- An ordered list of IP addresses/hostnames where the node can be contacted.legalIdentitiesAndCerts
- A non-empty list, where the first identity is assumed to be the default identity of the node.platformVersion
- An integer representing the set of protocol features the node supports. See the docsite for information on how the platform is versioned.serial
- An arbitrary number incremented each time the NodeInfo is changed. This is analogous to the same concept in DNS.interface NetworkMapCache
,
net.corda.core.messaging.CordaRPCOps.networkMapSnapshot
@NotNull public java.util.List<net.corda.core.identity.Party> getLegalIdentities()
An ordered list of legal identities supported by this node. The node will always have at least one, so if you are porting code from earlier versions of Corda that expected a single party per node, just use the first item in the returned list.
public boolean isLegalIdentity(@NotNull Party party)
Returns true if party
is one of the identities of this node, else false.
party
public boolean isLegalIdentity(@NotNull CordaX500Name name)
Returns true if name
matches one of the identities of this node, else false.
name
@NotNull public Party identityFromX500Name(@NotNull CordaX500Name name)
Get a legal identity of this node from the X.500 name. This is intended for use in cases where the node is expected to have a matching identity, and will throw an exception if no match is found.
IllegalArgumentException
- if the node has no matching identity.@NotNull public PartyAndCertificate identityAndCertFromX500Name(@NotNull CordaX500Name name)
Get a legal identity and certificate of this node from the X.500 name. This is intended for use in cases where the node is expected to have a matching identity, and will throw an exception if no match is found.
IllegalArgumentException
- if the node has no matching identity.@NotNull public java.util.List<net.corda.core.utilities.NetworkHostAndPort> getAddresses()
An ordered list of IP addresses/hostnames where the node can be contacted.
@NotNull public java.util.List<net.corda.core.identity.PartyAndCertificate> getLegalIdentitiesAndCerts()
A non-empty list,
where the first identity is assumed to be the default identity of the node.
public int getPlatformVersion()
An integer representing the set of protocol features the node supports.
See the docsite for information on how the platform is versioned.
public long getSerial()
An arbitrary number incremented each time the NodeInfo is changed.
This is analogous to the same concept in DNS.
@NotNull public java.util.List<net.corda.core.utilities.NetworkHostAndPort> component1()
An ordered list of IP addresses/hostnames where the node can be contacted.
@NotNull public java.util.List<net.corda.core.identity.PartyAndCertificate> component2()
A non-empty list,
where the first identity is assumed to be the default identity of the node.
public int component3()
An integer representing the set of protocol features the node supports.
See the docsite for information on how the platform is versioned.
public long component4()
An arbitrary number incremented each time the NodeInfo is changed.
This is analogous to the same concept in DNS.
@NotNull public NodeInfo copy(@NotNull java.util.List<net.corda.core.utilities.NetworkHostAndPort> addresses, @NotNull java.util.List<net.corda.core.identity.PartyAndCertificate> legalIdentitiesAndCerts, int platformVersion, long serial)
Information about a network node that acts on behalf of some party. NodeInfos can be found via the network map
cache, accessible from a interface NetworkMapCache
. They are also available via RPC
using the net.corda.core.messaging.CordaRPCOps.networkMapSnapshot
method.
@NotNull public java.lang.String toString()
Information about a network node that acts on behalf of some party. NodeInfos can be found via the network map
cache, accessible from a interface NetworkMapCache
. They are also available via RPC
using the net.corda.core.messaging.CordaRPCOps.networkMapSnapshot
method.
public int hashCode()
Information about a network node that acts on behalf of some party. NodeInfos can be found via the network map
cache, accessible from a interface NetworkMapCache
. They are also available via RPC
using the net.corda.core.messaging.CordaRPCOps.networkMapSnapshot
method.
public boolean equals(@Nullable java.lang.Object p)
Information about a network node that acts on behalf of some party. NodeInfos can be found via the network map
cache, accessible from a interface NetworkMapCache
. They are also available via RPC
using the net.corda.core.messaging.CordaRPCOps.networkMapSnapshot
method.