Class NodeEndPoint

java.lang.Object
net.spy.memcached.config.NodeEndPoint

public class NodeEndPoint extends Object
NodeEndPoint captures the information needed to connect to a cache node. Both hostName and ipAddress to capture the latest information instead of relying entirely on the DNS servers.
  • Constructor Details

    • NodeEndPoint

      public NodeEndPoint(String hostName, String ipAddress, int port)
      Immutable instance with a hostname, ip address, and port.
      Parameters:
      hostName - hostname (ex. foo.bar.com)
      ipAddress - string form of IP address (ex. 10.10.1.1). It is expected that this IP address is valid.
      port - port (ex. 11211)
    • NodeEndPoint

      public NodeEndPoint(String hostName, int port)
      Immutable instance, without an IP address.
      Parameters:
      hostName - hostname (ex. foo.bar.com).
      port - port (ex. 11211)
  • Method Details

    • getHostName

      public String getHostName()
      Returns:
      hostname (ex. foo.bar.com)
    • getIpAddress

      public String getIpAddress()
      Returns:
      IP address, in textual form (ex. 10.1.10.1)
    • getPort

      public int getPort()
      Returns:
      port (ex. 11211)
    • getInetSocketAddress

      public InetSocketAddress getInetSocketAddress()
    • getInetSocketAddress

      public InetSocketAddress getInetSocketAddress(boolean reresolve)
    • copy

      public static NodeEndPoint copy(NodeEndPoint other)
      copy one object to another.
    • toString

      public String toString()
      Overrides:
      toString in class Object