Package org.apache.bookkeeper.net
Class NetUtils
java.lang.Object
org.apache.bookkeeper.net.NetUtils
Network Utilities.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringnormalizeHostName(String name) Given a string representation of a host, return its ip address in textual presentation.normalizeHostNames(Collection<String> names) Given a collection of string representation of hosts, return a list of corresponding IP addresses in the textual representation.static StringresolveNetworkLocation(DNSToSwitchMapping dnsResolver, BookieSocketAddress addr)
-
Constructor Details
-
NetUtils
public NetUtils()
-
-
Method Details
-
normalizeHostName
Given a string representation of a host, return its ip address in textual presentation.- Parameters:
name- a string representation of a host: either a textual representation its IP address or its host name- Returns:
- its IP address in the string format
-
normalizeHostNames
Given a collection of string representation of hosts, return a list of corresponding IP addresses in the textual representation.- Parameters:
names- a collection of string representations of hosts- Returns:
- a list of corresponding IP addresses in the string format
- See Also:
-
resolveNetworkLocation
public static String resolveNetworkLocation(DNSToSwitchMapping dnsResolver, BookieSocketAddress addr)
-