public class InetNetworkBuilder extends Object
Builds a InetNetwork (Inet4Network or Inet6Network) in function on the provided string pattern that represents a subnet.
Inet4Network is constructed based on the IPv4 subnet expressed in one of several formats:
IPv4 Format Example Explicit address 127.0.0.1 Address with a wildcard 127.0.0.* Domain name myHost.com Domain name + prefix-length myHost.com/24 Domain name + mask myHost.com/255.255.255.0 IP address + prefix-length 127.0.0.0/8 IP + mask 127.0.0.0/255.0.0.0For more information on IP V4, see RFC 1518 and RFC 1519.
Inet6Network is constructed based on the IPv4 subnet expressed in one of several formats:
IPv6 Format Example Explicit address 0000:0000:0000:0000:0000:0000:0000:0001 IP address + subnet mask (/) 0000:0000:0000:0000:0000:0000:0000:0001/64 IP address + subnet mask (%) 0000:0000:0000:0000:0000:0000:0000:0001%64 The following V6 formats will be supported later: Domain name myHost.com Domain name + mask (/) myHost.com/48 Domain name + mask (%) myHost.com%48 Explicit shorted address ::1For more information on IP V6, see RFC 2460. (See also http://en.wikipedia.org/wiki/IPv6_address)
Constructor and Description |
---|
InetNetworkBuilder(DNSService dnsServer)
Constructs a InetNetwork.
|
Modifier and Type | Method and Description |
---|---|
InetNetwork |
getFromString(String netspec)
Creates a InetNetwork for the given String.
|
static boolean |
isV6(String netspec)
Returns true if the string parameters is a IPv6 pattern.
|
public InetNetworkBuilder(DNSService dnsServer)
dnsServer
- the DNSService to usepublic InetNetwork getFromString(String netspec) throws UnknownHostException
netspec
- the String which is will converted to InetNetworkUnknownHostException
public static boolean isV6(String netspec)
netspec
- true
if is a IPv6 pattern else false
Copyright © 2002-2012 The Apache Software Foundation. All Rights Reserved.