Class 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 Detail

      • MultiHomedServerAddress

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

      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • 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: