aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/doc/puml/mqtt_client_Location_Services.puml
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/doc/puml/mqtt_client_Location_Services.puml')
-rw-r--r--src/main/doc/puml/mqtt_client_Location_Services.puml106
1 files changed, 106 insertions, 0 deletions
diff --git a/src/main/doc/puml/mqtt_client_Location_Services.puml b/src/main/doc/puml/mqtt_client_Location_Services.puml
new file mode 100644
index 0000000..48f2e64
--- /dev/null
+++ b/src/main/doc/puml/mqtt_client_Location_Services.puml
@@ -0,0 +1,106 @@
+@startuml "mqtt Location Services Orchestration"
+
+
+participant "Vehicle Application" as application
+participant "Vehicle Edge MQTT Client" as client
+participant "MQTT Broker" as broker
+participant "Vehicle Location Service" as vehsloc
+participant "Location Enrichment Service" as cvc
+boundary "Outgoing Event Service" as pub
+database "Vehicle State" as vstat
+note left of application: This flow assumes \n the previous security \nlifecycle has been\n completed and TLS TCP \n connection established
+
+
+== Vehicle Event Publishing ===
+client -> broker: Connect
+broker -> broker: Authorization check
+broker -> client: ConnectAck
+broker -> vehsloc: <client_id> Connected
+application -> broker: Publish <topic_id>
+broker -> application: PUBACK
+broker -> vehsloc: <client_id> Published CurrentLocationMessage
+vehsloc -> cvc: <i>EnrichLocationData<i>
+cvc -> vehsloc: <i>Response>
+note right of cvc: Use to add more details such as address or points of interest
+vehsloc -> pub: Publish event to consuming applications via API
+vehsloc -> vstat: Store current location state
+
+== Request and Response ==
+pub -> vstat: Current Location
+create actor "Consuming Application User" as user
+pub -> user: Current location
+create participant "APIs" as api
+user -> api: Request Location Update
+api -> vehsloc: RequestCurrentVehicleLocation
+
+pub -> vehsloc: Message/Request for Vehicle
+vehsloc -> vehsloc: Create Message
+vehsloc -> vehstat: isVehicleSubscribed to <topic_id>
+alt Vehicle Connected and Subscribed
+vehstat -> vehsloc: isVehicleSubscribedResponse (Subscribed)
+note right of vehstat: The response should indicate both connection and subscription status for appropriate action to be taken
+vehsloc -> broker: Subscribe to <response_topic_id>
+broker -> vehsloc: SUBACK
+vehsloc -> broker: Publish to <topic_id>
+broker -> vehsloc: PUBACK
+
+
+
+else else "Client Not Connected/Subscribed"
+vehstat -> vehsloc: isVehicleSubscribedResponse (Not Subscribed)
+
+create boundary "SMS/Cellular Services" as sms
+vehsloc -> sms: Send SMS Wake up Message
+client -> broker: Connect
+broker -> broker: Authorization check
+broker -> client: ConnectAck
+broker -> vehstat: <client_id> Connected
+vehstat -> vehsloc: <client_id> Connected
+vehsloc -> broker: Subscribe to <response_topic_id>
+broker -> vehsloc: SUBACK
+vehsloc -> broker: Publish to <topic_id>
+broker -> vehsloc: PUBACK
+
+end
+
+broker <-> application: message received
+application -> broker: ACK (QoS dependent)
+application -> application: deserialize and take action
+application -> application: create response message
+application -> broker: Pubish Response to <response_topic_id>
+broker -> vehsloc: Response Message
+vehsloc -> pub: Response Message
+vehsloc -> broker: Subscribe to <response_topic_id>
+broker -> vehsloc: SUBACK
+vehsloc -> broker: Publish to <topic_id>
+broker -> vehsloc: PUBACK
+broker <-> application: message received
+application -> broker: ACK (QoS dependent)
+application -> application: deserialize and take action
+application -> application: create response message
+application -> broker: Pubish Response to <response_topic_id>
+broker -> vehsloc: Response Message
+vehsloc -> pub: Response Message
+vehsloc -> vehstat: Update Location
+pub -> user: New Location Data
+
+alt "Vehicle Connected"
+vehsloc -> broker: Publish RequestCurrentVehicleLocation
+else else "Vehicle not Connected"
+vehsloc -> client: (SMS) Wake up sent
+client -> broker: Connect
+broker -> broker: Authorization check
+broker -> client: ConnectAck
+end
+
+
+
+
+
+
+
+
+
+
+
+@enduml \ No newline at end of file