public class IPConfiguration
extends java.lang.Object
| Constructor and Description |
|---|
IPConfiguration() |
| Modifier and Type | Method and Description |
|---|---|
java.net.InetAddress[] |
getDNS()
Gets the DNS server addresses.
|
java.net.InetAddress |
getGateway()
Gets the gateway address.
|
java.net.InetAddress |
getIP()
Gets the IP address.
|
java.net.InetAddress |
getNetmask()
Gets the netmask.
|
boolean |
isDNSStatic()
Tells whether the DNS server address is statically configured or retrieved from DHCP server.
|
boolean |
isStatic()
Tells whether the IP configuration is set statically or retrieved from a DHCP server.
|
void |
setDNS(java.net.InetAddress[] dnsList)
Sets the addresses of the DNS servers.
|
void |
setGateway(java.net.InetAddress gateway)
Sets the IP address of the gateway.
|
void |
setIP(java.net.InetAddress ip)
Sets the IP address.
|
void |
setNetmask(java.net.InetAddress netmask)
Sets the netmask.
|
void |
useDHCP(boolean use)
Forces the use of DHCP or not.
|
void |
useStaticDNS(boolean use)
Selects the DNS configuration between a static statically configured DNS and the DNS given by DHCP server.
|
@Nullable public java.net.InetAddress[] getDNS()
null if not set.@Nullable public java.net.InetAddress getGateway()
null if not set.@Nullable public java.net.InetAddress getIP()
null if not set.@Nullable public java.net.InetAddress getNetmask()
null if not set.public boolean isDNSStatic()
isStatic(), the return of this method is not relevant.true for static DNS configuration, false if DHCP is used also for DNS.public boolean isStatic()
true for static configuration, false if DHCP is used.public void setDNS(@Nullable
java.net.InetAddress[] dnsList)
dnsList - the addresses of the DNS servers or null.public void setGateway(@Nullable
java.net.InetAddress gateway)
gateway - the IP address of the gateway or null.public void setIP(@Nullable
java.net.InetAddress ip)
ip - the IP address or null.public void setNetmask(@Nullable
java.net.InetAddress netmask)
netmask - the netmask or null.public void useDHCP(boolean use)
use - true to use DHCP, false for a static configuration.setIP(InetAddress)public void useStaticDNS(boolean use)
use - true to use a static DNS, false for a dynamic one.setDNS(InetAddress[])