Class Inet

java.lang.Object
org.wildfly.common.net.Inet

@Deprecated(forRemoval=true) public final class Inet extends Object
Deprecated, for removal: This API element is subject to removal in a future version.
Use Inet instead.
Utilities relating to Internet protocol (a.k.a. "INET" or "IP") address manipulation.
Author:
David M. Lloyd
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final Inet4Address
    Deprecated, for removal: This API element is subject to removal in a future version.
    Use Inet.INET4_ANY instead.
    static final Inet4Address
    Deprecated, for removal: This API element is subject to removal in a future version.
    Use Inet.INET4_BROADCAST instead.
    static final Inet4Address
    Deprecated, for removal: This API element is subject to removal in a future version.
    Use Inet.INET4_LOOPBACK instead.
    static final Inet6Address
    Deprecated, for removal: This API element is subject to removal in a future version.
    Use Inet.INET6_ANY instead.
    static final Inet6Address
    Deprecated, for removal: This API element is subject to removal in a future version.
    Use Inet.INET6_LOOPBACK instead.
  • Method Summary

    Modifier and Type
    Method
    Description
    Deprecated, for removal: This API element is subject to removal in a future version.
    static <T extends InetAddress>
    T
    getAddressByNameAndType(String hostName, Class<T> addressType)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Use Inet.getAddressByNameAndType(String, Class) instead.
    static <T extends InetAddress>
    T[]
    getAllAddressesByNameAndType(String hostName, Class<T> addressType)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Use Inet.getAllAddressesByNameAndType(String, Class) instead.
    static String
    Deprecated, for removal: This API element is subject to removal in a future version.
    Use Inet.getHostNameIfResolved(InetAddress) instead.
    static String
    Deprecated, for removal: This API element is subject to removal in a future version.
    Use Inet.getHostNameIfResolved(InetSocketAddress) instead.
    getInet4Address(int s1, int s2, int s3, int s4)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Use Inet.getInet4Address(int, int, int, int) instead.
    getInet6Address(int s1, int s2, int s3, int s4, int s5, int s6, int s7, int s8)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Use Inet.getInet6Address(int, int, int, int, int, int, int, int) instead.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Use Inet.getProtocolFamily(InetAddress) instead.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Use Inet.getResolved(InetSocketAddress) instead.
    getResolved(InetSocketAddress address, Class<? extends InetAddress> addressType)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Use Inet.getResolved(InetSocketAddress, Class) instead.
    getResolved(URI uri, int defaultPort)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Use Inet.getResolved(URI, int) instead.
    getResolved(URI uri, int defaultPort, Class<? extends InetAddress> addressType)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Use Inet.getResolved(URI, int, Class) instead.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Use Inet.getResolvedInetAddress(URI) instead.
    static <T extends InetAddress>
    T
    getResolvedInetAddress(URI uri, Class<T> addressType)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Use Inet.getResolvedInetAddress(URI, Class) instead.
    static int
    getScopeId(String scopeName)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Use Inet.getScopeId(String) instead.
    static int
    getScopeId(String scopeName, InetAddress compareWith)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Use Inet.getScopeId(String, InetAddress) instead.
    static int
    Deprecated, for removal: This API element is subject to removal in a future version.
    Use Inet.getScopeId(InetAddress) instead.
    static int
    getScopeId(NetworkInterface networkInterface)
    Deprecated, for removal: This API element is subject to removal in a future version.
    static int
    getScopeId(NetworkInterface networkInterface, InetAddress compareWith)
    Deprecated, for removal: This API element is subject to removal in a future version.
    static URI
    getURIFromAddress(String scheme, InetSocketAddress socketAddress, int defaultPort)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Use Inet.getURIFromAddress(String, InetSocketAddress, int) instead.
    static boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
    Use Inet.isInet4Address(String) instead.
    static boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
    Use Inet.isInet6Address(String) instead.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Use Inet.parseCidrAddress(String) instead.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Use Inet.parseInet4Address(String) instead.
    parseInet4Address(String address, String hostName)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Use Inet.parseInet4Address(String, String) instead.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Use Inet.parseInet4AddressOrFail(String) instead.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Use Inet.parseInet4AddressOrFail(String, String) instead.
    static byte[]
    Deprecated, for removal: This API element is subject to removal in a future version.
    Use Inet.parseInet4AddressToBytes(String) instead.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Use Inet.parseInet6Address(String) instead.
    parseInet6Address(String address, String hostName)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Use Inet.parseInet6Address(String, String) instead.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Use Inet.parseInet6AddressOrFail(String) instead.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Use Inet.parseInet6AddressOrFail(String, String) instead.
    static byte[]
    Deprecated, for removal: This API element is subject to removal in a future version.
    Use Inet.parseInet6AddressToBytes(String) instead.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Use Inet.parseInetAddress(String) instead.
    parseInetAddress(String address, String hostName)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Use Inet.parseInetAddress(String, String) instead.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Use Inet.parseInetAddressOrFail(String) instead.
    parseInetAddressOrFail(String address, String hostName)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Use Inet.parseInetAddressOrFail(String, String) instead.
    static byte[]
    Deprecated, for removal: This API element is subject to removal in a future version.
    Use Inet.parseInetAddressToBytes(String) instead.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Use Inet.toInet6Address(InetAddress) instead.
    static String
    toOptimalString(byte[] addressBytes)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Use Inet.toOptimalString(byte[]) instead.
    static String
    Deprecated, for removal: This API element is subject to removal in a future version.
    Use Inet.toOptimalString(InetAddress) instead.
    static String
    toURLString(byte[] addressBytes)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Use Inet.toURLString(byte[]) instead.
    static String
    toURLString(InetAddress inetAddress, boolean useHostNameIfPresent)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Use Inet.toURLString(InetAddress, boolean) instead.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • INET4_ANY

      @Deprecated(forRemoval=true) public static final Inet4Address INET4_ANY
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use Inet.INET4_ANY instead.
      The "any" address for IPv4.
    • INET4_LOOPBACK

      @Deprecated(forRemoval=true) public static final Inet4Address INET4_LOOPBACK
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use Inet.INET4_LOOPBACK instead.
      The traditional loopback address for IPv4.
    • INET4_BROADCAST

      @Deprecated(forRemoval=true) public static final Inet4Address INET4_BROADCAST
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use Inet.INET4_BROADCAST instead.
      The broadcast-all address for IPv4.
    • INET6_ANY

      @Deprecated(forRemoval=true) public static final Inet6Address INET6_ANY
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use Inet.INET6_ANY instead.
      The "any" address for IPv6.
    • INET6_LOOPBACK

      @Deprecated(forRemoval=true) public static final Inet6Address INET6_LOOPBACK
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use Inet.INET6_LOOPBACK instead.
      The loopback address for IPv6.
  • Method Details

    • toOptimalString

      @Deprecated(forRemoval=true) public static String toOptimalString(InetAddress inetAddress)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use Inet.toOptimalString(InetAddress) instead.
      Get the optimal string representation of an IP address. For IPv6 addresses, this representation will be more compact that the default.
      Parameters:
      inetAddress - the address (must not be null)
      Returns:
      the string representation (not null)
    • toOptimalString

      @Deprecated(forRemoval=true) public static String toOptimalString(byte[] addressBytes)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use Inet.toOptimalString(byte[]) instead.
      Get the optimal string representation of the bytes of an IP address.
      Parameters:
      addressBytes - the address bytes (must not be null)
      Returns:
      the string representation (not null)
    • toURLString

      @Deprecated(forRemoval=true) public static String toURLString(InetAddress inetAddress, boolean useHostNameIfPresent)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use Inet.toURLString(InetAddress, boolean) instead.
      Get a string representation of the given address which is suitable for use as the host component of a URL.
      Parameters:
      inetAddress - the address (must not be null)
      useHostNameIfPresent - true to preserve the host name string in the address, false to always give an IP address string
      Returns:
      the string representation (not null)
    • toURLString

      @Deprecated(forRemoval=true) public static String toURLString(byte[] addressBytes)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use Inet.toURLString(byte[]) instead.
      Get a string representation of the given address bytes which is suitable for use as the host component of a URL.
      Parameters:
      addressBytes - the address bytes (must not be null)
      Returns:
      the string representation (not null)
    • toInet6Address

      @Deprecated(forRemoval=true) public static Inet6Address toInet6Address(InetAddress inetAddress)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use Inet.toInet6Address(InetAddress) instead.
      Get the IPv6 equivalent of the given address. If the address is IPv4 then it is returned as a compatibility address.
      Parameters:
      inetAddress - the address to convert (must not be null)
      Returns:
      the converted address (not null)
    • getHostNameIfResolved

      @Deprecated(forRemoval=true) public static String getHostNameIfResolved(InetAddress inetAddress)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use Inet.getHostNameIfResolved(InetAddress) instead.
      Get the host name of the given address, if it is resolved. Otherwise, return null.
      Parameters:
      inetAddress - the address to check (must not be null)
      Returns:
      the host name, or null if the address has no host name and is unresolved
    • getHostNameIfResolved

      @Deprecated(forRemoval=true) public static String getHostNameIfResolved(InetSocketAddress socketAddress)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use Inet.getHostNameIfResolved(InetSocketAddress) instead.
      Get the host name of the given address, if it is resolved. Otherwise, return null.
      Parameters:
      socketAddress - the socket address to check (must not be null)
      Returns:
      the host name, or null if the address has no host name and is unresolved
    • getResolved

      @Deprecated(forRemoval=true) public static InetSocketAddress getResolved(URI uri, int defaultPort, Class<? extends InetAddress> addressType) throws UnknownHostException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use Inet.getResolved(URI, int, Class) instead.
      Get a resolved socket address from the given URI.
      Parameters:
      uri - the URI (must not be null)
      defaultPort - the default port to use if none is given (must be in the range 1 ≤ n ≤ 65535
      addressType - the class of the InetAddress to search for (must not be null)
      Returns:
      the socket address, or null if the URI does not have a host component
      Throws:
      UnknownHostException - if address resolution failed
    • getResolved

      @Deprecated(forRemoval=true) public static InetSocketAddress getResolved(URI uri, int defaultPort) throws UnknownHostException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use Inet.getResolved(URI, int) instead.
      Get the resolved socket address from the given URI.
      Parameters:
      uri - the URI (must not be null)
      defaultPort - the default port to use if none is given (must be in the range 1 ≤ n ≤ 65535
      Returns:
      the socket address, or null if the URI does not have a host component
      Throws:
      UnknownHostException - if address resolution failed
    • getResolvedInetAddress

      @Deprecated(forRemoval=true) public static <T extends InetAddress> T getResolvedInetAddress(URI uri, Class<T> addressType) throws UnknownHostException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use Inet.getResolvedInetAddress(URI, Class) instead.
      Get an Internet address for a URI destination, resolving the host name if necessary.
      Type Parameters:
      T - the type of the InetAddress to search for
      Parameters:
      uri - the destination URI
      Returns:
      the address, or null if no authority is present in the URI
      Throws:
      UnknownHostException - if the URI host was existent but could not be resolved to a valid address
    • getResolvedInetAddress

      @Deprecated(forRemoval=true) public static InetAddress getResolvedInetAddress(URI uri) throws UnknownHostException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use Inet.getResolvedInetAddress(URI) instead.
      Get an Internet address for a URI destination, resolving the host name if necessary.
      Parameters:
      uri - the destination URI
      Returns:
      the address, or null if no authority is present in the URI
      Throws:
      UnknownHostException - if the URI host was existent but could not be resolved to a valid address
    • getResolved

      @Deprecated(forRemoval=true) public static InetSocketAddress getResolved(InetSocketAddress address) throws UnknownHostException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use Inet.getResolved(InetSocketAddress) instead.
      Get a copy of the given socket address, but with a resolved address component.
      Parameters:
      address - the (possibly unresolved) address (must not be null)
      Returns:
      the resolved address (not null)
      Throws:
      UnknownHostException - if address resolution failed
    • getResolved

      @Deprecated(forRemoval=true) public static InetSocketAddress getResolved(InetSocketAddress address, Class<? extends InetAddress> addressType) throws UnknownHostException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use Inet.getResolved(InetSocketAddress, Class) instead.
      Get a copy of the given socket address, but with a resolved address component of the given type.
      Parameters:
      address - the (possibly unresolved) address (must not be null)
      addressType - the class of the InetAddress to search for (must not be null)
      Returns:
      the resolved address (not null)
      Throws:
      UnknownHostException - if address resolution failed, or if no addresses of the given type were found, or if the given address was already resolved but is not of the given address type
    • getAddressByNameAndType

      @Deprecated(forRemoval=true) public static <T extends InetAddress> T getAddressByNameAndType(String hostName, Class<T> addressType) throws UnknownHostException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use Inet.getAddressByNameAndType(String, Class) instead.
      Resolve the given host name, returning the first answer with the given address type.
      Type Parameters:
      T - the type of the InetAddress to search for
      Parameters:
      hostName - the host name to resolve (must not be null)
      addressType - the class of the InetAddress to search for (must not be null)
      Returns:
      the resolved address (not null)
      Throws:
      UnknownHostException - if address resolution failed or if no addresses of the given type were found
    • getAllAddressesByNameAndType

      @Deprecated(forRemoval=true) public static <T extends InetAddress> T[] getAllAddressesByNameAndType(String hostName, Class<T> addressType) throws UnknownHostException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use Inet.getAllAddressesByNameAndType(String, Class) instead.
      Resolve the given host name, returning all answers with the given address type.
      Type Parameters:
      T - the type of the InetAddress to search for
      Parameters:
      hostName - the host name to resolve (must not be null)
      addressType - the class of the InetAddress to search for (must not be null)
      Returns:
      the resolved addresses (not null)
      Throws:
      UnknownHostException - if address resolution failed or if no addresses of the given type were found
    • getInet4Address

      @Deprecated(forRemoval=true) public static Inet4Address getInet4Address(int s1, int s2, int s3, int s4)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use Inet.getInet4Address(int, int, int, int) instead.
      Get an IPv4 address from four integer segments. Each segment must be between 0 and 255.
      Parameters:
      s1 - the first segment
      s2 - the second segment
      s3 - the third segment
      s4 - the fourth segment
      Returns:
      the address (not null)
    • getInet6Address

      @Deprecated(forRemoval=true) public static Inet6Address getInet6Address(int s1, int s2, int s3, int s4, int s5, int s6, int s7, int s8)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use Inet.getInet6Address(int, int, int, int, int, int, int, int) instead.
      Get an IPv6 address from eight integer segments. Each segment must be between 0 and 65535 (0xffff).
      Parameters:
      s1 - the first segment
      s2 - the second segment
      s3 - the third segment
      s4 - the fourth segment
      s5 - the fifth segment
      s6 - the sixth segment
      s7 - the seventh segment
      s8 - the eighth segment
      Returns:
      the address (not null)
    • isInet6Address

      @Deprecated(forRemoval=true) public static boolean isInet6Address(String address)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use Inet.isInet6Address(String) instead.
      Checks whether given String is a valid IPv6 address.
      Parameters:
      address - address textual representation
      Returns:
      true if address is a valid IPv6 address, false otherwise
    • parseInet6Address

      @Deprecated(forRemoval=true) public static Inet6Address parseInet6Address(String address)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use Inet.parseInet6Address(String) instead.
      Parse an IPv6 address into an Inet6Address object.
      Parameters:
      address - the address to parse
      Returns:
      the parsed address, or null if the address is not valid
    • parseInet6Address

      @Deprecated(forRemoval=true) public static Inet6Address parseInet6Address(String address, String hostName)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use Inet.parseInet6Address(String, String) instead.
      Parse an IPv6 address into an Inet6Address object.
      Parameters:
      address - the address to parse (must not be null)
      hostName - the host name to use in the resultant object, or null to use the string representation of the address
      Returns:
      the parsed address, or null if the address is not valid
    • parseInet6AddressOrFail

      @Deprecated(forRemoval=true) public static Inet6Address parseInet6AddressOrFail(String address)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use Inet.parseInet6AddressOrFail(String) instead.
      Parse an IPv6 address into an Inet6Address object, throwing an exception on failure.
      Parameters:
      address - the address to parse
      Returns:
      the parsed address (not null)
      Throws:
      IllegalArgumentException - if the address is not valid
    • parseInet6AddressOrFail

      @Deprecated(forRemoval=true) public static Inet6Address parseInet6AddressOrFail(String address, String hostName)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use Inet.parseInet6AddressOrFail(String, String) instead.
      Parse an IPv6 address into an Inet6Address object.
      Parameters:
      address - the address to parse (must not be null)
      hostName - the host name to use in the resultant object, or null to use the string representation of the address
      Returns:
      the parsed address (not null)
      Throws:
      IllegalArgumentException - if the address is not valid
    • isInet4Address

      @Deprecated(forRemoval=true) public static boolean isInet4Address(String address)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use Inet.isInet4Address(String) instead.
      Checks whether given String is a valid IPv4 address.
      Parameters:
      address - address textual representation
      Returns:
      true if address is a valid IPv4 address, false otherwise
    • parseInet4Address

      @Deprecated(forRemoval=true) public static Inet4Address parseInet4Address(String address)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use Inet.parseInet4Address(String) instead.
      Parse an IPv4 address into an Inet4Address object.
      Parameters:
      address - the address to parse
      Returns:
      the parsed address, or null if the address is not valid
    • parseInet4Address

      @Deprecated(forRemoval=true) public static Inet4Address parseInet4Address(String address, String hostName)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use Inet.parseInet4Address(String, String) instead.
      Parse an IPv4 address into an Inet4Address object.
      Parameters:
      address - the address to parse
      hostName - the host name to use in the resultant object, or null to use the string representation of the address
      Returns:
      the parsed address, or null if the address is not valid
    • parseInet4AddressOrFail

      @Deprecated(forRemoval=true) public static Inet4Address parseInet4AddressOrFail(String address)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use Inet.parseInet4AddressOrFail(String) instead.
      Parse an IPv4 address into an Inet4Address object, throwing an exception on failure.
      Parameters:
      address - the address to parse
      Returns:
      the parsed address (not null)
      Throws:
      IllegalArgumentException - if the address is not valid
    • parseInet4AddressOrFail

      @Deprecated(forRemoval=true) public static Inet4Address parseInet4AddressOrFail(String address, String hostName)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use Inet.parseInet4AddressOrFail(String, String) instead.
      Parse an IPv4 address into an Inet4Address object.
      Parameters:
      address - the address to parse (must not be null)
      hostName - the host name to use in the resultant object, or null to use the string representation of the address
      Returns:
      the parsed address (not null)
      Throws:
      IllegalArgumentException - if the address is not valid
    • parseInetAddress

      @Deprecated(forRemoval=true) public static InetAddress parseInetAddress(String address)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use Inet.parseInetAddress(String) instead.
      Parse an IP address into an InetAddress object.
      Parameters:
      address - the address to parse
      Returns:
      the parsed address, or null if the address is not valid
    • parseInetAddress

      @Deprecated(forRemoval=true) public static InetAddress parseInetAddress(String address, String hostName)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use Inet.parseInetAddress(String, String) instead.
      Parse an IP address into an InetAddress object.
      Parameters:
      address - the address to parse
      hostName - the host name to use in the resultant object, or null to use the string representation of the address
      Returns:
      the parsed address, or null if the address is not valid
    • parseInetAddressOrFail

      @Deprecated(forRemoval=true) public static InetAddress parseInetAddressOrFail(String address)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use Inet.parseInetAddressOrFail(String) instead.
      Parse an IP address into an InetAddress object, throwing an exception on failure.
      Parameters:
      address - the address to parse
      Returns:
      the parsed address (not null)
      Throws:
      IllegalArgumentException - if the address is not valid
    • parseInetAddressOrFail

      @Deprecated(forRemoval=true) public static InetAddress parseInetAddressOrFail(String address, String hostName)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use Inet.parseInetAddressOrFail(String, String) instead.
      Parse an IP address into an InetAddress object.
      Parameters:
      address - the address to parse (must not be null)
      hostName - the host name to use in the resultant object, or null to use the string representation of the address
      Returns:
      the parsed address (not null)
      Throws:
      IllegalArgumentException - if the address is not valid
    • parseCidrAddress

      @Deprecated(forRemoval=true) public static CidrAddress parseCidrAddress(String address)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use Inet.parseCidrAddress(String) instead.
      Parse a CIDR address into a CidrAddress object.
      Parameters:
      address - the address to parse
      Returns:
      the parsed address, or null if the address is not valid
    • parseInet6AddressToBytes

      @Deprecated(forRemoval=true) public static byte[] parseInet6AddressToBytes(String address)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use Inet.parseInet6AddressToBytes(String) instead.
      Converts IPv6 address from textual representation to bytes.

      If given string doesn't represent valid IPv6 address, the method returns null.

      Parameters:
      address - address textual representation
      Returns:
      byte array representing the address, or null if the address is not valid
    • parseInet4AddressToBytes

      @Deprecated(forRemoval=true) public static byte[] parseInet4AddressToBytes(String address)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use Inet.parseInet4AddressToBytes(String) instead.
      Converts IPv4 address from textual representation to bytes.

      If given string doesn't represent valid IPv4 address, the method returns null.

      This only supports decimal notation.

      Parameters:
      address - address textual representation
      Returns:
      byte array representing the address, or null if the address is not valid
    • parseInetAddressToBytes

      @Deprecated(forRemoval=true) public static byte[] parseInetAddressToBytes(String address)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use Inet.parseInetAddressToBytes(String) instead.
      Converts an IP address from textual representation to bytes.

      If given string doesn't represent valid IP address, the method returns null.

      Parameters:
      address - address textual representation
      Returns:
      byte array representing the address, or null if the address is not valid
    • getScopeId

      @Deprecated(forRemoval=true) public static int getScopeId(InetAddress address)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use Inet.getScopeId(InetAddress) instead.
      Get the scope ID of the given address (if it is an IPv6 address).
      Returns:
      the scope ID, or 0 if there is none or the address is an IPv4 address
    • getScopeId

      @Deprecated(forRemoval=true) public static int getScopeId(String scopeName)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use Inet.getScopeId(String) instead.
      Attempt to get the scope ID of the given string. If the string is numeric then the number is parsed and returned as-is. If the scope is a string, then a search for the matching network interface will occur.
      Parameters:
      scopeName - the scope number or name as a string (must not be null)
      Returns:
      the scope ID, or 0 if no matching scope could be found
    • getScopeId

      @Deprecated(forRemoval=true) public static int getScopeId(String scopeName, InetAddress compareWith)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use Inet.getScopeId(String, InetAddress) instead.
      Attempt to get the scope ID of the given string. If the string is numeric then the number is parsed and returned as-is. If the scope is a string, then a search for the matching network interface will occur.
      Parameters:
      scopeName - the scope number or name as a string (must not be null)
      compareWith - the address to compare with, to ensure that the wrong local scope is not selected (may be null)
      Returns:
      the scope ID, or 0 if no matching scope could be found
    • findInterfaceWithScopeId

      @Deprecated(forRemoval=true) public static NetworkInterface findInterfaceWithScopeId(String scopeName)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getScopeId

      @Deprecated(forRemoval=true) public static int getScopeId(NetworkInterface networkInterface)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getScopeId

      @Deprecated(forRemoval=true) public static int getScopeId(NetworkInterface networkInterface, InetAddress compareWith)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getURIFromAddress

      @Deprecated(forRemoval=true) public static URI getURIFromAddress(String scheme, InetSocketAddress socketAddress, int defaultPort) throws URISyntaxException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use Inet.getURIFromAddress(String, InetSocketAddress, int) instead.
      Extract a base URI from the given scheme and socket address. The address is not resolved.
      Parameters:
      scheme - the URI scheme
      socketAddress - the host socket address
      defaultPort - the protocol default port, or -1 if there is none
      Returns:
      the URI instance
      Throws:
      URISyntaxException - if the URI failed to be constructed for some reason
    • getProtocolFamily

      @Deprecated(forRemoval=true) public static ProtocolFamily getProtocolFamily(InetAddress inetAddress)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use Inet.getProtocolFamily(InetAddress) instead.
      Get the protocol family of the given Internet address.
      Parameters:
      inetAddress - the address (must not be null)
      Returns:
      the protocol family (not null)