Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.flexstor.common.util
Class InetUtil  view InetUtil download InetUtil.java

java.lang.Object
  extended bycom.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.


Field Summary
(package private)  java.net.InetAddress[] allAddresses
           
(package private)  java.net.InetAddress host
           
 
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.
 
Method Summary
static java.lang.String getHostName()
          Returns the host name for this local machine, or null if the name cannot be determined.
static java.lang.String getIPAddress()
          Returns the IP Address for this local machine, or null if the address cannot be determined.
static java.lang.String getLocalHostName()
           
 boolean isLocalHost()
          Determines if this object holds an instance of the local host
static boolean isLocalHost(java.net.InetAddress aHost)
          Determines if the argument InetAddress represents the local host
static boolean isLocalHost(java.lang.String sHost)
          Determines if the argument string represents the host name of the local host
 boolean isThisHost(java.net.InetAddress aHost)
           
 boolean isThisHost(java.lang.String sHost)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

host

java.net.InetAddress host

allAddresses

java.net.InetAddress[] allAddresses
Constructor Detail

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.

Method Detail

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.