Package io.hekate.network
Interface NetworkServerFailure
-
public interface NetworkServerFailure
Failure inNetworkServer
.Information that is provided by this interface can be used to implement server failover functionality. For more details please see "Server failover" section of
NetworkServer
javadoc.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
NetworkServerFailure.Resolution
Resolution ofNetworkServerFailure
.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description int
attempt()
Returns the current failover attempt (starting with 0).Throwable
cause()
Returns the cause of this failure.NetworkServerFailure.Resolution
fail()
Resolves this failure to be unrecoverable.InetSocketAddress
lastTriedAddress()
Returns the last address that was tried by the server.NetworkServerFailure.Resolution
retry()
Resolves this failure to be recoverable.
-
-
-
Method Detail
-
cause
Throwable cause()
Returns the cause of this failure.- Returns:
- Cause of this failure.
-
attempt
int attempt()
Returns the current failover attempt (starting with 0).- Returns:
- Current failover attempt.
-
lastTriedAddress
InetSocketAddress lastTriedAddress()
Returns the last address that was tried by the server.- Returns:
- Last address that was tried by the server.
-
fail
NetworkServerFailure.Resolution fail()
Resolves this failure to be unrecoverable.- Returns:
- Failure resolution.
-
retry
NetworkServerFailure.Resolution retry()
Resolves this failure to be recoverable.- Returns:
- Failure resolution.
-
-