|
10Duke Scale SDK for Java
|
Interface for decision making when heartbeat API calls fail.
This handler is used to determine whether a locally stored license token should be automatically invalidated (deleted) when a heartbeat operation fails with specific error codes.
The handler follows a strategy pattern, allowing consumers of the SDK to customize the invalidation logic or disable automatic invalidation entirely.
Public Member Functions | |
| boolean | shouldInvalidateToken (LicenseHeartbeatArguments heartbeatArguments, JwtToken failedResult) |
| Determines whether a license token should be invalidated based on a failed heartbeat. | |
| boolean tenduke.scale.api.HeartbeatFailureHandler.shouldInvalidateToken | ( | LicenseHeartbeatArguments | heartbeatArguments, |
| JwtToken | failedResult ) |
Determines whether a license token should be invalidated based on a failed heartbeat.
This method is called when a heartbeat operation fails, providing both the original heartbeat arguments and the failed JWT result. The implementation should analyze the failure reason and return true if the token should be removed from local storage.
| heartbeatArguments | The original arguments used for the heartbeat request, containing information like lease ID and other context. |
| failedResult | The JWT token result from the failed heartbeat operation, which may contain error information in its claims. |
Implemented in tenduke.scale.client.DefaultHeartbeatFailureHandler.