From 08fb892cc5aa5099b23c31a99a45831323a90a24 Mon Sep 17 00:00:00 2001 From: Andrew Lalis Date: Fri, 13 May 2022 13:24:13 +0200 Subject: [PATCH] Added websocket connectivity and improved some things. --- .../railsystem/component/AddSwitchModal.vue | 2 +- .../railsystem/component/ComponentView.vue | 3 + .../component/PathNodeComponentView.vue | 62 +++++++------- .../SegmentBoundaryNodeComponentView.vue | 2 + .../component/SignalComponentView.vue | 2 +- .../component/SwitchComponentView.vue | 40 ++++++++++ railsignal-app/src/stores/railSystemsStore.js | 6 +- .../RailSignalApiApplication.java | 5 +- .../dao/ComponentAccessTokenRepository.java | 12 --- .../railsignalapi/dao/LabelRepository.java | 2 +- .../dao/LinkTokenRepository.java | 12 +++ .../railsignalapi/live/ComponentDownlink.java | 14 ++-- .../live/ComponentDownlinkService.java | 75 ++++++++++++++--- .../live/ComponentUplinkMessageHandler.java | 32 ++++++++ .../live/dto/ComponentUplinkMessage.java | 20 +++++ .../dto/SegmentBoundaryUpdateMessage.java | 30 +++++++ .../live/dto/SegmentStatusMessage.java | 6 ++ .../live/dto/SwitchUpdateMessage.java | 13 +++ .../live/tcp_socket/ConnectMessage.java | 6 ++ .../live/tcp_socket/TcpDownlink.java | 24 ------ .../live/tcp_socket/TcpLinkManager.java | 70 ++++++++++++++++ .../live/tcp_socket/TcpSocketServer.java | 76 +++++++++++++----- .../live/websocket/AppUpdateService.java | 80 +++++++++++++++++++ .../live/websocket/AppWebsocketHandler.java | 17 ++-- .../AppWebsocketHandshakeInterceptor.java | 2 +- .../websocket/ComponentWebsocketHandler.java | 21 ++--- ...omponentWebsocketHandshakeInterceptor.java | 10 +-- ...mponentAccessToken.java => LinkToken.java} | 4 +- .../andrewl/railsignalapi/model/Segment.java | 8 ++ .../model/{ => component}/Label.java | 3 +- .../model/component/SegmentBoundaryNode.java | 3 +- .../railsignalapi/model/component/Switch.java | 10 +++ .../railsignalapi/rest/SecurityConfig.java | 28 +++++++ .../andrewl/railsignalapi/rest/WebConfig.java | 2 - .../rest/dto/SegmentResponse.java | 10 +-- .../dto/component/in/ComponentPayload.java | 2 +- .../dto/component/out/ComponentResponse.java | 2 +- .../rest/dto/component/out/LabelResponse.java | 2 +- .../service/ComponentCreationService.java | 5 +- .../railsignalapi/service/SegmentService.java | 49 +++++++++++- .../railsignalapi/service/SwitchService.java | 30 +++++++ .../andrewl/railsignalapi/util/JsonUtils.java | 26 ++++++ 42 files changed, 672 insertions(+), 156 deletions(-) create mode 100644 railsignal-app/src/components/railsystem/component/SwitchComponentView.vue delete mode 100644 src/main/java/nl/andrewl/railsignalapi/dao/ComponentAccessTokenRepository.java create mode 100644 src/main/java/nl/andrewl/railsignalapi/dao/LinkTokenRepository.java create mode 100644 src/main/java/nl/andrewl/railsignalapi/live/ComponentUplinkMessageHandler.java create mode 100644 src/main/java/nl/andrewl/railsignalapi/live/dto/ComponentUplinkMessage.java create mode 100644 src/main/java/nl/andrewl/railsignalapi/live/dto/SegmentBoundaryUpdateMessage.java create mode 100644 src/main/java/nl/andrewl/railsignalapi/live/dto/SegmentStatusMessage.java create mode 100644 src/main/java/nl/andrewl/railsignalapi/live/dto/SwitchUpdateMessage.java create mode 100644 src/main/java/nl/andrewl/railsignalapi/live/tcp_socket/ConnectMessage.java delete mode 100644 src/main/java/nl/andrewl/railsignalapi/live/tcp_socket/TcpDownlink.java create mode 100644 src/main/java/nl/andrewl/railsignalapi/live/tcp_socket/TcpLinkManager.java create mode 100644 src/main/java/nl/andrewl/railsignalapi/live/websocket/AppUpdateService.java rename src/main/java/nl/andrewl/railsignalapi/model/{ComponentAccessToken.java => LinkToken.java} (89%) rename src/main/java/nl/andrewl/railsignalapi/model/{ => component}/Label.java (87%) create mode 100644 src/main/java/nl/andrewl/railsignalapi/rest/SecurityConfig.java create mode 100644 src/main/java/nl/andrewl/railsignalapi/service/SwitchService.java diff --git a/railsignal-app/src/components/railsystem/component/AddSwitchModal.vue b/railsignal-app/src/components/railsystem/component/AddSwitchModal.vue index 0a95194..a879041 100644 --- a/railsignal-app/src/components/railsystem/component/AddSwitchModal.vue +++ b/railsignal-app/src/components/railsystem/component/AddSwitchModal.vue @@ -29,7 +29,7 @@
- +