Package com.yahoo.net

Class HostName


  • public class HostName
    extends java.lang.Object
    Utilities for getting the hostname of the system running the JVM. Detection of the hostname is now done before starting any Vespa programs and provided in the environment variable VESPA_HOSTNAME; if that variable isn't set a default of "localhost" is always returned.
    Author:
    arnej
    • Constructor Summary

      Constructors 
      Constructor Description
      HostName()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String getLocalhost()
      Return a public and fully qualified hostname for localhost that resolves to an IP address on a network interface.
      static void setHostNameForTestingOnly​(java.lang.String hostName)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • HostName

        public HostName()
    • Method Detail

      • getLocalhost

        public static java.lang.String getLocalhost()
        Return a public and fully qualified hostname for localhost that resolves to an IP address on a network interface.
        Returns:
        the preferred name of localhost
      • setHostNameForTestingOnly

        public static void setHostNameForTestingOnly​(java.lang.String hostName)