java.lang.Object
io.lettuce.core.event.connection.ReconnectFailedEvent
- All Implemented Interfaces:
ConnectionId,ConnectionEvent,Event
public class ReconnectFailedEvent extends Object
Event fired on failed reconnect caused either by I/O issues or during connection initialization.
- Since:
- 5.2
- Author:
- Mark Paluch
-
Constructor Summary
Constructors Constructor Description ReconnectFailedEvent(String redisUri, String epId, SocketAddress local, SocketAddress remote, Throwable cause, int attempt)ReconnectFailedEvent(SocketAddress local, SocketAddress remote, Throwable cause, int attempt) -
Method Summary
Modifier and Type Method Description intgetAttempt()Returns the reconnect attempt counter for the connection.ThrowablegetCause()Returns theThrowablethat describes the reconnect cause.SocketAddresslocalAddress()Returns the local address.SocketAddressremoteAddress()Returns the remote address.StringtoString()
-
Constructor Details
-
ReconnectFailedEvent
public ReconnectFailedEvent(String redisUri, String epId, SocketAddress local, SocketAddress remote, Throwable cause, int attempt) -
ReconnectFailedEvent
public ReconnectFailedEvent(SocketAddress local, SocketAddress remote, Throwable cause, int attempt)
-
-
Method Details
-
getCause
Returns theThrowablethat describes the reconnect cause.- Returns:
- the
Throwablethat describes the reconnect cause.
-
getAttempt
public int getAttempt()Returns the reconnect attempt counter for the connection. Zero-based counter,0represents the first attempt. The counter is reset upon successful reconnect.- Returns:
- the reconnect attempt counter for the connection. Zero-based counter,
0represents the first attempt.
-
localAddress
Returns the local address.- Specified by:
localAddressin interfaceConnectionId- Returns:
- the local address
-
remoteAddress
Returns the remote address.- Specified by:
remoteAddressin interfaceConnectionId- Returns:
- the remote address
-
toString
-