Class AnyInterfaceCriteria

java.lang.Object
org.jboss.as.controller.interfaces.AnyInterfaceCriteria
All Implemented Interfaces:
Serializable, Comparable<InterfaceCriteria>, InterfaceCriteria

public class AnyInterfaceCriteria extends Object implements InterfaceCriteria
InterfaceCriteria that tests whether a given network interface and address satisfy any of a contained set of InterfaceCriteria.
Author:
Brian Stansberry
See Also:
  • Constructor Details

    • AnyInterfaceCriteria

      public AnyInterfaceCriteria(Set<InterfaceCriteria> criteria)
      Creates a new AnyInterfaceCriteria
      Parameters:
      criteria - the criteria to check to see if any are satisfied. Cannot be null
      Throws:
      IllegalArgumentException - if criteria is null
  • Method Details

    • getAcceptableAddresses

      public Map<NetworkInterface,Set<InetAddress>> getAcceptableAddresses(Map<NetworkInterface,Set<InetAddress>> candidates) throws SocketException
      Description copied from interface: InterfaceCriteria
      Gets 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:
      getAcceptableAddresses in interface InterfaceCriteria
      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 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.
      Throws:
      SocketException
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • compareTo

      public int compareTo(InterfaceCriteria o)
      Specified by:
      compareTo in interface Comparable<InterfaceCriteria>