Package org.apache.bookkeeper.net
Class NetUtils
- java.lang.Object
-
- org.apache.bookkeeper.net.NetUtils
-
public class NetUtils extends java.lang.Object
Network Utilities.
-
-
Constructor Summary
Constructors Constructor Description NetUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.String
normalizeHostName(java.lang.String name)
Given a string representation of a host, return its ip address in textual presentation.static java.util.List<java.lang.String>
normalizeHostNames(java.util.Collection<java.lang.String> names)
Given a collection of string representation of hosts, return a list of corresponding IP addresses in the textual representation.static java.lang.String
resolveNetworkLocation(DNSToSwitchMapping dnsResolver, BookieSocketAddress addr)
-
-
-
Method Detail
-
normalizeHostName
public static java.lang.String normalizeHostName(java.lang.String name)
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
public static java.util.List<java.lang.String> normalizeHostNames(java.util.Collection<java.lang.String> names)
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:
normalizeHostName(String)
-
resolveNetworkLocation
public static java.lang.String resolveNetworkLocation(DNSToSwitchMapping dnsResolver, BookieSocketAddress addr)
-
-