Class NodeIdentifier

java.lang.Object
org.apache.nifi.cluster.protocol.NodeIdentifier

public class NodeIdentifier extends Object
A node identifier denoting the coordinates of a flow controller that is connected to a cluster. Nodes provide an external public API interface and an internal private interface for communicating with the cluster. The external API interface and internal protocol each require an IP or hostname as well as a port for communicating. This class overrides hashCode and equals and considers two instances to be equal if they have the equal IDs.
  • Field Details

    • id

      private final String id
      the unique identifier for the node
    • apiAddress

      private final String apiAddress
      the IP or hostname to use for sending requests to the node's external interface
    • apiPort

      private final int apiPort
      the port to use use for sending requests to the node's external interface, this can be HTTP API port or HTTPS API port depending on whether //TODO: .
    • socketAddress

      private final String socketAddress
      the IP or hostname to use for sending requests to the node's internal interface
    • socketPort

      private final int socketPort
      the port to use for sending requests to the node's internal interface
    • loadBalanceAddress

      private final String loadBalanceAddress
      The IP or hostname to use for sending FlowFiles when load balancing a connection
    • loadBalancePort

      private final int loadBalancePort
      the port to use for sending FlowFiles when load balancing a connection
    • siteToSiteAddress

      private final String siteToSiteAddress
      the IP or hostname that external clients should use to communicate with this node via Site-to-Site
    • siteToSitePort

      private final Integer siteToSitePort
      the port that external clients should use to communicate with this node via Site-to-Site RAW Socket protocol
    • siteToSiteHttpApiPort

      private final Integer siteToSiteHttpApiPort
      the port that external clients should use to communicate with this node via Site-to-Site HTTP protocol, this can be HTTP API port or HTTPS API port depending on whether siteToSiteSecure or not.
    • siteToSiteSecure

      private final Boolean siteToSiteSecure
      whether or not site-to-site communications with this node are secure
    • nodeIdentities

      private final Set<String> nodeIdentities
  • Constructor Details

    • NodeIdentifier

      public NodeIdentifier(String id, String apiAddress, int apiPort, String socketAddress, int socketPort, String siteToSiteAddress, Integer siteToSitePort, Integer siteToSiteHttpApiPort, boolean siteToSiteSecure)
    • NodeIdentifier

      public NodeIdentifier(String id, String apiAddress, int apiPort, String socketAddress, int socketPort, String loadBalanceAddress, int loadBalancePort, String siteToSiteAddress, Integer siteToSitePort, Integer siteToSiteHttpApiPort, boolean siteToSiteSecure)
    • NodeIdentifier

      public NodeIdentifier(String id, String apiAddress, int apiPort, String socketAddress, int socketPort, String loadBalanceAddress, int loadBalancePort, String siteToSiteAddress, Integer siteToSitePort, Integer siteToSiteHttpApiPort, boolean siteToSiteSecure, Set<String> nodeIdentities)
    • NodeIdentifier

      public NodeIdentifier()
      This constructor should not be used and exists solely for the use of JAXB
  • Method Details

    • getId

      public String getId()
    • getNodeIdentities

      public Set<String> getNodeIdentities()
    • getApiAddress

      public String getApiAddress()
    • getApiPort

      public int getApiPort()
    • getSocketAddress

      public String getSocketAddress()
    • getSocketPort

      public int getSocketPort()
    • getLoadBalanceAddress

      public String getLoadBalanceAddress()
    • getLoadBalancePort

      public int getLoadBalancePort()
    • validatePort

      private void validatePort(int port)
    • getSiteToSiteAddress

      public String getSiteToSiteAddress()
    • getSiteToSitePort

      public Integer getSiteToSitePort()
    • getSiteToSiteHttpApiPort

      public Integer getSiteToSiteHttpApiPort()
    • isSiteToSiteSecure

      public boolean isSiteToSiteSecure()
    • equals

      public boolean equals(Object obj)
      Compares the id of two node identifiers for equality.
      Overrides:
      equals in class Object
      Parameters:
      obj - a node identifier
      Returns:
      true if the id is equal; false otherwise
    • logicallyEquals

      public boolean logicallyEquals(NodeIdentifier other)
      Compares API address/port and socket address/port for equality. The id is not used for comparison.
      Parameters:
      other - a node identifier
      Returns:
      true if API address/port and socket address/port are equal; false otherwise
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getFullDescription

      public String getFullDescription()