Class AbstractInterfaceCriteria
java.lang.Object
org.jboss.as.controller.interfaces.AbstractInterfaceCriteria
- All Implemented Interfaces:
Serializable,Comparable<InterfaceCriteria>,InterfaceCriteria
- Direct Known Subclasses:
InetAddressMatchInterfaceCriteria,LinkLocalInterfaceCriteria,LoopbackAddressInterfaceCriteria,LoopbackInterfaceCriteria,NicInterfaceCriteria,NicMatchInterfaceCriteria,PointToPointInterfaceCriteria,PublicAddressInterfaceCriteria,SiteLocalInterfaceCriteria,SubnetMatchInterfaceCriteria,SupportsMulticastInterfaceCriteria,UpInterfaceCriteria,VirtualInterfaceCriteria
Abstract superclass for
InterfaceCriteria implementations.- Author:
- Brian Stansberry (c) 2011 Red Hat Inc.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Map<NetworkInterface,Set<InetAddress>> cloneCandidates(Map<NetworkInterface, Set<InetAddress>> candidates) intgetAcceptableAddresses(Map<NetworkInterface, Set<InetAddress>> candidates) Gets which of the available network interfaces and addresses are acceptable for use.protected abstract InetAddressisAcceptable(NetworkInterface networkInterface, InetAddress address) Gets whether the given network interface and address are acceptable for use.
-
Constructor Details
-
AbstractInterfaceCriteria
public AbstractInterfaceCriteria()
-
-
Method Details
-
isAcceptable
protected abstract InetAddress isAcceptable(NetworkInterface networkInterface, InetAddress address) throws SocketException Gets whether the given network interface and address are acceptable for use. Acceptance is indicated by returning the address which should be used for binding against the network interface; typically this is the givenaddressparameter. For those criteria which override the configured address, the override address should be returned.- Parameters:
networkInterface- the network interface. Cannot benulladdress- an address that is associated withnetworkInterface. Cannot benull- Returns:
InetAddressthe non-null address to bind to if the criteria is met,nullif the criteria is not satisfied- Throws:
SocketException- if evaluating the state ofnetworkInterfaceresults in one
-
getAcceptableAddresses
public Map<NetworkInterface,Set<InetAddress>> getAcceptableAddresses(Map<NetworkInterface, Set<InetAddress>> candidates) throws SocketExceptionDescription copied from interface:InterfaceCriteriaGets which of the available network interfaces and addresses are acceptable for use. Acceptance is indicated by including a network interface and the acceptable addresses associated with it in a map. The map may include more than one entry, and the set of addresses for any given entry may include more than one value. For those criteria which override the configured addresses (e.g.LoopbackAddressInterfaceCriteria, the override address should be returned in the set associated with the relevant interface.- Specified by:
getAcceptableAddressesin interfaceInterfaceCriteria- Parameters:
candidates- 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.- Returns:
- map of accepted network interfaces to their acceptable addresses. Cannot return
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 benullor 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. - Throws:
SocketException
-
cloneCandidates
public static Map<NetworkInterface,Set<InetAddress>> cloneCandidates(Map<NetworkInterface, Set<InetAddress>> candidates) -
compareTo
- Specified by:
compareToin interfaceComparable<InterfaceCriteria>
-