Package org.infinispan.server.hotrod
Class MultiHomedServerAddress
java.lang.Object
org.infinispan.server.hotrod.MultiHomedServerAddress
- All Implemented Interfaces:
ServerAddress
A Hot Rod server address which encapsulates a multi-homed server. This class enumerates all available addresses on
all the local interfaces.
- Since:
- 10.1
- Author:
- Tristan Tarrant, Galder ZamarreƱo
-
Nested Class Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
getHost
(InetAddress localAddress) Return the interface address which matches the incoming addressint
getPort()
int
hashCode()
static boolean
inetAddressMatchesInterfaceAddress
(byte[] inetAddress, byte[] interfaceAddress, int prefixLength) Checks whether the supplied network address matches the interfaceAddress.toString()
-
Constructor Details
-
MultiHomedServerAddress
public MultiHomedServerAddress(int port, boolean networkPrefixOverride) - Parameters:
port
-
-
-
Method Details
-
equals
-
hashCode
public int hashCode() -
toString
-
getPort
public int getPort()- Specified by:
getPort
in interfaceServerAddress
-
getHost
Return the interface address which matches the incoming address- Specified by:
getHost
in interfaceServerAddress
- Parameters:
localAddress
-- Returns:
-
inetAddressMatchesInterfaceAddress
public static boolean inetAddressMatchesInterfaceAddress(byte[] inetAddress, byte[] interfaceAddress, int prefixLength) Checks whether the supplied network address matches the interfaceAddress. It does this by using the interface's prefixLength and comparing the bits in the prefix.- Parameters:
inetAddress
-interfaceAddress
-- Returns:
-