10Duke Scale SDK for Java
Loading...
Searching...
No Matches
tenduke.scale.api.HeartbeatFailureHandler Interface Reference

Detailed Description

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.

Inheritance diagram for tenduke.scale.api.HeartbeatFailureHandler:
tenduke.scale.client.DefaultHeartbeatFailureHandler

Public Member Functions

boolean shouldInvalidateToken (LicenseHeartbeatArguments heartbeatArguments, JwtToken failedResult)
 Determines whether a license token should be invalidated based on a failed heartbeat.
 

Member Function Documentation

◆ shouldInvalidateToken()

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.

Parameters
heartbeatArgumentsThe original arguments used for the heartbeat request, containing information like lease ID and other context.
failedResultThe JWT token result from the failed heartbeat operation, which may contain error information in its claims.
Returns
true if the token should be invalidated (deleted), false otherwise.

Implemented in tenduke.scale.client.DefaultHeartbeatFailureHandler.


The documentation for this interface was generated from the following file: