java.lang.Object
io.lettuce.core.event.connection.ReconnectAttemptEvent
- All Implemented Interfaces:
ConnectionId,ConnectionEvent,Event
public class ReconnectAttemptEvent extends Object
Event fired on reconnect attempts.
- Since:
- 6.1
- Author:
- Mark Paluch
-
Constructor Summary
Constructors Constructor Description ReconnectAttemptEvent(String redisUri, String epId, SocketAddress local, SocketAddress remote, int attempt, Duration delay)ReconnectAttemptEvent(SocketAddress local, SocketAddress remote, int attempt) -
Method Summary
Modifier and Type Method Description intgetAttempt()Returns the reconnect attempt counter for the connection.DurationgetDelay()SocketAddresslocalAddress()Returns the local address.SocketAddressremoteAddress()Returns the remote address.StringtoString()
-
Constructor Details
-
ReconnectAttemptEvent
public ReconnectAttemptEvent(String redisUri, String epId, SocketAddress local, SocketAddress remote, int attempt, Duration delay) -
ReconnectAttemptEvent
-
-
Method Details
-
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.
-
getDelay
-
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
-