Interface HeartbeatTarget<I>
-
- Type Parameters:
I
- Type of the payload which is sent to the heartbeat target
- All Known Subinterfaces:
HeartbeatManager<I,O>
- All Known Implementing Classes:
HeartbeatReceiver
,HeartbeatSender
,NoOpHeartbeatManager
public interface HeartbeatTarget<I>
Interface for components which can be sent heartbeats and from which one can request a heartbeat response. Both the heartbeat response as well as the heartbeat request can carry a payload. This payload is reported to the heartbeat target and contains additional information. The payload can be empty which is indicated by a null value.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description CompletableFuture<Void>
receiveHeartbeat(ResourceID heartbeatOrigin, I heartbeatPayload)
Sends a heartbeat response to the target.CompletableFuture<Void>
requestHeartbeat(ResourceID requestOrigin, I heartbeatPayload)
Requests a heartbeat from the target.
-
-
-
Method Detail
-
receiveHeartbeat
CompletableFuture<Void> receiveHeartbeat(ResourceID heartbeatOrigin, I heartbeatPayload)
Sends a heartbeat response to the target. Each heartbeat response can carry a payload which contains additional information for the heartbeat target.- Parameters:
heartbeatOrigin
- Resource ID identifying the machine for which a heartbeat shall be reported.heartbeatPayload
- Payload of the heartbeat. Null indicates an empty payload.- Returns:
- Future that is completed exceptionally if the heartbeat response could not be sent to the target
-
requestHeartbeat
CompletableFuture<Void> requestHeartbeat(ResourceID requestOrigin, I heartbeatPayload)
Requests a heartbeat from the target. Each heartbeat request can carry a payload which contains additional information for the heartbeat target.- Parameters:
requestOrigin
- Resource ID identifying the machine issuing the heartbeat request.heartbeatPayload
- Payload of the heartbeat request. Null indicates an empty payload.- Returns:
- Future that is completed exceptionally if the heartbeat request could not be sent to the target
-
-