Skip to content

Commit

Permalink
add nil user id
Browse files Browse the repository at this point in the history
  • Loading branch information
jkralik committed Sep 28, 2023
1 parent 43c4e07 commit 04c2582
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ In the context of managing CoAP gateways and their associated devices, the proce

{{< /warning >}}

3. **Processing ServicesMetadataUpdated**: Initially, the response containing the new validity information is forwarded to the CoAP gateway, which is then utilized to calculate the timing of the next update. In the event that any offline services are encompassed within the `ServicesMetadataUpdated` event, the resource-aggregate proceeds to iterate through all devices that are linked to these offline services. It triggers the `UpdateDeviceMetadata` operation for each device, commanding a transition to an OFFLINE state, effectively disassociating them from the respective service. Once all devices have undergone this update, and the `DeviceMetadataUpdated` event has been disseminated, the resource aggregate initiates the `ConfirmOfflineServices` procedure, which serves the purpose of purging offline services from the database.
3. **Processing ServicesMetadataUpdated**: Initially, the response containing the new validity information is forwarded to the CoAP gateway, which is then utilized to calculate the timing of the next update. In the event that any offline services are encompassed within the `ServicesMetadataUpdated` event, the resource-aggregate proceeds to iterate through all devices that are linked to these offline services. It triggers the `UpdateDeviceMetadata` operation for each device with a **nil-uuid** user id, commanding a transition to an OFFLINE state, effectively disassociating them from the respective service. Once all devices have undergone this update, and the `DeviceMetadataUpdated` event has been disseminated, the resource aggregate initiates the `ConfirmOfflineServices` procedure, which serves the purpose of purging offline services from the database.

4. **Iterate Until heartbeatValidUntil Expires**: The CoAP gateway continuously iterates through the update process until the `heartbeatValidUntil` parameter reaches its expiration. These updates are scheduled at intervals of one-third until the service's expiration deadline, denoted by `heartbeatValidUntil`. With each successful update, the `heartbeatValidUntil` parameter is refreshed with a new value. However, if the time surpasses the `heartbeatValidUntil` parameter, the service is deemed offline, so the CoAP gateway initiate a self-termination process (SIGTERM).

Expand All @@ -49,7 +49,7 @@ loop every 1/3 until heartbeatValidUntil
loop for each offline service
loop for each device associated with the offline service
ResourceAggregate -> ResourceAggregate: Send UpdateDeviceMetadataRequest with\nDevice ID, Connection.Status = OFFLINE
ResourceAggregate -> EventBus: Publish DeviceMetadataUpdated with\nConnection.Status = OFFLINE, Connection.ServiceId = ""
ResourceAggregate -> EventBus: Publish DeviceMetadataUpdated with\nConnection.Status = OFFLINE, Connection.ServiceId = "", AuditContext.UserId = "00000000-0000-0000-0000-000000000000"
end
ResourceAggregate -> ResourceAggregate: Confirm the offline service
end
Expand Down

0 comments on commit 04c2582

Please sign in to comment.