Package oshi.software.common
Class AbstractNetworkParams
java.lang.Object
oshi.software.common.AbstractNetworkParams
- All Implemented Interfaces:
NetworkParams
- Direct Known Subclasses:
OpenBsdNetworkParams
Common NetworkParams implementation.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionString[]Gets the DNS Servers configured for this machine.Gets the Domain Name of the machine executing OSHI.Gets the HostName of the machine executing OSHI.protected static StringsearchGateway(List<String> lines) Convenience method to parse the output of the `route` command.toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface oshi.software.os.NetworkParams
getIpv4DefaultGateway, getIpv6DefaultGateway
-
Constructor Details
-
AbstractNetworkParams
public AbstractNetworkParams()
-
-
Method Details
-
getDomainName
Description copied from interface:NetworkParamsGets the Domain Name of the machine executing OSHI.- Specified by:
getDomainNamein interfaceNetworkParams- Returns:
- the domain name
-
getHostName
Description copied from interface:NetworkParamsGets the HostName of the machine executing OSHI.- Specified by:
getHostNamein interfaceNetworkParams- Returns:
- the hostname
-
getDnsServers
Description copied from interface:NetworkParamsGets the DNS Servers configured for this machine.- Specified by:
getDnsServersin interfaceNetworkParams- Returns:
- the DNS servers
-
searchGateway
Convenience method to parse the output of the `route` command. While the command arguments vary between OS's the output is consistently parsable.- Parameters:
lines- output of OS-specific route command- Returns:
- default gateway
-
toString
-