Package com.yahoo.net
Class HostName
- All Implemented Interfaces:
Comparable<HostName>
Hostnames match
DomainName.domainNamePattern
, but are restricted to 64 characters in length.
This class also has 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, jonmv
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
Return a public and fully qualified hostname for localhost that resolves to an IP address on a network interface.static HostName
static void
setHostNameForTestingOnly
(String hostName)
-
Method Details
-
of
-
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
-