Class ACMLocalIps


  • public class ACMLocalIps
    extends java.lang.Object
    ACMLocalIps provides an efficient way to check if an ip address is a local ip address. This is different from a localhost, which specifically is the loopback (127.0.0.1) address. Rather, it is any ip address that is on a local ip card.

    Normally a call to NetworkInterface.getByInetAddress() can be made. But that method is terribly inefficient!
    • Constructor Summary

      Constructors 
      Constructor Description
      ACMLocalIps()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean isLocalhostByNameOrIP​(java.lang.String hostName)  
      static boolean isLocalIp​(java.lang.String iIpAddress)
      isLocalIp returns true if the input IP address corresponds to any local ip address (hosted by a network card locally).

      This does not do a DNS lookup.
      static boolean isLocalIp​(java.net.InetAddress iInetAddress)
      isLocalIp returns true is the input IP address corresponds to any local ip address (hosted by a network card locally).
      • Methods inherited from class java.lang.Object

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

      • ACMLocalIps

        public ACMLocalIps()
    • Method Detail

      • isLocalhostByNameOrIP

        public static boolean isLocalhostByNameOrIP​(java.lang.String hostName)
      • isLocalIp

        public static boolean isLocalIp​(java.lang.String iIpAddress)
                                 throws MSTRWebAPIException
        isLocalIp returns true if the input IP address corresponds to any local ip address (hosted by a network card locally).

        This does not do a DNS lookup.
        Parameters:
        iIpAddress -
        Returns:
        true if the address is a local host
        Throws:
        MSTRWebAPIException
      • isLocalIp

        public static boolean isLocalIp​(java.net.InetAddress iInetAddress)
        isLocalIp returns true is the input IP address corresponds to any local ip address (hosted by a network card locally).
        Parameters:
        iIpAddress -
        Returns: