public class HostNameIpsRing extends Object
The lookup itself is delegated to InetAddress.getAllByName(String), which in turn delegates to the underlying platform.
Caching is already handled by the underlying mechanism and is controlled by system properties (See the javadoc for
InetAddress, InetAddress Caching section for insight on this mechanism).
| Constructor and Description |
|---|
HostNameIpsRing(String hostName)
Builds the resolver for the given
hostName. |
| Modifier and Type | Method and Description |
|---|---|
List<InetAddress> |
getIpAddresses()
Calls to this method are thread safe.
|
List<InetAddress> |
getRotatedIpAddresses()
Calls to this method are thread safe.
|
public HostNameIpsRing(String hostName)
hostName.hostName - the hostName to resolve addresses for.public List<InetAddress> getRotatedIpAddresses() throws UnknownHostException
Two subsequent calls from the same thread may yield the same address.
UnknownHostException - See InetAddress.getAllByName(String)public List<InetAddress> getIpAddresses() throws UnknownHostException
UnknownHostException - See InetAddress.getAllByName(String)Copyright © 2003–2025 MuleSoft, Inc.. All rights reserved.