Commit 23797f49 authored by AfirSraftGarrier's avatar AfirSraftGarrier

格式并加些打印

parent 4de2d7fa
...@@ -11,7 +11,6 @@ import org.springframework.stereotype.Component; ...@@ -11,7 +11,6 @@ import org.springframework.stereotype.Component;
@Component @Component
@Slf4j @Slf4j
public class DeviceClientLicenseEventHandler { public class DeviceClientLicenseEventHandler {
@Autowired @Autowired
DeviceManager deviceManager; DeviceManager deviceManager;
@Autowired @Autowired
...@@ -33,10 +32,6 @@ public class DeviceClientLicenseEventHandler { ...@@ -33,10 +32,6 @@ public class DeviceClientLicenseEventHandler {
} else { } else {
session.getClientChannel().writeAndFlush(protocol); session.getClientChannel().writeAndFlush(protocol);
log.debug("device client license success ..."); log.debug("device client license success ...");
} }
} }
} }
...@@ -20,7 +20,7 @@ public class ForwardConnectionListener extends BaseConnectionListener { ...@@ -20,7 +20,7 @@ public class ForwardConnectionListener extends BaseConnectionListener {
public void operationComplete(ChannelFuture channelFuture) { public void operationComplete(ChannelFuture channelFuture) {
AlarmService alarmService = SpringUtil.getBean(AlarmService.class); AlarmService alarmService = SpringUtil.getBean(AlarmService.class);
if (!channelFuture.isSuccess()) { if (!channelFuture.isSuccess()) {
//TODO 失败进行告警 // 失败进行告警
log.debug("桥接客户端,连接服务器失败:{},{},{}", this.host, this.port, this.appId); log.debug("桥接客户端,连接服务器失败:{},{},{}", this.host, this.port, this.appId);
int typeId = 1; int typeId = 1;
...@@ -28,8 +28,7 @@ public class ForwardConnectionListener extends BaseConnectionListener { ...@@ -28,8 +28,7 @@ public class ForwardConnectionListener extends BaseConnectionListener {
String content = "连接服务器:" + this.host + ":" + this.port + "失败"; String content = "连接服务器:" + this.host + ":" + this.port + "失败";
alarmService.addAlarm(typeId, title, content); alarmService.addAlarm(typeId, title, content);
// forward client连接失败,则强制踢掉设备客户端
//TODO forward client连接失败,则强制踢掉设备客户端
DeviceClientBeForcedOfflineEvent deviceClientBeForcedOfflineEvent = new DeviceClientBeForcedOfflineEvent(); DeviceClientBeForcedOfflineEvent deviceClientBeForcedOfflineEvent = new DeviceClientBeForcedOfflineEvent();
deviceClientBeForcedOfflineEvent.setAppId(this.appId); deviceClientBeForcedOfflineEvent.setAppId(this.appId);
EventPublisher eventPublisher = SpringUtil.getBean(EventPublisher.class); EventPublisher eventPublisher = SpringUtil.getBean(EventPublisher.class);
...@@ -49,7 +48,6 @@ public class ForwardConnectionListener extends BaseConnectionListener { ...@@ -49,7 +48,6 @@ public class ForwardConnectionListener extends BaseConnectionListener {
EventPublisher eventPublisher = SpringUtil.getBean(EventPublisher.class); EventPublisher eventPublisher = SpringUtil.getBean(EventPublisher.class);
eventPublisher.publishEvent(forwardClientConnectEvent); eventPublisher.publishEvent(forwardClientConnectEvent);
short stx = 21930; short stx = 21930;
byte ack = 0x0; byte ack = 0x0;
int len = 3; int len = 3;
...@@ -58,7 +56,6 @@ public class ForwardConnectionListener extends BaseConnectionListener { ...@@ -58,7 +56,6 @@ public class ForwardConnectionListener extends BaseConnectionListener {
content[0] = 0x7e; content[0] = 0x7e;
byte end = 0x1; byte end = 0x1;
DeviceProtocol protocol = new DeviceProtocol(stx, len, cmd, ack, content, end); DeviceProtocol protocol = new DeviceProtocol(stx, len, cmd, ack, content, end);
...@@ -69,5 +66,4 @@ public class ForwardConnectionListener extends BaseConnectionListener { ...@@ -69,5 +66,4 @@ public class ForwardConnectionListener extends BaseConnectionListener {
eventPublisher.publishEvent(deviceClientLicenseEvent); eventPublisher.publishEvent(deviceClientLicenseEvent);
} }
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment