From e1c168a82e9d3984d4ca56c4253ae662e11276bc Mon Sep 17 00:00:00 2001 From: tiger_zhou Date: Tue, 2 Jan 2024 09:37:42 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8D=E7=A7=B0=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...rtDataSource.java => AlertDeviceStatusRepository.java} | 8 ++++---- .../ats/warn/atp/TrainAtpCutAlertMonitoringTask.java | 6 ++---- .../xiannccda/ats/warn/axle/AxleLedInterlockTask.java | 4 ++-- .../ats/warn/axle/AxleLedMostMonitorListener.java | 4 ++-- .../ats/warn/bule/BuleDisplayMonitoringTask.java | 4 ++-- .../joylink/xiannccda/ats/warn/lost/SwitchLostTask.java | 4 ++-- .../ats/warn/platform/PlatformAlertMonitoringTask.java | 6 ++---- .../club/joylink/xiannccda/service/AlertMockService.java | 4 ++-- 8 files changed, 18 insertions(+), 22 deletions(-) rename src/main/java/club/joylink/xiannccda/alert/core/{AlertDataSource.java => AlertDeviceStatusRepository.java} (92%) diff --git a/src/main/java/club/joylink/xiannccda/alert/core/AlertDataSource.java b/src/main/java/club/joylink/xiannccda/alert/core/AlertDeviceStatusRepository.java similarity index 92% rename from src/main/java/club/joylink/xiannccda/alert/core/AlertDataSource.java rename to src/main/java/club/joylink/xiannccda/alert/core/AlertDeviceStatusRepository.java index 30c1a0b..d9e5e24 100644 --- a/src/main/java/club/joylink/xiannccda/alert/core/AlertDataSource.java +++ b/src/main/java/club/joylink/xiannccda/alert/core/AlertDeviceStatusRepository.java @@ -17,7 +17,7 @@ import org.apache.commons.lang3.StringUtils; * 事件任务管理器 */ @Slf4j -public class AlertDataSource { +public class AlertDeviceStatusRepository { /** * 保存已经报警的设备 @@ -30,11 +30,11 @@ public class AlertDataSource { */ private static final Table DEVICE_ALTER_TABLE = Tables.synchronizedTable(HashBasedTable.create()); - private volatile static AlertDataSource dataSource; + private volatile static AlertDeviceStatusRepository dataSource; - public synchronized static AlertDataSource getInstance() { + public synchronized static AlertDeviceStatusRepository getInstance() { if (Objects.isNull(dataSource)) { - return dataSource = new AlertDataSource(); + return dataSource = new AlertDeviceStatusRepository(); } return dataSource; } diff --git a/src/main/java/club/joylink/xiannccda/ats/warn/atp/TrainAtpCutAlertMonitoringTask.java b/src/main/java/club/joylink/xiannccda/ats/warn/atp/TrainAtpCutAlertMonitoringTask.java index 8dccf77..afebf4d 100644 --- a/src/main/java/club/joylink/xiannccda/ats/warn/atp/TrainAtpCutAlertMonitoringTask.java +++ b/src/main/java/club/joylink/xiannccda/ats/warn/atp/TrainAtpCutAlertMonitoringTask.java @@ -1,7 +1,7 @@ package club.joylink.xiannccda.ats.warn.atp; import club.joylink.xiannccda.alert.NccAlertInfo; -import club.joylink.xiannccda.alert.core.AlertDataSource; +import club.joylink.xiannccda.alert.core.AlertDeviceStatusRepository; import club.joylink.xiannccda.alert.core.AlertDeviceType; import club.joylink.xiannccda.alert.core.AlertManager; import club.joylink.xiannccda.alert.core.AlertMonitoringTask; @@ -13,7 +13,6 @@ import club.joylink.xiannccda.dto.protos.GuardConfigProto.GuardConfig; import club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.CommonInfo; import club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.LogicSection; import club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.Section; -import club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.Section.SectionType; import club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.Turnout; import club.joylink.xiannccda.dto.protos.TrainProto.TrainInfo; import club.joylink.xiannccda.dto.protos.TrainProto.TrainInfo.Builder; @@ -25,7 +24,6 @@ import java.util.Map; import java.util.Objects; import java.util.concurrent.ConcurrentHashMap; import lombok.extern.slf4j.Slf4j; -import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Component; @Component @@ -41,7 +39,7 @@ public class TrainAtpCutAlertMonitoringTask implements AlertMonitoringTask { } private final AlertManager alertManager = AlertManager.getDefault(); - private final AlertDataSource alertDataSource = AlertDataSource.getInstance(); + private final AlertDeviceStatusRepository alertDataSource = AlertDeviceStatusRepository.getInstance(); private final Map trainInfoMap = new ConcurrentHashMap<>(); diff --git a/src/main/java/club/joylink/xiannccda/ats/warn/axle/AxleLedInterlockTask.java b/src/main/java/club/joylink/xiannccda/ats/warn/axle/AxleLedInterlockTask.java index 0034f75..eb624bb 100644 --- a/src/main/java/club/joylink/xiannccda/ats/warn/axle/AxleLedInterlockTask.java +++ b/src/main/java/club/joylink/xiannccda/ats/warn/axle/AxleLedInterlockTask.java @@ -1,7 +1,7 @@ package club.joylink.xiannccda.ats.warn.axle; import club.joylink.xiannccda.alert.NccAlertInfo; -import club.joylink.xiannccda.alert.core.AlertDataSource; +import club.joylink.xiannccda.alert.core.AlertDeviceStatusRepository; import club.joylink.xiannccda.alert.core.AlertDeviceType; import club.joylink.xiannccda.alert.core.AlertManager; import club.joylink.xiannccda.alert.core.AlertMonitoringTask; @@ -47,7 +47,7 @@ public class AxleLedInterlockTask implements AlertMonitoringTask { } private final AlertManager alertManager = AlertManager.getDefault(); - private final AlertDataSource alertDataSource = AlertDataSource.getInstance(); + private final AlertDeviceStatusRepository alertDataSource = AlertDeviceStatusRepository.getInstance(); @Override public String getName() { diff --git a/src/main/java/club/joylink/xiannccda/ats/warn/axle/AxleLedMostMonitorListener.java b/src/main/java/club/joylink/xiannccda/ats/warn/axle/AxleLedMostMonitorListener.java index 17f8e1e..71b1b51 100644 --- a/src/main/java/club/joylink/xiannccda/ats/warn/axle/AxleLedMostMonitorListener.java +++ b/src/main/java/club/joylink/xiannccda/ats/warn/axle/AxleLedMostMonitorListener.java @@ -1,7 +1,7 @@ package club.joylink.xiannccda.ats.warn.axle; import club.joylink.xiannccda.alert.NccAlertInfo; -import club.joylink.xiannccda.alert.core.AlertDataSource; +import club.joylink.xiannccda.alert.core.AlertDeviceStatusRepository; import club.joylink.xiannccda.alert.core.AlertDeviceType; import club.joylink.xiannccda.alert.core.AlertManager; import club.joylink.xiannccda.alert.core.AlertSourceEventListener; @@ -43,7 +43,7 @@ public class AxleLedMostMonitorListener implements AlertSourceEventListener trainRecordMap = new ConcurrentHashMap<>(); diff --git a/src/main/java/club/joylink/xiannccda/service/AlertMockService.java b/src/main/java/club/joylink/xiannccda/service/AlertMockService.java index 64c645e..5d15357 100644 --- a/src/main/java/club/joylink/xiannccda/service/AlertMockService.java +++ b/src/main/java/club/joylink/xiannccda/service/AlertMockService.java @@ -2,7 +2,7 @@ package club.joylink.xiannccda.service; import club.joylink.xiannccda.alert.AlertDetailFactory; import club.joylink.xiannccda.alert.NccAlertInfo; -import club.joylink.xiannccda.alert.core.AlertDataSource; +import club.joylink.xiannccda.alert.core.AlertDeviceStatusRepository; import club.joylink.xiannccda.alert.core.AlertDeviceType; import club.joylink.xiannccda.alert.core.AlertManager; import club.joylink.xiannccda.ats.cache.LineGraphicDataRepository; @@ -91,7 +91,7 @@ public class AlertMockService { AbstractData planData = DeviceDataRepository.findDataSouce(lineId.toString(), DataTypeEnum.TRAIN_PLAN); planData.clear(); - AlertDataSource dataSource = AlertDataSource.getInstance(); + AlertDeviceStatusRepository dataSource = AlertDeviceStatusRepository.getInstance(); dataSource.clearAlertDataMsg(lineId); }