Class Host

java.lang.Object
com.aerospike.client.Host

public final class Host
extends Object
Host name/port of database server.
  • Field Summary

    Fields 
    Modifier and Type Field Description
    String name
    Host name or IP address of database server.
    int port
    Port of database server.
    String tlsName
    TLS certificate name used for secure connections.
  • Constructor Summary

    Constructors 
    Constructor Description
    Host​(String name, int port)
    Initialize host.
    Host​(String name, String tlsName, int port)
    Initialize host.
  • Method Summary

    Modifier and Type Method Description
    boolean equals​(Object obj)  
    int hashCode()  
    static Host[] parseHosts​(String str, int defaultPort)
    Parse command-line hosts from string format: hostname1[:tlsname1][:port1],...
    static List<Host> parseServiceHosts​(String str)
    Parse server service hosts from string format: hostname1:port1,...
    String toString()  

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • name

      public final String name
      Host name or IP address of database server.
    • tlsName

      public final String tlsName
      TLS certificate name used for secure connections.
    • port

      public final int port
      Port of database server.
  • Constructor Details

    • Host

      public Host​(String name, int port)
      Initialize host.
    • Host

      public Host​(String name, String tlsName, int port)
      Initialize host.
  • Method Details

    • toString

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

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

      public boolean equals​(Object obj)
      Overrides:
      equals in class Object
    • parseHosts

      public static Host[] parseHosts​(String str, int defaultPort)
      Parse command-line hosts from string format: hostname1[:tlsname1][:port1],...

      Hostname may also be an IP address in the following formats.

      • IPv4: xxx.xxx.xxx.xxx
      • IPv6: [xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx]
      • IPv6: [xxxx::xxxx]
      IPv6 addresses must be enclosed by brackets. tlsname and port are optional.
    • parseServiceHosts

      public static List<Host> parseServiceHosts​(String str)
      Parse server service hosts from string format: hostname1:port1,...

      Hostname may also be an IP address in the following formats.

      • IPv4: xxx.xxx.xxx.xxx
      • IPv6: [xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx]
      • IPv6: [xxxx::xxxx]
      IPv6 addresses must be enclosed by brackets.