Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
platform
/
platform-charging-server
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 3cdc6831
authored
Nov 09, 2023
by
tiger
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
更换日志
1 parent
a50b0f5e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
8 deletions
platform-charging/src/main/java/cn/com/glsx/charging/modules/gbt/ocpp16/tcp/server/ProxyHelper.java
platform-charging/src/main/java/cn/com/glsx/charging/modules/gbt/ocpp16/tcp/server/ProxyHelper.java
View file @
3cdc683
package
cn
.
com
.
glsx
.
charging
.
modules
.
gbt
.
ocpp16
.
tcp
.
server
;
package
cn
.
com
.
glsx
.
charging
.
modules
.
gbt
.
ocpp16
.
tcp
.
server
;
import
cn.com.glsx.charging.modules.gbt.ocpp16.tcp.base.TcpBase
;
import
cn.com.glsx.charging.modules.gbt.ocpp16.tcp.base.TcpCallback
;
import
cn.com.glsx.charging.modules.gbt.ocpp16.tcp.base.TcpRsp
;
import
java.net.InetSocketAddress
;
import
java.net.InetSocketAddress
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -10,8 +7,12 @@ import java.util.Map;
...
@@ -10,8 +7,12 @@ import java.util.Map;
import
com.google.common.collect.Maps
;
import
com.google.common.collect.Maps
;
import
cn.com.glsx.charging.modules.gbt.ocpp16.Ocpp16Helper
;
import
cn.com.glsx.charging.modules.gbt.ocpp16.Ocpp16Helper
;
import
cn.com.glsx.charging.modules.gbt.ocpp16.tcp.base.TcpBase
;
import
cn.com.glsx.charging.modules.gbt.ocpp16.tcp.base.TcpCallback
;
import
cn.com.glsx.charging.modules.gbt.ocpp16.tcp.base.TcpRsp
;
import
cn.com.glsx.charging.util.JacksonUtils
;
import
cn.com.glsx.charging.util.JacksonUtils
;
import
cn.com.glsx.charging.util.TaskExecutor
;
import
cn.com.glsx.charging.util.TaskExecutor
;
import
cn.hutool.core.util.StrUtil
;
import
io.netty.channel.Channel
;
import
io.netty.channel.Channel
;
import
io.netty.util.Attribute
;
import
io.netty.util.Attribute
;
import
io.netty.util.AttributeKey
;
import
io.netty.util.AttributeKey
;
...
@@ -54,7 +55,7 @@ public class ProxyHelper {
...
@@ -54,7 +55,7 @@ public class ProxyHelper {
public
static
ProxyInfo
registProxyInfo
(
String
pileId
,
Channel
channel
)
{
public
static
ProxyInfo
registProxyInfo
(
String
pileId
,
Channel
channel
)
{
// 标记连接
// 标记连接
Attribute
<
String
>
attr
=
channel
.
attr
(
ProxyHelper
.
PILE_ID_KEY
);
Attribute
<
String
>
attr
=
channel
.
attr
(
ProxyHelper
.
PILE_ID_KEY
);
if
(
attr
.
get
()
!=
null
)
{
if
(!
StrUtil
.
equals
(
attr
.
get
(),
pileId
)
)
{
log
.
warn
(
"【连接更换】{} -> {}"
,
attr
.
get
(),
pileId
);
log
.
warn
(
"【连接更换】{} -> {}"
,
attr
.
get
(),
pileId
);
}
}
attr
.
set
(
pileId
);
attr
.
set
(
pileId
);
...
@@ -66,8 +67,7 @@ public class ProxyHelper {
...
@@ -66,8 +67,7 @@ public class ProxyHelper {
log
.
info
(
"【{}】Proxy连接建立:{}"
,
pileId
,
proxyInfo
);
log
.
info
(
"【{}】Proxy连接建立:{}"
,
pileId
,
proxyInfo
);
}
else
{
}
else
{
if
(
proxyInfo
.
getChannel
().
id
()
!=
channel
.
id
())
{
if
(
proxyInfo
.
getChannel
().
id
()
!=
channel
.
id
())
{
log
.
warn
(
"【警告】pileId:{} 包含两个连接,新:{} 会覆盖旧:{} ..."
,
pileId
,
channel
.
toString
(),
log
.
warn
(
"【警告】pileId:{} 包含两个连接,新:{} 会覆盖旧:{} ..."
,
pileId
,
channel
.
toString
(),
proxyInfo
.
getChannel
().
toString
());
proxyInfo
.
getChannel
().
toString
());
}
}
}
}
proxyInfo
.
setChannel
(
channel
);
proxyInfo
.
setChannel
(
channel
);
...
@@ -148,8 +148,7 @@ public class ProxyHelper {
...
@@ -148,8 +148,7 @@ public class ProxyHelper {
return
;
return
;
}
}
//
//
log
.
info
(
log
.
info
(
"【自检】-------------------------------------------------------------------------------"
);
"【自检】-------------------------------------------------------------------------------"
);
// log.info("【自检托管】{}", users);
// log.info("【自检托管】{}", users);
for
(
ProxyInfo
proxy
:
map
.
values
())
{
for
(
ProxyInfo
proxy
:
map
.
values
())
{
log
.
info
(
"【自检】{}"
,
JacksonUtils
.
nodefaultMapper
.
toJson
(
proxy
));
log
.
info
(
"【自检】{}"
,
JacksonUtils
.
nodefaultMapper
.
toJson
(
proxy
));
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment