|
@@ -19,6 +19,8 @@ import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
import javax.annotation.PostConstruct;
|
|
|
import javax.annotation.PreDestroy;
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.Collections;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
import java.util.concurrent.ConcurrentHashMap;
|
|
@@ -131,7 +133,6 @@ public class ApplicationRepository {
|
|
|
List<TbEvpsCenter> lists = this.mapper.selectAll();
|
|
|
log.info("ApplicationRepository.loadCenterInfo: {} EA", lists.size());
|
|
|
for (TbEvpsCenter entity : lists) {
|
|
|
- log.info("ApplicationRepository.loadCenterInfo: {}.", entity);
|
|
|
EvpsCenter dto = entity.toDto();
|
|
|
EvpsCenter center = this.centerMap.get(dto.getCenterId());
|
|
|
if (center != null) {
|
|
@@ -143,9 +144,11 @@ public class ApplicationRepository {
|
|
|
}
|
|
|
}
|
|
|
else {
|
|
|
- this.centerMap.put(dto.getCenterId(), dto);
|
|
|
- this.ipAddrMap.put(dto.getIpAddress(), dto);
|
|
|
+ center = dto;
|
|
|
+ this.centerMap.put(dto.getCenterId(), center);
|
|
|
+ this.ipAddrMap.put(dto.getIpAddress(), center);
|
|
|
}
|
|
|
+ log.info("ApplicationRepository.loadCenterInfo: NetStat: {}, {}.", center.getNetState().getState(), entity);
|
|
|
}
|
|
|
}
|
|
|
catch (Exception e) {
|
|
@@ -178,29 +181,29 @@ public class ApplicationRepository {
|
|
|
this.mapper.updateCommStateDisconnect(center.getCenterId());
|
|
|
});
|
|
|
}
|
|
|
-//
|
|
|
-// public void reportChannelSessions() {
|
|
|
-// log.info("++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++");
|
|
|
-// //log.info("Report Region Center Channel Sessions Information.");
|
|
|
-// log.info("Center Name IpAddress Connect_Count Connect_Time Disconnect_Time Remote_Address");
|
|
|
-// log.info("----------------------------------------------------------------------------------------------------------------");
|
|
|
-// List<String> keySet = new ArrayList<>(this.centerMap.keySet());
|
|
|
-// Collections.sort(keySet);
|
|
|
-// //this.centerMap.forEach((key, center) -> {
|
|
|
-// for (String key : keySet) {
|
|
|
-// EvpsCenter center = this.centerMap.get(key);
|
|
|
-// String channelIpAddress = center.getNetState().isActive() ? NettyUtils.getRemoteAddress(center.getNetState().getChannel()) : "---";
|
|
|
-// log.info("{}", String.format("%-6s %-9s %-15s %-7s %5d %s %s %s",
|
|
|
-// center.getCenterId(),
|
|
|
-// center.getCenterNm(),
|
|
|
-// center.getIpAddress(),
|
|
|
-// center.getNetState().isActive(),
|
|
|
-// center.getNetState().getConnectCount(),
|
|
|
-// center.getNetState().getConnectTimeString(),
|
|
|
-// center.getNetState().getDisconnectTimeString(),
|
|
|
-// channelIpAddress));
|
|
|
-// }
|
|
|
-// log.info("++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++");
|
|
|
-// }
|
|
|
+
|
|
|
+ public void reportCenterSessions() {
|
|
|
+ //[Remote #(10.4.4.51:47734)]
|
|
|
+ log.info("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++");
|
|
|
+ log.info("Center IpAddress NetState Connected Connect_Time Disconnect_Time Remote_Address Name ");
|
|
|
+ log.info("-----------------------------------------------------------------------------------------------------------------------------------------");
|
|
|
+ List<String> keySet = new ArrayList<>(this.centerMap.keySet());
|
|
|
+ Collections.sort(keySet);
|
|
|
+ //this.centerMap.forEach((key, center) -> {
|
|
|
+ for (String key : keySet) {
|
|
|
+ EvpsCenter center = this.centerMap.get(key);
|
|
|
+ String channelIpAddress = center.getNetState().isActive() ? NettyUtils.getRemoteAddress(center.getNetState().getChannel()) : "---";
|
|
|
+ log.info("{}", String.format("%-6s %-15s %-8s %9d %s %s %-33s %s",
|
|
|
+ center.getCenterId(),
|
|
|
+ center.getIpAddress(),
|
|
|
+ center.getNetState().isActive(),
|
|
|
+ center.getNetState().getConnectCount(),
|
|
|
+ center.getNetState().getConnectTimeString(),
|
|
|
+ center.getNetState().getDisconnectTimeString(),
|
|
|
+ channelIpAddress,
|
|
|
+ center.getCenterNm()));
|
|
|
+ }
|
|
|
+ log.info("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++");
|
|
|
+ }
|
|
|
|
|
|
}
|