Class ClientLinkRedirectedException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- org.apache.qpid.protonj2.client.exceptions.ClientException
-
- org.apache.qpid.protonj2.client.exceptions.ClientIllegalStateException
-
- org.apache.qpid.protonj2.client.exceptions.ClientResourceRemotelyClosedException
-
- org.apache.qpid.protonj2.client.exceptions.ClientLinkRemotelyClosedException
-
- org.apache.qpid.protonj2.client.exceptions.ClientLinkRedirectedException
-
- All Implemented Interfaces:
Serializable
public class ClientLinkRedirectedException extends ClientLinkRemotelyClosedException
AClientLinkRemotelyClosedException
type that defines that the remote peer has requested that this link 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. The address is also accessible for use in creating a new link after reconnection.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ClientLinkRedirectedException(String reason, ClientRedirect redirect, ErrorCondition condition)
Create a new instance of the link redirected exception
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getAddress()
The address value that should be used when connecting to the provided host and port and creating a new link instance as directed.String
getHostname()
String
getNetworkHost()
A network level host name that matches either the DNS hostname or IP address of the remote container.String
getPath()
The path value that should be used when connecting to the provided host and port.int
getPort()
A network level port value that should be used when redirecting this connection.URI
getRedirectionURI()
String
getScheme()
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.ClientResourceRemotelyClosedException
getErrorCondition
-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
Constructor Detail
-
ClientLinkRedirectedException
public ClientLinkRedirectedException(String reason, ClientRedirect redirect, ErrorCondition condition)
Create a new instance of the link redirected exception- Parameters:
reason
- The reason for the link redirectredirect
- A ClientRedirect object with redirection information.condition
- The error condition that was provided from the remote peer.
-
-
Method Detail
-
getHostname
public String getHostname()
the host name of the remote peer where theSender
orReceiver
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 theConnectionOptions.virtualHost(String)
value in theConnectionOptions
passed to the newly createdConnection
.- 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.
-
getAddress
public String getAddress()
The address value that should be used when connecting to the provided host and port and creating a new link instance as directed.- Returns:
- the address 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 clientSender
orReceiver
.- Returns:
- the URI that represents the redirection.
- Throws:
Exception
- if an error occurs while converting the redirect into a URI.
-
-