java.lang.Object
com.flexstor.common.util.InetUtil
- public class InetUtil
- extends java.lang.Object
InetUtil returns information for a specific server.
Given a server name, this class can determine all IP Addresses of the server
and also compares if this server has other names.
|
Constructor Summary |
InetUtil()
With no arguments, this constructor will load information
about the local host. |
InetUtil(java.lang.String sHost)
Loads information about the specified host. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
host
java.net.InetAddress host
allAddresses
java.net.InetAddress[] allAddresses
InetUtil
public InetUtil()
throws java.net.UnknownHostException
- With no arguments, this constructor will load information
about the local host.
InetUtil
public InetUtil(java.lang.String sHost)
throws java.net.UnknownHostException
- Loads information about the specified host.
The host name can either be a DNS or IP Address.
isLocalHost
public boolean isLocalHost()
- Determines if this object holds an instance of the local host
isLocalHost
public static boolean isLocalHost(java.lang.String sHost)
throws java.net.UnknownHostException
- Determines if the argument string represents the host name of the local host
isLocalHost
public static boolean isLocalHost(java.net.InetAddress aHost)
throws java.net.UnknownHostException
- Determines if the argument InetAddress represents the local host
isThisHost
public boolean isThisHost(java.lang.String sHost)
throws java.net.UnknownHostException
isThisHost
public boolean isThisHost(java.net.InetAddress aHost)
throws java.net.UnknownHostException
getLocalHostName
public static java.lang.String getLocalHostName()
getIPAddress
public static java.lang.String getIPAddress()
- Returns the IP Address for this local machine, or null if the
address cannot be determined.
getHostName
public static java.lang.String getHostName()
- Returns the host name for this local machine, or null if the
name cannot be determined.