Package org.infinispan.server.hotrod
Class MultiHomedServerAddress
- java.lang.Object
-
- org.infinispan.server.hotrod.MultiHomedServerAddress
-
- All Implemented Interfaces:
ServerAddress
public class MultiHomedServerAddress extends Object implements ServerAddress
A Hot Rod server address which encapsulates a multi-homed server. This class enumerates all available addresses on all of the local interfaces.- Since:
- 10.1
- Author:
- Tristan Tarrant, Galder ZamarreƱo
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classMultiHomedServerAddress.InetAddressWithNetMask
-
Constructor Summary
Constructors Constructor Description MultiHomedServerAddress(int port, boolean networkPrefixOverride)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)StringgetHost(InetAddress localAddress)Return the interface address which matches the incoming addressintgetPort()inthashCode()static booleaninetAddressMatchesInterfaceAddress(byte[] inetAddress, byte[] interfaceAddress, int prefixLength)Checks whether the supplied network address matches the interfaceAddress.StringtoString()
-
-
-
Method Detail
-
getPort
public int getPort()
- Specified by:
getPortin interfaceServerAddress
-
getHost
public String getHost(InetAddress localAddress)
Return the interface address which matches the incoming address- Specified by:
getHostin 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:
-
-