Class SubnetMatchInterfaceCriteria
- java.lang.Object
-
- org.jboss.as.controller.interfaces.AbstractInterfaceCriteria
-
- org.jboss.as.controller.interfaces.SubnetMatchInterfaceCriteria
-
- All Implemented Interfaces:
Serializable,Comparable<InterfaceCriteria>,InterfaceCriteria
public class SubnetMatchInterfaceCriteria extends AbstractInterfaceCriteria
InterfaceCriteriathat tests whether a given address is on the desired subnet.- Author:
- Brian Stansberry
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description SubnetMatchInterfaceCriteria(byte[] network, int mask)Creates a new SubnetMatchInterfaceCriteria
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)inthashCode()protected InetAddressisAcceptable(NetworkInterface networkInterface, InetAddress address)Gets whether the given network interface and address are acceptable for use.-
Methods inherited from class org.jboss.as.controller.interfaces.AbstractInterfaceCriteria
cloneCandidates, compareTo, getAcceptableAddresses
-
-
-
-
Constructor Detail
-
SubnetMatchInterfaceCriteria
public SubnetMatchInterfaceCriteria(byte[] network, int mask)Creates a new SubnetMatchInterfaceCriteria- Parameters:
network- an InetAddress in byte[] form. Cannot benullmask- the number of bits innetworkthat represent the network- Throws:
IllegalArgumentException- ifnetworkisnull
-
-
Method Detail
-
isAcceptable
protected 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.- Specified by:
isAcceptablein classAbstractInterfaceCriteria- Parameters:
networkInterface- the network interface. Cannot benulladdress- an address that is associated withnetworkInterface. Cannot benull- Returns:
addressif theaddressis on the correct subnet.- Throws:
SocketException- if evaluating the state ofnetworkInterfaceresults in one
-
-