Class ClientConnectionRedirectedException

    • Constructor Detail

      • ClientConnectionRedirectedException

        public ClientConnectionRedirectedException​(String reason,
                                                   ClientRedirect redirect,
                                                   ErrorCondition condition)
        Creates a new connection redirect exception with the provided redirection information.
        Parameters:
        reason - The reason for the redirect
        redirect - The ClientRedirect information object.
        condition - The ErrorCondition that describes the redirection error.
    • Method Detail

      • getHostname

        public String getHostname()
        the host name of the remote peer where the Connection is being redirected.

        This value should be used in the 'hostname' field of the Open frame, and during SASL negotiation (if used). When using this client to reconnect this value would be assigned to the ConnectionOptions.virtualHost(String) value in the ConnectionOptions passed to the newly created Connection.

        Returns:
        the host name of the remote AMQP container to redirect to.
      • getNetworkHost

        public String getNetworkHost()
        A network level host name that matches either the DNS hostname or IP address of the remote container.
        Returns:
        the network level host name value where the connection is being redirected.
      • getPort

        public int getPort()
        A network level port value that should be used when redirecting this connection.
        Returns:
        the network port value where the connection is being redirected.
      • getScheme

        public String getScheme()
        Returns the connection scheme that should be used when connecting to the remote host and port provided in this redirection.
        Returns:
        the connection scheme to use when redirecting to the provided host and port.
      • getPath

        public String getPath()
        The path value that should be used when connecting to the provided host and port.
        Returns:
        the path value that should be used when redirecting to the provided host and port.
      • getRedirectionURI

        public URI getRedirectionURI()
                              throws Exception
        Attempt to construct a URI that represents the location where the redirect is sending the client Connection.
        Returns:
        the URI that represents the redirection.
        Throws:
        Exception - if an error occurs while converting the redirect into a URI.