Class InetSocketAddressUtil

java.lang.Object
org.opendaylight.protocol.util.InetSocketAddressUtil

public final class InetSocketAddressUtil extends Object
Created as a util for test tools.
  • Method Details

    • parseAddresses

      public static List<InetSocketAddress> parseAddresses(String address, int defaultPort)
    • parseAddresses

      public static List<InetSocketAddress> parseAddresses(String address)
    • toHostAndPort

      public static com.google.common.net.HostAndPort toHostAndPort(InetSocketAddress address)
    • getInetSocketAddress

      public static InetSocketAddress getInetSocketAddress(String hostPortString, Integer defaultPort)
    • getRandomLoopbackInetSocketAddress

      public static InetSocketAddress getRandomLoopbackInetSocketAddress(int port)
    • getRandomLoopbackInetSocketAddress

      public static InetSocketAddress getRandomLoopbackInetSocketAddress()
    • getRandomPort

      public static int getRandomPort()
      Generate a random high range port number.
      Returns:
      A port number range from 20000 to 60000
    • getRandomLoopbackIpAddress

      public static String getRandomLoopbackIpAddress()
      Generate a random loopback ip address. IP address range: 127.50.50.50 ~ 127.250.250.250 We did not utilize the whole 127./8 range to avoid using common addresses like 127.0.0.1
      Returns:
      Generated random loopback IP address