use of me.retrodaredevil.solarthing.type.event.feedback.ImmutableHeartbeatPacket in project solarthing by wildmountainfarms.
the class RequestHeartbeatReceiver method receivePacketGroup.
@Override
public void receivePacketGroup(String sender, TargetPacketGroup packetGroup) {
Instant now = Instant.now();
for (Packet packet : packetGroup.getPackets()) {
if (packet instanceof RequestHeartbeatPacket) {
RequestHeartbeatPacket requestHeartbeatPacket = (RequestHeartbeatPacket) packet;
HeartbeatData data = requestHeartbeatPacket.getData();
OpenSource openSource = new OpenSource(sender, packetGroup.getDateMillis(), requestHeartbeatPacket, requestHeartbeatPacket.getUniqueString());
ExecutionReason executionReason = new OpenSourceExecutionReason(openSource);
HeartbeatPacket heartbeatPacket = new ImmutableHeartbeatPacket(data, executionReason);
eventPacketListReceiverHandler.uploadSimple(now, Arrays.asList(heartbeatPacket));
}
}
}
Aggregations