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 the local interfaces.- Since:
- 10.1
- Author:
- Tristan Tarrant, Galder ZamarreƱo
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
MultiHomedServerAddress.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 boolean
equals(Object o)
String
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.String
toString()
-
-
-
Method Detail
-
getPort
public int getPort()
- Specified by:
getPort
in interfaceServerAddress
-
getHost
public String getHost(InetAddress localAddress)
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:
-
-