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
  • Constructor Details

    • MultiHomedServerAddress

      public MultiHomedServerAddress(int port, boolean networkPrefixOverride)
      Parameters:
      port -
  • Method Details

    • equals

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

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

      public String toString()
      Overrides:
      toString in class Object
    • getPort

      public int getPort()
      Specified by:
      getPort in interface ServerAddress
    • getHost

      public String getHost(InetAddress localAddress)
      Return the interface address which matches the incoming address
      Specified by:
      getHost in interface ServerAddress
      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: