Package io.lettuce.core.event.connection
Class ReconnectAttemptEvent
- 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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getAttempt()
Returns the reconnect attempt counter for the connection.Duration
getDelay()
SocketAddress
localAddress()
Returns the local address.SocketAddress
remoteAddress()
Returns the remote address.String
toString()
-
-
-
Constructor Detail
-
ReconnectAttemptEvent
public ReconnectAttemptEvent(String redisUri, String epId, SocketAddress local, SocketAddress remote, int attempt, Duration delay)
-
ReconnectAttemptEvent
public ReconnectAttemptEvent(SocketAddress local, SocketAddress remote, int attempt)
-
-
Method Detail
-
getAttempt
public int getAttempt()
Returns the reconnect attempt counter for the connection. Zero-based counter,0
represents the first attempt. The counter is reset upon successful reconnect.- Returns:
- the reconnect attempt counter for the connection. Zero-based counter,
0
represents the first attempt.
-
getDelay
public Duration getDelay()
-
localAddress
public SocketAddress localAddress()
Returns the local address.- Specified by:
localAddress
in interfaceConnectionId
- Returns:
- the local address
-
remoteAddress
public SocketAddress remoteAddress()
Returns the remote address.- Specified by:
remoteAddress
in interfaceConnectionId
- Returns:
- the remote address
-
-