|
@@ -8,11 +8,13 @@ import java.text.SimpleDateFormat;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Date;
|
|
|
import java.util.HashMap;
|
|
|
+import java.util.Iterator;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
+import org.slf4j.Marker;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
import com.tidecloud.dataacceptance.entity.Advice;
|
|
@@ -49,16 +51,26 @@ public class DiscardServerHandler extends ChannelInboundHandlerAdapter {
|
|
|
private void reply(ChannelHandlerContext ctx, String msg) throws Exception {
|
|
|
Advice advice = getAdevice(msg);
|
|
|
String deviceId = advice.getDeviceId();
|
|
|
+ String adviceType = advice.getAdviceType();
|
|
|
Channel channel = ctx.channel();
|
|
|
Channel channelInMap = channelMap.get(deviceId);
|
|
|
if (channelInMap == null) {
|
|
|
channelMap.put(deviceId, channel);
|
|
|
}
|
|
|
- if (!"LK".equals(advice.getAdviceType())) {
|
|
|
+ switch (adviceType) {
|
|
|
+
|
|
|
+ case "UD":
|
|
|
+ Device device = getDevice(msg);
|
|
|
+ logger.info("正常存储设备信息:" + device.toString());
|
|
|
+ break;
|
|
|
+ case "UD2":
|
|
|
+ logger.info("正常存储设备信息:" + getDevice(msg).toString());
|
|
|
+ break;
|
|
|
+ case "LK":
|
|
|
normalReply(advice);
|
|
|
- } else {
|
|
|
- // 正常存储
|
|
|
- logger.info("正在存储监控项数据: " + getDevice(String.valueOf(msg)).toString());
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ break;
|
|
|
}
|
|
|
}
|
|
|
|