public class Host extends Object
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_HOSTNAME
The name that will be provided for the hostname or IP address if
they can not be obtained from the host system.
|
static String |
FULL_HOSTNAME
The cannonical, fully qualified name of the host system.
|
static String |
ID |
static String |
IP_ADDRESS
The Internet Protocol address of the host system.
|
static String |
SHORT_HOSTNAME
The short, single word name of the host system.
|
Modifier and Type | Method and Description |
---|---|
static Properties |
Environment()
Get all the environment variables from the host.
|
static String |
Full_Hostname()
Get the fully qualified name of the host system.
|
static String |
Full_Hostname(String hostname)
Get the fully qualified name for a hostname.
|
static String |
Hostname()
Get the name of the host system.
|
static String |
Hostname(String address)
Get the name of a host system.
|
static String |
IP_Address()
Get the IP address of the host system.
|
static String |
IP_Address(String hostname)
Get the IP address for a hostname.
|
static String |
OS_Name()
Get the name of the host operating system.
|
public static final String ID
public static final String FULL_HOSTNAME
If the hostname can not be obtained from the host system
the DEFAULT_HOSTNAME
will be used.
SHORT_HOSTNAME
public static final String SHORT_HOSTNAME
If the hostname can not be obtained from the host system
the DEFAULT_HOSTNAME
will be used.
FULL_HOSTNAME
public static final String IP_ADDRESS
If the IP address can not be obtained from the host system
the DEFAULT_HOSTNAME
will be used.
public static final String DEFAULT_HOSTNAME
public static String Hostname()
DEFAULT_HOSTNAME
is returned.SHORT_HOSTNAME
public static String Hostname(String address)
address
- The textual representation of a host system IP
address or its hostname. If null, the local host system is
assumed.local system
, the DEFAULT_HOSTNAME
will not
be returned if hostname lookup fails; instead of an ambiguous
name for possibly multiple unknown hostnames, the calling
application is expected to have rules to deal with an unknown
hostname in this case.SecurityException
- If hostname lookup is not allowed.public static String Full_Hostname()
DEFAULT_HOSTNAME
is returned.FULL_HOSTNAME
public static String Full_Hostname(String hostname)
hostname
- The name host system or the textual
representation of its IP address. If null, the local host system
is assumed.local system
, the DEFAULT_HOSTNAME
will not be returned if hostname lookup fails;
instead of an ambiguous name for possibly multiple unknown
hostnames, the calling application is expected to have rules to
deal with an unknown hostname in this case.SecurityException
- If hostname lookup is not allowed.public static String IP_Address()
DEFAULT_HOSTNAME
is returned.IP_ADDRESS
public static String IP_Address(String hostname)
hostname
- The name host system or the textual
representation of its IP address. If null, the local host system
is assumed.local
system
, the DEFAULT_HOSTNAME
will not be returned if
hostname lookup fails; instead of an ambiguous name for possibly
multiple unknown hostnames, the calling application is expected
to have rules to deal with an unknown hostname in this case.SecurityException
- If hostname lookup is not allowed.public static String OS_Name()
public static Properties Environment()