Class NetworkHelper
java.lang.Object
org.sentrysoftware.metricshub.engine.common.helpers.NetworkHelper
Helper class to retrieve network information.
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringGet the fully qualified domain name (FQDN) of the given hostname.static booleanisLocalhost(String hostname) Check whether the given hostname is a localhost.static StringresolveDns(String hostname) Resolve the IP address of the given hostname.
-
Method Details
-
isLocalhost
Check whether the given hostname is a localhost.- Parameters:
hostname- The hostname to check.- Returns:
trueif the hostname is a localhost,falseotherwise.
-
resolveDns
Resolve the IP address of the given hostname.- Parameters:
hostname- The hostname.- Returns:
- The IP address of the hostname, or
nullif not resolved.
-
getFqdn
Get the fully qualified domain name (FQDN) of the given hostname.- Parameters:
hostname- The hostname.- Returns:
- The FQDN of the hostname, or the original hostname if not resolved.
-