|
|
@@ -14,13 +14,26 @@ public class TsiChannelSession {
|
|
|
private TsiChannelSession() {
|
|
|
// Private constructor to prevent instantiation
|
|
|
}
|
|
|
+ public static void initChannel(TsiNodeVo nodeVo, String remoteIpAddress) {
|
|
|
+ try {
|
|
|
+ if (nodeVo != null) {
|
|
|
+ final String logKey = nodeVo.getKey();
|
|
|
+ MDC.put("id", logKey);
|
|
|
+ log.info("Node: {}, initChannel, Connects: {}, {}", nodeVo.getNodeId(), nodeVo.getConnectCount().get(), remoteIpAddress);
|
|
|
+ MDC.clear();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ catch (Exception e) {
|
|
|
+ // Log the exception with a meaningful message
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
public static void sessionActive(TsiNodeVo nodeVo, String remoteIpAddress) {
|
|
|
try {
|
|
|
if (nodeVo != null) {
|
|
|
final String logKey = nodeVo.getKey();
|
|
|
MDC.put("id", logKey);
|
|
|
- log.info("Node: {}, ---Connect, Connects: {}, {}", nodeVo.getNodeId(), nodeVo.getConnectCount().get(), remoteIpAddress);
|
|
|
+ log.info("Node: {}, sessionActive, Connects: {}, {}", nodeVo.getNodeId(), nodeVo.getConnectCount().get(), remoteIpAddress);
|
|
|
MDC.clear();
|
|
|
}
|
|
|
}
|
|
|
@@ -34,7 +47,7 @@ public class TsiChannelSession {
|
|
|
if (nodeVo != null) {
|
|
|
final String logKey = nodeVo.getKey();
|
|
|
MDC.put("id", logKey);
|
|
|
- log.info("Node: {}, Disconnect, Connects: {}, {}", nodeVo.getNodeId(), nodeVo.getConnectCount().get(), remoteIpAddress);
|
|
|
+ log.info("Node: {}, sessionInactive, Connects: {}, {}", nodeVo.getNodeId(), nodeVo.getConnectCount().get(), remoteIpAddress);
|
|
|
MDC.clear();
|
|
|
}
|
|
|
}
|
|
|
@@ -48,7 +61,7 @@ public class TsiChannelSession {
|
|
|
if (nodeVo != null) {
|
|
|
final String logKey = nodeVo.getKey();
|
|
|
MDC.put("id", logKey);
|
|
|
- log.info("Node: {}, Registered, Connects: {}, {}", nodeVo.getNodeId(), nodeVo.getConnectCount().get(), remoteIpAddress);
|
|
|
+ log.info("Node: {}, objRegistered, Connects: {}, {}", nodeVo.getNodeId(), nodeVo.getConnectCount().get(), remoteIpAddress);
|
|
|
MDC.clear();
|
|
|
}
|
|
|
}
|
|
|
@@ -62,7 +75,7 @@ public class TsiChannelSession {
|
|
|
if (nodeVo != null) {
|
|
|
final String logKey = nodeVo.getKey();
|
|
|
MDC.put("id", logKey);
|
|
|
- log.info("Node: {}, RcvTimeout, Connects: {}, {}", nodeVo.getNodeId(), nodeVo.getConnectCount().get(), remoteIpAddress);
|
|
|
+ log.info("Node: {}, sessionTimeout, Connects: {}, {}", nodeVo.getNodeId(), nodeVo.getConnectCount().get(), remoteIpAddress);
|
|
|
MDC.clear();
|
|
|
}
|
|
|
}
|