diff --git a/src/main/java/com/nis/domain/restful/TrafficNmsServerStatisticList.java b/src/main/java/com/nis/domain/restful/TrafficNmsServerStatisticList.java
new file mode 100644
index 0000000..101bfa5
--- /dev/null
+++ b/src/main/java/com/nis/domain/restful/TrafficNmsServerStatisticList.java
@@ -0,0 +1,31 @@
+package com.nis.domain.restful;
+
+import java.io.Serializable;
+import java.util.List;
+
+import com.wordnik.swagger.annotations.ApiModel;
+
+/**
+ *
+ *
Title: TrafficNmsServerStatistic
+ * Description: 记录nms服务器信息,全网机器总量,正常在线机器总数,异常机器列表
+ * Company: IIE
+ * @author rkg
+ * @date 2018年8月17日
+ *
+ */
+@ApiModel(value = "TrafficNmsServerStatistic对象", description = "nms上报的服务器相关信息对象类")
+public class TrafficNmsServerStatisticList implements Serializable {
+ private static final long serialVersionUID = 1L;
+
+ private List trafficNmsServerList;
+
+ public List getTrafficNmsServerList() {
+ return trafficNmsServerList;
+ }
+
+ public void setTrafficNmsServerList(List trafficNmsServerList) {
+ this.trafficNmsServerList = trafficNmsServerList;
+ }
+
+}
diff --git a/src/main/java/com/nis/domain/restful/dashboard/NtcTotalReport.java b/src/main/java/com/nis/domain/restful/dashboard/NtcTotalReport.java
new file mode 100644
index 0000000..7c637e1
--- /dev/null
+++ b/src/main/java/com/nis/domain/restful/dashboard/NtcTotalReport.java
@@ -0,0 +1,93 @@
+package com.nis.domain.restful.dashboard;
+
+import java.util.Date;
+
+public class NtcTotalReport {
+
+ private Integer statId ;//int(11) NOT NULL AUTO_INCREMENT COMMENT id自增,
+ private Integer rejectNum ;//int(11) NOT NULL COMMENT 封堵数量,
+ private Integer monitorNum ;//int(11) NOT NULL COMMENT 监测数量,
+ private Integer c2sPktNum ;//int(11) DEFAULT NULL COMMENT c2s包数,
+ private Integer s2cPktNum ;//int(11) DEFAULT NULL COMMENT s2c包数,
+ private Integer c2sByteLen ;//int(11) NOT NULL COMMENT c2s字节数,
+ private Integer s2cByteLen ;//int(11) NOT NULL COMMENT s2c字节数,
+ private Integer newUniConnNum ;//int(11) DEFAULT NULL COMMENT 新建链接数,
+ private Integer liveConnNum ;//int(11) DEFAULT NULL COMMENT 活跃链接数,
+ private Integer dropConnNum ;//int(11) DEFAULT NULL COMMENT 丢弃链接数,
+ private Integer loopConnNum ;//int(11) DEFAULT NULL COMMENT 回流链接数,
+ private Date reportTime ;//datetime NOT NULL COMMENT 统计时间,
+
+ public Integer getStatId() {
+ return statId;
+ }
+ public void setStatId(Integer statId) {
+ this.statId = statId;
+ }
+ public Integer getRejectNum() {
+ return rejectNum;
+ }
+ public void setRejectNum(Integer rejectNum) {
+ this.rejectNum = rejectNum;
+ }
+ public Integer getMonitorNum() {
+ return monitorNum;
+ }
+ public void setMonitorNum(Integer monitorNum) {
+ this.monitorNum = monitorNum;
+ }
+ public Integer getC2sPktNum() {
+ return c2sPktNum;
+ }
+ public void setC2sPktNum(Integer c2sPktNum) {
+ this.c2sPktNum = c2sPktNum;
+ }
+ public Integer getS2cPktNum() {
+ return s2cPktNum;
+ }
+ public void setS2cPktNum(Integer s2cPktNum) {
+ this.s2cPktNum = s2cPktNum;
+ }
+ public Integer getC2sByteLen() {
+ return c2sByteLen;
+ }
+ public void setC2sByteLen(Integer c2sByteLen) {
+ this.c2sByteLen = c2sByteLen;
+ }
+ public Integer getS2cByteNen() {
+ return s2cByteLen;
+ }
+ public void setS2cByteNen(Integer s2cByteLen) {
+ this.s2cByteLen = s2cByteLen;
+ }
+ public Integer getNewUniConnNum() {
+ return newUniConnNum;
+ }
+ public void setNewUniConnNum(Integer newUniConnNum) {
+ this.newUniConnNum = newUniConnNum;
+ }
+ public Integer getLiveConnNum() {
+ return liveConnNum;
+ }
+ public void setLiveConnNum(Integer liveConnNum) {
+ this.liveConnNum = liveConnNum;
+ }
+ public Integer getDropConnNum() {
+ return dropConnNum;
+ }
+ public void setDropConnNum(Integer dropConnNum) {
+ this.dropConnNum = dropConnNum;
+ }
+ public Integer getLoopConnNum() {
+ return loopConnNum;
+ }
+ public void setLoopConnNum(Integer loopConnNum) {
+ this.loopConnNum = loopConnNum;
+ }
+ public Date getReportTime() {
+ return reportTime;
+ }
+ public void setReportTime(Date reportTime) {
+ this.reportTime = reportTime;
+ }
+
+}
\ No newline at end of file
diff --git a/src/main/java/com/nis/domain/restful/dashboard/TrafficHttpStatistic.java b/src/main/java/com/nis/domain/restful/dashboard/TrafficHttpStatistic.java
index e928204..9fadebf 100644
--- a/src/main/java/com/nis/domain/restful/dashboard/TrafficHttpStatistic.java
+++ b/src/main/java/com/nis/domain/restful/dashboard/TrafficHttpStatistic.java
@@ -23,8 +23,18 @@ public class TrafficHttpStatistic {
private Integer count;
private Integer pktNum;
private Integer byteLen;
+ private Integer websiteServiceId;//网站id
- public Integer getCount() {
+
+ public Integer getWesiteServiceId() {
+ return websiteServiceId;
+ }
+
+ public void setWebsiteServiceId(Integer websiteServiceId) {
+ this.websiteServiceId = websiteServiceId;
+ }
+
+ public Integer getCount() {
return count;
}
diff --git a/src/main/java/com/nis/domain/restful/dashboard/TrafficPortActiveStatistic.java b/src/main/java/com/nis/domain/restful/dashboard/TrafficPortActiveStatistic.java
new file mode 100644
index 0000000..98b3592
--- /dev/null
+++ b/src/main/java/com/nis/domain/restful/dashboard/TrafficPortActiveStatistic.java
@@ -0,0 +1,38 @@
+package com.nis.domain.restful.dashboard;
+
+import java.util.Date;
+
+public class TrafficPortActiveStatistic {
+//流量统计之活跃端口统计
+ private Integer statId;
+ private Integer port;
+ private Integer sum;
+ private Date statTime;
+
+ public Integer getStatId() {
+ return statId;
+ }
+ public void setStatId(Integer statId) {
+ this.statId = statId;
+ }
+ public Integer getPort() {
+ return port;
+ }
+ public void setPort(Integer port) {
+ this.port = port;
+ }
+ public Integer getSum() {
+ return sum;
+ }
+ public void setSum(Integer sum) {
+ this.sum = sum;
+ }
+ public Date getStatTime() {
+ return statTime;
+ }
+ public void setStatTime(Date statTime) {
+ this.statTime = statTime;
+ }
+
+
+}
diff --git a/src/main/java/com/nis/domain/restful/dashboard/WebsiteDomainTopic.java b/src/main/java/com/nis/domain/restful/dashboard/WebsiteDomainTopic.java
new file mode 100644
index 0000000..03319b4
--- /dev/null
+++ b/src/main/java/com/nis/domain/restful/dashboard/WebsiteDomainTopic.java
@@ -0,0 +1,59 @@
+package com.nis.domain.restful.dashboard;
+
+import java.util.Date;
+
+public class WebsiteDomainTopic {
+
+ private Long id; // `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ private Long websiteServiceId; // `website_service_id` bigint(20) DEFAULT NULL COMMENT '网站服务Id',
+ private String domain; // `domain` varchar(200) DEFAULT NULL COMMENT '域名',
+ private Long topicId; // `topic_id` bigint(20) DEFAULT NULL COMMENT '主题Id',
+ private Date createTime; // `create_time` timestamp NULL DEFAULT NULL ON UPDATE current_timestamp(),
+ private Integer creatorId; // `creator_id` int(11) DEFAULT NULL,
+ private Integer isValid; // `is_valid` int(1) DEFAULT NULL,
+
+ public Long getId() {
+ return id;
+ }
+ public void setId(Long id) {
+ this.id = id;
+ }
+ public Long getWebsiteServiceId() {
+ return websiteServiceId;
+ }
+ public void setWebsiteServiceId(Long websiteServiceId) {
+ this.websiteServiceId = websiteServiceId;
+ }
+ public String getDomain() {
+ return domain;
+ }
+ public void setDomain(String domain) {
+ this.domain = domain;
+ }
+ public Long getTopicId() {
+ return topicId;
+ }
+ public void setTopicId(Long topicId) {
+ this.topicId = topicId;
+ }
+ public Date getCreateTime() {
+ return createTime;
+ }
+ public void setCreateTime(Date createTime) {
+ this.createTime = createTime;
+ }
+ public Integer getCreatorId() {
+ return creatorId;
+ }
+ public void setCreatorId(Integer creatorId) {
+ this.creatorId = creatorId;
+ }
+ public Integer getIsValid() {
+ return isValid;
+ }
+ public void setIsValid(Integer isValid) {
+ this.isValid = isValid;
+ }
+
+
+}
diff --git a/src/main/java/com/nis/restful/RestBusinessCode.java b/src/main/java/com/nis/restful/RestBusinessCode.java
index 3a66acb..3f2c39e 100644
--- a/src/main/java/com/nis/restful/RestBusinessCode.java
+++ b/src/main/java/com/nis/restful/RestBusinessCode.java
@@ -592,6 +592,12 @@ public enum RestBusinessCode {
*/
RegionIsNotExist(5002010,"删除分组复用域配置时,无法在关联关系中找到对应的域配置信息,之前该域没有添加过,或者关联关系被损坏请检查"),
+
+ /**
+ *配置文件内容有误
+ */
+ PropertiesIsError(5002011,"配置文件内容有误"),
+
/**
* 无法从Map中获取配置的属性值
*/
diff --git a/src/main/java/com/nis/util/ServiceAndRDBIndexReal.java b/src/main/java/com/nis/util/ServiceAndRDBIndexReal.java
index df5d261..7f4be47 100644
--- a/src/main/java/com/nis/util/ServiceAndRDBIndexReal.java
+++ b/src/main/java/com/nis/util/ServiceAndRDBIndexReal.java
@@ -29,7 +29,7 @@ public class ServiceAndRDBIndexReal {
* 记录哪些service可以被分组复用(只有maat类配置可以被分组复用)
* Map>
*/
- private static Map>> serviceGroupReuseMap = new HashMap>>();
+ private static Map>> serviceGroupReuseMap = new HashMap>>();
/**
* 第一个key是业务类型,第二个key是type(编译配置,分组配置,域配置)value是表名
@@ -57,35 +57,32 @@ public class ServiceAndRDBIndexReal {
private static Map> maatToValveMap = new HashMap>();
/**
- * 阀门保存的redis数据库Index,在seriveTable.properties中定义
+ * 阀门保存的redis数据库Index,在nis.properties中定义
*/
- private static Integer valveDBIndex = 7;
+ private static Integer valveDBIndex = Configurations.getIntProperty("tapRedisDb", 5);
static {
String unMaatService = Configurations.getStringProperty("unMaatService", "");
if (unMaatService != null && !unMaatService.trim().equals("")) {
String[] split = unMaatService.split(";");
for (String str : split) {
- String[] serviceAction = str.split(":");
- if (serviceAction.length==2) {
- serviceActionMap.put(Integer.valueOf(serviceAction[0]),
- Integer.valueOf(serviceAction[1]));
- }else{
- serviceActionMap.put(Integer.valueOf(serviceAction[0]),
- null);
- }
- String serviceType = Configurations.getStringProperty(serviceAction[0], "");
- if (serviceType != null && !serviceType.trim().equals("")) {
- String[] typeArrs = serviceType.split(";");
- for (String typeStr : typeArrs) {
- String[] typeArr = typeStr.split(":");
- String tableNameArr[] = typeArr[1].split(",");
- for (String tableName : tableNameArr) {
- unMaatSercieNameMap.put(Integer.parseInt(serviceAction[0]),
- tableName.toUpperCase());
- }
- }
- }
+ String[] serviceAction = str.split(":");
+ if (serviceAction.length == 2) {
+ serviceActionMap.put(Integer.valueOf(serviceAction[0]), Integer.valueOf(serviceAction[1]));
+ } else {
+ serviceActionMap.put(Integer.valueOf(serviceAction[0]), null);
+ }
+ String serviceType = Configurations.getStringProperty(serviceAction[0], "");
+ if (serviceType != null && !serviceType.trim().equals("")) {
+ String[] typeArrs = serviceType.split(";");
+ for (String typeStr : typeArrs) {
+ String[] typeArr = typeStr.split(":");
+ String tableNameArr[] = typeArr[1].split(",");
+ for (String tableName : tableNameArr) {
+ unMaatSercieNameMap.put(Integer.parseInt(serviceAction[0]), tableName.toUpperCase());
+ }
+ }
+ }
}
}
@@ -161,17 +158,17 @@ public class ServiceAndRDBIndexReal {
if (!StringUtil.isEmpty(serviceRepeatedReal)) {
String[] serviceRepeatedRealArr = serviceRepeatedReal.split(";");
for (String serviceRepeated : serviceRepeatedRealArr) {
- String [] serInfos = serviceRepeated.split(":");
- String [] regionInfos = serInfos[1].split("[|]");
+ String[] serInfos = serviceRepeated.split(":");
+ String[] regionInfos = serInfos[1].split("[|]");
for (String regionInfo : regionInfos) {
- String [] regionTabName = regionInfo.split("@");
- String [] tableNames = regionTabName[1].split(",");
+ String[] regionTabName = regionInfo.split("@");
+ String[] tableNames = regionTabName[1].split(",");
for (String tableName : tableNames) {
Integer ser = Integer.valueOf(serInfos[0]);
- if(serviceGroupReuseMap.containsKey(ser)){
+ if (serviceGroupReuseMap.containsKey(ser)) {
serviceGroupReuseMap.get(ser).get(regionTabName[0]).add(tableName);
- }else{
- Map> regTabMap = new HashMap>();
+ } else {
+ Map> regTabMap = new HashMap>();
List tabList = new ArrayList();
tabList.add(tableName);
regTabMap.put(regionTabName[0], tabList);
@@ -183,8 +180,6 @@ public class ServiceAndRDBIndexReal {
}
}
-
-
public static void main(String[] args) {
// getUnMaatTable();
getMaatTable();
@@ -326,7 +321,7 @@ public class ServiceAndRDBIndexReal {
return null;
}
-
+
/**
* 判断service是否被分组复用
* @param service
@@ -336,10 +331,25 @@ public class ServiceAndRDBIndexReal {
if (service != null) {
return serviceGroupReuseMap.containsKey(service);
} else {
- throw new ServiceRuntimeException("判断service是否是分组复用时发生了异常,异常原因:service=null", RestBusinessCode.ServiceIsNull.getValue());
+ throw new ServiceRuntimeException("判断service是否是分组复用时发生了异常,异常原因:service=null",
+ RestBusinessCode.ServiceIsNull.getValue());
}
}
+ /**
+ * 验证当前service是否是向阀门添加action,service或者userregion等属性
+ * @param service
+ * @return
+ */
+ public static boolean isAddASU(int service) {
+ boolean isValve = false;
+ Map map2 = maatToValveMap.get(service);
+ if (map2 != null && map2.size() > 0) {
+ isValve = true;
+ }
+ return isValve;
+ }
+
/**
* 根据业务类型获取unmaat配置表名
* @param service
@@ -401,6 +411,7 @@ public class ServiceAndRDBIndexReal {
public static void setUnMaatSercieNameMap(Map unMaatSercieNameMap) {
ServiceAndRDBIndexReal.unMaatSercieNameMap = unMaatSercieNameMap;
}
+
/**
* @return the serviceGroupReuseMap
*/
@@ -416,7 +427,7 @@ public class ServiceAndRDBIndexReal {
List list = new ArrayList();
list.addAll(map.get(regionName));
groupReuseRegionMap.put(regionName, list);
- }else{
+ } else {
groupReuseRegionMap.get(regionName).addAll(map.get(regionName));
}
}
diff --git a/src/main/java/com/nis/web/controller/restful/DashboardServiceController.java b/src/main/java/com/nis/web/controller/restful/DashboardServiceController.java
index 78f371c..2c6ec57 100644
--- a/src/main/java/com/nis/web/controller/restful/DashboardServiceController.java
+++ b/src/main/java/com/nis/web/controller/restful/DashboardServiceController.java
@@ -6,6 +6,7 @@ import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
+import com.nis.domain.restful.dashboard.TrafficPortActiveStatistic;
import com.nis.restful.RestServiceException;
import com.nis.util.Constants;
import javax.servlet.http.HttpServletRequest;
@@ -34,6 +35,67 @@ public class DashboardServiceController extends BaseRestController {
protected ServicesRequestLogService servicesRequestLogService;
@Autowired
public DashboardService dashboardService;
+
+ /**
+ * 流量统计info滚动条数据显示 封堵监测回流丢弃
+ */
+ @RequestMapping(value = "ntcTotalReport", method = RequestMethod.GET)
+ @ApiOperation(value = "业务总量汇聚", httpMethod = "GET", notes = "对应流量统计info滚动条数据显示")
+ public Map ntcTotalReport(Model model, HttpServletRequest request, HttpServletResponse response) {
+
+ long start = System.currentTimeMillis();
+ AuditLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET, request, null);
+ List