Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
ioc_sixiang_license
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zengtianlai3
ioc_sixiang_license
Commits
23797f49
Commit
23797f49
authored
Nov 15, 2022
by
AfirSraftGarrier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
格式并加些打印
parent
4de2d7fa
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
11 deletions
+2
-11
DeviceClientLicenseEventHandler.java
...ixiang/license/event/DeviceClientLicenseEventHandler.java
+0
-5
ForwardConnectionListener.java
...ot/sixiang/license/forward/ForwardConnectionListener.java
+2
-6
No files found.
license/src/main/java/iot/sixiang/license/event/DeviceClientLicenseEventHandler.java
View file @
23797f49
...
@@ -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 ..."
);
}
}
}
}
}
}
license/src/main/java/iot/sixiang/license/forward/ForwardConnectionListener.java
View file @
23797f49
...
@@ -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
);
}
}
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment