public class InetAddressMatchInterfaceCriteria extends AbstractInterfaceCriteria
InterfaceCriteria that tests whether a given address is matches
the specified address.| Constructor and Description |
|---|
InetAddressMatchInterfaceCriteria(InetAddress address) |
InetAddressMatchInterfaceCriteria(String address)
Creates a new InetAddressMatchInterfaceCriteria
|
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(InterfaceCriteria o) |
boolean |
equals(Object o) |
Map<NetworkInterface,Set<InetAddress>> |
getAcceptableAddresses(Map<NetworkInterface,Set<InetAddress>> candidates)
Gets which of the available network interfaces and addresses are acceptable for
use.
|
InetAddress |
getAddress() |
int |
hashCode() |
protected InetAddress |
isAcceptable(NetworkInterface networkInterface,
InetAddress address)
Gets whether the given network interface and address are acceptable for
use.
|
String |
toString() |
cloneCandidatespublic InetAddressMatchInterfaceCriteria(InetAddress address)
public InetAddressMatchInterfaceCriteria(String address)
address - a valid String value to pass to InetAddress.getByName(String)
Cannot be nullIllegalArgumentException - if network is nullpublic InetAddress getAddress() throws UnknownHostException
UnknownHostExceptionpublic Map<NetworkInterface,Set<InetAddress>> getAcceptableAddresses(Map<NetworkInterface,Set<InetAddress>> candidates) throws SocketException
InterfaceCriteriaLoopbackAddressInterfaceCriteria, the override
address should be returned in the set associated with the relevant interface.getAcceptableAddresses in interface InterfaceCriteriagetAcceptableAddresses in class AbstractInterfaceCriteriacandidates - map of candidate interfaces and addresses. This map may include all known interfaces and
addresses or the system, or a subset of them that were acceptable to other criteria.null; an
empty map should be returned if no acceptable items are found. The set of addresses stored as
values in the map should not be null or empty; no key for an interface should be stored
if no addresses are acceptable. A criteria that only cares about the network interface should
return a map including all provided candidate addresses for that interface.SocketExceptionpublic int compareTo(InterfaceCriteria o)
compareTo in interface Comparable<InterfaceCriteria>compareTo in class AbstractInterfaceCriteriaprotected InetAddress isAcceptable(NetworkInterface networkInterface, InetAddress address) throws SocketException
address
parameter. For those criteria which override the configured address, the override address should
be returned.isAcceptable in class AbstractInterfaceCriterianetworkInterface - the network interface. Cannot be nulladdress - an address that is associated with networkInterface.
Cannot be nullgetAddress() if the address is the same as the one returned by getAddress().SocketException - if evaluating the state of networkInterface results in oneCopyright © 2020 JBoss by Red Hat. All rights reserved.