名称调整
This commit is contained in:
parent
1f2a42c2f5
commit
e1c168a82e
@ -17,7 +17,7 @@ import org.apache.commons.lang3.StringUtils;
|
|||||||
* 事件任务管理器
|
* 事件任务管理器
|
||||||
*/
|
*/
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class AlertDataSource {
|
public class AlertDeviceStatusRepository {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 保存已经报警的设备
|
* 保存已经报警的设备
|
||||||
@ -30,11 +30,11 @@ public class AlertDataSource {
|
|||||||
*/
|
*/
|
||||||
private static final Table<Integer, String, AlertTableDetail> DEVICE_ALTER_TABLE = Tables.synchronizedTable(HashBasedTable.create());
|
private static final Table<Integer, String, AlertTableDetail> 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)) {
|
if (Objects.isNull(dataSource)) {
|
||||||
return dataSource = new AlertDataSource();
|
return dataSource = new AlertDeviceStatusRepository();
|
||||||
}
|
}
|
||||||
return dataSource;
|
return dataSource;
|
||||||
}
|
}
|
@ -1,7 +1,7 @@
|
|||||||
package club.joylink.xiannccda.ats.warn.atp;
|
package club.joylink.xiannccda.ats.warn.atp;
|
||||||
|
|
||||||
import club.joylink.xiannccda.alert.NccAlertInfo;
|
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.AlertDeviceType;
|
||||||
import club.joylink.xiannccda.alert.core.AlertManager;
|
import club.joylink.xiannccda.alert.core.AlertManager;
|
||||||
import club.joylink.xiannccda.alert.core.AlertMonitoringTask;
|
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.CommonInfo;
|
||||||
import club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.LogicSection;
|
import club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.LogicSection;
|
||||||
import club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.Section;
|
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.LayoutGraphicsProto.Turnout;
|
||||||
import club.joylink.xiannccda.dto.protos.TrainProto.TrainInfo;
|
import club.joylink.xiannccda.dto.protos.TrainProto.TrainInfo;
|
||||||
import club.joylink.xiannccda.dto.protos.TrainProto.TrainInfo.Builder;
|
import club.joylink.xiannccda.dto.protos.TrainProto.TrainInfo.Builder;
|
||||||
@ -25,7 +24,6 @@ import java.util.Map;
|
|||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
@Component
|
@Component
|
||||||
@ -41,7 +39,7 @@ public class TrainAtpCutAlertMonitoringTask implements AlertMonitoringTask {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private final AlertManager alertManager = AlertManager.getDefault();
|
private final AlertManager alertManager = AlertManager.getDefault();
|
||||||
private final AlertDataSource alertDataSource = AlertDataSource.getInstance();
|
private final AlertDeviceStatusRepository alertDataSource = AlertDeviceStatusRepository.getInstance();
|
||||||
private final Map<String, TrainInfo.Builder> trainInfoMap = new ConcurrentHashMap<>();
|
private final Map<String, TrainInfo.Builder> trainInfoMap = new ConcurrentHashMap<>();
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package club.joylink.xiannccda.ats.warn.axle;
|
package club.joylink.xiannccda.ats.warn.axle;
|
||||||
|
|
||||||
import club.joylink.xiannccda.alert.NccAlertInfo;
|
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.AlertDeviceType;
|
||||||
import club.joylink.xiannccda.alert.core.AlertManager;
|
import club.joylink.xiannccda.alert.core.AlertManager;
|
||||||
import club.joylink.xiannccda.alert.core.AlertMonitoringTask;
|
import club.joylink.xiannccda.alert.core.AlertMonitoringTask;
|
||||||
@ -47,7 +47,7 @@ public class AxleLedInterlockTask implements AlertMonitoringTask {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private final AlertManager alertManager = AlertManager.getDefault();
|
private final AlertManager alertManager = AlertManager.getDefault();
|
||||||
private final AlertDataSource alertDataSource = AlertDataSource.getInstance();
|
private final AlertDeviceStatusRepository alertDataSource = AlertDeviceStatusRepository.getInstance();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getName() {
|
public String getName() {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package club.joylink.xiannccda.ats.warn.axle;
|
package club.joylink.xiannccda.ats.warn.axle;
|
||||||
|
|
||||||
import club.joylink.xiannccda.alert.NccAlertInfo;
|
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.AlertDeviceType;
|
||||||
import club.joylink.xiannccda.alert.core.AlertManager;
|
import club.joylink.xiannccda.alert.core.AlertManager;
|
||||||
import club.joylink.xiannccda.alert.core.AlertSourceEventListener;
|
import club.joylink.xiannccda.alert.core.AlertSourceEventListener;
|
||||||
@ -43,7 +43,7 @@ public class AxleLedMostMonitorListener implements AlertSourceEventListener<LedM
|
|||||||
}
|
}
|
||||||
|
|
||||||
private final AlertManager alertManager = AlertManager.getDefault();
|
private final AlertManager alertManager = AlertManager.getDefault();
|
||||||
private final AlertDataSource alertDataSource = AlertDataSource.getInstance();
|
private final AlertDeviceStatusRepository alertDataSource = AlertDeviceStatusRepository.getInstance();
|
||||||
|
|
||||||
private String getAlertName(AlertType mostType, String areaName) {
|
private String getAlertName(AlertType mostType, String areaName) {
|
||||||
return String.format("%s-%s", mostType.name(), areaName);
|
return String.format("%s-%s", mostType.name(), areaName);
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package club.joylink.xiannccda.ats.warn.bule;
|
package club.joylink.xiannccda.ats.warn.bule;
|
||||||
|
|
||||||
import club.joylink.xiannccda.alert.NccAlertInfo;
|
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.AlertDeviceType;
|
||||||
import club.joylink.xiannccda.alert.core.AlertManager;
|
import club.joylink.xiannccda.alert.core.AlertManager;
|
||||||
import club.joylink.xiannccda.alert.core.AlertMonitoringTask;
|
import club.joylink.xiannccda.alert.core.AlertMonitoringTask;
|
||||||
@ -45,7 +45,7 @@ public class BuleDisplayMonitoringTask implements AlertMonitoringTask {
|
|||||||
|
|
||||||
private final AlertManager alertManager = AlertManager.getDefault();
|
private final AlertManager alertManager = AlertManager.getDefault();
|
||||||
|
|
||||||
private final AlertDataSource alertDataSource = AlertDataSource.getInstance();
|
private final AlertDeviceStatusRepository alertDataSource = AlertDeviceStatusRepository.getInstance();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getName() {
|
public String getName() {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package club.joylink.xiannccda.ats.warn.lost;
|
package club.joylink.xiannccda.ats.warn.lost;
|
||||||
|
|
||||||
import club.joylink.xiannccda.alert.NccAlertInfo;
|
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.AlertDeviceType;
|
||||||
import club.joylink.xiannccda.alert.core.AlertManager;
|
import club.joylink.xiannccda.alert.core.AlertManager;
|
||||||
import club.joylink.xiannccda.alert.core.AlertMonitoringTask;
|
import club.joylink.xiannccda.alert.core.AlertMonitoringTask;
|
||||||
@ -36,7 +36,7 @@ public class SwitchLostTask implements AlertMonitoringTask {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private final AlertManager alertManager = AlertManager.getDefault();
|
private final AlertManager alertManager = AlertManager.getDefault();
|
||||||
private final AlertDataSource alertDataSource = AlertDataSource.getInstance();
|
private final AlertDeviceStatusRepository alertDataSource = AlertDeviceStatusRepository.getInstance();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getName() {
|
public String getName() {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package club.joylink.xiannccda.ats.warn.platform;
|
package club.joylink.xiannccda.ats.warn.platform;
|
||||||
|
|
||||||
import club.joylink.xiannccda.alert.NccAlertInfo;
|
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.AlertDeviceType;
|
||||||
import club.joylink.xiannccda.alert.core.AlertManager;
|
import club.joylink.xiannccda.alert.core.AlertManager;
|
||||||
import club.joylink.xiannccda.alert.core.AlertMonitoringTask;
|
import club.joylink.xiannccda.alert.core.AlertMonitoringTask;
|
||||||
@ -10,8 +10,6 @@ import club.joylink.xiannccda.ats.message.collect.DeviceDataRepository;
|
|||||||
import club.joylink.xiannccda.ats.message.collect.DeviceDataRepository.DataTypeEnum;
|
import club.joylink.xiannccda.ats.message.collect.DeviceDataRepository.DataTypeEnum;
|
||||||
import club.joylink.xiannccda.ats.message.collect.datasource.DeviceStatusData;
|
import club.joylink.xiannccda.ats.message.collect.datasource.DeviceStatusData;
|
||||||
import club.joylink.xiannccda.ats.message.collect.datasource.InUsedScheduleData;
|
import club.joylink.xiannccda.ats.message.collect.datasource.InUsedScheduleData;
|
||||||
import club.joylink.xiannccda.ats.message.line3.changer.DeviceNameChangerManage;
|
|
||||||
import club.joylink.xiannccda.ats.message.line3.device.DeviceType;
|
|
||||||
import club.joylink.xiannccda.ats.message.line3.rep.TrainRecordResponse.DirectionEnum;
|
import club.joylink.xiannccda.ats.message.line3.rep.TrainRecordResponse.DirectionEnum;
|
||||||
import club.joylink.xiannccda.dto.protos.AlertConstProto.AlertType;
|
import club.joylink.xiannccda.dto.protos.AlertConstProto.AlertType;
|
||||||
import club.joylink.xiannccda.dto.protos.DeviceStatusProto;
|
import club.joylink.xiannccda.dto.protos.DeviceStatusProto;
|
||||||
@ -48,7 +46,7 @@ public class PlatformAlertMonitoringTask implements AlertMonitoringTask {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private final AlertManager alertManager = AlertManager.getDefault();
|
private final AlertManager alertManager = AlertManager.getDefault();
|
||||||
private final AlertDataSource alertDataSource = AlertDataSource.getInstance();
|
private final AlertDeviceStatusRepository alertDataSource = AlertDeviceStatusRepository.getInstance();
|
||||||
|
|
||||||
private final Map<String, TrainRecord.Builder> trainRecordMap = new ConcurrentHashMap<>();
|
private final Map<String, TrainRecord.Builder> trainRecordMap = new ConcurrentHashMap<>();
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@ package club.joylink.xiannccda.service;
|
|||||||
|
|
||||||
import club.joylink.xiannccda.alert.AlertDetailFactory;
|
import club.joylink.xiannccda.alert.AlertDetailFactory;
|
||||||
import club.joylink.xiannccda.alert.NccAlertInfo;
|
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.AlertDeviceType;
|
||||||
import club.joylink.xiannccda.alert.core.AlertManager;
|
import club.joylink.xiannccda.alert.core.AlertManager;
|
||||||
import club.joylink.xiannccda.ats.cache.LineGraphicDataRepository;
|
import club.joylink.xiannccda.ats.cache.LineGraphicDataRepository;
|
||||||
@ -91,7 +91,7 @@ public class AlertMockService {
|
|||||||
AbstractData planData = DeviceDataRepository.findDataSouce(lineId.toString(), DataTypeEnum.TRAIN_PLAN);
|
AbstractData planData = DeviceDataRepository.findDataSouce(lineId.toString(), DataTypeEnum.TRAIN_PLAN);
|
||||||
planData.clear();
|
planData.clear();
|
||||||
|
|
||||||
AlertDataSource dataSource = AlertDataSource.getInstance();
|
AlertDeviceStatusRepository dataSource = AlertDeviceStatusRepository.getInstance();
|
||||||
dataSource.clearAlertDataMsg(lineId);
|
dataSource.clearAlertDataMsg(lineId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user