Class ClientConnectionRedirectedException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- org.apache.qpid.protonj2.client.exceptions.ClientException
-
- org.apache.qpid.protonj2.client.exceptions.ClientIOException
-
- org.apache.qpid.protonj2.client.exceptions.ClientConnectionRemotelyClosedException
-
- org.apache.qpid.protonj2.client.exceptions.ClientConnectionRedirectedException
-
- All Implemented Interfaces:
java.io.Serializable
public class ClientConnectionRedirectedException extends ClientConnectionRemotelyClosedException
AClientIOExceptiontype that defines that the remote peer has requested that this connection be redirected to some alternative peer. The redirect information can be obtained by calling thegetRedirectionURI()method which return the URI of the peer the client is being redirect to.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ClientConnectionRedirectedException(java.lang.String reason, ClientRedirect redirect, ErrorCondition condition)Creates a new connection redirect exception with the provided redirection information.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetHostname()the host name of the remote peer where theConnectionis being redirected.java.lang.StringgetNetworkHost()A network level host name that matches either the DNS hostname or IP address of the remote container.java.lang.StringgetPath()The path value that should be used when connecting to the provided host and port.intgetPort()A network level port value that should be used when redirecting this connection.java.net.URIgetRedirectionURI()Attempt to construct a URI that represents the location where the redirect is sending the clientConnection.java.lang.StringgetScheme()Returns the connection scheme that should be used when connecting to the remote host and port provided in this redirection.-
Methods inherited from class org.apache.qpid.protonj2.client.exceptions.ClientConnectionRemotelyClosedException
getErrorCondition
-
-
-
-
Constructor Detail
-
ClientConnectionRedirectedException
public ClientConnectionRedirectedException(java.lang.String reason, ClientRedirect redirect, ErrorCondition condition)Creates a new connection redirect exception with the provided redirection information.- Parameters:
reason- The reason for the redirectredirect- TheClientRedirectinformation object.condition- TheErrorConditionthat describes the redirection error.
-
-
Method Detail
-
getHostname
public java.lang.String getHostname()
the host name of the remote peer where theConnectionis being redirected.This value should be used in the 'hostname' field of the
Openframe, and during SASL negotiation (if used). When using this client to reconnect this value would be assigned to theConnectionOptions.virtualHost(String)value in theConnectionOptionspassed to the newly createdConnection.- Returns:
- the host name of the remote AMQP container to redirect to.
-
getNetworkHost
public java.lang.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 java.lang.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 java.lang.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 java.net.URI getRedirectionURI() throws java.lang.ExceptionAttempt to construct a URI that represents the location where the redirect is sending the clientConnection.- Returns:
- the URI that represents the redirection.
- Throws:
java.lang.Exception- if an error occurs while converting the redirect into a URI.
-
-