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); }