Package io.netty.resolver
Class DefaultHostsFileEntriesResolver
- java.lang.Object
-
- io.netty.resolver.DefaultHostsFileEntriesResolver
-
- All Implemented Interfaces:
HostsFileEntriesResolver
public final class DefaultHostsFileEntriesResolver extends java.lang.Object implements HostsFileEntriesResolver
DefaultHostsFileEntriesResolver
that resolves hosts file entries only once.
-
-
Field Summary
-
Fields inherited from interface io.netty.resolver.HostsFileEntriesResolver
DEFAULT
-
-
Constructor Summary
Constructors Constructor Description DefaultHostsFileEntriesResolver()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.net.InetAddress
address(java.lang.String inetHost, ResolvedAddressTypes resolvedAddressTypes)
Resolve the address of a hostname against the entries in a hosts file, depending on some address types.java.util.List<java.net.InetAddress>
addresses(java.lang.String inetHost, ResolvedAddressTypes resolvedAddressTypes)
Resolves all addresses of a hostname against the entries in a hosts file, depending on the specifiedResolvedAddressTypes
.
-
-
-
Method Detail
-
address
public java.net.InetAddress address(java.lang.String inetHost, ResolvedAddressTypes resolvedAddressTypes)
Description copied from interface:HostsFileEntriesResolver
Resolve the address of a hostname against the entries in a hosts file, depending on some address types.- Specified by:
address
in interfaceHostsFileEntriesResolver
- Parameters:
inetHost
- the hostname to resolveresolvedAddressTypes
- the address types to resolve- Returns:
- the first matching address
-
addresses
public java.util.List<java.net.InetAddress> addresses(java.lang.String inetHost, ResolvedAddressTypes resolvedAddressTypes)
Resolves all addresses of a hostname against the entries in a hosts file, depending on the specifiedResolvedAddressTypes
.- Parameters:
inetHost
- the hostname to resolveresolvedAddressTypes
- the address types to resolve- Returns:
- all matching addresses or
null
in case the hostname cannot be resolved
-
-