Compare commits
431 Commits
feature-im
...
develop_20
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fa1e2fab5f | ||
|
|
155bd134fc | ||
|
|
3384f7e604 | ||
|
|
2155998f13 | ||
|
|
0edcf7162f | ||
|
|
7080e65671 | ||
|
|
06221477a5 | ||
|
|
6e646d83e5 | ||
|
|
fe24ba0fc6 | ||
|
|
1c8ff7cb08 | ||
|
|
3ddd809066 | ||
|
|
c0f424579b | ||
|
|
881372118e | ||
|
|
e746cb413e | ||
|
|
d1335db3a3 | ||
|
|
c6e315e1bc | ||
|
|
51a833f9fb | ||
|
|
714ac134f8 | ||
|
|
a1f0f432e7 | ||
|
|
2ed5ae2727 | ||
|
|
9d47a56130 | ||
|
|
11a5d1a65f | ||
|
|
8db3eca2e0 | ||
|
|
8fb4f6e5b5 | ||
|
|
ca17b49bf8 | ||
|
|
e82e69edbc | ||
|
|
28c9d6d107 | ||
|
|
090ab473c2 | ||
|
|
98477b8e08 | ||
|
|
d12973f2bf | ||
|
|
c9f99cb592 | ||
|
|
15aee31e5d | ||
|
|
d2787f6080 | ||
|
|
e9a06cabaf | ||
|
|
e23b638907 | ||
|
|
240b10a05d | ||
|
|
05599738d9 | ||
|
|
a97c2b51c0 | ||
|
|
7ad3d9a80b | ||
|
|
7dfe52590b | ||
|
|
1eaf3fb4c6 | ||
|
|
a0ecce4678 | ||
|
|
5f63be0c72 | ||
|
|
92c34a108c | ||
|
|
c812bebb2d | ||
|
|
30ec0dc379 | ||
|
|
d7fc2a1d81 | ||
|
|
540d669073 | ||
|
|
8910c864ef | ||
|
|
24ff189f8d | ||
|
|
30b8d63f21 | ||
|
|
32e35b4bc3 | ||
|
|
891d1a9cbb | ||
|
|
fd3b6f8fca | ||
|
|
d67a25335f | ||
|
|
4a3e865c75 | ||
|
|
84579c8f3f | ||
|
|
d6f8927499 | ||
|
|
399396815f | ||
|
|
eab1a85554 | ||
|
|
b5e49c5dba | ||
|
|
38f63b8175 | ||
|
|
b4c06301b0 | ||
|
|
8217770d6d | ||
|
|
cf6d462feb | ||
|
|
620f26fa2f | ||
|
|
0a695b3a51 | ||
|
|
6eafd88642 | ||
|
|
fc339cae7e | ||
|
|
bb13d8bbec | ||
|
|
5f7eb1ec43 | ||
|
|
46fd30e443 | ||
|
|
ce75edd0d2 | ||
|
|
01655fcc4c | ||
|
|
629a92a2ce | ||
|
|
f03cba22dd | ||
|
|
a1a2324304 | ||
|
|
e622288234 | ||
|
|
eb3616f6ff | ||
|
|
323920263d | ||
|
|
25a5cc802e | ||
|
|
889d58ca11 | ||
|
|
e08ee12192 | ||
|
|
9bcf405945 | ||
|
|
a403a82922 | ||
|
|
0cdbbe4201 | ||
|
|
bc2b862e39 | ||
|
|
f41d43b843 | ||
|
|
48a294fac3 | ||
|
|
a4e5b0f78d | ||
|
|
55e2272333 | ||
|
|
1d0835a563 | ||
|
|
10d153c40f | ||
|
|
ef16dddf34 | ||
|
|
1d64a1bc0f | ||
|
|
0f06c49b48 | ||
|
|
d245ef7dc4 | ||
|
|
3aebe7d905 | ||
|
|
2190ee447d | ||
|
|
3cf97daa6a | ||
|
|
f232a5b90a | ||
|
|
1c4308e536 | ||
|
|
7ce70a10f8 | ||
|
|
b280c23021 | ||
|
|
1031b0a118 | ||
|
|
6a9c2db32a | ||
|
|
1441b6697b | ||
|
|
98f1722bdd | ||
|
|
7501eb4317 | ||
|
|
446c802ece | ||
|
|
a12b74b1d3 | ||
|
|
c58bac38d1 | ||
|
|
aaf64fc527 | ||
|
|
afafed1804 | ||
|
|
6f3647694e | ||
|
|
c8467db46b | ||
|
|
193bb8c1c3 | ||
|
|
bbda5e233f | ||
|
|
fdb38ce727 | ||
|
|
2b23095c9d | ||
|
|
9e276d1f0a | ||
|
|
4d4d1d9153 | ||
|
|
bf03ca1cc0 | ||
|
|
7dc9e4ac43 | ||
|
|
66b3673bce | ||
|
|
24c7d0b3ad | ||
|
|
8d44987c6f | ||
|
|
21cd6c06be | ||
|
|
194bf20558 | ||
|
|
3fbe796217 | ||
|
|
238c342339 | ||
|
|
c7bd7dcba1 | ||
|
|
2f74cd03cc | ||
|
|
b22cfec67f | ||
|
|
723da765a0 | ||
|
|
dace2ab798 | ||
|
|
3b57a384b6 | ||
|
|
ee513ccdae | ||
|
|
4f85cf1beb | ||
|
|
3247d6fc9e | ||
|
|
a821ca4364 | ||
|
|
2bee7a7f68 | ||
|
|
5f8a9b43fc | ||
|
|
df690cffd3 | ||
|
|
744a6eae55 | ||
|
|
56f08a1bfa | ||
|
|
d0554f0f2b | ||
|
|
897125210d | ||
|
|
27b0cfa560 | ||
|
|
4ae632b3ab | ||
|
|
9754bd757d | ||
|
|
d76e44d06f | ||
|
|
2f04b583ea | ||
|
|
3e1500cf38 | ||
|
|
d0499163b3 | ||
|
|
94e764f97e | ||
|
|
f9768ab910 | ||
|
|
ad04b41d7a | ||
|
|
d7bcd91b8a | ||
|
|
77059b8d2c | ||
|
|
452e295d8a | ||
|
|
db7049c041 | ||
|
|
c83472c508 | ||
|
|
2e2249ce15 | ||
|
|
3bbc700ed3 | ||
|
|
70312e4d5d | ||
|
|
7b1fd6074d | ||
|
|
4494bbd5c4 | ||
|
|
30e04c19f6 | ||
|
|
f074c1432a | ||
|
|
7bc04a2df3 | ||
|
|
5036f89db5 | ||
|
|
0406998c42 | ||
|
|
87dc47cbf3 | ||
|
|
2ad805617b | ||
|
|
1cc1ed42ec | ||
|
|
775230f99b | ||
|
|
576e446292 | ||
|
|
fd714e30f4 | ||
|
|
8c766e90a8 | ||
|
|
28da266944 | ||
|
|
9441ed77a1 | ||
|
|
b7e2a89f09 | ||
|
|
e9a91921d4 | ||
|
|
3641e2c64e | ||
|
|
3e206c8ad1 | ||
|
|
a6260ee1ef | ||
|
|
692d00050c | ||
|
|
5355c9ab9c | ||
|
|
468054b5a4 | ||
|
|
eb9ad8941e | ||
|
|
ae5f827155 | ||
|
|
65c06777ed | ||
|
|
f917c7678a | ||
|
|
1b2f115ee5 | ||
|
|
33590ee8f4 | ||
|
|
91aaf716c8 | ||
|
|
5dc3136724 | ||
|
|
a4f341cf74 | ||
|
|
b1bf4d1185 | ||
|
|
95dc4a7e5f | ||
|
|
93b3729bbe | ||
|
|
1ef6002c57 | ||
|
|
c0461322fa | ||
|
|
8770f98ea1 | ||
|
|
613ef99e67 | ||
|
|
935f70fa4f | ||
|
|
231a3ca1d5 | ||
|
|
baf3035eda | ||
|
|
411639fe16 | ||
|
|
b453c1f178 | ||
|
|
2b7973c962 | ||
|
|
f5961fd68a | ||
|
|
d4ea223b99 | ||
|
|
e9bb74d9fd | ||
|
|
84c10eac7d | ||
|
|
dd31466774 | ||
|
|
ab25fbc8f0 | ||
|
|
72fee91228 | ||
|
|
733cd55636 | ||
|
|
90678068c9 | ||
|
|
5ad397d752 | ||
|
|
8472c6efcf | ||
|
|
f2d29374da | ||
|
|
2786ee2fe8 | ||
|
|
8b2a692aeb | ||
|
|
062161826e | ||
|
|
db9d2a41fd | ||
|
|
8261647a35 | ||
|
|
672d76b046 | ||
|
|
00b3ea807f | ||
|
|
99f002d0c6 | ||
|
|
39cbf62517 | ||
|
|
25c2bb790e | ||
|
|
cf29b7ec04 | ||
|
|
4a810d918a | ||
|
|
5c00167d76 | ||
|
|
a68c454559 | ||
|
|
6abfd25a1d | ||
|
|
5b5b6d8584 | ||
|
|
c0d85d20bb | ||
|
|
8788c65357 | ||
|
|
a2c5ba8f7a | ||
|
|
8c9706fb0e | ||
|
|
b2aac3e567 | ||
|
|
182a6a8ddc | ||
|
|
ac52747686 | ||
|
|
8657cfa142 | ||
|
|
952ea78b66 | ||
|
|
f30acfdbbd | ||
|
|
c44ddb9ffc | ||
|
|
a9a15f4c0a | ||
|
|
025873ce76 | ||
|
|
28771355cc | ||
|
|
0629e8b1de | ||
|
|
8d7a6c69b6 | ||
|
|
fe3f632046 | ||
|
|
9527b41592 | ||
|
|
6312a65351 | ||
|
|
f6c37c7bda | ||
|
|
c81dd92aca | ||
|
|
9f4264d878 | ||
|
|
d4e153533a | ||
|
|
35ca1636ef | ||
|
|
44486b98cb | ||
|
|
ea456f83d0 | ||
|
|
b4f9eac0d3 | ||
|
|
54333afe0b | ||
|
|
48806bd775 | ||
|
|
23ae0f08d3 | ||
|
|
21ca3bc804 | ||
|
|
d9110dfa14 | ||
|
|
fd2d285b92 | ||
|
|
8a27636007 | ||
|
|
89336a3677 | ||
|
|
144900d6df | ||
|
|
ba758cab58 | ||
|
|
10fb06f5bf | ||
|
|
dd37178cfc | ||
|
|
46fff54557 | ||
|
|
f1fc6ee9aa | ||
|
|
dde951fe4a | ||
|
|
33fd4df21d | ||
|
|
1882d011cb | ||
|
|
cd977ed81a | ||
|
|
e8a5c506e9 | ||
|
|
f8e1b8f093 | ||
|
|
c30ab53f00 | ||
|
|
ea33bae40f | ||
|
|
d1082f539e | ||
|
|
c1188539b5 | ||
|
|
269f4e0644 | ||
|
|
3f6d6a6d60 | ||
|
|
00ffdd863c | ||
|
|
1eaa2e668b | ||
|
|
86c2d86565 | ||
|
|
35e491e20c | ||
|
|
ce8c273aa4 | ||
|
|
d00a855666 | ||
|
|
2b57e33d12 | ||
|
|
fa9edae028 | ||
|
|
d4ee7c7a42 | ||
|
|
eac5552be2 | ||
|
|
18c5567f58 | ||
|
|
b0a9982d54 | ||
|
|
8e724393e1 | ||
|
|
494fb0669a | ||
|
|
36d1fee141 | ||
|
|
999406cbd1 | ||
|
|
4107e0fb92 | ||
|
|
efd965f4ca | ||
|
|
6eecad82aa | ||
|
|
ab8c4448ce | ||
|
|
9ade865187 | ||
|
|
2aa3524104 | ||
|
|
35a1b72fee | ||
|
|
724eeef0f5 | ||
|
|
65d3f5013f | ||
|
|
b50d324303 | ||
|
|
26097409d6 | ||
|
|
6223c66618 | ||
|
|
0499fb845d | ||
|
|
30007d50d0 | ||
|
|
1221ce6a18 | ||
|
|
b9246ddeeb | ||
|
|
eda0103068 | ||
|
|
589cf100ee | ||
|
|
3b838aa838 | ||
|
|
b3abe1f0e5 | ||
|
|
0b1a51aa47 | ||
|
|
40e166510c | ||
|
|
47771e57e7 | ||
|
|
94f0bc56b8 | ||
|
|
0cf19aeab9 | ||
|
|
078b1a0071 | ||
|
|
728201cfbe | ||
|
|
8719ed0527 | ||
|
|
77716a9517 | ||
|
|
5e9400e723 | ||
|
|
541aaf4640 | ||
|
|
f773c95c0b | ||
|
|
77c7649b6a | ||
|
|
e8dd565262 | ||
|
|
fe90fd9935 | ||
|
|
827a43d843 | ||
|
|
34a6cb5ed4 | ||
|
|
42724b94de | ||
|
|
97d1a52d3c | ||
|
|
28f07f00f2 | ||
|
|
c716cb1fc3 | ||
|
|
1191db5fbe | ||
|
|
5b63b0237e | ||
|
|
99c3c8c84f | ||
|
|
865811b9b2 | ||
|
|
5a5bdddba4 | ||
|
|
6bd04a92ce | ||
|
|
e69992d712 | ||
|
|
4725a3ff90 | ||
|
|
6ac930fd22 | ||
|
|
7b5c9092d1 | ||
|
|
1cf9594bd2 | ||
|
|
cc8cb48da1 | ||
|
|
b8d1bd9ab9 | ||
|
|
3acdae76d0 | ||
|
|
7b27b457a2 | ||
|
|
7c36ec0abc | ||
|
|
80b590b673 | ||
|
|
f52651b382 | ||
|
|
a1998f24f7 | ||
|
|
3bd9c15566 | ||
|
|
84eff37a0d | ||
|
|
233a02b7dc | ||
|
|
02bade2de0 | ||
|
|
bdcc2bb1b4 | ||
|
|
4c2872c5ea | ||
|
|
36e990a247 | ||
|
|
f06830ae23 | ||
|
|
e4effb7ab4 | ||
|
|
910072f66f | ||
|
|
359dd64696 | ||
|
|
96e8493509 | ||
|
|
faad92ed0d | ||
|
|
a2f8cf56d3 | ||
|
|
32804e2a9a | ||
|
|
c224080ef9 | ||
|
|
ecb1fed2d5 | ||
|
|
a769757728 | ||
|
|
8b36721749 | ||
|
|
451c114419 | ||
|
|
161c545fcd | ||
|
|
84f5646f86 | ||
|
|
47029f0eaf | ||
|
|
1f93d4f3b0 | ||
|
|
a478bee5f3 | ||
|
|
bca7de6990 | ||
|
|
268a0ae81b | ||
|
|
fc08261929 | ||
|
|
04a94458ed | ||
|
|
7f9a1c4f70 | ||
|
|
9b5792d748 | ||
|
|
002ad20be4 | ||
|
|
9f97dc2202 | ||
|
|
bcc0f7f220 | ||
|
|
add20445ad | ||
|
|
3be1c1a625 | ||
|
|
aa25c49a87 | ||
|
|
4ce7ebef05 | ||
|
|
f3ea596e5a | ||
|
|
da9ea20e8f | ||
|
|
7af6c7c203 | ||
|
|
c2faf2a2a3 | ||
|
|
af4491d739 | ||
|
|
ae0f91e36d | ||
|
|
4880832028 | ||
|
|
f6405c6f04 | ||
|
|
04db6bcb47 | ||
|
|
f2b5d7413c | ||
|
|
b372f4a9d8 | ||
|
|
851301c671 | ||
|
|
6eea9ee15b | ||
|
|
7189f2a671 | ||
|
|
85da9461e5 | ||
|
|
2809d1890d | ||
|
|
e4cf2aa1b4 | ||
|
|
91d93e7840 | ||
|
|
5e1095f2bb | ||
|
|
bea5312e9f | ||
|
|
09405e06e1 | ||
|
|
bf00ccd875 | ||
|
|
08dd0f3868 | ||
|
|
b7a64234f8 |
@@ -1 +1,7 @@
|
||||
在公共分组功能逻辑完善之前,此分支为ntc界面系统的全集上线升级分支合并版。
|
||||
630上线内容版本:
|
||||
|
||||
1、统计整合为一个模块儿
|
||||
|
||||
2、object-list-group HTTP和代理
|
||||
|
||||
3、代理新功能;
|
||||
6
pom.xml
6
pom.xml
@@ -727,6 +727,10 @@
|
||||
<artifactId>druid</artifactId>
|
||||
<version>1.1.10</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>fastjson</artifactId>
|
||||
<version>1.2.57</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
||||
@@ -14,6 +14,8 @@ public class ScheduleCfg extends BaseCfg<ScheduleCfg>{
|
||||
private String cronValid;//生效cron表达式
|
||||
private String cronInvalid;//失效cron表达式
|
||||
private String whereStr;//动态where 条件
|
||||
private int delFlag;
|
||||
private int type;
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
@@ -38,6 +40,17 @@ public class ScheduleCfg extends BaseCfg<ScheduleCfg>{
|
||||
public void setWhereStr(String whereStr) {
|
||||
this.whereStr = whereStr;
|
||||
}
|
||||
|
||||
public int getType() {
|
||||
return type;
|
||||
}
|
||||
public void setType(int type) {
|
||||
this.type = type;
|
||||
}
|
||||
public int getDelFlag() {
|
||||
return delFlag;
|
||||
}
|
||||
public void setDelFlag(int delFlag) {
|
||||
this.delFlag = delFlag;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
92
src/main/java/com/nis/domain/SysUserWarn.java
Normal file
92
src/main/java/com/nis/domain/SysUserWarn.java
Normal file
@@ -0,0 +1,92 @@
|
||||
package com.nis.domain;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import javax.xml.bind.annotation.XmlTransient;
|
||||
|
||||
import org.apache.poi.ss.formula.functions.T;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
|
||||
public class SysUserWarn {
|
||||
|
||||
private String serviceId; //业务Id
|
||||
private String serviceDesc;//业务描述
|
||||
private Integer interfaceCfgTotal;//界面配置数量
|
||||
|
||||
private Integer systemCfgTotal;//服务端配置数量
|
||||
|
||||
private Date time;//时间
|
||||
private String remark;//备注
|
||||
|
||||
private Integer id;//serviceID
|
||||
private String tableName;//表名
|
||||
/**
|
||||
* 当前实体分页对象
|
||||
*/
|
||||
protected Page<SysUserWarn> page;
|
||||
|
||||
public String getServiceId() {
|
||||
return serviceId;
|
||||
}
|
||||
public void setServiceId(String serviceId) {
|
||||
this.serviceId = serviceId;
|
||||
}
|
||||
public String getServiceDesc() {
|
||||
return serviceDesc;
|
||||
}
|
||||
public void setServiceDesc(String serviceDesc) {
|
||||
this.serviceDesc = serviceDesc;
|
||||
}
|
||||
public Integer getInterfaceCfgTotal() {
|
||||
return interfaceCfgTotal;
|
||||
}
|
||||
public void setInterfaceCfgTotal(Integer interfaceCfgTotal) {
|
||||
this.interfaceCfgTotal = interfaceCfgTotal;
|
||||
}
|
||||
public Integer getSystemCfgTotal() {
|
||||
return systemCfgTotal;
|
||||
}
|
||||
public void setSystemCfgTotal(Integer systemCfgTotal) {
|
||||
this.systemCfgTotal = systemCfgTotal;
|
||||
}
|
||||
public Date getTime() {
|
||||
return time;
|
||||
}
|
||||
public void setTime(Date time) {
|
||||
this.time = time;
|
||||
}
|
||||
public String getRemark() {
|
||||
return remark;
|
||||
}
|
||||
public void setRemark(String remark) {
|
||||
this.remark = remark;
|
||||
}
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
public String getTableName() {
|
||||
return tableName;
|
||||
}
|
||||
public void setTableName(String tableName) {
|
||||
this.tableName = tableName;
|
||||
}
|
||||
@JsonIgnore
|
||||
@XmlTransient
|
||||
public Page<SysUserWarn> getPage() {
|
||||
if (page == null){
|
||||
page = new Page<SysUserWarn>();
|
||||
}
|
||||
return page;
|
||||
}
|
||||
|
||||
public Page<SysUserWarn> setPage(Page<SysUserWarn> page) {
|
||||
this.page = page;
|
||||
return page;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
46
src/main/java/com/nis/domain/SysUserWarnData.java
Normal file
46
src/main/java/com/nis/domain/SysUserWarnData.java
Normal file
@@ -0,0 +1,46 @@
|
||||
package com.nis.domain;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class SysUserWarnData {
|
||||
|
||||
private Map<String,List<String>> effective;
|
||||
private Integer effectiveCount;
|
||||
private Map<String,List<String>> obsolete;
|
||||
private Integer obsoleteCount;
|
||||
|
||||
|
||||
public Map<String, List<String>> getEffective() {
|
||||
return effective;
|
||||
}
|
||||
public void setEffective(Map<String, List<String>> effective) {
|
||||
this.effective = effective;
|
||||
}
|
||||
public Integer getEffectiveCount() {
|
||||
return effectiveCount;
|
||||
}
|
||||
public void setEffectiveCount(Integer effectiveCount) {
|
||||
this.effectiveCount = effectiveCount;
|
||||
}
|
||||
public Map<String, List<String>> getObsolete() {
|
||||
return obsolete;
|
||||
}
|
||||
public void setObsolete(Map<String, List<String>> obsolete) {
|
||||
this.obsolete = obsolete;
|
||||
}
|
||||
public Integer getObsoleteCount() {
|
||||
return obsoleteCount;
|
||||
}
|
||||
public void setObsoleteCount(Integer obsoleteCount) {
|
||||
this.obsoleteCount = obsoleteCount;
|
||||
}
|
||||
@Override
|
||||
public String toString() {
|
||||
return "SysUserWarnData [effective=" + effective + ", effectiveCount=" + effectiveCount + ", obsolete="
|
||||
+ obsolete + ", obsoleteCount=" + obsoleteCount + "]";
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
67
src/main/java/com/nis/domain/SysUserWarnRecvData.java
Normal file
67
src/main/java/com/nis/domain/SysUserWarnRecvData.java
Normal file
@@ -0,0 +1,67 @@
|
||||
package com.nis.domain;
|
||||
|
||||
public class SysUserWarnRecvData {
|
||||
private Integer status;
|
||||
private Integer businessCode;
|
||||
private String reason;
|
||||
private String msg;
|
||||
private String fromuri;
|
||||
private String logSource;
|
||||
private String traceCode;
|
||||
private SysUserWarnData data;
|
||||
|
||||
|
||||
public Integer getStatus() {
|
||||
return status;
|
||||
}
|
||||
public void setStatus(Integer status) {
|
||||
this.status = status;
|
||||
}
|
||||
public Integer getBusinessCode() {
|
||||
return businessCode;
|
||||
}
|
||||
public void setBusinessCode(Integer businessCode) {
|
||||
this.businessCode = businessCode;
|
||||
}
|
||||
public String getReason() {
|
||||
return reason;
|
||||
}
|
||||
public void setReason(String reason) {
|
||||
this.reason = reason;
|
||||
}
|
||||
public String getMsg() {
|
||||
return msg;
|
||||
}
|
||||
public void setMsg(String msg) {
|
||||
this.msg = msg;
|
||||
}
|
||||
public String getFromuri() {
|
||||
return fromuri;
|
||||
}
|
||||
public void setFromuri(String fromuri) {
|
||||
this.fromuri = fromuri;
|
||||
}
|
||||
public String getLogSource() {
|
||||
return logSource;
|
||||
}
|
||||
public void setLogSource(String logSource) {
|
||||
this.logSource = logSource;
|
||||
}
|
||||
public String getTraceCode() {
|
||||
return traceCode;
|
||||
}
|
||||
public void setTraceCode(String traceCode) {
|
||||
this.traceCode = traceCode;
|
||||
}
|
||||
public SysUserWarnData getData() {
|
||||
return data;
|
||||
}
|
||||
public void setData(SysUserWarnData data) {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -20,12 +20,14 @@ public class AsnIpCfg extends BaseCfg<AsnIpCfg> {
|
||||
@ExcelField(title="ip_type",dictType="IP_TYPE",sort=6)
|
||||
@SerializedName("ipType")
|
||||
private Integer ipType;
|
||||
@ExcelField(title="ip_pattern",dictType="IP_PATTERN",sort=8)
|
||||
private Integer ipPattern;
|
||||
private Integer srcIpPattern;
|
||||
@ExcelField(title="dest_ip_pattern",dictType="IP_PATTERN",sort=8)
|
||||
private Integer destIpPattern;
|
||||
private String srcIpAddress;
|
||||
@ExcelField(title="ip",sort=7)
|
||||
private String destIpAddress;
|
||||
private Integer portPattern;
|
||||
private Integer srcPortPattern;
|
||||
private Integer destPortPattern;
|
||||
private String srcPort;
|
||||
private String destPort;
|
||||
//@ExcelField(title="group",sort=2)
|
||||
@@ -117,11 +119,30 @@ public class AsnIpCfg extends BaseCfg<AsnIpCfg> {
|
||||
public void setIpType(Integer ipType) {
|
||||
this.ipType = ipType;
|
||||
}
|
||||
public Integer getIpPattern() {
|
||||
return ipPattern;
|
||||
|
||||
public Integer getSrcIpPattern() {
|
||||
return srcIpPattern;
|
||||
}
|
||||
public void setIpPattern(Integer ipPattern) {
|
||||
this.ipPattern = ipPattern;
|
||||
public void setSrcIpPattern(Integer srcIpPattern) {
|
||||
this.srcIpPattern = srcIpPattern;
|
||||
}
|
||||
public Integer getDestIpPattern() {
|
||||
return destIpPattern;
|
||||
}
|
||||
public void setDestIpPattern(Integer destIpPattern) {
|
||||
this.destIpPattern = destIpPattern;
|
||||
}
|
||||
public Integer getSrcPortPattern() {
|
||||
return srcPortPattern;
|
||||
}
|
||||
public void setSrcPortPattern(Integer srcPortPattern) {
|
||||
this.srcPortPattern = srcPortPattern;
|
||||
}
|
||||
public Integer getDestPortPattern() {
|
||||
return destPortPattern;
|
||||
}
|
||||
public void setDestPortPattern(Integer destPortPattern) {
|
||||
this.destPortPattern = destPortPattern;
|
||||
}
|
||||
public String getSrcIpAddress() {
|
||||
return srcIpAddress;
|
||||
@@ -135,12 +156,6 @@ public class AsnIpCfg extends BaseCfg<AsnIpCfg> {
|
||||
public void setDestIpAddress(String destIpAddress) {
|
||||
this.destIpAddress = destIpAddress;
|
||||
}
|
||||
public Integer getPortPattern() {
|
||||
return portPattern;
|
||||
}
|
||||
public void setPortPattern(Integer portPattern) {
|
||||
this.portPattern = portPattern;
|
||||
}
|
||||
public String getSrcPort() {
|
||||
return srcPort;
|
||||
}
|
||||
@@ -176,9 +191,10 @@ public class AsnIpCfg extends BaseCfg<AsnIpCfg> {
|
||||
}
|
||||
@Override
|
||||
public String toString() {
|
||||
return "AsnIpCfg [regionId=" + regionId + ", ratelimit=" + ratelimit + ", ipType=" + ipType + ", ipPattern="
|
||||
+ ipPattern + ", srcIpAddress=" + srcIpAddress + ", destIpAddress=" + destIpAddress + ", portPattern="
|
||||
+ portPattern + ", srcPort=" + srcPort + ", destPort=" + destPort + ", asnIpGroupName=" + asnIpGroupName
|
||||
return "AsnIpCfg [regionId=" + regionId + ", ratelimit=" + ratelimit + ", ipType=" + ipType + ", srcIpPattern="
|
||||
+ srcIpPattern + ", destIpPattern="+ destIpPattern+ ", srcIpAddress=" + srcIpAddress + ", destIpAddress="
|
||||
+ destIpAddress + ", srcPortPattern="+ srcPortPattern+", destPortPattern="+ destPortPattern + ", srcPort="
|
||||
+ srcPort + ", destPort=" + destPort + ", asnIpGroupName=" + asnIpGroupName
|
||||
+ ", asnIpGroup=" + asnIpGroup + ", direction=" + direction + ", protocol=" + protocol + ", protocolId="
|
||||
+ protocolId + ", compileId=" + compileId + ", isValid=" + isValid + ", userRegion1=" + userRegion1
|
||||
+ ", userRegion2=" + userRegion2 + ", userRegion3=" + userRegion3 + ", userRegion4=" + userRegion4
|
||||
|
||||
74
src/main/java/com/nis/domain/basics/CommonGroupInfo.java
Normal file
74
src/main/java/com/nis/domain/basics/CommonGroupInfo.java
Normal file
@@ -0,0 +1,74 @@
|
||||
package com.nis.domain.basics;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import com.nis.domain.configuration.BaseCfg;
|
||||
import com.nis.util.excel.ExcelField;
|
||||
|
||||
/**
|
||||
* 公共分组实体
|
||||
*/
|
||||
public class CommonGroupInfo extends BaseCfg<CommonGroupInfo> implements Serializable{
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 7931466570918016654L;
|
||||
|
||||
private Integer groupId;
|
||||
|
||||
@ExcelField(title="group_name",sort=1)
|
||||
private String groupName;
|
||||
|
||||
@ExcelField(title="group_type",dictType="GROUP_TYPE",sort=2)
|
||||
private Integer groupType;
|
||||
|
||||
private Integer serviceGroupId;
|
||||
|
||||
@ExcelField(title="desc",sort=4)
|
||||
private String description;
|
||||
|
||||
public Integer getServiceGroupId() {
|
||||
return serviceGroupId;
|
||||
}
|
||||
public void setServiceGroupId(Integer serviceGroupId) {
|
||||
this.serviceGroupId = serviceGroupId;
|
||||
}
|
||||
public Integer getGroupId() {
|
||||
return groupId;
|
||||
}
|
||||
public void setGroupId(Integer groupId) {
|
||||
this.groupId = groupId;
|
||||
}
|
||||
public String getGroupName() {
|
||||
return groupName;
|
||||
}
|
||||
public void setGroupName(String groupName) {
|
||||
this.groupName = groupName;
|
||||
}
|
||||
public Date getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
public void setCreateTime(Date createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
public Date getEditTime() {
|
||||
return editTime;
|
||||
}
|
||||
public void setEditTime(Date editTime) {
|
||||
this.editTime = editTime;
|
||||
}
|
||||
public Integer getGroupType() {
|
||||
return groupType;
|
||||
}
|
||||
public void setGroupType(Integer groupType) {
|
||||
this.groupType = groupType;
|
||||
}
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
}
|
||||
67
src/main/java/com/nis/domain/basics/DomainCommCfg.java
Normal file
67
src/main/java/com/nis/domain/basics/DomainCommCfg.java
Normal file
@@ -0,0 +1,67 @@
|
||||
package com.nis.domain.basics;
|
||||
|
||||
import com.nis.domain.configuration.BaseStringCfg;
|
||||
import com.nis.util.excel.ExcelField;
|
||||
|
||||
public class DomainCommCfg extends BaseStringCfg<DomainCommCfg>{
|
||||
|
||||
private static final long serialVersionUID = 5117517145731135023L;
|
||||
private static final String tableName="domain_comm_cfg";
|
||||
|
||||
@ExcelField(title="key_word",sort=3)
|
||||
protected String cfgKeywords;
|
||||
|
||||
protected Integer isHexbin;
|
||||
|
||||
protected String ratelimit;
|
||||
|
||||
@ExcelField(title="group_name",sort=2)
|
||||
protected String groupName;//公共组名称
|
||||
|
||||
@ExcelField(title="expression_type",dictType="EXPRESSION_TYPE",sort=18)
|
||||
protected Integer exprType;
|
||||
|
||||
@ExcelField(title="match_method",dictType="MATCH_METHOD",sort=20)
|
||||
protected Integer matchMethod;
|
||||
|
||||
public String getCfgKeywords() {
|
||||
return cfgKeywords;
|
||||
}
|
||||
public void setCfgKeywords(String cfgKeywords) {
|
||||
this.cfgKeywords = cfgKeywords;
|
||||
}
|
||||
public Integer getIsHexbin() {
|
||||
return isHexbin;
|
||||
}
|
||||
public void setIsHexbin(Integer isHexbin) {
|
||||
this.isHexbin = isHexbin;
|
||||
}
|
||||
public String getRatelimit() {
|
||||
return ratelimit;
|
||||
}
|
||||
public void setRatelimit(String ratelimit) {
|
||||
this.ratelimit = ratelimit;
|
||||
}
|
||||
public static String getTablename() {
|
||||
return tableName;
|
||||
}
|
||||
public String getGroupName() {
|
||||
return groupName;
|
||||
}
|
||||
public void setGroupName(String groupName) {
|
||||
this.groupName = groupName;
|
||||
}
|
||||
public Integer getMatchMethod() {
|
||||
return matchMethod;
|
||||
}
|
||||
public void setMatchMethod(Integer matchMethod) {
|
||||
this.matchMethod = matchMethod;
|
||||
}
|
||||
public Integer getExprType() {
|
||||
return exprType;
|
||||
}
|
||||
public void setExprType(Integer exprType) {
|
||||
this.exprType = exprType;
|
||||
}
|
||||
|
||||
}
|
||||
312
src/main/java/com/nis/domain/basics/IpCommCfg.java
Normal file
312
src/main/java/com/nis/domain/basics/IpCommCfg.java
Normal file
@@ -0,0 +1,312 @@
|
||||
package com.nis.domain.basics;
|
||||
|
||||
import com.google.gson.annotations.Expose;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import com.nis.domain.configuration.BaseCfg;
|
||||
import com.nis.util.excel.ExcelField;
|
||||
|
||||
public class IpCommCfg extends BaseCfg<IpCommCfg> {
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 4218856118489784060L;
|
||||
|
||||
/**
|
||||
* 创建一个新的实例 BaseIpCfg.
|
||||
*
|
||||
*/
|
||||
public IpCommCfg() {
|
||||
super();
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
private static final String indexTable="ip_comm_cfg";
|
||||
/**
|
||||
* ip类型
|
||||
*/
|
||||
@Expose
|
||||
@SerializedName("ipType")
|
||||
@ExcelField(title="ip_type",dictType="IP_TYPE",sort=50)
|
||||
protected Integer ipType;
|
||||
@ExcelField(title="src_ip_pattern",dictType="IP_PATTERN",sort=51)
|
||||
protected Integer srcIpPattern;
|
||||
@ExcelField(title="client_ip",sort=52)
|
||||
protected String srcIpAddress;
|
||||
@ExcelField(title="dest_ip_pattern",dictType="IP_PATTERN",sort=53)
|
||||
protected Integer destIpPattern;
|
||||
@ExcelField(title="server_ip",sort=54)
|
||||
protected String destIpAddress;
|
||||
@ExcelField(title="src_port_pattern",dictType="PORT_PATTERN",sort=54)
|
||||
protected Integer srcPortPattern;
|
||||
@ExcelField(title="dest_port_pattern",dictType="PORT_PATTERN",sort=56)
|
||||
protected Integer destPortPattern;
|
||||
@ExcelField(title="client_port",sort=55)
|
||||
protected String srcPort;
|
||||
@ExcelField(title="server_port",sort=57)
|
||||
protected String destPort;
|
||||
protected Integer dnsStrategyId;
|
||||
@ExcelField(title="ir_type",dictType="IR_TYPE",sort=58)
|
||||
protected Integer irType;
|
||||
@ExcelField(title="group_name",sort=45)
|
||||
protected String groupName;
|
||||
// @ExcelField(title="log_total",sort=42)
|
||||
private Long totalLogs;
|
||||
private Integer regionId;
|
||||
private Integer groupId;
|
||||
|
||||
public Integer getRegionId() {
|
||||
return regionId;
|
||||
}
|
||||
public void setRegionId(Integer regionId) {
|
||||
this.regionId = regionId;
|
||||
}
|
||||
public Integer getGroupId() {
|
||||
return groupId;
|
||||
}
|
||||
public void setGroupId(Integer groupId) {
|
||||
this.groupId = groupId;
|
||||
}
|
||||
public Long getTotalLogs() {
|
||||
return totalLogs;
|
||||
}
|
||||
public void setTotalLogs(Long totalLogs) {
|
||||
this.totalLogs = totalLogs;
|
||||
}
|
||||
/**
|
||||
* irType
|
||||
* @return irType
|
||||
*/
|
||||
|
||||
public Integer getIrType() {
|
||||
return irType;
|
||||
}
|
||||
/**
|
||||
* @param irType the irType to set
|
||||
*/
|
||||
public void setIrType(Integer irType) {
|
||||
this.irType = irType;
|
||||
}
|
||||
/**
|
||||
* groupName
|
||||
* @return groupName
|
||||
*/
|
||||
|
||||
public String getGroupName() {
|
||||
return groupName;
|
||||
}
|
||||
/**
|
||||
* @param groupName the groupName to set
|
||||
*/
|
||||
public void setGroupName(String groupName) {
|
||||
this.groupName = groupName;
|
||||
}
|
||||
/**
|
||||
* 方向
|
||||
*/
|
||||
@Expose
|
||||
@SerializedName("direction")
|
||||
@ExcelField(title="direction",dictType="DIRECTION",sort=58)
|
||||
protected Integer direction ;
|
||||
/**
|
||||
* 协议
|
||||
*/
|
||||
@Expose
|
||||
@SerializedName("protocol")
|
||||
@ExcelField(title="protocol",dictType="PROTOCOL",sort=59)
|
||||
protected Integer protocol ;
|
||||
/**
|
||||
* 协议ID
|
||||
*/
|
||||
@Expose
|
||||
@SerializedName("protocolId")
|
||||
protected Integer protocolId ;
|
||||
/**
|
||||
* 限速比例
|
||||
*/
|
||||
protected String ratelimit ;
|
||||
|
||||
/**
|
||||
* ratelimit
|
||||
* @return ratelimit
|
||||
*/
|
||||
|
||||
public String getRatelimit() {
|
||||
return ratelimit;
|
||||
}
|
||||
/**
|
||||
* @param ratelimit the ratelimit to set
|
||||
*/
|
||||
public void setRatelimit(String ratelimit) {
|
||||
this.ratelimit = ratelimit;
|
||||
}
|
||||
/**
|
||||
* ipType
|
||||
* @return ipType
|
||||
*/
|
||||
|
||||
public Integer getIpType() {
|
||||
return ipType;
|
||||
}
|
||||
/**
|
||||
* @param ipType the ipType to set
|
||||
*/
|
||||
public void setIpType(Integer ipType) {
|
||||
this.ipType = ipType;
|
||||
}
|
||||
|
||||
/**
|
||||
* direction
|
||||
* @return direction
|
||||
*/
|
||||
|
||||
public Integer getDirection() {
|
||||
return direction;
|
||||
}
|
||||
/**
|
||||
* @param direction the direction to set
|
||||
*/
|
||||
public void setDirection(Integer direction) {
|
||||
this.direction = direction;
|
||||
}
|
||||
/**
|
||||
* protocol
|
||||
* @return protocol
|
||||
*/
|
||||
|
||||
public Integer getProtocol() {
|
||||
return protocol;
|
||||
}
|
||||
/**
|
||||
* @param protocol the protocol to set
|
||||
*/
|
||||
public void setProtocol(Integer protocol) {
|
||||
this.protocol = protocol;
|
||||
}
|
||||
/**
|
||||
* protocolId
|
||||
* @return protocolId
|
||||
*/
|
||||
|
||||
public Integer getProtocolId() {
|
||||
return protocolId;
|
||||
}
|
||||
/**
|
||||
* @param protocolId the protocolId to set
|
||||
*/
|
||||
public void setProtocolId(Integer protocolId) {
|
||||
this.protocolId = protocolId;
|
||||
}
|
||||
|
||||
|
||||
public Integer getSrcIpPattern() {
|
||||
return srcIpPattern;
|
||||
}
|
||||
public void setSrcIpPattern(Integer srcIpPattern) {
|
||||
this.srcIpPattern = srcIpPattern;
|
||||
}
|
||||
public Integer getDestIpPattern() {
|
||||
return destIpPattern;
|
||||
}
|
||||
public void setDestIpPattern(Integer destIpPattern) {
|
||||
this.destIpPattern = destIpPattern;
|
||||
}
|
||||
public Integer getSrcPortPattern() {
|
||||
return srcPortPattern;
|
||||
}
|
||||
public void setSrcPortPattern(Integer srcPortPattern) {
|
||||
this.srcPortPattern = srcPortPattern;
|
||||
}
|
||||
public Integer getDestPortPattern() {
|
||||
return destPortPattern;
|
||||
}
|
||||
public void setDestPortPattern(Integer destPortPattern) {
|
||||
this.destPortPattern = destPortPattern;
|
||||
}
|
||||
/**
|
||||
* srcIpAddress
|
||||
* @return srcIpAddress
|
||||
*/
|
||||
|
||||
public String getSrcIpAddress() {
|
||||
return srcIpAddress;
|
||||
}
|
||||
/**
|
||||
* @param srcIpAddress the srcIpAddress to set
|
||||
*/
|
||||
public void setSrcIpAddress(String srcIpAddress) {
|
||||
this.srcIpAddress = srcIpAddress;
|
||||
}
|
||||
/**
|
||||
* destIpAddress
|
||||
* @return destIpAddress
|
||||
*/
|
||||
|
||||
public String getDestIpAddress() {
|
||||
return destIpAddress;
|
||||
}
|
||||
/**
|
||||
* @param destIpAddress the destIpAddress to set
|
||||
*/
|
||||
public void setDestIpAddress(String destIpAddress) {
|
||||
this.destIpAddress = destIpAddress;
|
||||
}
|
||||
/**
|
||||
* srcPort
|
||||
* @return srcPort
|
||||
*/
|
||||
|
||||
public String getSrcPort() {
|
||||
return srcPort;
|
||||
}
|
||||
/**
|
||||
* @param srcPort the srcPort to set
|
||||
*/
|
||||
public void setSrcPort(String srcPort) {
|
||||
this.srcPort = srcPort;
|
||||
}
|
||||
/**
|
||||
* destPort
|
||||
* @return destPort
|
||||
*/
|
||||
|
||||
public String getDestPort() {
|
||||
return destPort;
|
||||
}
|
||||
/**
|
||||
* @param destPort the destPort to set
|
||||
*/
|
||||
public void setDestPort(String destPort) {
|
||||
this.destPort = destPort;
|
||||
}
|
||||
|
||||
/**
|
||||
* dnsStrategyId
|
||||
* @return dnsStrategyId
|
||||
*/
|
||||
|
||||
public Integer getDnsStrategyId() {
|
||||
return dnsStrategyId;
|
||||
}
|
||||
/**
|
||||
* @param dnsStrategyId the dnsStrategyId to set
|
||||
*/
|
||||
public void setDnsStrategyId(Integer dnsStrategyId) {
|
||||
this.dnsStrategyId = dnsStrategyId;
|
||||
}
|
||||
@Override
|
||||
public void initDefaultValue(){
|
||||
super.initDefaultValue();
|
||||
this.direction = 0;
|
||||
}
|
||||
|
||||
public static String getIndexTable() {
|
||||
return indexTable;
|
||||
}
|
||||
public Integer getIndex() {
|
||||
return index;
|
||||
}
|
||||
public void setIndex(Integer index) {
|
||||
this.index = index;
|
||||
}
|
||||
}
|
||||
57
src/main/java/com/nis/domain/basics/ProtectionListInfo.java
Normal file
57
src/main/java/com/nis/domain/basics/ProtectionListInfo.java
Normal file
@@ -0,0 +1,57 @@
|
||||
package com.nis.domain.basics;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import com.nis.domain.configuration.BaseCfg;
|
||||
|
||||
public class ProtectionListInfo extends BaseCfg<ProtectionListInfo> implements Serializable{
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = -3781310894175345207L;
|
||||
private Integer proId;
|
||||
private String keyword;
|
||||
private String targetType;
|
||||
private String description;
|
||||
|
||||
|
||||
public Integer getProId() {
|
||||
return proId;
|
||||
}
|
||||
public void setProId(Integer proId) {
|
||||
this.proId = proId;
|
||||
}
|
||||
public String getKeyword() {
|
||||
return keyword;
|
||||
}
|
||||
public void setKeyword(String keyword) {
|
||||
this.keyword = keyword;
|
||||
}
|
||||
public String getTargetType() {
|
||||
return targetType;
|
||||
}
|
||||
public void setTargetType(String targetType) {
|
||||
this.targetType = targetType;
|
||||
}
|
||||
public Date getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
public void setCreateTime(Date createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
public Date getEditTime() {
|
||||
return editTime;
|
||||
}
|
||||
public void setEditTime(Date editTime) {
|
||||
this.editTime = editTime;
|
||||
}
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
}
|
||||
67
src/main/java/com/nis/domain/basics/ScriberIdCommCfg.java
Normal file
67
src/main/java/com/nis/domain/basics/ScriberIdCommCfg.java
Normal file
@@ -0,0 +1,67 @@
|
||||
package com.nis.domain.basics;
|
||||
|
||||
import com.nis.domain.configuration.BaseStringCfg;
|
||||
import com.nis.util.excel.ExcelField;
|
||||
|
||||
public class ScriberIdCommCfg extends BaseStringCfg<ScriberIdCommCfg>{
|
||||
|
||||
private static final long serialVersionUID = 5117517145731135023L;
|
||||
private static final String tableName="scriberid_comm_cfg";
|
||||
|
||||
@ExcelField(title="key_word",sort=3)
|
||||
protected String cfgKeywords;
|
||||
|
||||
protected Integer isHexbin;
|
||||
|
||||
protected String ratelimit;
|
||||
|
||||
@ExcelField(title="group_name",sort=2)
|
||||
protected String groupName;//公共组名称
|
||||
|
||||
@ExcelField(title="expression_type",dictType="EXPRESSION_TYPE",sort=18)
|
||||
protected Integer exprType;
|
||||
|
||||
@ExcelField(title="match_method",dictType="MATCH_METHOD",sort=20)
|
||||
protected Integer matchMethod;
|
||||
|
||||
public String getCfgKeywords() {
|
||||
return cfgKeywords;
|
||||
}
|
||||
public void setCfgKeywords(String cfgKeywords) {
|
||||
this.cfgKeywords = cfgKeywords;
|
||||
}
|
||||
public Integer getIsHexbin() {
|
||||
return isHexbin;
|
||||
}
|
||||
public void setIsHexbin(Integer isHexbin) {
|
||||
this.isHexbin = isHexbin;
|
||||
}
|
||||
public String getRatelimit() {
|
||||
return ratelimit;
|
||||
}
|
||||
public void setRatelimit(String ratelimit) {
|
||||
this.ratelimit = ratelimit;
|
||||
}
|
||||
public static String getTablename() {
|
||||
return tableName;
|
||||
}
|
||||
public String getGroupName() {
|
||||
return groupName;
|
||||
}
|
||||
public void setGroupName(String groupName) {
|
||||
this.groupName = groupName;
|
||||
}
|
||||
public Integer getMatchMethod() {
|
||||
return matchMethod;
|
||||
}
|
||||
public void setMatchMethod(Integer matchMethod) {
|
||||
this.matchMethod = matchMethod;
|
||||
}
|
||||
public Integer getExprType() {
|
||||
return exprType;
|
||||
}
|
||||
public void setExprType(Integer exprType) {
|
||||
this.exprType = exprType;
|
||||
}
|
||||
|
||||
}
|
||||
66
src/main/java/com/nis/domain/basics/UrlCommCfg.java
Normal file
66
src/main/java/com/nis/domain/basics/UrlCommCfg.java
Normal file
@@ -0,0 +1,66 @@
|
||||
package com.nis.domain.basics;
|
||||
|
||||
import com.nis.domain.configuration.BaseStringCfg;
|
||||
import com.nis.util.excel.ExcelField;
|
||||
|
||||
public class UrlCommCfg extends BaseStringCfg<UrlCommCfg>{
|
||||
|
||||
private static final long serialVersionUID = 398247881810945300L;
|
||||
private static final String tableName="url_comm_cfg";
|
||||
|
||||
@ExcelField(title="key_word",sort=3)
|
||||
protected String cfgKeywords;//url关键字配置
|
||||
|
||||
protected Integer isHexbin;//是否大小写敏感
|
||||
protected String ratelimit;//限速比例,0到1之间
|
||||
@ExcelField(title="group_name",sort=2)
|
||||
protected String groupName;//公共组名称
|
||||
|
||||
@ExcelField(title="expression_type",dictType="EXPRESSION_TYPE",sort=18)
|
||||
protected Integer exprType;
|
||||
|
||||
@ExcelField(title="match_method",dictType="MATCH_METHOD",sort=20)
|
||||
protected Integer matchMethod;
|
||||
|
||||
public String getCfgKeywords() {
|
||||
return cfgKeywords;
|
||||
}
|
||||
public void setCfgKeywords(String cfgKeywords) {
|
||||
this.cfgKeywords = cfgKeywords;
|
||||
}
|
||||
public Integer getIsHexbin() {
|
||||
return isHexbin;
|
||||
}
|
||||
public void setIsHexbin(Integer isHexbin) {
|
||||
this.isHexbin = isHexbin;
|
||||
}
|
||||
public String getRatelimit() {
|
||||
return ratelimit;
|
||||
}
|
||||
public void setRatelimit(String ratelimit) {
|
||||
this.ratelimit = ratelimit;
|
||||
}
|
||||
public static String getTablename() {
|
||||
return tableName;
|
||||
}
|
||||
|
||||
public String getGroupName() {
|
||||
return groupName;
|
||||
}
|
||||
public void setGroupName(String groupName) {
|
||||
this.groupName = groupName;
|
||||
}
|
||||
public Integer getMatchMethod() {
|
||||
return matchMethod;
|
||||
}
|
||||
public void setMatchMethod(Integer matchMethod) {
|
||||
this.matchMethod = matchMethod;
|
||||
}
|
||||
public Integer getExprType() {
|
||||
return exprType;
|
||||
}
|
||||
public void setExprType(Integer exprType) {
|
||||
this.exprType = exprType;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
package com.nis.domain.callback;
|
||||
|
||||
import com.nis.domain.configuration.BaseCfg;
|
||||
import com.nis.util.excel.ExcelField;
|
||||
|
||||
/**
|
||||
* http代理劫持文件
|
||||
* @author lenovo
|
||||
*
|
||||
*/
|
||||
public class ProxyFileHijackCfg extends BaseCfg<ProxyFileHijackCfg>{
|
||||
|
||||
private static final long serialVersionUID = -4600604393808056286L;
|
||||
public String indexTable = "pxy_profile_hijack_files";//对应表名
|
||||
@ExcelField(title="profile_name",sort=1)
|
||||
private String profileName;//名称,辅助记忆
|
||||
@ExcelField(title="content_type",sort=3)
|
||||
private String contentType;//填充HTTP content-type,如“video/mp4” (exe、apk)
|
||||
@ExcelField(title="hijack_file_strategy",sort=2)
|
||||
private String path;//储存路径
|
||||
@ExcelField(title="content_name",sort=4)
|
||||
private String contentName;//内容格式
|
||||
|
||||
public String getContentName() {
|
||||
return contentName;
|
||||
}
|
||||
public void setContentName(String contentName) {
|
||||
this.contentName = contentName;
|
||||
}
|
||||
public String getIndexTable() {
|
||||
return indexTable;
|
||||
}
|
||||
public void setIndexTable(String indexTable) {
|
||||
this.indexTable = indexTable;
|
||||
}
|
||||
public String getProfileName() {
|
||||
return profileName;
|
||||
}
|
||||
public void setProfileName(String profileName) {
|
||||
this.profileName = profileName;
|
||||
}
|
||||
public String getContentType() {
|
||||
return contentType;
|
||||
}
|
||||
public void setContentType(String contentType) {
|
||||
this.contentType = contentType;
|
||||
}
|
||||
public String getPath() {
|
||||
return path;
|
||||
}
|
||||
public void setPath(String path) {
|
||||
this.path = path;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,114 @@
|
||||
package com.nis.domain.callback;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import com.google.gson.annotations.Expose;
|
||||
|
||||
public class ProxyFileHijackCfgAudit {
|
||||
|
||||
@Expose
|
||||
private Long id; //compileId
|
||||
@Expose
|
||||
private Integer cfgId; //compileId
|
||||
@Expose
|
||||
private Integer profileId;//compileId
|
||||
@Expose
|
||||
private Integer action;
|
||||
@Expose
|
||||
private Integer service;
|
||||
@Expose
|
||||
private Integer isValid;
|
||||
@Expose
|
||||
private Date opTime;
|
||||
@Expose
|
||||
private String profileName;
|
||||
@Expose
|
||||
private String contentType;
|
||||
@Expose
|
||||
private String path;
|
||||
@Expose
|
||||
private String contentName;
|
||||
@Expose
|
||||
private Long opUser;
|
||||
|
||||
public Long getOpUser() {
|
||||
return opUser;
|
||||
}
|
||||
public void setOpUser(Long opUser) {
|
||||
this.opUser = opUser;
|
||||
}
|
||||
|
||||
public String getContentName() {
|
||||
return contentName;
|
||||
}
|
||||
|
||||
public void setContentName(String contentName) {
|
||||
this.contentName = contentName;
|
||||
}
|
||||
|
||||
public String getPath() {
|
||||
return path;
|
||||
}
|
||||
|
||||
public void setPath(String path) {
|
||||
this.path = path;
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public Integer getProfileId() {
|
||||
return profileId;
|
||||
}
|
||||
|
||||
public void setProfileId(Integer profileId) {
|
||||
this.profileId = profileId;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
public Integer getCfgId() {
|
||||
return cfgId;
|
||||
}
|
||||
public void setCfgId(Integer cfgId) {
|
||||
this.cfgId = cfgId;
|
||||
}
|
||||
public Integer getAction() {
|
||||
return action;
|
||||
}
|
||||
public void setAction(Integer action) {
|
||||
this.action = action;
|
||||
}
|
||||
public Integer getService() {
|
||||
return service;
|
||||
}
|
||||
public void setService(Integer service) {
|
||||
this.service = service;
|
||||
}
|
||||
public Integer getIsValid() {
|
||||
return isValid;
|
||||
}
|
||||
public void setIsValid(Integer isValid) {
|
||||
this.isValid = isValid;
|
||||
}
|
||||
public Date getOpTime() {
|
||||
return opTime;
|
||||
}
|
||||
public void setOpTime(Date opTime) {
|
||||
this.opTime = opTime;
|
||||
}
|
||||
public String getProfileName() {
|
||||
return profileName;
|
||||
}
|
||||
public void setProfileName(String profileName) {
|
||||
this.profileName = profileName;
|
||||
}
|
||||
public String getContentType() {
|
||||
return contentType;
|
||||
}
|
||||
public void setContentType(String contentType) {
|
||||
this.contentType = contentType;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package com.nis.domain.callback;
|
||||
|
||||
import com.nis.domain.configuration.BaseCfg;
|
||||
import com.nis.util.excel.ExcelField;
|
||||
|
||||
public class ProxyFileInsertScriptCfg extends BaseCfg<ProxyFileInsertScriptCfg>{
|
||||
|
||||
private static final long serialVersionUID = 4705202662940705064L;
|
||||
public String indexTable = "pxy_profile_insert_scripts";//对应表名
|
||||
@ExcelField(title="script_name",sort=1)
|
||||
private String cfgDesc;//名称,辅助记忆
|
||||
@ExcelField(title="script_format",sort=3)
|
||||
private String format;//css/js
|
||||
@ExcelField(title="script_file",sort=2)
|
||||
private String path;//储存路径
|
||||
public String getIndexTable() {
|
||||
return indexTable;
|
||||
}
|
||||
public void setIndexTable(String indexTable) {
|
||||
this.indexTable = indexTable;
|
||||
}
|
||||
public String getCfgDesc() {
|
||||
return cfgDesc;
|
||||
}
|
||||
public void setCfgDesc(String cfgDesc) {
|
||||
this.cfgDesc = cfgDesc;
|
||||
}
|
||||
public String getFormat() {
|
||||
return format;
|
||||
}
|
||||
public void setFormat(String format) {
|
||||
this.format = format;
|
||||
}
|
||||
public String getPath() {
|
||||
return path;
|
||||
}
|
||||
public void setPath(String path) {
|
||||
this.path = path;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
package com.nis.domain.callback;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import com.google.gson.annotations.Expose;
|
||||
|
||||
public class ProxyFileInsertScriptCfgAudit {
|
||||
@Expose
|
||||
private Long id; //compileId
|
||||
@Expose
|
||||
private Integer cfgId; //compileId
|
||||
@Expose
|
||||
private Integer profileId;//compileId
|
||||
@Expose
|
||||
private Integer action;
|
||||
@Expose
|
||||
private Integer service;
|
||||
@Expose
|
||||
private Integer isValid;
|
||||
@Expose
|
||||
private Date opTime;
|
||||
@Expose
|
||||
private String profileName;
|
||||
@Expose
|
||||
private String format;
|
||||
@Expose
|
||||
private String path;
|
||||
@Expose
|
||||
private Long opUser;
|
||||
|
||||
public Long getOpUser() {
|
||||
return opUser;
|
||||
}
|
||||
public void setOpUser(Long opUser) {
|
||||
this.opUser = opUser;
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
public Integer getCfgId() {
|
||||
return cfgId;
|
||||
}
|
||||
public void setCfgId(Integer cfgId) {
|
||||
this.cfgId = cfgId;
|
||||
}
|
||||
public Integer getProfileId() {
|
||||
return profileId;
|
||||
}
|
||||
public void setProfileId(Integer profileId) {
|
||||
this.profileId = profileId;
|
||||
}
|
||||
public Integer getAction() {
|
||||
return action;
|
||||
}
|
||||
public void setAction(Integer action) {
|
||||
this.action = action;
|
||||
}
|
||||
public Integer getService() {
|
||||
return service;
|
||||
}
|
||||
public void setService(Integer service) {
|
||||
this.service = service;
|
||||
}
|
||||
public Integer getIsValid() {
|
||||
return isValid;
|
||||
}
|
||||
public void setIsValid(Integer isValid) {
|
||||
this.isValid = isValid;
|
||||
}
|
||||
public Date getOpTime() {
|
||||
return opTime;
|
||||
}
|
||||
public void setOpTime(Date opTime) {
|
||||
this.opTime = opTime;
|
||||
}
|
||||
public String getProfileName() {
|
||||
return profileName;
|
||||
}
|
||||
public void setProfileName(String profileName) {
|
||||
this.profileName = profileName;
|
||||
}
|
||||
public String getFormat() {
|
||||
return format;
|
||||
}
|
||||
public void setFormat(String format) {
|
||||
this.format = format;
|
||||
}
|
||||
public String getPath() {
|
||||
return path;
|
||||
}
|
||||
public void setPath(String path) {
|
||||
this.path = path;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
package com.nis.domain.callback;
|
||||
|
||||
import com.nis.domain.configuration.BaseCfg;
|
||||
import com.nis.util.excel.ExcelField;
|
||||
/**
|
||||
* http代理文件策略
|
||||
* @author nanfang
|
||||
*
|
||||
*/
|
||||
public class ProxyFileResponsePageCfg extends BaseCfg<ProxyFileResponsePageCfg> {
|
||||
|
||||
private static final long serialVersionUID = -1989406217948847813L;
|
||||
public final static String TABLE_NAME = "pxy_profile_response_pages";//对应表名
|
||||
private String indexTable = "pxy_profile_response_pages";
|
||||
@ExcelField(title="file_desc",sort=1)
|
||||
private String fileDesc;//文件描述
|
||||
@ExcelField(title="response_file",sort=2)
|
||||
private String url;//文件保存的url
|
||||
@ExcelField(title="format",sort=3)
|
||||
private String contentType;//内容类型,如text/html,取字典表contentType
|
||||
private String md5;//文件md5值
|
||||
private Long contentLength;//文件长度
|
||||
|
||||
public String getIndexTable() {
|
||||
return indexTable;
|
||||
}
|
||||
|
||||
public void setIndexTable(String indexTable) {
|
||||
this.indexTable = indexTable;
|
||||
}
|
||||
|
||||
public ProxyFileResponsePageCfg() {
|
||||
super();
|
||||
}
|
||||
|
||||
public String getFileDesc() {
|
||||
return fileDesc;
|
||||
}
|
||||
public void setFileDesc(String fileDesc) {
|
||||
this.fileDesc = fileDesc;
|
||||
}
|
||||
public String getUrl() {
|
||||
return url;
|
||||
}
|
||||
public void setUrl(String url) {
|
||||
this.url = url;
|
||||
}
|
||||
public String getContentType() {
|
||||
return contentType;
|
||||
}
|
||||
public void setContentType(String contentType) {
|
||||
this.contentType = contentType;
|
||||
}
|
||||
public Long getContentLength() {
|
||||
return contentLength;
|
||||
}
|
||||
public void setContentLength(Long contentLength) {
|
||||
this.contentLength = contentLength;
|
||||
}
|
||||
public String getMd5() {
|
||||
return md5;
|
||||
}
|
||||
public void setMd5(String md5) {
|
||||
this.md5 = md5;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,106 @@
|
||||
package com.nis.domain.callback;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import com.google.gson.annotations.Expose;
|
||||
|
||||
public class ProxyFileResponsePageCfgAudit {
|
||||
@Expose
|
||||
private Long id; //compileId
|
||||
@Expose
|
||||
private Integer cfgId; //compileId
|
||||
@Expose
|
||||
private Integer action;
|
||||
@Expose
|
||||
private Integer service;
|
||||
@Expose
|
||||
private Integer isValid;
|
||||
@Expose
|
||||
private Date opTime;
|
||||
@Expose
|
||||
private String format;
|
||||
@Expose
|
||||
private Long contentLength;
|
||||
@Expose
|
||||
private String path;
|
||||
@Expose
|
||||
private Long profileId;
|
||||
@Expose
|
||||
private String profileName;
|
||||
@Expose
|
||||
private Long opUser;
|
||||
|
||||
public Long getOpUser() {
|
||||
return opUser;
|
||||
}
|
||||
public void setOpUser(Long opUser) {
|
||||
this.opUser = opUser;
|
||||
}
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
public Integer getCfgId() {
|
||||
return cfgId;
|
||||
}
|
||||
public void setCfgId(Integer cfgId) {
|
||||
this.cfgId = cfgId;
|
||||
}
|
||||
public Integer getAction() {
|
||||
return action;
|
||||
}
|
||||
public void setAction(Integer action) {
|
||||
this.action = action;
|
||||
}
|
||||
public Integer getService() {
|
||||
return service;
|
||||
}
|
||||
public void setService(Integer service) {
|
||||
this.service = service;
|
||||
}
|
||||
public Integer getIsValid() {
|
||||
return isValid;
|
||||
}
|
||||
public void setIsValid(Integer isValid) {
|
||||
this.isValid = isValid;
|
||||
}
|
||||
public Date getOpTime() {
|
||||
return opTime;
|
||||
}
|
||||
public void setOpTime(Date opTime) {
|
||||
this.opTime = opTime;
|
||||
}
|
||||
public String getFormat() {
|
||||
return format;
|
||||
}
|
||||
public void setFormat(String format) {
|
||||
this.format = format;
|
||||
}
|
||||
public Long getContentLength() {
|
||||
return contentLength;
|
||||
}
|
||||
public void setContentLength(Long contentLength) {
|
||||
this.contentLength = contentLength;
|
||||
}
|
||||
public String getPath() {
|
||||
return path;
|
||||
}
|
||||
public void setPath(String path) {
|
||||
this.path = path;
|
||||
}
|
||||
public Long getProfileId() {
|
||||
return profileId;
|
||||
}
|
||||
public void setProfileId(Long profileId) {
|
||||
this.profileId = profileId;
|
||||
}
|
||||
public String getProfileName() {
|
||||
return profileName;
|
||||
}
|
||||
public void setProfileName(String profileName) {
|
||||
this.profileName = profileName;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -9,12 +9,21 @@ import com.nis.domain.configuration.BaseCfg;
|
||||
public class ProxyFileStrategyCfg extends BaseCfg<ProxyFileStrategyCfg> {
|
||||
private static final long serialVersionUID = 4283944377949702481L;
|
||||
public final static String TABLE_NAME = "PROXY_FILE_STRATEGY_CFG";//对应表名
|
||||
private String indexTable = "proxy_file_strategy_cfg";
|
||||
private String fileDesc;//文件描述
|
||||
private String url;//文件保存的url
|
||||
private String contentType;//内容类型,如text/html,取字典表contentType
|
||||
private String md5;//文件md5值
|
||||
private Long contentLength;//文件长度
|
||||
|
||||
public String getIndexTable() {
|
||||
return indexTable;
|
||||
}
|
||||
|
||||
public void setIndexTable(String indexTable) {
|
||||
this.indexTable = indexTable;
|
||||
}
|
||||
|
||||
public ProxyFileStrategyCfg() {
|
||||
super();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,106 @@
|
||||
package com.nis.domain.callback;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import com.google.gson.annotations.Expose;
|
||||
|
||||
public class ProxyFileStrategyCfgAudit {
|
||||
@Expose
|
||||
private Long id; //compileId
|
||||
@Expose
|
||||
private Integer cfgId; //compileId
|
||||
@Expose
|
||||
private Integer action;
|
||||
@Expose
|
||||
private Integer service;
|
||||
@Expose
|
||||
private Integer isValid;
|
||||
@Expose
|
||||
private Date opTime;
|
||||
@Expose
|
||||
private String contentType;
|
||||
@Expose
|
||||
private Long contentLength;
|
||||
@Expose
|
||||
private String filePath;
|
||||
@Expose
|
||||
private Long fileId;
|
||||
@Expose
|
||||
private String fileDesc;
|
||||
@Expose
|
||||
private Long opUser;
|
||||
|
||||
public Long getOpUser() {
|
||||
return opUser;
|
||||
}
|
||||
public void setOpUser(Long opUser) {
|
||||
this.opUser = opUser;
|
||||
}
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
public Integer getCfgId() {
|
||||
return cfgId;
|
||||
}
|
||||
public void setCfgId(Integer cfgId) {
|
||||
this.cfgId = cfgId;
|
||||
}
|
||||
public Integer getAction() {
|
||||
return action;
|
||||
}
|
||||
public void setAction(Integer action) {
|
||||
this.action = action;
|
||||
}
|
||||
public Integer getService() {
|
||||
return service;
|
||||
}
|
||||
public void setService(Integer service) {
|
||||
this.service = service;
|
||||
}
|
||||
public Integer getIsValid() {
|
||||
return isValid;
|
||||
}
|
||||
public void setIsValid(Integer isValid) {
|
||||
this.isValid = isValid;
|
||||
}
|
||||
public Date getOpTime() {
|
||||
return opTime;
|
||||
}
|
||||
public void setOpTime(Date opTime) {
|
||||
this.opTime = opTime;
|
||||
}
|
||||
public String getContentType() {
|
||||
return contentType;
|
||||
}
|
||||
public void setContentType(String contentType) {
|
||||
this.contentType = contentType;
|
||||
}
|
||||
public Long getContentLength() {
|
||||
return contentLength;
|
||||
}
|
||||
public void setContentLength(Long contentLength) {
|
||||
this.contentLength = contentLength;
|
||||
}
|
||||
public String getFilePath() {
|
||||
return filePath;
|
||||
}
|
||||
public void setFilePath(String filePath) {
|
||||
this.filePath = filePath;
|
||||
}
|
||||
public Long getFileId() {
|
||||
return fileId;
|
||||
}
|
||||
public void setFileId(Long fileId) {
|
||||
this.fileId = fileId;
|
||||
}
|
||||
public String getFileDesc() {
|
||||
return fileDesc;
|
||||
}
|
||||
public void setFileDesc(String fileDesc) {
|
||||
this.fileDesc = fileDesc;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package com.nis.domain.callback;
|
||||
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
import com.nis.domain.configuration.BaseCfg;
|
||||
import com.nis.util.excel.ExcelField;
|
||||
|
||||
import antlr.collections.List;
|
||||
|
||||
public class ProxyFileTrafficMirrorCfg extends BaseCfg<ProxyFileTrafficMirrorCfg>{
|
||||
|
||||
private static final long serialVersionUID = -5895958073449509268L;
|
||||
public String indexTable = "pxy_profile_traffic_mirror";//对应表名
|
||||
@ExcelField(title="address_name",sort=1)
|
||||
private String cfgDesc;//名称,辅助记忆
|
||||
@ExcelField(title="mirror_addr_list",sort=3)
|
||||
private String addrList;//目标表示列表
|
||||
@ExcelField(title="mirror_addr_type",sort=2)
|
||||
private String addrType;//目标表示类型
|
||||
public String getIndexTable() {
|
||||
return indexTable;
|
||||
}
|
||||
public void setIndexTable(String indexTable) {
|
||||
this.indexTable = indexTable;
|
||||
}
|
||||
public String getCfgDesc() {
|
||||
return cfgDesc;
|
||||
}
|
||||
public void setCfgDesc(String cfgDesc) {
|
||||
this.cfgDesc = cfgDesc;
|
||||
}
|
||||
public String getAddrList() {
|
||||
return addrList;
|
||||
}
|
||||
public void setAddrList(String addrList) {
|
||||
this.addrList = addrList;
|
||||
}
|
||||
public String getAddrType() {
|
||||
return addrType;
|
||||
}
|
||||
public void setAddrType(String addrType) {
|
||||
this.addrType = addrType;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,106 @@
|
||||
package com.nis.domain.callback;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.google.gson.annotations.Expose;
|
||||
|
||||
public class ProxyFileTrafficMirrorCfgAudit {
|
||||
@Expose
|
||||
private Long id; //compileId
|
||||
@Expose
|
||||
private Integer cfgId; //compileId
|
||||
@Expose
|
||||
private Integer profileId;//compileId
|
||||
@Expose
|
||||
private Integer action;
|
||||
@Expose
|
||||
private Integer service;
|
||||
@Expose
|
||||
private Integer isValid;
|
||||
@Expose
|
||||
private Date opTime;
|
||||
@Expose
|
||||
private String profileName;
|
||||
@Expose
|
||||
private String addrList;
|
||||
@Expose
|
||||
private String addrContent;
|
||||
@Expose
|
||||
private String addrType;
|
||||
@Expose
|
||||
private Long opUser;
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
public Integer getCfgId() {
|
||||
return cfgId;
|
||||
}
|
||||
public void setCfgId(Integer cfgId) {
|
||||
this.cfgId = cfgId;
|
||||
}
|
||||
public Integer getProfileId() {
|
||||
return profileId;
|
||||
}
|
||||
public void setProfileId(Integer profileId) {
|
||||
this.profileId = profileId;
|
||||
}
|
||||
public Integer getAction() {
|
||||
return action;
|
||||
}
|
||||
public void setAction(Integer action) {
|
||||
this.action = action;
|
||||
}
|
||||
public Integer getService() {
|
||||
return service;
|
||||
}
|
||||
public void setService(Integer service) {
|
||||
this.service = service;
|
||||
}
|
||||
public Integer getIsValid() {
|
||||
return isValid;
|
||||
}
|
||||
public void setIsValid(Integer isValid) {
|
||||
this.isValid = isValid;
|
||||
}
|
||||
public Date getOpTime() {
|
||||
return opTime;
|
||||
}
|
||||
public void setOpTime(Date opTime) {
|
||||
this.opTime = opTime;
|
||||
}
|
||||
public String getProfileName() {
|
||||
return profileName;
|
||||
}
|
||||
public void setProfileName(String profileName) {
|
||||
this.profileName = profileName;
|
||||
}
|
||||
public String getAddrList() {
|
||||
return addrList;
|
||||
}
|
||||
public void setAddrList(String addrList) {
|
||||
this.addrList = addrList;
|
||||
}
|
||||
public String getAddrContent() {
|
||||
return addrContent;
|
||||
}
|
||||
public void setAddrContent(String addrContent) {
|
||||
this.addrContent = addrContent;
|
||||
}
|
||||
public String getAddrType() {
|
||||
return addrType;
|
||||
}
|
||||
public void setAddrType(String addrType) {
|
||||
this.addrType = addrType;
|
||||
}
|
||||
public Long getOpUser() {
|
||||
return opUser;
|
||||
}
|
||||
public void setOpUser(Long opUser) {
|
||||
this.opUser = opUser;
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,6 @@
|
||||
|
||||
package com.nis.domain.configuration;
|
||||
|
||||
import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
|
||||
|
||||
import com.google.gson.annotations.Expose;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import com.nis.util.excel.ExcelField;
|
||||
@@ -34,11 +32,13 @@ public class AppIpCfg extends BaseCfg<AppIpCfg> {
|
||||
@ExcelField(title="ip_type",dictType="IP_TYPE",sort=3)
|
||||
@SerializedName("ipType")
|
||||
protected Integer ipType;
|
||||
protected Integer ipPattern;
|
||||
protected Integer srcIpPattern;
|
||||
protected Integer destIpPattern;
|
||||
protected String srcIpAddress;
|
||||
@ExcelField(title="server_ip",sort=4)
|
||||
protected String destIpAddress;
|
||||
protected Integer portPattern;
|
||||
protected Integer srcPortPattern;
|
||||
protected Integer destPortPattern;
|
||||
protected String srcPort;
|
||||
@ExcelField(title="server_port",sort=5)
|
||||
protected String destPort;
|
||||
@@ -121,34 +121,7 @@ public class AppIpCfg extends BaseCfg<AppIpCfg> {
|
||||
// this.protocolId = protocolId;
|
||||
// }
|
||||
|
||||
/**
|
||||
* ipPattern
|
||||
* @return ipPattern
|
||||
*/
|
||||
|
||||
public Integer getIpPattern() {
|
||||
return ipPattern;
|
||||
}
|
||||
/**
|
||||
* @param ipPattern the ipPattern to set
|
||||
*/
|
||||
public void setIpPattern(Integer ipPattern) {
|
||||
this.ipPattern = ipPattern;
|
||||
}
|
||||
/**
|
||||
* portPattern
|
||||
* @return portPattern
|
||||
*/
|
||||
|
||||
public Integer getPortPattern() {
|
||||
return portPattern;
|
||||
}
|
||||
/**
|
||||
* @param portPattern the portPattern to set
|
||||
*/
|
||||
public void setPortPattern(Integer portPattern) {
|
||||
this.portPattern = portPattern;
|
||||
}
|
||||
|
||||
/**
|
||||
* srcIpAddress
|
||||
@@ -158,6 +131,30 @@ public class AppIpCfg extends BaseCfg<AppIpCfg> {
|
||||
public String getSrcIpAddress() {
|
||||
return srcIpAddress;
|
||||
}
|
||||
public Integer getSrcIpPattern() {
|
||||
return srcIpPattern;
|
||||
}
|
||||
public void setSrcIpPattern(Integer srcIpPattern) {
|
||||
this.srcIpPattern = srcIpPattern;
|
||||
}
|
||||
public Integer getDestIpPattern() {
|
||||
return destIpPattern;
|
||||
}
|
||||
public void setDestIpPattern(Integer destIpPattern) {
|
||||
this.destIpPattern = destIpPattern;
|
||||
}
|
||||
public Integer getSrcPortPattern() {
|
||||
return srcPortPattern;
|
||||
}
|
||||
public void setSrcPortPattern(Integer srcPortPattern) {
|
||||
this.srcPortPattern = srcPortPattern;
|
||||
}
|
||||
public Integer getDestPortPattern() {
|
||||
return destPortPattern;
|
||||
}
|
||||
public void setDestPortPattern(Integer destPortPattern) {
|
||||
this.destPortPattern = destPortPattern;
|
||||
}
|
||||
/**
|
||||
* @param srcIpAddress the srcIpAddress to set
|
||||
*/
|
||||
@@ -257,16 +254,10 @@ public class AppIpCfg extends BaseCfg<AppIpCfg> {
|
||||
public String toString() {
|
||||
return "AppIpCfg [compileId=" + compileId + ", ratelimit=" + ratelimit + ", appCode=" + appCode + ", behavCode="
|
||||
+ behavCode + ", specServiceId=" + specServiceId + ", appName=" + appName + ", ipType=" + ipType
|
||||
+ ", ipPattern=" + ipPattern + ", srcIpAddress=" + srcIpAddress + ", destIpAddress=" + destIpAddress
|
||||
+ ", portPattern=" + portPattern + ", srcPort=" + srcPort + ", destPort=" + destPort + ", direction="
|
||||
+ direction + ", protocol=" + protocol + ", userRegion1=" + userRegion1 + ", userRegion2=" + userRegion2
|
||||
+ ", userRegion3=" + userRegion3 + ", userRegion4=" + userRegion4 + ", userRegion5=" + userRegion5
|
||||
+ ", cfgId=" + cfgId + ", cfgDesc=" + cfgDesc + ", action=" + action + ", isValid=" + isValid
|
||||
+ ", isAudit=" + isAudit + ", creatorId=" + creatorId + ", createTime=" + createTime + ", editorId="
|
||||
+ editorId + ", editTime=" + editTime + ", auditorId=" + auditorId + ", auditTime=" + auditTime
|
||||
+ ", serviceId=" + serviceId + ", requestId=" + requestId + ", cancelRequestId=" + cancelRequestId
|
||||
+ ", isAreaEffective=" + isAreaEffective + ", classify=" + classify + ", attribute=" + attribute
|
||||
+ ", lable=" + lable + ", areaEffectiveIds=" + areaEffectiveIds + ", cfgRegionCode=" + cfgRegionCode
|
||||
+ ", cfgType=" + cfgType + ", functionId=" + functionId + ", doLog=" + doLog + "]";
|
||||
+ ", srcIpPattern=" + srcIpPattern + ", destIpPattern=" + destIpPattern + ", srcIpAddress="
|
||||
+ srcIpAddress + ", destIpAddress=" + destIpAddress + ", srcPortPattern=" + srcPortPattern
|
||||
+ ", destPortPattern=" + destPortPattern + ", srcPort=" + srcPort + ", destPort=" + destPort
|
||||
+ ", direction=" + direction + ", protocol=" + protocol + "]";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -59,7 +59,8 @@ public class AreaIpCfg extends BaseIpCfg {
|
||||
this.cfgType=Constants.AREA_REGION;
|
||||
this.cfgRegionCode=1;
|
||||
this.protocol=0;
|
||||
this.portPattern=1;
|
||||
this.srcPortPattern=1;
|
||||
this.destPortPattern=1;
|
||||
this.srcPort="0";
|
||||
this.destPort="0";
|
||||
this.direction=0;
|
||||
|
||||
@@ -9,8 +9,18 @@ package com.nis.domain.configuration;
|
||||
* @version V1.0
|
||||
*/
|
||||
public class AvVoipAccountCfg extends BaseStringCfg<AvVoipAccountCfg>{
|
||||
|
||||
private static final String tableName="av_voip_account_cfg";
|
||||
|
||||
private static final long serialVersionUID = -7398698517584394431L;
|
||||
|
||||
@Override
|
||||
public void initDefaultValue() {
|
||||
super.initDefaultValue();
|
||||
this.exprType=0;
|
||||
this.matchMethod=0;
|
||||
}
|
||||
public static String getTablename() {
|
||||
return tableName;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -61,6 +61,13 @@ public class BaseCfg<T> extends BaseEntity<T> implements Cloneable{
|
||||
protected Integer compileIsIssued;
|
||||
protected String exType;//导出类型
|
||||
protected String hColumns;//导出隐藏列
|
||||
|
||||
protected String compileIdNew;// 查询 配置ID 范围
|
||||
|
||||
//批量操作时,记录isAudit和isValid检索条件
|
||||
protected String batchAuditValue;
|
||||
protected String batchValidValue;
|
||||
|
||||
/**
|
||||
* 定时任务信息
|
||||
*/
|
||||
@@ -70,16 +77,28 @@ public class BaseCfg<T> extends BaseEntity<T> implements Cloneable{
|
||||
*/
|
||||
protected ScheduleCfg schedule;
|
||||
|
||||
private String commonGroupIds; //公共组织id(考虑一个compile存在多个asn组织的情况)
|
||||
protected String commonGroupIds; //公共组织id(考虑一个compile存在多个asn组织的情况)
|
||||
protected Integer groupType; //url组以及dns组相关功能使用
|
||||
protected Integer udFlag; //url组以及dns组相关功能使用 过滤数据库数据标记
|
||||
|
||||
public String getCommonGroupIds() {
|
||||
return commonGroupIds;
|
||||
}
|
||||
|
||||
public void setCommonGroupIds(String commonGroupIds) {
|
||||
this.commonGroupIds = commonGroupIds;
|
||||
}
|
||||
|
||||
|
||||
public Integer getGroupType() {
|
||||
return groupType;
|
||||
}
|
||||
public void setGroupType(Integer groupType) {
|
||||
this.groupType = groupType;
|
||||
}
|
||||
public Integer getUdFlag() {
|
||||
return udFlag;
|
||||
}
|
||||
public void setUdFlag(Integer udFlag) {
|
||||
this.udFlag = udFlag;
|
||||
}
|
||||
|
||||
public String getExType() {
|
||||
return exType;
|
||||
@@ -107,6 +126,12 @@ public class BaseCfg<T> extends BaseEntity<T> implements Cloneable{
|
||||
public void setCompileGroupMap(Map<Integer, Integer> compileGroupMap) {
|
||||
this.compileGroupMap = compileGroupMap;
|
||||
}
|
||||
public String getCompileIdNew() {
|
||||
return compileIdNew;
|
||||
}
|
||||
public void setCompileIdNew(String compileIdNew) {
|
||||
this.compileIdNew = compileIdNew;
|
||||
}
|
||||
|
||||
/**
|
||||
* 编译id
|
||||
@@ -995,6 +1020,17 @@ public class BaseCfg<T> extends BaseEntity<T> implements Cloneable{
|
||||
public void setSchedule(ScheduleCfg schedule) {
|
||||
this.schedule = schedule;
|
||||
}
|
||||
|
||||
public String getBatchAuditValue() {
|
||||
return batchAuditValue;
|
||||
}
|
||||
public String getBatchValidValue() {
|
||||
return batchValidValue;
|
||||
}
|
||||
public void setBatchAuditValue(String batchAuditValue) {
|
||||
this.batchAuditValue = batchAuditValue;
|
||||
}
|
||||
public void setBatchValidValue(String batchValidValue) {
|
||||
this.batchValidValue = batchValidValue;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
package com.nis.domain.configuration;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.google.gson.annotations.Expose;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
@@ -45,14 +46,18 @@ public class BaseIpCfg extends BaseCfg<BaseIpCfg> {
|
||||
@SerializedName("ipType")
|
||||
@ExcelField(title="ip_type",dictType="IP_TYPE",sort=50)
|
||||
protected Integer ipType;
|
||||
@ExcelField(title="ip_pattern",dictType="IP_PATTERN",sort=51)
|
||||
protected Integer ipPattern;
|
||||
@ExcelField(title="client_ip",sort=53)
|
||||
@ExcelField(title="src_ip_pattern",dictType="IP_PATTERN",sort=51)
|
||||
protected Integer srcIpPattern;
|
||||
@ExcelField(title="client_ip",sort=52)
|
||||
protected String srcIpAddress;
|
||||
@ExcelField(title="server_ip",sort=52)
|
||||
@ExcelField(title="dest_ip_pattern",dictType="IP_PATTERN",sort=53)
|
||||
protected Integer destIpPattern;
|
||||
@ExcelField(title="server_ip",sort=54)
|
||||
protected String destIpAddress;
|
||||
@ExcelField(title="port_pattern",dictType="PORT_PATTERN",sort=54)
|
||||
protected Integer portPattern;
|
||||
@ExcelField(title="src_port_pattern",dictType="PORT_PATTERN",sort=54)
|
||||
protected Integer srcPortPattern;
|
||||
@ExcelField(title="dest_port_pattern",dictType="PORT_PATTERN",sort=54)
|
||||
protected Integer destPortPattern;
|
||||
@ExcelField(title="client_port",sort=55)
|
||||
protected String srcPort;
|
||||
@ExcelField(title="server_port",sort=56)
|
||||
@@ -269,35 +274,31 @@ public class BaseIpCfg extends BaseCfg<BaseIpCfg> {
|
||||
this.protocolId = protocolId;
|
||||
}
|
||||
|
||||
/**
|
||||
* ipPattern
|
||||
* @return ipPattern
|
||||
*/
|
||||
|
||||
public Integer getIpPattern() {
|
||||
return ipPattern;
|
||||
public Integer getSrcIpPattern() {
|
||||
return srcIpPattern;
|
||||
}
|
||||
/**
|
||||
* @param ipPattern the ipPattern to set
|
||||
*/
|
||||
public void setIpPattern(Integer ipPattern) {
|
||||
this.ipPattern = ipPattern;
|
||||
public void setSrcIpPattern(Integer srcIpPattern) {
|
||||
this.srcIpPattern = srcIpPattern;
|
||||
}
|
||||
/**
|
||||
* portPattern
|
||||
* @return portPattern
|
||||
*/
|
||||
|
||||
public Integer getPortPattern() {
|
||||
return portPattern;
|
||||
public Integer getDestIpPattern() {
|
||||
return destIpPattern;
|
||||
}
|
||||
/**
|
||||
* @param portPattern the portPattern to set
|
||||
*/
|
||||
public void setPortPattern(Integer portPattern) {
|
||||
this.portPattern = portPattern;
|
||||
public void setDestIpPattern(Integer destIpPattern) {
|
||||
this.destIpPattern = destIpPattern;
|
||||
}
|
||||
public Integer getSrcPortPattern() {
|
||||
return srcPortPattern;
|
||||
}
|
||||
public void setSrcPortPattern(Integer srcPortPattern) {
|
||||
this.srcPortPattern = srcPortPattern;
|
||||
}
|
||||
public Integer getDestPortPattern() {
|
||||
return destPortPattern;
|
||||
}
|
||||
public void setDestPortPattern(Integer destPortPattern) {
|
||||
this.destPortPattern = destPortPattern;
|
||||
}
|
||||
|
||||
/**
|
||||
* srcIpAddress
|
||||
* @return srcIpAddress
|
||||
@@ -399,4 +400,125 @@ public class BaseIpCfg extends BaseCfg<BaseIpCfg> {
|
||||
public void setIndex(Integer index) {
|
||||
this.index = index;
|
||||
}
|
||||
protected Integer keyring;
|
||||
protected Integer evCert;
|
||||
protected Integer certTransparency;
|
||||
protected Integer clientCertReq;
|
||||
protected Integer pinning;
|
||||
protected Integer protocolErrors;
|
||||
protected Integer cn;
|
||||
protected Integer issuer;
|
||||
protected Integer selfSigned;
|
||||
protected Integer expiration;
|
||||
protected String failMethod;
|
||||
protected String min;
|
||||
protected String max;
|
||||
protected Integer mirrorClient;
|
||||
protected Integer allowHttp2;
|
||||
protected Integer enable;
|
||||
protected Integer mirrorProfile;
|
||||
|
||||
public Integer getKeyring() {
|
||||
return keyring;
|
||||
}
|
||||
public void setKeyring(Integer keyring) {
|
||||
this.keyring = keyring;
|
||||
}
|
||||
public Integer getEvCert() {
|
||||
return evCert;
|
||||
}
|
||||
public void setEvCert(Integer evCert) {
|
||||
this.evCert = evCert;
|
||||
}
|
||||
public Integer getCertTransparency() {
|
||||
return certTransparency;
|
||||
}
|
||||
public void setCertTransparency(Integer certTransparency) {
|
||||
this.certTransparency = certTransparency;
|
||||
}
|
||||
public Integer getClientCertReq() {
|
||||
return clientCertReq;
|
||||
}
|
||||
public void setClientCertReq(Integer clientCertReq) {
|
||||
this.clientCertReq = clientCertReq;
|
||||
}
|
||||
public Integer getPinning() {
|
||||
return pinning;
|
||||
}
|
||||
public void setPinning(Integer pinning) {
|
||||
this.pinning = pinning;
|
||||
}
|
||||
public Integer getProtocolErrors() {
|
||||
return protocolErrors;
|
||||
}
|
||||
public void setProtocolErrors(Integer protocolErrors) {
|
||||
this.protocolErrors = protocolErrors;
|
||||
}
|
||||
public Integer getCn() {
|
||||
return cn;
|
||||
}
|
||||
public void setCn(Integer cn) {
|
||||
this.cn = cn;
|
||||
}
|
||||
public Integer getIssuer() {
|
||||
return issuer;
|
||||
}
|
||||
public void setIssuer(Integer issuer) {
|
||||
this.issuer = issuer;
|
||||
}
|
||||
public Integer getSelfSigned() {
|
||||
return selfSigned;
|
||||
}
|
||||
public void setSelfSigned(Integer selfSigned) {
|
||||
this.selfSigned = selfSigned;
|
||||
}
|
||||
public Integer getExpiration() {
|
||||
return expiration;
|
||||
}
|
||||
public void setExpiration(Integer expiration) {
|
||||
this.expiration = expiration;
|
||||
}
|
||||
public String getFailMethod() {
|
||||
return failMethod;
|
||||
}
|
||||
public void setFailMethod(String failMethod) {
|
||||
this.failMethod = failMethod;
|
||||
}
|
||||
public String getMin() {
|
||||
return min;
|
||||
}
|
||||
public void setMin(String min) {
|
||||
this.min = min;
|
||||
}
|
||||
public String getMax() {
|
||||
return max;
|
||||
}
|
||||
public void setMax(String max) {
|
||||
this.max = max;
|
||||
}
|
||||
public Integer getMirrorClient() {
|
||||
return mirrorClient;
|
||||
}
|
||||
public void setMirrorClient(Integer mirrorClient) {
|
||||
this.mirrorClient = mirrorClient;
|
||||
}
|
||||
|
||||
public Integer getAllowHttp2() {
|
||||
return allowHttp2;
|
||||
}
|
||||
public void setAllowHttp2(Integer allowHttp2) {
|
||||
this.allowHttp2 = allowHttp2;
|
||||
}
|
||||
public Integer getEnable() {
|
||||
return enable;
|
||||
}
|
||||
public void setEnable(Integer enable) {
|
||||
this.enable = enable;
|
||||
}
|
||||
public Integer getMirrorProfile() {
|
||||
return mirrorProfile;
|
||||
}
|
||||
public void setMirrorProfile(Integer mirrorProfile) {
|
||||
this.mirrorProfile = mirrorProfile;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,7 +45,14 @@ public class BaseStringCfg<T> extends BaseCfg<T> {
|
||||
protected Integer specServiceId;//仅用于copy属性使用
|
||||
protected String domain;//仅用于copy属性使用
|
||||
protected Integer dnsStrategyId;//仅用作复制属性使用
|
||||
protected String groupName;
|
||||
|
||||
public String getGroupName() {
|
||||
return groupName;
|
||||
}
|
||||
public void setGroupName(String groupName) {
|
||||
this.groupName = groupName;
|
||||
}
|
||||
public Integer getDnsStrategyId() {
|
||||
return dnsStrategyId;
|
||||
}
|
||||
@@ -282,5 +289,124 @@ public class BaseStringCfg<T> extends BaseCfg<T> {
|
||||
public void setRegionId(Integer regionId) {
|
||||
this.regionId = regionId;
|
||||
}
|
||||
protected Integer keyring;
|
||||
protected Integer evCert;
|
||||
protected Integer certTransparency;
|
||||
protected Integer clientCertReq;
|
||||
protected Integer pinning;
|
||||
protected Integer protocolErrors;
|
||||
protected Integer cn;
|
||||
protected Integer issuer;
|
||||
protected Integer selfSigned;
|
||||
protected Integer expiration;
|
||||
protected String failMethod;
|
||||
protected String min;
|
||||
protected String max;
|
||||
protected Integer mirrorClient;
|
||||
protected Integer allowHttp2;
|
||||
protected Integer enable;
|
||||
protected Integer mirrorProfile;
|
||||
|
||||
public Integer getKeyring() {
|
||||
return keyring;
|
||||
}
|
||||
public void setKeyring(Integer keyring) {
|
||||
this.keyring = keyring;
|
||||
}
|
||||
public Integer getEvCert() {
|
||||
return evCert;
|
||||
}
|
||||
public void setEvCert(Integer evCert) {
|
||||
this.evCert = evCert;
|
||||
}
|
||||
public Integer getCertTransparency() {
|
||||
return certTransparency;
|
||||
}
|
||||
public void setCertTransparency(Integer certTransparency) {
|
||||
this.certTransparency = certTransparency;
|
||||
}
|
||||
public Integer getClientCertReq() {
|
||||
return clientCertReq;
|
||||
}
|
||||
public void setClientCertReq(Integer clientCertReq) {
|
||||
this.clientCertReq = clientCertReq;
|
||||
}
|
||||
public Integer getPinning() {
|
||||
return pinning;
|
||||
}
|
||||
public void setPinning(Integer pinning) {
|
||||
this.pinning = pinning;
|
||||
}
|
||||
public Integer getProtocolErrors() {
|
||||
return protocolErrors;
|
||||
}
|
||||
public void setProtocolErrors(Integer protocolErrors) {
|
||||
this.protocolErrors = protocolErrors;
|
||||
}
|
||||
public Integer getCn() {
|
||||
return cn;
|
||||
}
|
||||
public void setCn(Integer cn) {
|
||||
this.cn = cn;
|
||||
}
|
||||
public Integer getIssuer() {
|
||||
return issuer;
|
||||
}
|
||||
public void setIssuer(Integer issuer) {
|
||||
this.issuer = issuer;
|
||||
}
|
||||
public Integer getSelfSigned() {
|
||||
return selfSigned;
|
||||
}
|
||||
public void setSelfSigned(Integer selfSigned) {
|
||||
this.selfSigned = selfSigned;
|
||||
}
|
||||
public Integer getExpiration() {
|
||||
return expiration;
|
||||
}
|
||||
public void setExpiration(Integer expiration) {
|
||||
this.expiration = expiration;
|
||||
}
|
||||
public String getFailMethod() {
|
||||
return failMethod;
|
||||
}
|
||||
public void setFailMethod(String failMethod) {
|
||||
this.failMethod = failMethod;
|
||||
}
|
||||
public String getMin() {
|
||||
return min;
|
||||
}
|
||||
public void setMin(String min) {
|
||||
this.min = min;
|
||||
}
|
||||
public String getMax() {
|
||||
return max;
|
||||
}
|
||||
public void setMax(String max) {
|
||||
this.max = max;
|
||||
}
|
||||
public Integer getMirrorClient() {
|
||||
return mirrorClient;
|
||||
}
|
||||
public void setMirrorClient(Integer mirrorClient) {
|
||||
this.mirrorClient = mirrorClient;
|
||||
}
|
||||
public Integer getAllowHttp2() {
|
||||
return allowHttp2;
|
||||
}
|
||||
public void setAllowHttp2(Integer allowHttp2) {
|
||||
this.allowHttp2 = allowHttp2;
|
||||
}
|
||||
public Integer getEnable() {
|
||||
return enable;
|
||||
}
|
||||
public void setEnable(Integer enable) {
|
||||
this.enable = enable;
|
||||
}
|
||||
public Integer getMirrorProfile() {
|
||||
return mirrorProfile;
|
||||
}
|
||||
public void setMirrorProfile(Integer mirrorProfile) {
|
||||
this.mirrorProfile = mirrorProfile;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,7 +14,11 @@ import java.util.Map;
|
||||
import com.google.gson.annotations.Expose;
|
||||
import com.nis.domain.basics.AsnGroupInfo;
|
||||
import com.nis.domain.basics.AsnIpCfg;
|
||||
import com.nis.domain.basics.DomainCommCfg;
|
||||
import com.nis.domain.basics.IpCommCfg;
|
||||
import com.nis.domain.basics.IpReuseIpCfg;
|
||||
import com.nis.domain.basics.ScriberIdCommCfg;
|
||||
import com.nis.domain.basics.UrlCommCfg;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.util.excel.ExcelField;
|
||||
|
||||
@@ -88,7 +92,11 @@ public class CfgIndexInfo extends BaseCfg<CfgIndexInfo> {
|
||||
private List<AsnKeywordCfg> asnKeywords;
|
||||
@ExcelField(title="log_total",sort=42)
|
||||
private Long totalLogs;
|
||||
|
||||
private List<UrlCommCfg> urlCommGroupList;
|
||||
private List<IpCommCfg> ipCommGroupCfgList;
|
||||
private List<DomainCommCfg> domainCommGroupList;
|
||||
private List<ScriberIdCommCfg> scriberIdCommGroupList;
|
||||
private String groupName;
|
||||
|
||||
/*private CachePolicyUserRegion cachePolicyUserRegion;//缓存策略用户自定义域参数
|
||||
|
||||
@@ -101,6 +109,18 @@ public class CfgIndexInfo extends BaseCfg<CfgIndexInfo> {
|
||||
public String getOrganization() {
|
||||
return organization;
|
||||
}
|
||||
public String getGroupName() {
|
||||
return groupName;
|
||||
}
|
||||
public void setGroupName(String groupName) {
|
||||
this.groupName = groupName;
|
||||
}
|
||||
public List<IpCommCfg> getIpCommGroupCfgList() {
|
||||
return ipCommGroupCfgList;
|
||||
}
|
||||
public void setIpCommGroupCfgList(List<IpCommCfg> ipCommGroupCfgList) {
|
||||
this.ipCommGroupCfgList = ipCommGroupCfgList;
|
||||
}
|
||||
public List<AsnKeywordCfg> getAsnKeywords() {
|
||||
return asnKeywords;
|
||||
}
|
||||
@@ -411,4 +431,26 @@ public class CfgIndexInfo extends BaseCfg<CfgIndexInfo> {
|
||||
public void setTotalLogs(Long totalLogs) {
|
||||
this.totalLogs = totalLogs;
|
||||
}
|
||||
public List<UrlCommCfg> getUrlCommGroupList() {
|
||||
return urlCommGroupList;
|
||||
}
|
||||
public void setUrlCommGroupList(List<UrlCommCfg> urlCommGroupList) {
|
||||
this.urlCommGroupList = urlCommGroupList;
|
||||
}
|
||||
|
||||
public List<DomainCommCfg> getDomainCommGroupList() {
|
||||
return domainCommGroupList;
|
||||
}
|
||||
public void setDomainCommGroupList(List<DomainCommCfg> domainCommGroupList) {
|
||||
this.domainCommGroupList = domainCommGroupList;
|
||||
}
|
||||
|
||||
public List<ScriberIdCommCfg> getScriberIdCommGroupList() {
|
||||
return scriberIdCommGroupList;
|
||||
}
|
||||
public void setScriberIdCommGroupList(List<ScriberIdCommCfg> scriberIdCommGroupList) {
|
||||
this.scriberIdCommGroupList = scriberIdCommGroupList;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
package com.nis.domain.configuration;
|
||||
|
||||
import com.nis.util.excel.ExcelField;
|
||||
|
||||
public class ManipulatCfgExport extends CfgIndexInfo {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = -842585769617969577L;
|
||||
|
||||
@ExcelField(title="block_type",dictType="SERVICE_ACTION",sort=2)
|
||||
private String actionExport;
|
||||
|
||||
@ExcelField(title="method_export",dictType="SERVICE_ACTION",sort=3)
|
||||
private String methodExport;
|
||||
|
||||
@ExcelField(title="response_code",sort=3)
|
||||
private String responseCode;
|
||||
|
||||
@ExcelField(title="profile_info",sort=10)
|
||||
private String profileInfo;
|
||||
|
||||
private Integer action;
|
||||
|
||||
public String getResponseCode() {
|
||||
return responseCode;
|
||||
}
|
||||
public void setResponseCode(String responseCode) {
|
||||
this.responseCode = responseCode;
|
||||
}
|
||||
public String getMethodExport() {
|
||||
return methodExport;
|
||||
}
|
||||
public void setMethodExport(String methodExport) {
|
||||
this.methodExport = methodExport;
|
||||
}
|
||||
public String getProfileInfo() {
|
||||
return profileInfo;
|
||||
}
|
||||
public void setProfileInfo(String profileInfo) {
|
||||
this.profileInfo = profileInfo;
|
||||
}
|
||||
public String getActionExport() {
|
||||
return actionExport;
|
||||
}
|
||||
public void setActionExport(String actionExport) {
|
||||
this.actionExport = actionExport;
|
||||
}
|
||||
|
||||
public Integer getAction() {
|
||||
return action;
|
||||
}
|
||||
public void setAction(Integer action) {
|
||||
this.action = action;
|
||||
}
|
||||
|
||||
}
|
||||
60
src/main/java/com/nis/domain/configuration/ObjGroupCfg.java
Normal file
60
src/main/java/com/nis/domain/configuration/ObjGroupCfg.java
Normal file
@@ -0,0 +1,60 @@
|
||||
package com.nis.domain.configuration;
|
||||
|
||||
import com.nis.util.excel.ExcelField;
|
||||
|
||||
public class ObjGroupCfg extends BaseCfg<ObjGroupCfg> {
|
||||
|
||||
@ExcelField(title="ip_group",sort=33)
|
||||
private String ipGroup;
|
||||
@ExcelField(title="url_group",sort=35)
|
||||
private String urlGroup;
|
||||
@ExcelField(title="subscribe_id_group",sort=34)
|
||||
private String subscribeIdGroup;
|
||||
@ExcelField(title="domain_group",sort=36)
|
||||
private String domainGroup;
|
||||
@ExcelField(title="block_type",sort=2)//这里没有使用公共方法处理,直接将字典值set进去了,不用使用dictType
|
||||
protected String actionCode;
|
||||
@ExcelField(title="protocol",sort=3)
|
||||
protected String userRegion1;
|
||||
|
||||
public String getActionCode() {
|
||||
return actionCode;
|
||||
}
|
||||
|
||||
public void setActionCode(String actionCode) {
|
||||
this.actionCode = actionCode;
|
||||
}
|
||||
|
||||
public String getIpGroup() {
|
||||
return ipGroup;
|
||||
}
|
||||
|
||||
public void setIpGroup(String ipGroup) {
|
||||
this.ipGroup = ipGroup;
|
||||
}
|
||||
|
||||
public String getUrlGroup() {
|
||||
return urlGroup;
|
||||
}
|
||||
|
||||
public void setUrlGroup(String urlGroup) {
|
||||
this.urlGroup = urlGroup;
|
||||
}
|
||||
|
||||
public String getSubscribeIdGroup() {
|
||||
return subscribeIdGroup;
|
||||
}
|
||||
|
||||
public void setSubscribeIdGroup(String subscribeIdGroup) {
|
||||
this.subscribeIdGroup = subscribeIdGroup;
|
||||
}
|
||||
|
||||
public String getDomainGroup() {
|
||||
return domainGroup;
|
||||
}
|
||||
|
||||
public void setDomainGroup(String domainGroup) {
|
||||
this.domainGroup = domainGroup;
|
||||
}
|
||||
protected Integer action;//覆盖默认的action上的注解
|
||||
}
|
||||
153
src/main/java/com/nis/domain/configuration/PxyInterceptCfg.java
Normal file
153
src/main/java/com/nis/domain/configuration/PxyInterceptCfg.java
Normal file
@@ -0,0 +1,153 @@
|
||||
package com.nis.domain.configuration;
|
||||
|
||||
import com.nis.util.excel.ExcelField;
|
||||
|
||||
public class PxyInterceptCfg extends CfgIndexInfo {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 994229066993318362L;
|
||||
@ExcelField(title="pxy_intercept_monit_keyring",sort=8)
|
||||
private String keyring;
|
||||
@ExcelField(title="exclusions_ev_cert",dictType="SYS_YES_NO",sort=9)
|
||||
private String evCert;
|
||||
@ExcelField(title="exclusions_cert_transparency",dictType="SYS_YES_NO",sort=10)
|
||||
private String certTransparency;
|
||||
@ExcelField(title="exclusions_client_cert_req",dictType="SYS_YES_NO",sort=11)
|
||||
private String clientCertReq;
|
||||
@ExcelField(title="exclusions_pinning",dictType="SYS_YES_NO",sort=12)
|
||||
private String pinning;
|
||||
@ExcelField(title="exclusions_protocol_errors",dictType="SYS_YES_NO",sort=13)
|
||||
private String protocolErrors;
|
||||
@ExcelField(title="cert_verify_approach_cn",dictType="SYS_YES_NO",sort=14)
|
||||
private String cn;
|
||||
@ExcelField(title="cert_verify_approach_issuer",dictType="SYS_YES_NO",sort=15)
|
||||
private String issuer;
|
||||
@ExcelField(title="cert_verify_approach_self_signed",dictType="SYS_YES_NO",sort=16)
|
||||
private String selfSigned;
|
||||
@ExcelField(title="cert_verify_approach_expiration",dictType="SYS_YES_NO",sort=17)
|
||||
private String expiration;
|
||||
@ExcelField(title="cert_verify_fail_method",dictType="FAIL_METHOD",sort=18)
|
||||
private String failMethod;
|
||||
@ExcelField(title="ssl_ver_min",dictType="SSL_VERSION",sort=19)
|
||||
private String min;
|
||||
@ExcelField(title="ssl_ver_max",dictType="SSL_VERSION",sort=20)
|
||||
private String max;
|
||||
@ExcelField(title="ssl_ver_mirror_client",dictType="SYS_YES_NO",sort=21)
|
||||
private String mirrorClient;
|
||||
@ExcelField(title="ssl_ver_allow_http2",dictType="SYS_YES_NO",sort=22)
|
||||
private String allowHttp2;
|
||||
@ExcelField(title="decrypt_mirror_enable",dictType="SYS_YES_NO",sort=23)
|
||||
private String enable;
|
||||
@ExcelField(title="decrypt_mirror_mirror_profile",sort=24)
|
||||
private String mirrorProfile;
|
||||
private String userRegion1;
|
||||
private String userRegion2;
|
||||
private String userRegion3;
|
||||
private String userRegion4;
|
||||
// private String userRegion5;
|
||||
public String getKeyring() {
|
||||
return keyring;
|
||||
}
|
||||
public void setKeyring(String keyring) {
|
||||
this.keyring = keyring;
|
||||
}
|
||||
public String getEvCert() {
|
||||
return evCert;
|
||||
}
|
||||
public void setEvCert(String evCert) {
|
||||
this.evCert = evCert;
|
||||
}
|
||||
public String getCertTransparency() {
|
||||
return certTransparency;
|
||||
}
|
||||
public void setCertTransparency(String certTransparency) {
|
||||
this.certTransparency = certTransparency;
|
||||
}
|
||||
public String getClientCertReq() {
|
||||
return clientCertReq;
|
||||
}
|
||||
public void setClientCertReq(String clientCertReq) {
|
||||
this.clientCertReq = clientCertReq;
|
||||
}
|
||||
public String getPinning() {
|
||||
return pinning;
|
||||
}
|
||||
public void setPinning(String pinning) {
|
||||
this.pinning = pinning;
|
||||
}
|
||||
public String getProtocolErrors() {
|
||||
return protocolErrors;
|
||||
}
|
||||
public void setProtocolErrors(String protocolErrors) {
|
||||
this.protocolErrors = protocolErrors;
|
||||
}
|
||||
public String getCn() {
|
||||
return cn;
|
||||
}
|
||||
public void setCn(String cn) {
|
||||
this.cn = cn;
|
||||
}
|
||||
public String getIssuer() {
|
||||
return issuer;
|
||||
}
|
||||
public void setIssuer(String issuer) {
|
||||
this.issuer = issuer;
|
||||
}
|
||||
public String getSelfSigned() {
|
||||
return selfSigned;
|
||||
}
|
||||
public void setSelfSigned(String selfSigned) {
|
||||
this.selfSigned = selfSigned;
|
||||
}
|
||||
public String getExpiration() {
|
||||
return expiration;
|
||||
}
|
||||
public void setExpiration(String expiration) {
|
||||
this.expiration = expiration;
|
||||
}
|
||||
public String getFailMethod() {
|
||||
return failMethod;
|
||||
}
|
||||
public void setFailMethod(String failMethod) {
|
||||
this.failMethod = failMethod;
|
||||
}
|
||||
public String getMin() {
|
||||
return min;
|
||||
}
|
||||
public void setMin(String min) {
|
||||
this.min = min;
|
||||
}
|
||||
public String getMax() {
|
||||
return max;
|
||||
}
|
||||
public void setMax(String max) {
|
||||
this.max = max;
|
||||
}
|
||||
public String getMirrorClient() {
|
||||
return mirrorClient;
|
||||
}
|
||||
public void setMirrorClient(String mirrorClient) {
|
||||
this.mirrorClient = mirrorClient;
|
||||
}
|
||||
public String getAllowHttp2() {
|
||||
return allowHttp2;
|
||||
}
|
||||
public void setAllowHttp2(String allowHttp2) {
|
||||
this.allowHttp2 = allowHttp2;
|
||||
}
|
||||
public String getEnable() {
|
||||
return enable;
|
||||
}
|
||||
public void setEnable(String enable) {
|
||||
this.enable = enable;
|
||||
}
|
||||
public String getMirrorProfile() {
|
||||
return mirrorProfile;
|
||||
}
|
||||
public void setMirrorProfile(String mirrorProfile) {
|
||||
this.mirrorProfile = mirrorProfile;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -25,6 +25,7 @@ public class PxyObjKeyring extends BaseCfg<PxyObjKeyring> {
|
||||
@ExcelField(title="expire_after",sort=5)
|
||||
private Integer expireAfter;
|
||||
private String publicKeyAlgo;
|
||||
@ExcelField(title="CRL",sort=5)
|
||||
private String crl;
|
||||
@ExcelField(title="issuer",sort=6)
|
||||
private String issuer;
|
||||
|
||||
@@ -18,9 +18,18 @@ public class PxyObjTrustedCaCert extends BaseCfg<PxyObjTrustedCaCert> {
|
||||
private String issuer; //颁发者
|
||||
@ExcelField(title="certificate_file",sort=2)
|
||||
private String certFile;
|
||||
@ExcelField(title="crl_file",sort=4)
|
||||
//@ExcelField(title="crl_file",sort=4)
|
||||
private String crlFile;
|
||||
private Integer builtIn;//是否内置证书
|
||||
@ExcelField(title="built_in",sort=5)//是否内置证书(导出用)
|
||||
private String builtInExp;
|
||||
|
||||
public String getBuiltInExp() {
|
||||
return builtInExp;
|
||||
}
|
||||
public void setBuiltInExp(String builtInExp) {
|
||||
this.builtInExp = builtInExp;
|
||||
}
|
||||
public String getCrlFile() {
|
||||
return crlFile;
|
||||
}
|
||||
@@ -47,6 +56,11 @@ public class PxyObjTrustedCaCert extends BaseCfg<PxyObjTrustedCaCert> {
|
||||
public void setIndexTable(String indexTable) {
|
||||
this.indexTable = indexTable;
|
||||
}
|
||||
|
||||
public Integer getBuiltIn() {
|
||||
return builtIn;
|
||||
}
|
||||
public void setBuiltIn(Integer builtIn) {
|
||||
this.builtIn = builtIn;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
package com.nis.domain.configuration.template;
|
||||
|
||||
import com.nis.util.excel.ExcelField;
|
||||
|
||||
public class BlackListComplexStringTemplate extends ComplexStringAllTemplate {
|
||||
private Integer doBlackList;
|
||||
@ExcelField(title="doBlacklist",align=2,sort=3)
|
||||
public Integer getDoBlackList() {
|
||||
return doBlackList;
|
||||
}
|
||||
|
||||
public void setDoBlackList(Integer doBlackList) {
|
||||
this.doBlackList = doBlackList;
|
||||
}
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
package com.nis.domain.configuration.template;
|
||||
|
||||
import com.nis.util.excel.ExcelField;
|
||||
|
||||
public class BlackListIPTemplate extends IpAllTemplate {
|
||||
private Integer doBlackList;
|
||||
@ExcelField(title="doBlacklist",align=2,sort=3)
|
||||
public Integer getDoBlackList() {
|
||||
return doBlackList;
|
||||
}
|
||||
public void setDoBlackList(Integer doBlackList) {
|
||||
this.doBlackList = doBlackList;
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
package com.nis.domain.configuration.template;
|
||||
|
||||
import com.nis.util.excel.ExcelField;
|
||||
|
||||
public class BlackListP2pHashStringTemplate extends P2pHashStringTemplate {
|
||||
private Integer doBlackList;
|
||||
@ExcelField(title="doBlacklist",align=2,sort=4)
|
||||
public Integer getDoBlackList() {
|
||||
return doBlackList;
|
||||
}
|
||||
|
||||
public void setDoBlackList(Integer doBlackList) {
|
||||
this.doBlackList = doBlackList;
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
package com.nis.domain.configuration.template;
|
||||
|
||||
import com.nis.util.excel.ExcelField;
|
||||
|
||||
public class BlackListP2pIpTemplate extends P2pIpTemplate {
|
||||
private Integer doBlackList;
|
||||
@ExcelField(title="doBlacklist",align=2,sort=4)
|
||||
public Integer getDoBlackList() {
|
||||
return doBlackList;
|
||||
}
|
||||
|
||||
public void setDoBlackList(Integer doBlackList) {
|
||||
this.doBlackList = doBlackList;
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
package com.nis.domain.configuration.template;
|
||||
|
||||
import com.nis.util.excel.ExcelField;
|
||||
|
||||
public class BlackListStringTemplate extends StringAllTemplate {
|
||||
private Integer doBlackList;
|
||||
@ExcelField(title="doBlacklist",align=2,sort=3)
|
||||
public Integer getDoBlackList() {
|
||||
return doBlackList;
|
||||
}
|
||||
|
||||
public void setDoBlackList(Integer doBlackList) {
|
||||
this.doBlackList = doBlackList;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
package com.nis.domain.configuration.template;
|
||||
|
||||
import com.nis.util.excel.ExcelField;
|
||||
|
||||
public class DnsStringTemplate extends StringAllTemplate {
|
||||
/**
|
||||
* @Fields serialVersionUID:TODO(用一句话描述这个变量表示什么)
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
||||
|
||||
private Integer dnsStrategyId;
|
||||
|
||||
@ExcelField(title="policy_name",align=2,sort=3)
|
||||
public Integer getDnsStrategyId() {
|
||||
return dnsStrategyId;
|
||||
}
|
||||
public void setDnsStrategyId(Integer dnsStrategyId) {
|
||||
this.dnsStrategyId = dnsStrategyId;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.nis.domain.configuration.template;
|
||||
|
||||
import com.nis.util.excel.ExcelField;
|
||||
|
||||
/**
|
||||
* 域名公共组配置 导入模板
|
||||
* @author dell
|
||||
*
|
||||
*/
|
||||
public class DomainCommCfgTemplate extends StringAllNotDoLogTemplate{
|
||||
|
||||
@ExcelField(title="group_name",align=2,sort=10)
|
||||
private String groupName;
|
||||
|
||||
public String getGroupName() {
|
||||
return groupName;
|
||||
}
|
||||
|
||||
public void setGroupName(String groupName) {
|
||||
this.groupName = groupName;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -12,7 +12,7 @@ public class DomainInterceptMonitTemplate extends StringAllNotDoLogTemplate{
|
||||
private String userRegion5;
|
||||
private String cfgKeywords;
|
||||
|
||||
@ExcelField(title="intercept_intensity",dictType="INTERCEPT_DOMAIN_INTENSITY",align=2,sort=2)
|
||||
@ExcelField(title="intercept_intensity",dictType="INTERCEPT_DOMAIN_INTENSITY",align=2,sort=12)
|
||||
public String getUserRegion5() {
|
||||
return userRegion5;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,160 @@
|
||||
package com.nis.domain.configuration.template;
|
||||
|
||||
import com.nis.util.excel.ExcelField;
|
||||
|
||||
public class InterceptDomainTemplate extends StringAllNotDoLogTemplate {
|
||||
private Integer keyring;
|
||||
|
||||
private Integer evCert;
|
||||
|
||||
private Integer certTransparency;
|
||||
|
||||
private Integer clientCertReq;
|
||||
|
||||
private Integer pinning;
|
||||
|
||||
private Integer protocolErrors;
|
||||
|
||||
private Integer cn;
|
||||
|
||||
private Integer issuer;
|
||||
|
||||
private Integer selfSigned;
|
||||
|
||||
private Integer expiration;
|
||||
|
||||
private String failMethod;
|
||||
|
||||
private String min;
|
||||
|
||||
private String max;
|
||||
|
||||
private Integer mirrorClient;
|
||||
|
||||
private Integer allowHttp2;
|
||||
|
||||
private Integer enable;
|
||||
|
||||
private Integer mirrorProfile;
|
||||
|
||||
@ExcelField(title="pxy_intercept_monit_keyring",align=2,sort=17)
|
||||
public Integer getKeyring() {
|
||||
return keyring;
|
||||
}
|
||||
public void setKeyring(Integer keyring) {
|
||||
this.keyring = keyring;
|
||||
}
|
||||
@ExcelField(title="exclusions_ev_cert",align=2,sort=18)
|
||||
public Integer getEvCert() {
|
||||
return evCert;
|
||||
}
|
||||
public void setEvCert(Integer evCert) {
|
||||
this.evCert = evCert;
|
||||
}
|
||||
@ExcelField(title="exclusions_cert_transparency",align=2,sort=19)
|
||||
public Integer getCertTransparency() {
|
||||
return certTransparency;
|
||||
}
|
||||
public void setCertTransparency(Integer certTransparency) {
|
||||
this.certTransparency = certTransparency;
|
||||
}
|
||||
@ExcelField(title="exclusions_client_cert_req",align=2,sort=20)
|
||||
public Integer getClientCertReq() {
|
||||
return clientCertReq;
|
||||
}
|
||||
public void setClientCertReq(Integer clientCertReq) {
|
||||
this.clientCertReq = clientCertReq;
|
||||
}
|
||||
@ExcelField(title="exclusions_pinning",align=2,sort=21)
|
||||
public Integer getPinning() {
|
||||
return pinning;
|
||||
}
|
||||
public void setPinning(Integer pinning) {
|
||||
this.pinning = pinning;
|
||||
}
|
||||
@ExcelField(title="protocol_errors",align=2,sort=22)
|
||||
public Integer getProtocolErrors() {
|
||||
return protocolErrors;
|
||||
}
|
||||
public void setProtocolErrors(Integer protocolErrors) {
|
||||
this.protocolErrors = protocolErrors;
|
||||
}
|
||||
@ExcelField(title="cert_verify_approach_cn",align=2,sort=23)
|
||||
public Integer getCn() {
|
||||
return cn;
|
||||
}
|
||||
public void setCn(Integer cn) {
|
||||
this.cn = cn;
|
||||
}
|
||||
@ExcelField(title="cert_verify_approach_issuer",align=2,sort=24)
|
||||
public Integer getIssuer() {
|
||||
return issuer;
|
||||
}
|
||||
public void setIssuer(Integer issuer) {
|
||||
this.issuer = issuer;
|
||||
}
|
||||
@ExcelField(title="cert_verify_approach_self_signed",align=2,sort=25)
|
||||
public Integer getSelfSigned() {
|
||||
return selfSigned;
|
||||
}
|
||||
public void setSelfSigned(Integer selfSigned) {
|
||||
this.selfSigned = selfSigned;
|
||||
}
|
||||
@ExcelField(title="cert_verify_approach_expiration",align=2,sort=26)
|
||||
public Integer getExpiration() {
|
||||
return expiration;
|
||||
}
|
||||
public void setExpiration(Integer expiration) {
|
||||
this.expiration = expiration;
|
||||
}
|
||||
@ExcelField(title="cert_verify_fail_method",dictType="FAIL_METHOD",align=2,sort=27)
|
||||
public String getFailMethod() {
|
||||
return failMethod;
|
||||
}
|
||||
public void setFailMethod(String failMethod) {
|
||||
this.failMethod = failMethod;
|
||||
}
|
||||
@ExcelField(title="ssl_ver_min",dictType="SSL_VERSION",align=2,sort=28)
|
||||
public String getMin() {
|
||||
return min;
|
||||
}
|
||||
public void setMin(String min) {
|
||||
this.min = min;
|
||||
}
|
||||
@ExcelField(title="ssl_ver_max",dictType="SSL_VERSION",align=2,sort=29)
|
||||
public String getMax() {
|
||||
return max;
|
||||
}
|
||||
public void setMax(String max) {
|
||||
this.max = max;
|
||||
}
|
||||
@ExcelField(title="ssl_ver_mirror_client",align=2,sort=30)
|
||||
public Integer getMirrorClient() {
|
||||
return mirrorClient;
|
||||
}
|
||||
public void setMirrorClient(Integer mirrorClient) {
|
||||
this.mirrorClient = mirrorClient;
|
||||
}
|
||||
@ExcelField(title="ssl_ver_allow_http2",align=2,sort=31)
|
||||
public Integer getAllowHttp2() {
|
||||
return allowHttp2;
|
||||
}
|
||||
public void setAllowHttp2(Integer allowHttp2) {
|
||||
this.allowHttp2 = allowHttp2;
|
||||
}
|
||||
@ExcelField(title="decrypt_mirror_enable",align=2,sort=32)
|
||||
public Integer getEnable() {
|
||||
return enable;
|
||||
}
|
||||
public void setEnable(Integer enable) {
|
||||
this.enable = enable;
|
||||
}
|
||||
@ExcelField(title="decrypt_mirror_mirror_profile",align=2,sort=33)
|
||||
public Integer getMirrorProfile() {
|
||||
return mirrorProfile;
|
||||
}
|
||||
public void setMirrorProfile(Integer mirrorProfile) {
|
||||
this.mirrorProfile = mirrorProfile;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,161 @@
|
||||
package com.nis.domain.configuration.template;
|
||||
|
||||
import com.nis.util.excel.ExcelField;
|
||||
|
||||
public class InterceptIpTemplate extends IpAllNotDoLogTemplate {
|
||||
|
||||
private Integer keyring;
|
||||
|
||||
private Integer evCert;
|
||||
|
||||
private Integer certTransparency;
|
||||
|
||||
private Integer clientCertReq;
|
||||
|
||||
private Integer pinning;
|
||||
|
||||
private Integer protocolErrors;
|
||||
|
||||
private Integer cn;
|
||||
|
||||
private Integer issuer;
|
||||
|
||||
private Integer selfSigned;
|
||||
|
||||
private Integer expiration;
|
||||
|
||||
private String failMethod;
|
||||
|
||||
private String min;
|
||||
|
||||
private String max;
|
||||
|
||||
private Integer mirrorClient;
|
||||
|
||||
private Integer allowHttp2;
|
||||
|
||||
private Integer enable;
|
||||
|
||||
private Integer mirrorProfile;
|
||||
|
||||
@ExcelField(title="pxy_intercept_monit_keyring",align=2,sort=17)
|
||||
public Integer getKeyring() {
|
||||
return keyring;
|
||||
}
|
||||
public void setKeyring(Integer keyring) {
|
||||
this.keyring = keyring;
|
||||
}
|
||||
@ExcelField(title="exclusions_ev_cert",align=2,sort=18)
|
||||
public Integer getEvCert() {
|
||||
return evCert;
|
||||
}
|
||||
public void setEvCert(Integer evCert) {
|
||||
this.evCert = evCert;
|
||||
}
|
||||
@ExcelField(title="exclusions_cert_transparency",align=2,sort=19)
|
||||
public Integer getCertTransparency() {
|
||||
return certTransparency;
|
||||
}
|
||||
public void setCertTransparency(Integer certTransparency) {
|
||||
this.certTransparency = certTransparency;
|
||||
}
|
||||
@ExcelField(title="exclusions_client_cert_req",align=2,sort=20)
|
||||
public Integer getClientCertReq() {
|
||||
return clientCertReq;
|
||||
}
|
||||
public void setClientCertReq(Integer clientCertReq) {
|
||||
this.clientCertReq = clientCertReq;
|
||||
}
|
||||
@ExcelField(title="exclusions_pinning",align=2,sort=21)
|
||||
public Integer getPinning() {
|
||||
return pinning;
|
||||
}
|
||||
public void setPinning(Integer pinning) {
|
||||
this.pinning = pinning;
|
||||
}
|
||||
@ExcelField(title="exclusions_protocol_errors",align=2,sort=22)
|
||||
public Integer getProtocolErrors() {
|
||||
return protocolErrors;
|
||||
}
|
||||
public void setProtocolErrors(Integer protocolErrors) {
|
||||
this.protocolErrors = protocolErrors;
|
||||
}
|
||||
@ExcelField(title="cert_verify_approach_cn",align=2,sort=23)
|
||||
public Integer getCn() {
|
||||
return cn;
|
||||
}
|
||||
public void setCn(Integer cn) {
|
||||
this.cn = cn;
|
||||
}
|
||||
@ExcelField(title="cert_verify_approach_issuer",align=2,sort=24)
|
||||
public Integer getIssuer() {
|
||||
return issuer;
|
||||
}
|
||||
public void setIssuer(Integer issuer) {
|
||||
this.issuer = issuer;
|
||||
}
|
||||
@ExcelField(title="cert_verify_approach_self_signed",align=2,sort=25)
|
||||
public Integer getSelfSigned() {
|
||||
return selfSigned;
|
||||
}
|
||||
public void setSelfSigned(Integer selfSigned) {
|
||||
this.selfSigned = selfSigned;
|
||||
}
|
||||
@ExcelField(title="cert_verify_approach_expiration",align=2,sort=26)
|
||||
public Integer getExpiration() {
|
||||
return expiration;
|
||||
}
|
||||
public void setExpiration(Integer expiration) {
|
||||
this.expiration = expiration;
|
||||
}
|
||||
@ExcelField(title="cert_verify_fail_method",dictType="FAIL_METHOD",align=2,sort=27)
|
||||
public String getFailMethod() {
|
||||
return failMethod;
|
||||
}
|
||||
public void setFailMethod(String failMethod) {
|
||||
this.failMethod = failMethod;
|
||||
}
|
||||
@ExcelField(title="ssl_ver_min",dictType="SSL_VERSION",align=2,sort=28)
|
||||
public String getMin() {
|
||||
return min;
|
||||
}
|
||||
public void setMin(String min) {
|
||||
this.min = min;
|
||||
}
|
||||
@ExcelField(title="ssl_ver_max",dictType="SSL_VERSION",align=2,sort=29)
|
||||
public String getMax() {
|
||||
return max;
|
||||
}
|
||||
public void setMax(String max) {
|
||||
this.max = max;
|
||||
}
|
||||
@ExcelField(title="ssl_ver_mirror_client",align=2,sort=30)
|
||||
public Integer getMirrorClient() {
|
||||
return mirrorClient;
|
||||
}
|
||||
public void setMirrorClient(Integer mirrorClient) {
|
||||
this.mirrorClient = mirrorClient;
|
||||
}
|
||||
@ExcelField(title="ssl_ver_allow_http2",align=2,sort=31)
|
||||
public Integer getAllowHttp2() {
|
||||
return allowHttp2;
|
||||
}
|
||||
public void setAllowHttp2(Integer allowHttp2) {
|
||||
this.allowHttp2 = allowHttp2;
|
||||
}
|
||||
@ExcelField(title="decrypt_mirror_enable",align=2,sort=32)
|
||||
public Integer getEnable() {
|
||||
return enable;
|
||||
}
|
||||
public void setEnable(Integer enable) {
|
||||
this.enable = enable;
|
||||
}
|
||||
@ExcelField(title="decrypt_mirror_mirror_profile",align=2,sort=33)
|
||||
public Integer getMirrorProfile() {
|
||||
return mirrorProfile;
|
||||
}
|
||||
public void setMirrorProfile(Integer mirrorProfile) {
|
||||
this.mirrorProfile = mirrorProfile;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
package com.nis.domain.configuration.template;
|
||||
|
||||
/**
|
||||
* wx 将部分字段的标题改变,或者不需要的字段隐藏
|
||||
* 隐藏方法,对于不需要的字段或者方法,Override该字段方法,但是@ExcelField注解不需要加上了
|
||||
* @author dell
|
||||
*
|
||||
*/
|
||||
@Deprecated
|
||||
public class IpAddrTemplate extends IpCfgTemplate {
|
||||
|
||||
|
||||
@Override
|
||||
public Integer getIrType() {
|
||||
// TODO Auto-generated method stub
|
||||
return super.getIrType();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getDnsStrategyId() {
|
||||
// TODO Auto-generated method stub
|
||||
return super.getDnsStrategyId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRatelimit() {
|
||||
// TODO Auto-generated method stub
|
||||
return super.getRatelimit();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -15,13 +15,13 @@ public class IpAllNotDoLogTemplate extends BasicTemplate{
|
||||
|
||||
|
||||
|
||||
private String cfgDesc;
|
||||
private String srcIpAddress;
|
||||
private String destIpAddress;
|
||||
private String srcPort;
|
||||
private String destPort;
|
||||
private Integer protocol;
|
||||
private Integer direction;
|
||||
protected String cfgDesc;
|
||||
protected String srcIpAddress;
|
||||
protected String destIpAddress;
|
||||
protected String srcPort;
|
||||
protected String destPort;
|
||||
protected Integer protocol;
|
||||
protected Integer direction;
|
||||
|
||||
@ExcelField(title="config_describe",align=2,sort=1)
|
||||
public String getCfgDesc() {
|
||||
|
||||
@@ -1,310 +0,0 @@
|
||||
/**
|
||||
*@Title: BaseStringConfig.java
|
||||
*@Package com.nis.domain.restful
|
||||
*@Description TODO
|
||||
*@author dell
|
||||
*@date 2018年2月5日 下午5:26:02
|
||||
*@version 版本号
|
||||
*/
|
||||
package com.nis.domain.configuration.template;
|
||||
|
||||
import com.nis.util.excel.ExcelField;
|
||||
|
||||
/**
|
||||
* @Description: excel导入IP类配置
|
||||
*/
|
||||
@Deprecated
|
||||
public class IpCfgTemplate {
|
||||
|
||||
/**
|
||||
* @Fields serialVersionUID:TODO(用一句话描述这个变量表示什么)
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
||||
|
||||
|
||||
private Long cfgId;
|
||||
private Integer ipType;//1
|
||||
private Integer ipPattern;//2
|
||||
private String srcIpAddress; //3
|
||||
private String destIpAddress; //4
|
||||
private Integer portPattern; //5
|
||||
private String srcPort; //6
|
||||
private String destPort;//7
|
||||
private Integer protocol;//8
|
||||
protected Integer direction;//9
|
||||
private String cfgDesc;//10
|
||||
private Integer requestId;//11
|
||||
private String requestName;//12
|
||||
private Integer isAreaEffective;//13
|
||||
private String classify;//14
|
||||
private String attribute;//15
|
||||
private String lable;//16
|
||||
private String classifyName;//17
|
||||
private String attributeName;//18
|
||||
private String lableName;//19
|
||||
private String areaEffectiveIds;//20
|
||||
private String ratelimit;//21
|
||||
private Integer dnsStrategyId;//22
|
||||
private Integer irType;//23
|
||||
private String userRegion1;//77
|
||||
private String userRegion2;//78
|
||||
private String userRegion3;//79
|
||||
private String userRegion4;//80
|
||||
private String userRegion5;//81
|
||||
|
||||
/**
|
||||
* userRegion1
|
||||
* @return userRegion1
|
||||
*/
|
||||
// @ExcelField(title="userregion1",align=2,sort=77)
|
||||
public String getUserRegion1() {
|
||||
return userRegion1;
|
||||
}
|
||||
/**
|
||||
* @param userRegion1 the userRegion1 to set
|
||||
*/
|
||||
public void setUserRegion1(String userRegion1) {
|
||||
this.userRegion1 = userRegion1;
|
||||
}
|
||||
/**
|
||||
* userRegion2
|
||||
* @return userRegion2
|
||||
*/
|
||||
// @ExcelField(title="userregion2",align=2,sort=78)
|
||||
public String getUserRegion2() {
|
||||
return userRegion2;
|
||||
}
|
||||
/**
|
||||
* @param userRegion2 the userRegion2 to set
|
||||
*/
|
||||
public void setUserRegion2(String userRegion2) {
|
||||
this.userRegion2 = userRegion2;
|
||||
}
|
||||
/**
|
||||
* userRegion3
|
||||
* @return userRegion3
|
||||
*/
|
||||
// @ExcelField(title="userregion3",align=2,sort=79)
|
||||
public String getUserRegion3() {
|
||||
return userRegion3;
|
||||
}
|
||||
/**
|
||||
* @param userRegion3 the userRegion3 to set
|
||||
*/
|
||||
public void setUserRegion3(String userRegion3) {
|
||||
this.userRegion3 = userRegion3;
|
||||
}
|
||||
/**
|
||||
* userRegion4
|
||||
* @return userRegion4
|
||||
*/
|
||||
// @ExcelField(title="userregion4",align=2,sort=80)
|
||||
public String getUserRegion4() {
|
||||
return userRegion4;
|
||||
}
|
||||
/**
|
||||
* @param userRegion4 the userRegion4 to set
|
||||
*/
|
||||
public void setUserRegion4(String userRegion4) {
|
||||
this.userRegion4 = userRegion4;
|
||||
}
|
||||
/**
|
||||
* userRegion5
|
||||
* @return userRegion5
|
||||
*/
|
||||
// @ExcelField(title="userregion5",align=2,sort=81)
|
||||
public String getUserRegion5() {
|
||||
return userRegion5;
|
||||
}
|
||||
/**
|
||||
* @param userRegion5 the userRegion5 to set
|
||||
*/
|
||||
public void setUserRegion5(String userRegion5) {
|
||||
this.userRegion5 = userRegion5;
|
||||
}
|
||||
/**
|
||||
* ratelimit
|
||||
* @return ratelimit
|
||||
*/
|
||||
@ExcelField(title="ratelimit",align=2,sort=74)
|
||||
public String getRatelimit() {
|
||||
return ratelimit;
|
||||
}
|
||||
/**
|
||||
* @param ratelimit the ratelimit to set
|
||||
*/
|
||||
public void setRatelimit(String ratelimit) {
|
||||
this.ratelimit = ratelimit;
|
||||
}
|
||||
/**
|
||||
* irType
|
||||
* @return irType
|
||||
*/
|
||||
@ExcelField(title="ir_type",align=2,sort=76)
|
||||
public Integer getIrType() {
|
||||
return irType;
|
||||
}
|
||||
/**
|
||||
* @param irType the irType to set
|
||||
*/
|
||||
public void setIrType(Integer irType) {
|
||||
this.irType = irType;
|
||||
}
|
||||
/**
|
||||
* dnsStrategyId
|
||||
* @return dnsStrategyId
|
||||
*/
|
||||
@ExcelField(title="dns_strategy_id",align=2,sort=75)
|
||||
public Integer getDnsStrategyId() {
|
||||
return dnsStrategyId;
|
||||
}
|
||||
/**
|
||||
* @param dnsStrategyId the dnsStrategyId to set
|
||||
*/
|
||||
public void setDnsStrategyId(Integer dnsStrategyId) {
|
||||
this.dnsStrategyId = dnsStrategyId;
|
||||
}
|
||||
@ExcelField(title="ip_type",align=2,sort=1)
|
||||
public Integer getIpType() {
|
||||
return ipType;
|
||||
}
|
||||
public void setIpType(Integer ipType) {
|
||||
this.ipType = ipType;
|
||||
}
|
||||
@ExcelField(title="ip_pattern",align=2,sort=2)
|
||||
public Integer getIpPattern() {
|
||||
return ipPattern;
|
||||
}
|
||||
public void setIpPattern(Integer ipPattern) {
|
||||
this.ipPattern = ipPattern;
|
||||
}
|
||||
@ExcelField(title="client_ip",align=2,sort=3)
|
||||
public String getSrcIpAddress() {
|
||||
return srcIpAddress;
|
||||
}
|
||||
public void setSrcIpAddress(String srcIpAddress) {
|
||||
this.srcIpAddress = srcIpAddress;
|
||||
}
|
||||
@ExcelField(title="server_ip",align=2,sort=4)
|
||||
public String getDestIpAddress() {
|
||||
return destIpAddress;
|
||||
}
|
||||
public void setDestIpAddress(String destIpAddress) {
|
||||
this.destIpAddress = destIpAddress;
|
||||
}
|
||||
@ExcelField(title="port_pattern",align=2,sort=5)
|
||||
public Integer getPortPattern() {
|
||||
return portPattern;
|
||||
}
|
||||
public void setPortPattern(Integer portPattern) {
|
||||
this.portPattern = portPattern;
|
||||
}
|
||||
@ExcelField(title="client_port",align=2,sort=6)
|
||||
public String getSrcPort() {
|
||||
return srcPort;
|
||||
}
|
||||
public void setSrcPort(String srcPort) {
|
||||
this.srcPort = srcPort;
|
||||
}
|
||||
@ExcelField(title="server_port",align=2,sort=7)
|
||||
public String getDestPort() {
|
||||
return destPort;
|
||||
}
|
||||
public void setDestPort(String destPort) {
|
||||
this.destPort = destPort;
|
||||
}
|
||||
public Long getCfgId() {
|
||||
return cfgId;
|
||||
}
|
||||
public void setCfgId(Long cfgId) {
|
||||
this.cfgId = cfgId;
|
||||
}
|
||||
@ExcelField(title="direction",align=2,sort=8)
|
||||
public Integer getDirection() {
|
||||
return direction;
|
||||
}
|
||||
public void setDirection(Integer direction) {
|
||||
this.direction = direction;
|
||||
}
|
||||
@ExcelField(title="config_describe",align=2,sort=11)
|
||||
public String getCfgDesc() {
|
||||
return cfgDesc;
|
||||
}
|
||||
public void setCfgDesc(String cfgDesc) {
|
||||
this.cfgDesc = cfgDesc;
|
||||
}
|
||||
@ExcelField(title="letter",align=2,sort=13)
|
||||
public Integer getRequestId() {
|
||||
return requestId;
|
||||
}
|
||||
public void setRequestId(Integer requestId) {
|
||||
this.requestId = requestId;
|
||||
}
|
||||
public String getRequestName() {
|
||||
return requestName;
|
||||
}
|
||||
public void setRequestName(String requestName) {
|
||||
this.requestName = requestName;
|
||||
}
|
||||
public Integer getIsAreaEffective() {
|
||||
return isAreaEffective;
|
||||
}
|
||||
public void setIsAreaEffective(Integer isAreaEffective) {
|
||||
this.isAreaEffective = isAreaEffective;
|
||||
}
|
||||
@ExcelField(title="classification",align=2,sort=71)
|
||||
public String getClassify() {
|
||||
return classify;
|
||||
}
|
||||
public void setClassify(String classify) {
|
||||
this.classify = classify;
|
||||
}
|
||||
@ExcelField(title="attribute",align=2,sort=72)
|
||||
public String getAttribute() {
|
||||
return attribute;
|
||||
}
|
||||
public void setAttribute(String attribute) {
|
||||
this.attribute = attribute;
|
||||
}
|
||||
@ExcelField(title="label",align=2,sort=73)
|
||||
public String getLable() {
|
||||
return lable;
|
||||
}
|
||||
public void setLable(String lable) {
|
||||
this.lable = lable;
|
||||
}
|
||||
public String getClassifyName() {
|
||||
return classifyName;
|
||||
}
|
||||
public void setClassifyName(String classifyName) {
|
||||
this.classifyName = classifyName;
|
||||
}
|
||||
public String getAttributeName() {
|
||||
return attributeName;
|
||||
}
|
||||
public void setAttributeName(String attributeName) {
|
||||
this.attributeName = attributeName;
|
||||
}
|
||||
public String getLableName() {
|
||||
return lableName;
|
||||
}
|
||||
public void setLableName(String lableName) {
|
||||
this.lableName = lableName;
|
||||
}
|
||||
// @ExcelField(title="area_effective",align=2,sort=70)
|
||||
public String getAreaEffectiveIds() {
|
||||
return areaEffectiveIds;
|
||||
}
|
||||
public void setAreaEffectiveIds(String areaEffectiveIds) {
|
||||
this.areaEffectiveIds = areaEffectiveIds;
|
||||
}
|
||||
@ExcelField(title="protocol",align=2,sort=9)
|
||||
public Integer getProtocol() {
|
||||
return protocol;
|
||||
}
|
||||
public void setProtocol(Integer protocol) {
|
||||
this.protocol = protocol;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.nis.domain.configuration.template;
|
||||
|
||||
import com.nis.util.excel.ExcelField;
|
||||
|
||||
public class IpCommCfgTemplate extends IpAllNotDoLogTemplate{
|
||||
|
||||
@ExcelField(title="group_name",align=2,sort=10)
|
||||
private String groupName;
|
||||
|
||||
public String getGroupName() {
|
||||
return groupName;
|
||||
}
|
||||
|
||||
public void setGroupName(String groupName) {
|
||||
this.groupName = groupName;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
package com.nis.domain.configuration.template;
|
||||
|
||||
import com.nis.util.excel.ExcelField;
|
||||
/**
|
||||
* wx 将部分字段的标题改变,或者不需要的字段隐藏
|
||||
* 隐藏方法,对于不需要的字段或者方法,Override该字段方法,但是@ExcelField注解不需要加上了
|
||||
* @author dell
|
||||
*
|
||||
*/
|
||||
@Deprecated
|
||||
public class IpMultiplexPolicyTemplate extends IpCfgTemplate {
|
||||
@Override
|
||||
@ExcelField(title="IP",align=2,sort=3)
|
||||
public String getSrcIpAddress() {
|
||||
return super.getSrcIpAddress();
|
||||
}
|
||||
@ExcelField(title="port",align=2,sort=6)
|
||||
@Override
|
||||
public String getSrcPort() {
|
||||
// TODO Auto-generated method stub
|
||||
return super.getSrcPort();
|
||||
}
|
||||
|
||||
@Override
|
||||
@ExcelField(title="group_name",align=2,sort=75)
|
||||
public Integer getDnsStrategyId() {
|
||||
// TODO Auto-generated method stub
|
||||
return super.getDnsStrategyId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRatelimit() {
|
||||
// TODO Auto-generated method stub
|
||||
return super.getRatelimit();
|
||||
}
|
||||
@Override
|
||||
public String getDestPort() {
|
||||
// TODO Auto-generated method stub
|
||||
return super.getDestPort();
|
||||
}
|
||||
@Override
|
||||
public String getDestIpAddress() {
|
||||
// TODO Auto-generated method stub
|
||||
return super.getDestIpAddress();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
package com.nis.domain.configuration.template;
|
||||
|
||||
/**
|
||||
* wx 将部分字段的标题改变,或者不需要的字段隐藏
|
||||
* 隐藏方法,对于不需要的字段或者方法,Override该字段方法,但是@ExcelField注解不需要加上了
|
||||
* @author dell
|
||||
*
|
||||
*/
|
||||
@Deprecated
|
||||
public class IpsecTemplate extends IpCfgTemplate {
|
||||
|
||||
|
||||
@Override
|
||||
public Integer getIrType() {
|
||||
// TODO Auto-generated method stub
|
||||
return super.getIrType();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getDnsStrategyId() {
|
||||
// TODO Auto-generated method stub
|
||||
return super.getDnsStrategyId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRatelimit() {
|
||||
// TODO Auto-generated method stub
|
||||
return super.getRatelimit();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -16,7 +16,7 @@ import com.nis.util.excel.ExcelField;
|
||||
public class P2pHashStringTemplate extends StringAllTemplate {
|
||||
private String userRegion1;
|
||||
|
||||
@ExcelField(title="p2p_hash_type",dictType="P2P_HASH_TYPE",align=2,sort=3)
|
||||
@ExcelField(title="p2p_hash_type",dictType="P2P_HASH_TYPE",align=2,sort=2)
|
||||
public String getUserRegion1() {
|
||||
return userRegion1;
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ public class P2pIpTemplate extends IpAllTemplate {
|
||||
|
||||
private String userRegion2;
|
||||
|
||||
@ExcelField(title="p2p_ip_config_type",dictType="P2P_IP_TYPE",align=2,sort=3)
|
||||
@ExcelField(title="p2p_ip_config_type",dictType="P2P_IP_TYPE",align=2,sort=5)
|
||||
public String getUserRegion2() {
|
||||
return userRegion2;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.nis.domain.configuration.template;
|
||||
|
||||
import com.nis.util.excel.ExcelField;
|
||||
|
||||
/**
|
||||
* 域名公共组配置 导入模板
|
||||
* @author dell
|
||||
*
|
||||
*/
|
||||
public class ScriberIdCommCfgTemplate extends StringAllNotDoLogTemplate{
|
||||
|
||||
@ExcelField(title="group_name",align=2,sort=10)
|
||||
private String groupName;
|
||||
|
||||
public String getGroupName() {
|
||||
return groupName;
|
||||
}
|
||||
|
||||
public void setGroupName(String groupName) {
|
||||
this.groupName = groupName;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
package com.nis.domain.configuration.template;
|
||||
|
||||
/**
|
||||
* wx 将部分字段的标题改变,或者不需要的字段隐藏
|
||||
* 隐藏方法,对于不需要的字段或者方法,Override该字段方法,但是@ExcelField注解不需要加上了
|
||||
* @author dell
|
||||
*
|
||||
*/
|
||||
@Deprecated
|
||||
public class TunnelIpTemplate extends IpCfgTemplate {
|
||||
|
||||
|
||||
@Override
|
||||
public Integer getIrType() {
|
||||
// TODO Auto-generated method stub
|
||||
return super.getIrType();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getDnsStrategyId() {
|
||||
// TODO Auto-generated method stub
|
||||
return super.getDnsStrategyId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRatelimit() {
|
||||
// TODO Auto-generated method stub
|
||||
return super.getRatelimit();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getProtocol() {
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.nis.domain.configuration.template;
|
||||
|
||||
import com.nis.util.excel.ExcelField;
|
||||
|
||||
/**
|
||||
* URL公共组配置 导入模板
|
||||
* @author dell
|
||||
*
|
||||
*/
|
||||
public class UrlCommCfgTemplate extends StringAllNotDoLogTemplate{
|
||||
|
||||
@ExcelField(title="group_name",align=2,sort=10)
|
||||
private String groupName;
|
||||
|
||||
public String getGroupName() {
|
||||
return groupName;
|
||||
}
|
||||
|
||||
public void setGroupName(String groupName) {
|
||||
this.groupName = groupName;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,66 +0,0 @@
|
||||
package com.nis.domain.configuration.template;
|
||||
|
||||
/**
|
||||
* wx 将部分字段的标题改变,或者不需要的字段隐藏
|
||||
* 隐藏方法,对于不需要的字段或者方法,Override该字段方法,但是@ExcelField注解不需要加上了
|
||||
* @author dell
|
||||
*
|
||||
*/
|
||||
@Deprecated
|
||||
public class WhiteListIpTemplate extends IpCfgTemplate {
|
||||
|
||||
@Override
|
||||
public Integer getDirection() {
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getProtocol() {
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getIrType() {
|
||||
// TODO Auto-generated method stub
|
||||
return super.getIrType();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getDnsStrategyId() {
|
||||
// TODO Auto-generated method stub
|
||||
return super.getDnsStrategyId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getRequestId() {
|
||||
// TODO Auto-generated method stub
|
||||
return super.getRequestId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getClassify() {
|
||||
// TODO Auto-generated method stub
|
||||
return super.getClassify();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getAttribute() {
|
||||
// TODO Auto-generated method stub
|
||||
return super.getAttribute();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getLable() {
|
||||
// TODO Auto-generated method stub
|
||||
return super.getLable();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRatelimit() {
|
||||
// TODO Auto-generated method stub
|
||||
return super.getRatelimit();
|
||||
}
|
||||
|
||||
}
|
||||
116
src/main/java/com/nis/domain/dashboard/ConfigStatistic.java
Normal file
116
src/main/java/com/nis/domain/dashboard/ConfigStatistic.java
Normal file
@@ -0,0 +1,116 @@
|
||||
package com.nis.domain.dashboard;
|
||||
|
||||
import com.nis.domain.report.BaseReport;
|
||||
import com.nis.util.excel.ExcelField;
|
||||
|
||||
public class ConfigStatistic extends BaseReport<ConfigStatistic>{
|
||||
private static final long serialVersionUID = 8905927100915123026L;
|
||||
|
||||
@ExcelField(title="cfg_id",sort=1)
|
||||
private String cfgId;
|
||||
@ExcelField(title="config_describe",sort=2)
|
||||
private String cfgDesc;
|
||||
private String serviceId;
|
||||
private String tableName;//表名
|
||||
private String beginDate;
|
||||
private String endDate;
|
||||
private String area;//区域
|
||||
private String operator;//运营商
|
||||
private String chartType;//图表类型
|
||||
|
||||
public String getBeginDate() {
|
||||
return beginDate;
|
||||
}
|
||||
|
||||
public void setBeginDate(String beginDate) {
|
||||
this.beginDate = beginDate;
|
||||
}
|
||||
|
||||
public String getEndDate() {
|
||||
return endDate;
|
||||
}
|
||||
|
||||
public void setEndDate(String endDate) {
|
||||
this.endDate = endDate;
|
||||
}
|
||||
|
||||
public String getTime() {
|
||||
return time;
|
||||
}
|
||||
|
||||
public void setTime(String time) {
|
||||
this.time = time;
|
||||
}
|
||||
|
||||
public String getCfgId() {
|
||||
return cfgId;
|
||||
}
|
||||
|
||||
public void setCfgId(String cfgId) {
|
||||
this.cfgId = cfgId;
|
||||
}
|
||||
|
||||
public String getCfgDesc() {
|
||||
return cfgDesc;
|
||||
}
|
||||
|
||||
public void setCfgDesc(String cfgDesc) {
|
||||
this.cfgDesc = cfgDesc;
|
||||
}
|
||||
|
||||
public String getServiceId() {
|
||||
return serviceId;
|
||||
}
|
||||
|
||||
public void setServiceId(String serviceId) {
|
||||
this.serviceId = serviceId;
|
||||
}
|
||||
|
||||
public String getTableName() {
|
||||
return tableName;
|
||||
}
|
||||
|
||||
public void setTableName(String tableName) {
|
||||
this.tableName = tableName;
|
||||
}
|
||||
|
||||
public Long getSum() {
|
||||
return sum;
|
||||
}
|
||||
|
||||
public void setSum(Long sum) {
|
||||
this.sum = sum;
|
||||
}
|
||||
|
||||
public Integer getService() {
|
||||
return service;
|
||||
}
|
||||
|
||||
public void setService(Integer service) {
|
||||
this.service = service;
|
||||
}
|
||||
|
||||
public String getArea() {
|
||||
return area;
|
||||
}
|
||||
|
||||
public void setArea(String area) {
|
||||
this.area = area;
|
||||
}
|
||||
|
||||
public String getOperator() {
|
||||
return operator;
|
||||
}
|
||||
|
||||
public void setOperator(String operator) {
|
||||
this.operator = operator;
|
||||
}
|
||||
|
||||
public String getChartType() {
|
||||
return chartType;
|
||||
}
|
||||
|
||||
public void setChartType(String chartType) {
|
||||
this.chartType = chartType;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
package com.nis.domain.dashboard.codedic;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
public class CodeDomainDic implements Serializable{
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 8878203808371459079L;
|
||||
|
||||
private Integer id;
|
||||
|
||||
private String websiteServiceId;
|
||||
|
||||
private String domain;
|
||||
|
||||
private String topicId;
|
||||
|
||||
private Date createTime;
|
||||
|
||||
private String creatorId;
|
||||
|
||||
private Integer isValid;
|
||||
|
||||
private String ican;
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getWebsiteServiceId() {
|
||||
return websiteServiceId;
|
||||
}
|
||||
|
||||
public void setWebsiteServiceId(String websiteServiceId) {
|
||||
this.websiteServiceId = websiteServiceId;
|
||||
}
|
||||
|
||||
public String getDomain() {
|
||||
return domain;
|
||||
}
|
||||
|
||||
public void setDomain(String domain) {
|
||||
this.domain = domain;
|
||||
}
|
||||
|
||||
public String getTopicId() {
|
||||
return topicId;
|
||||
}
|
||||
|
||||
public void setTopicId(String topicId) {
|
||||
this.topicId = topicId;
|
||||
}
|
||||
|
||||
public Date getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public void setCreateTime(Date createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
public String getCreatorId() {
|
||||
return creatorId;
|
||||
}
|
||||
|
||||
public void setCreatorId(String creatorId) {
|
||||
this.creatorId = creatorId;
|
||||
}
|
||||
|
||||
public Integer getIsValid() {
|
||||
return isValid;
|
||||
}
|
||||
|
||||
public void setIsValid(Integer isValid) {
|
||||
this.isValid = isValid;
|
||||
}
|
||||
|
||||
public String getIcan() {
|
||||
return ican;
|
||||
}
|
||||
|
||||
public void setIcan(String ican) {
|
||||
this.ican = ican;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -6,7 +6,7 @@ public class NtcCollectRadiusLog extends BaseLogEntity<NtcCollectRadiusLog> {
|
||||
|
||||
private static final long serialVersionUID = -4947912502754359817L;
|
||||
|
||||
@ExcelField(title="message_type",dictType="MESSAGE_TYPE",sort=10)
|
||||
@ExcelField(title="code",dictType="MESSAGE_TYPE",sort=10)
|
||||
protected Integer code;
|
||||
@ExcelField(title="nas_ip",sort=15)
|
||||
protected String nasIp;
|
||||
|
||||
736
src/main/java/com/nis/domain/log/PxyHttpManipulationLog.java
Normal file
736
src/main/java/com/nis/domain/log/PxyHttpManipulationLog.java
Normal file
@@ -0,0 +1,736 @@
|
||||
package com.nis.domain.log;
|
||||
|
||||
import com.google.gson.annotations.Expose;
|
||||
import com.nis.domain.BaseEntity;
|
||||
import com.nis.util.excel.ExcelField;
|
||||
/**
|
||||
* (日志 代理)HTTP 操控 实体类
|
||||
*
|
||||
*/
|
||||
public class PxyHttpManipulationLog extends BaseEntity<PxyHttpManipulationLog>{
|
||||
private static final long serialVersionUID = -3046458130302949428L;
|
||||
|
||||
@ExcelField(title="found_time",sort=5)
|
||||
protected String foundTime; //发现时间,timestamp
|
||||
@ExcelField(title="recv_time",sort=6)
|
||||
protected String recvTime; //接收时间,timestamp
|
||||
@ExcelField(title="transport_layer_protocol",dictType="LOG_PROTOCOL",sort=30)
|
||||
protected String transProto; //协议类型,从字典LOG_PROTOCOL取值
|
||||
@ExcelField(title="addr_type",dictType="IP_TYPE",sort=35)
|
||||
protected Integer addrType; //ip地址类型,从字典IP_TYPE取值
|
||||
@ExcelField(title="URL",sort=8)
|
||||
private String url;
|
||||
@ExcelField(title="host",sort=8)
|
||||
private String host;//主机地址
|
||||
@ExcelField(title="domain_name",sort=8)
|
||||
private String domain;//域名
|
||||
@ExcelField(title="category",sort=8)
|
||||
private String category;//域名分类
|
||||
@ExcelField(title="req_line",sort=9)
|
||||
private String reqLine;
|
||||
@ExcelField(title="res_line",sort=10)
|
||||
private String resLine;
|
||||
@ExcelField(title="PXY_CACHE_HTTP_COOKIE",sort=11)
|
||||
private String cookie;
|
||||
@ExcelField(title="referer",sort=12)
|
||||
private String referer;
|
||||
@ExcelField(title="user_agent",sort=13)
|
||||
private String userAgent;
|
||||
@ExcelField(title="content_len",sort=14)
|
||||
private String contentLen;
|
||||
@ExcelField(title="content_type",sort=15)
|
||||
private String contentType;
|
||||
@ExcelField(title="set_cookie",sort=16)
|
||||
private String setCookie;
|
||||
@ExcelField(title="req_header",sort=17)
|
||||
private String reqHeader;
|
||||
@ExcelField(title="resp_header",sort=18)
|
||||
private String respHeader;
|
||||
@ExcelField(title="req_body",sort=78)
|
||||
private String reqBody;
|
||||
@ExcelField(title="resp_body",sort=79)
|
||||
private String respBody;
|
||||
// @ExcelField(title="website",sort=8)
|
||||
// private String website;
|
||||
@ExcelField(title="cfg_id",sort=1)
|
||||
private Integer policyId;//
|
||||
@ExcelField(title="app_proto",sort=31)
|
||||
private String appProto;//应用协议类型
|
||||
@ExcelField(title="startTime",sort=5)
|
||||
private String startTime;//会话创建时间
|
||||
@ExcelField(title="endTime",sort=5)
|
||||
private String endTime;//会话结束时间
|
||||
@Expose
|
||||
@ExcelField(title="server_ip",sort=40)
|
||||
protected String serverIp; //服务端ip地址
|
||||
@Expose
|
||||
@ExcelField(title="client_ip",sort=41)
|
||||
protected String clientIp; //客户端ip地址
|
||||
@Expose
|
||||
@ExcelField(title="server_port",sort=42)
|
||||
protected String serverPort; //服务端ip端口
|
||||
@Expose
|
||||
@ExcelField(title="client_port",sort=43)
|
||||
protected String clientPort; //客户端ip端口
|
||||
@ExcelField(title="entrance_id",dictType="ENTRANCE",sort=7)
|
||||
protected Integer entranceId; //出入口编号
|
||||
@ExcelField(title="deviceid",dictType="DEVICE",sort=50)
|
||||
protected Integer deviceId; //串联设备编号
|
||||
@ExcelField(title="direction",dictType="LOG_DIRECTION",sort=55)
|
||||
protected Integer direction; //传输方向 0:域内->域外,1:域外->域内,从字典LOG_DIRECTION取值
|
||||
@ExcelField(title="stream_type",dictType="LOG_STREAM_TYPE",sort=65)
|
||||
protected Integer streamDir; //流类型 0:c2s;1:s2c;2:double,从字典LOG_STREAMTYPE取值
|
||||
@ExcelField(title="clj_ip",sort=27)
|
||||
protected String capIp; //处理机IP
|
||||
@ExcelField(title="nest_addr_list",sort=66)
|
||||
protected String addrList; //嵌套地址列表
|
||||
@ExcelField(title="server_locate",sort=67)
|
||||
protected String serverLocation;// 服务端地址定位信息
|
||||
@ExcelField(title="client_locate",sort=68)
|
||||
protected String clientLocation;// 客户端地址定位信息
|
||||
@ExcelField(title="s_asn",sort=70)
|
||||
protected String clientAsn;//客户端ASN
|
||||
@ExcelField(title="d_asn",sort=71)
|
||||
protected String serverAsn;//服务端ASN
|
||||
@ExcelField(title="s_subscribe_id",sort=73)
|
||||
protected String subscribeId;//客户端用户名
|
||||
@ExcelField(title="scene_file",sort=77)
|
||||
protected String sceneFile;//现场日志文件地址
|
||||
|
||||
@ExcelField(title="isp",sort=80)
|
||||
protected String isp;//运营商
|
||||
protected Integer service; //配置表的serviceId
|
||||
protected Integer functionId;
|
||||
@ExcelField(title="action",dictType="SERVICE_ACTION",sort=2)
|
||||
protected Integer action;
|
||||
//新增字段
|
||||
@ExcelField(title="encap_type",dictType="ENCAP_TYPE",sort=52)
|
||||
protected Integer encapType;//原始二层封装格式
|
||||
@ExcelField(title="link_id",dictType="LINK",sort=51)
|
||||
protected Integer linkId;//串联设备链路号
|
||||
@ExcelField(title="inner_smac",sort=58)
|
||||
protected String innerSmac;//MAC_IN_MAC的内层源MAC
|
||||
@ExcelField(title="inner_dmac",sort=59)
|
||||
protected String innerDmac;//MAC_IN_MAC的内层目标MAC
|
||||
//自定义字段
|
||||
protected String date;//配置界面日志总量查询时间
|
||||
protected String seltype;//选中类型,页面搜索用
|
||||
protected String searchFoundStartTime;//开始时间,格式为yyyy-mm-dd hh24:mi:ss
|
||||
protected String searchFoundEndTime;//结束时间,格式同上
|
||||
protected String isLogTotalSearch;//由配置界面跳转日志查询标识
|
||||
protected String orderBy;//排序参数
|
||||
protected Integer cfgId;
|
||||
protected String fields;
|
||||
|
||||
protected Integer compileId;//
|
||||
protected String startRecvTime;//开始时间
|
||||
protected String endRecvTime; //结束时间
|
||||
@ExcelField(title="con_duration_ms",sort=81)
|
||||
protected Integer conDurationMs;//通信时长
|
||||
protected String reqBodyKey;//请求体转储文件KEY
|
||||
protected String resBodyKey;//应答体转储文件KEY
|
||||
@ExcelField(title="version",sort=82)
|
||||
protected String version;//版本
|
||||
@ExcelField(title="sni",sort=83)
|
||||
protected String sni;//
|
||||
@ExcelField(title="san",sort=84)
|
||||
protected String san;
|
||||
@ExcelField(title="cn",sort=85)
|
||||
protected String cn;
|
||||
@ExcelField(title="social_app",sort=86)
|
||||
protected String appId;//app
|
||||
// @ExcelField(title="social_app",sort=86)
|
||||
protected String appName;//app
|
||||
@ExcelField(title="protocol",sort=87)
|
||||
protected String protocolId;//协议
|
||||
// @ExcelField(title="protocol",sort=87)
|
||||
protected String protocolName;//协议
|
||||
@ExcelField(title="con_latency_ms",sort=88)
|
||||
protected Integer conLatencyMs;//握手延迟
|
||||
@ExcelField(title="pinning",dictType="PINNING",sort=89)
|
||||
protected Integer pinningst;//pinning状态
|
||||
@ExcelField(title="intercept_state",dictType="INTERCEPT_STATE",sort=90)
|
||||
protected Integer interceptState;//拦截状态
|
||||
@ExcelField(title="ssl_server_side_latency",sort=91)
|
||||
protected Integer sslServerSideLatency;//服务器侧ssl建立延迟
|
||||
@ExcelField(title="ssl_client_side_latency",sort=92)
|
||||
protected Integer sslClientSideLatency;//客户端侧ssl建立延迟
|
||||
@ExcelField(title="ssl_server_side_version",dictType="SSL_VERSION",sort=93)
|
||||
protected String sslServerSideVersion;//服务端侧ssl版本
|
||||
@ExcelField(title="ssl_client_side_version",dictType="SSL_VERSION",sort=94)
|
||||
protected String sslClientSideVersion;//客户端侧ssl版本
|
||||
@ExcelField(title="ssl_cert_verify",dictType="SSL_CERT_VERIFY",sort=95)
|
||||
protected Integer sslCertVerify;//证书校验结果
|
||||
@ExcelField(title="stream_trace_id",sort=96)
|
||||
protected String streamTraceId;//流的追踪ID
|
||||
@ExcelField(title="ssl_error",sort=97)
|
||||
protected String sslError;//ssl错误信息
|
||||
@ExcelField(title="c2s_pkt_num",sort=98)
|
||||
protected Integer c2sPktNum;//c2s包数
|
||||
@ExcelField(title="s2c_pkt_num",sort=99)
|
||||
protected Integer s2cPktNum;//s2c包数
|
||||
@ExcelField(title="c2s_byte_num",sort=100)
|
||||
protected Integer c2sByteNum;//c2s字节数
|
||||
@ExcelField(title="s2c_byte_num",sort=101)
|
||||
protected Integer s2cByteNum;//s2c字节数
|
||||
@ExcelField(title="nas_ip",sort=102)
|
||||
protected String nasIp;//ISN接入的IP
|
||||
@ExcelField(title="framed_ip",sort=103)
|
||||
protected String framedIp;//用户IP地址
|
||||
@ExcelField(title="account",sort=104)
|
||||
protected String account;//用户名
|
||||
@ExcelField(title="packet_type",dictType="MESSAGE_TYPE",sort=105)
|
||||
protected Integer packetType;//报文类型
|
||||
|
||||
protected String dIp;
|
||||
protected String sIp;
|
||||
public String getProtocolName() {
|
||||
return protocolName;
|
||||
}
|
||||
public void setProtocolName(String protocolName) {
|
||||
this.protocolName = protocolName;
|
||||
}
|
||||
public String getAppName() {
|
||||
return appName;
|
||||
}
|
||||
public void setAppName(String appName) {
|
||||
this.appName = appName;
|
||||
}
|
||||
public String getdIp() {
|
||||
return dIp;
|
||||
}
|
||||
public void setdIp(String dIp) {
|
||||
this.dIp = dIp;
|
||||
}
|
||||
public String getsIp() {
|
||||
return sIp;
|
||||
}
|
||||
public void setsIp(String sIp) {
|
||||
this.sIp = sIp;
|
||||
}
|
||||
public String getAppProto() {
|
||||
return appProto;
|
||||
}
|
||||
public void setAppProto(String appProto) {
|
||||
this.appProto = appProto;
|
||||
}
|
||||
public String getUrl() {
|
||||
return url;
|
||||
}
|
||||
public void setUrl(String url) {
|
||||
this.url = url;
|
||||
}
|
||||
public String getReqLine() {
|
||||
return reqLine;
|
||||
}
|
||||
public void setReqLine(String reqLine) {
|
||||
this.reqLine = reqLine;
|
||||
}
|
||||
public String getResLine() {
|
||||
return resLine;
|
||||
}
|
||||
public void setResLine(String resLine) {
|
||||
this.resLine = resLine;
|
||||
}
|
||||
public String getCookie() {
|
||||
return cookie;
|
||||
}
|
||||
public void setCookie(String cookie) {
|
||||
this.cookie = cookie;
|
||||
}
|
||||
public String getReferer() {
|
||||
return referer;
|
||||
}
|
||||
public void setReferer(String referer) {
|
||||
this.referer = referer;
|
||||
}
|
||||
public String getUserAgent() {
|
||||
return userAgent;
|
||||
}
|
||||
public void setUserAgent(String userAgent) {
|
||||
this.userAgent = userAgent;
|
||||
}
|
||||
public String getContentLen() {
|
||||
return contentLen;
|
||||
}
|
||||
public void setContentLen(String contentLen) {
|
||||
this.contentLen = contentLen;
|
||||
}
|
||||
public String getContentType() {
|
||||
return contentType;
|
||||
}
|
||||
public void setContentType(String contentType) {
|
||||
this.contentType = contentType;
|
||||
}
|
||||
public String getSetCookie() {
|
||||
return setCookie;
|
||||
}
|
||||
public void setSetCookie(String setCookie) {
|
||||
this.setCookie = setCookie;
|
||||
}
|
||||
public String getReqHeader() {
|
||||
return reqHeader;
|
||||
}
|
||||
public void setReqHeader(String reqHeader) {
|
||||
this.reqHeader = reqHeader;
|
||||
}
|
||||
public String getRespHeader() {
|
||||
return respHeader;
|
||||
}
|
||||
public void setRespHeader(String respHeader) {
|
||||
this.respHeader = respHeader;
|
||||
}
|
||||
public String getReqBody() {
|
||||
return reqBody;
|
||||
}
|
||||
public void setReqBody(String reqBody) {
|
||||
this.reqBody = reqBody;
|
||||
}
|
||||
public String getRespBody() {
|
||||
return respBody;
|
||||
}
|
||||
public void setRespBody(String respBody) {
|
||||
this.respBody = respBody;
|
||||
}
|
||||
// public String getWebsite() {
|
||||
// return website;
|
||||
// }
|
||||
// public void setWebsite(String website) {
|
||||
// this.website = website;
|
||||
// }
|
||||
public String getHost() {
|
||||
return host;
|
||||
}
|
||||
public void setHost(String host) {
|
||||
this.host = host;
|
||||
}
|
||||
public String getDomain() {
|
||||
return domain;
|
||||
}
|
||||
public void setDomain(String domain) {
|
||||
this.domain = domain;
|
||||
}
|
||||
public String getCategory() {
|
||||
return category;
|
||||
}
|
||||
public void setCategory(String category) {
|
||||
this.category = category;
|
||||
}
|
||||
public String getIsp() {
|
||||
return isp;
|
||||
}
|
||||
public void setIsp(String isp) {
|
||||
this.isp = isp;
|
||||
}
|
||||
public Integer getPolicyId() {
|
||||
return policyId;
|
||||
}
|
||||
public void setPolicyId(Integer policyId) {
|
||||
this.policyId = policyId;
|
||||
}
|
||||
public String getStartTime() {
|
||||
return startTime;
|
||||
}
|
||||
public void setStartTime(String startTime) {
|
||||
this.startTime = startTime;
|
||||
}
|
||||
public String getEndTime() {
|
||||
return endTime;
|
||||
}
|
||||
public void setEndTime(String endTime) {
|
||||
this.endTime = endTime;
|
||||
}
|
||||
public String getServerIp() {
|
||||
return serverIp;
|
||||
}
|
||||
public void setServerIp(String serverIp) {
|
||||
this.serverIp = serverIp;
|
||||
}
|
||||
public String getClientIp() {
|
||||
return clientIp;
|
||||
}
|
||||
public void setClientIp(String clientIp) {
|
||||
this.clientIp = clientIp;
|
||||
}
|
||||
public String getServerPort() {
|
||||
return serverPort;
|
||||
}
|
||||
public void setServerPort(String serverPort) {
|
||||
this.serverPort = serverPort;
|
||||
}
|
||||
public String getClientPort() {
|
||||
return clientPort;
|
||||
}
|
||||
public void setClientPort(String clientPort) {
|
||||
this.clientPort = clientPort;
|
||||
}
|
||||
public String getServerLocation() {
|
||||
return serverLocation;
|
||||
}
|
||||
public void setServerLocation(String serverLocation) {
|
||||
this.serverLocation = serverLocation;
|
||||
}
|
||||
public String getClientLocation() {
|
||||
return clientLocation;
|
||||
}
|
||||
public void setClientLocation(String clientLocation) {
|
||||
this.clientLocation = clientLocation;
|
||||
}
|
||||
public String getClientAsn() {
|
||||
return clientAsn;
|
||||
}
|
||||
public void setClientAsn(String clientAsn) {
|
||||
this.clientAsn = clientAsn;
|
||||
}
|
||||
public String getServerAsn() {
|
||||
return serverAsn;
|
||||
}
|
||||
public void setServerAsn(String serverAsn) {
|
||||
this.serverAsn = serverAsn;
|
||||
}
|
||||
public String getSubscribeId() {
|
||||
return subscribeId;
|
||||
}
|
||||
public void setSubscribeId(String subscribeId) {
|
||||
this.subscribeId = subscribeId;
|
||||
}
|
||||
public Integer getConDurationMs() {
|
||||
return conDurationMs;
|
||||
}
|
||||
public void setConDurationMs(Integer conDurationMs) {
|
||||
this.conDurationMs = conDurationMs;
|
||||
}
|
||||
public String getReqBodyKey() {
|
||||
return reqBodyKey;
|
||||
}
|
||||
public void setReqBodyKey(String reqBodyKey) {
|
||||
this.reqBodyKey = reqBodyKey;
|
||||
}
|
||||
public String getResBodyKey() {
|
||||
return resBodyKey;
|
||||
}
|
||||
public void setResBodyKey(String resBodyKey) {
|
||||
this.resBodyKey = resBodyKey;
|
||||
}
|
||||
public String getVersion() {
|
||||
return version;
|
||||
}
|
||||
public void setVersion(String version) {
|
||||
this.version = version;
|
||||
}
|
||||
public String getSni() {
|
||||
return sni;
|
||||
}
|
||||
public void setSni(String sni) {
|
||||
this.sni = sni;
|
||||
}
|
||||
public String getSan() {
|
||||
return san;
|
||||
}
|
||||
public void setSan(String san) {
|
||||
this.san = san;
|
||||
}
|
||||
public String getCn() {
|
||||
return cn;
|
||||
}
|
||||
public void setCn(String cn) {
|
||||
this.cn = cn;
|
||||
}
|
||||
public String getAppId() {
|
||||
return appId;
|
||||
}
|
||||
public void setAppId(String appId) {
|
||||
this.appId = appId;
|
||||
}
|
||||
public String getProtocolId() {
|
||||
return protocolId;
|
||||
}
|
||||
public void setProtocolId(String protocolId) {
|
||||
this.protocolId = protocolId;
|
||||
}
|
||||
public Integer getConLatencyMs() {
|
||||
return conLatencyMs;
|
||||
}
|
||||
public void setConLatencyMs(Integer conLatencyMs) {
|
||||
this.conLatencyMs = conLatencyMs;
|
||||
}
|
||||
public Integer getPinningst() {
|
||||
return pinningst;
|
||||
}
|
||||
public void setPinningst(Integer pinningst) {
|
||||
this.pinningst = pinningst;
|
||||
}
|
||||
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 getC2sByteNum() {
|
||||
return c2sByteNum;
|
||||
}
|
||||
public void setC2sByteNum(Integer c2sByteNum) {
|
||||
this.c2sByteNum = c2sByteNum;
|
||||
}
|
||||
public Integer getS2cByteNum() {
|
||||
return s2cByteNum;
|
||||
}
|
||||
public void setS2cByteNum(Integer s2cByteNum) {
|
||||
this.s2cByteNum = s2cByteNum;
|
||||
}
|
||||
public String getNasIp() {
|
||||
return nasIp;
|
||||
}
|
||||
public void setNasIp(String nasIp) {
|
||||
this.nasIp = nasIp;
|
||||
}
|
||||
public String getFramedIp() {
|
||||
return framedIp;
|
||||
}
|
||||
public void setFramedIp(String framedIp) {
|
||||
this.framedIp = framedIp;
|
||||
}
|
||||
public String getAccount() {
|
||||
return account;
|
||||
}
|
||||
public void setAccount(String account) {
|
||||
this.account = account;
|
||||
}
|
||||
public Integer getPacketType() {
|
||||
return packetType;
|
||||
}
|
||||
public void setPacketType(Integer packetType) {
|
||||
this.packetType = packetType;
|
||||
}
|
||||
public Integer getCompileId() {
|
||||
return compileId;
|
||||
}
|
||||
public void setCompileId(Integer compileId) {
|
||||
this.compileId = compileId;
|
||||
}
|
||||
public String getStartRecvTime() {
|
||||
return startRecvTime;
|
||||
}
|
||||
public void setStartRecvTime(String startRecvTime) {
|
||||
this.startRecvTime = startRecvTime;
|
||||
}
|
||||
public String getEndRecvTime() {
|
||||
return endRecvTime;
|
||||
}
|
||||
public void setEndRecvTime(String endRecvTime) {
|
||||
this.endRecvTime = endRecvTime;
|
||||
}
|
||||
public String getFoundTime() {
|
||||
return foundTime;
|
||||
}
|
||||
public void setFoundTime(String foundTime) {
|
||||
this.foundTime = foundTime;
|
||||
}
|
||||
public String getRecvTime() {
|
||||
return recvTime;
|
||||
}
|
||||
public void setRecvTime(String recvTime) {
|
||||
this.recvTime = recvTime;
|
||||
}
|
||||
public String getTransProto() {
|
||||
return transProto;
|
||||
}
|
||||
public void setTransProto(String transProto) {
|
||||
this.transProto = transProto;
|
||||
}
|
||||
public Integer getAddrType() {
|
||||
return addrType;
|
||||
}
|
||||
public void setAddrType(Integer addrType) {
|
||||
this.addrType = addrType;
|
||||
}
|
||||
public Integer getEntranceId() {
|
||||
return entranceId;
|
||||
}
|
||||
public void setEntranceId(Integer entranceId) {
|
||||
this.entranceId = entranceId;
|
||||
}
|
||||
public Integer getDeviceId() {
|
||||
return deviceId;
|
||||
}
|
||||
public void setDeviceId(Integer deviceId) {
|
||||
this.deviceId = deviceId;
|
||||
}
|
||||
public Integer getDirection() {
|
||||
return direction;
|
||||
}
|
||||
public void setDirection(Integer direction) {
|
||||
this.direction = direction;
|
||||
}
|
||||
public Integer getStreamDir() {
|
||||
return streamDir;
|
||||
}
|
||||
public void setStreamDir(Integer streamDir) {
|
||||
this.streamDir = streamDir;
|
||||
}
|
||||
public String getCapIp() {
|
||||
return capIp;
|
||||
}
|
||||
public void setCapIp(String capIp) {
|
||||
this.capIp = capIp;
|
||||
}
|
||||
public String getAddrList() {
|
||||
return addrList;
|
||||
}
|
||||
public void setAddrList(String addrList) {
|
||||
this.addrList = addrList;
|
||||
}
|
||||
public String getSceneFile() {
|
||||
return sceneFile;
|
||||
}
|
||||
public void setSceneFile(String sceneFile) {
|
||||
this.sceneFile = sceneFile;
|
||||
}
|
||||
public Integer getService() {
|
||||
return service;
|
||||
}
|
||||
public void setService(Integer service) {
|
||||
this.service = service;
|
||||
}
|
||||
public Integer getFunctionId() {
|
||||
return functionId;
|
||||
}
|
||||
public void setFunctionId(Integer functionId) {
|
||||
this.functionId = functionId;
|
||||
}
|
||||
public Integer getAction() {
|
||||
return action;
|
||||
}
|
||||
public void setAction(Integer action) {
|
||||
this.action = action;
|
||||
}
|
||||
public Integer getEncapType() {
|
||||
return encapType;
|
||||
}
|
||||
public void setEncapType(Integer encapType) {
|
||||
this.encapType = encapType;
|
||||
}
|
||||
public Integer getLinkId() {
|
||||
return linkId;
|
||||
}
|
||||
public void setLinkId(Integer linkId) {
|
||||
this.linkId = linkId;
|
||||
}
|
||||
public String getInnerSmac() {
|
||||
return innerSmac;
|
||||
}
|
||||
public void setInnerSmac(String innerSmac) {
|
||||
this.innerSmac = innerSmac;
|
||||
}
|
||||
public String getInnerDmac() {
|
||||
return innerDmac;
|
||||
}
|
||||
public void setInnerDmac(String innerDmac) {
|
||||
this.innerDmac = innerDmac;
|
||||
}
|
||||
public String getDate() {
|
||||
return date;
|
||||
}
|
||||
public void setDate(String date) {
|
||||
this.date = date;
|
||||
}
|
||||
public String getSeltype() {
|
||||
return seltype;
|
||||
}
|
||||
public void setSeltype(String seltype) {
|
||||
this.seltype = seltype;
|
||||
}
|
||||
public String getSearchFoundStartTime() {
|
||||
return searchFoundStartTime;
|
||||
}
|
||||
public void setSearchFoundStartTime(String searchFoundStartTime) {
|
||||
this.searchFoundStartTime = searchFoundStartTime;
|
||||
}
|
||||
public String getSearchFoundEndTime() {
|
||||
return searchFoundEndTime;
|
||||
}
|
||||
public void setSearchFoundEndTime(String searchFoundEndTime) {
|
||||
this.searchFoundEndTime = searchFoundEndTime;
|
||||
}
|
||||
public String getIsLogTotalSearch() {
|
||||
return isLogTotalSearch;
|
||||
}
|
||||
public void setIsLogTotalSearch(String isLogTotalSearch) {
|
||||
this.isLogTotalSearch = isLogTotalSearch;
|
||||
}
|
||||
public String getOrderBy() {
|
||||
return orderBy;
|
||||
}
|
||||
public void setOrderBy(String orderBy) {
|
||||
this.orderBy = orderBy;
|
||||
}
|
||||
public Integer getInterceptState() {
|
||||
return interceptState;
|
||||
}
|
||||
public void setInterceptState(Integer interceptState) {
|
||||
this.interceptState = interceptState;
|
||||
}
|
||||
public Integer getSslServerSideLatency() {
|
||||
return sslServerSideLatency;
|
||||
}
|
||||
public void setSslServerSideLatency(Integer sslServerSideLatency) {
|
||||
this.sslServerSideLatency = sslServerSideLatency;
|
||||
}
|
||||
public Integer getSslClientSideLatency() {
|
||||
return sslClientSideLatency;
|
||||
}
|
||||
public void setSslClientSideLatency(Integer sslClientSideLatency) {
|
||||
this.sslClientSideLatency = sslClientSideLatency;
|
||||
}
|
||||
public String getSslServerSideVersion() {
|
||||
return sslServerSideVersion;
|
||||
}
|
||||
public void setSslServerSideVersion(String sslServerSideVersion) {
|
||||
this.sslServerSideVersion = sslServerSideVersion;
|
||||
}
|
||||
public String getSslClientSideVersion() {
|
||||
return sslClientSideVersion;
|
||||
}
|
||||
public void setSslClientSideVersion(String sslClientSideVersion) {
|
||||
this.sslClientSideVersion = sslClientSideVersion;
|
||||
}
|
||||
public Integer getSslCertVerify() {
|
||||
return sslCertVerify;
|
||||
}
|
||||
public void setSslCertVerify(Integer sslCertVerify) {
|
||||
this.sslCertVerify = sslCertVerify;
|
||||
}
|
||||
public String getStreamTraceId() {
|
||||
return streamTraceId;
|
||||
}
|
||||
public void setStreamTraceId(String streamTraceId) {
|
||||
this.streamTraceId = streamTraceId;
|
||||
}
|
||||
public String getSslError() {
|
||||
return sslError;
|
||||
}
|
||||
public void setSslError(String sslError) {
|
||||
this.sslError = sslError;
|
||||
}
|
||||
public Integer getCfgId() {
|
||||
return cfgId;
|
||||
}
|
||||
public void setCfgId(Integer cfgId) {
|
||||
this.cfgId = cfgId;
|
||||
}
|
||||
public String getFields() {
|
||||
return fields;
|
||||
}
|
||||
public void setFields(String fields) {
|
||||
this.fields = fields;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
140
src/main/java/com/nis/domain/maat/ManipulatActionParam.java
Normal file
140
src/main/java/com/nis/domain/maat/ManipulatActionParam.java
Normal file
@@ -0,0 +1,140 @@
|
||||
package com.nis.domain.maat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
import com.google.gson.annotations.Expose;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
/**
|
||||
* 管控策略动作参数
|
||||
*/
|
||||
public class ManipulatActionParam implements Serializable{
|
||||
|
||||
private static final long serialVersionUID = 7282481538239386968L;
|
||||
|
||||
@Expose
|
||||
private String method;
|
||||
|
||||
@Expose
|
||||
private Integer code;
|
||||
|
||||
@Expose
|
||||
private String to;
|
||||
|
||||
@Expose
|
||||
private String message;
|
||||
|
||||
@Expose
|
||||
private Integer html_profile;
|
||||
|
||||
@Expose
|
||||
private List<ReplaceCfg> rules;
|
||||
|
||||
public static class ReplaceCfg{
|
||||
@Expose
|
||||
private String search_in;
|
||||
|
||||
@Expose
|
||||
private String find;
|
||||
|
||||
@Expose
|
||||
private String replace_with;
|
||||
|
||||
public String getSearch_in() {
|
||||
return search_in;
|
||||
}
|
||||
|
||||
public void setSearch_in(String search_in) {
|
||||
this.search_in = search_in;
|
||||
}
|
||||
|
||||
public String getFind() {
|
||||
return find;
|
||||
}
|
||||
|
||||
public void setFind(String find) {
|
||||
this.find = find;
|
||||
}
|
||||
|
||||
public String getReplace_with() {
|
||||
return replace_with;
|
||||
}
|
||||
|
||||
public void setReplace_with(String replace_with) {
|
||||
this.replace_with = replace_with;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Expose
|
||||
private Integer hijack_profile;
|
||||
|
||||
@Expose
|
||||
private Integer insert_profile;
|
||||
|
||||
public String getMethod() {
|
||||
return method;
|
||||
}
|
||||
|
||||
public void setMethod(String method) {
|
||||
this.method = method;
|
||||
}
|
||||
|
||||
public Integer getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public void setCode(Integer code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public String getTo() {
|
||||
return to;
|
||||
}
|
||||
|
||||
public void setTo(String to) {
|
||||
this.to = to;
|
||||
}
|
||||
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
public void setMessage(String message) {
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public Integer getHtml_profile() {
|
||||
return html_profile;
|
||||
}
|
||||
|
||||
public void setHtml_profile(Integer html_profile) {
|
||||
this.html_profile = html_profile;
|
||||
}
|
||||
|
||||
public List<ReplaceCfg> getRules() {
|
||||
return rules;
|
||||
}
|
||||
|
||||
public void setRules(List<ReplaceCfg> rules) {
|
||||
this.rules = rules;
|
||||
}
|
||||
|
||||
public Integer getHijack_profile() {
|
||||
return hijack_profile;
|
||||
}
|
||||
|
||||
public void setHijack_profile(Integer hijack_profile) {
|
||||
this.hijack_profile = hijack_profile;
|
||||
}
|
||||
|
||||
public Integer getInsert_profile() {
|
||||
return insert_profile;
|
||||
}
|
||||
|
||||
public void setInsert_profile(Integer insert_profile) {
|
||||
this.insert_profile = insert_profile;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -9,6 +9,7 @@
|
||||
package com.nis.domain.report;
|
||||
|
||||
import com.nis.domain.BaseEntity;
|
||||
import com.nis.util.excel.ExcelField;
|
||||
|
||||
/**
|
||||
* @ClassName: BaseReportLog.java
|
||||
@@ -25,6 +26,7 @@ public class BaseReport<T> extends BaseEntity<T>{
|
||||
*/
|
||||
|
||||
private static final long serialVersionUID = -6190203013788730697L;
|
||||
@ExcelField(title="config_log_total",sort=3)
|
||||
protected Long sum;
|
||||
protected Integer service;
|
||||
protected String reportTime;
|
||||
|
||||
@@ -30,13 +30,15 @@ public class SpecificServiceHostCfg extends BaseEntity<SpecificServiceHostCfg>{
|
||||
@Expose
|
||||
private Integer protocol; //protocol 协议 int N 6表示tcp,17表示udp,0表示任意
|
||||
@Expose
|
||||
private Integer ipPattern; //ip格式
|
||||
private Integer srcIpPattern; //ip格式
|
||||
private Integer destIpPattern; //ip格式
|
||||
@Expose
|
||||
private String srcIpAddress; //源(客户端)IP地址
|
||||
@Expose
|
||||
private String destIpAddress; //目的(服务器)IP地址
|
||||
@Expose
|
||||
private Integer portPattern; //端口格式
|
||||
private Integer srcPortPattern; //端口格式
|
||||
private Integer destPortPattern; //端口格式
|
||||
@Expose
|
||||
private String srcPort; //源(客户端)端口
|
||||
@Expose
|
||||
@@ -114,19 +116,33 @@ public class SpecificServiceHostCfg extends BaseEntity<SpecificServiceHostCfg>{
|
||||
public void setDestPort(String destPort) {
|
||||
this.destPort = destPort;
|
||||
}
|
||||
@ExcelField(title="ip_pattern",align=2,sort=21,fieldType=Integer.class)
|
||||
public Integer getIpPattern() {
|
||||
return ipPattern;
|
||||
@ExcelField(title="src_ip_pattern",align=2,sort=21,fieldType=Integer.class)
|
||||
public Integer getSrcIpPattern() {
|
||||
return srcIpPattern;
|
||||
}
|
||||
public void setIpPattern(Integer ipPattern) {
|
||||
this.ipPattern = ipPattern;
|
||||
public void setSrcIpPattern(Integer srcIpPattern) {
|
||||
this.srcIpPattern = srcIpPattern;
|
||||
}
|
||||
@ExcelField(title="port_pattern",align=2,sort=40,fieldType=Integer.class)
|
||||
public Integer getPortPattern() {
|
||||
return portPattern;
|
||||
@ExcelField(title="dest_ip_pattern",align=2,sort=22,fieldType=Integer.class)
|
||||
public Integer getDestIpPattern() {
|
||||
return destIpPattern;
|
||||
}
|
||||
public void setPortPattern(Integer portPattern) {
|
||||
this.portPattern = portPattern;
|
||||
public void setDestIpPattern(Integer destIpPattern) {
|
||||
this.destIpPattern = destIpPattern;
|
||||
}
|
||||
@ExcelField(title="src_port_pattern",align=2,sort=40,fieldType=Integer.class)
|
||||
public Integer getSrcPortPattern() {
|
||||
return srcPortPattern;
|
||||
}
|
||||
public void setSrcPortPattern(Integer srcPortPattern) {
|
||||
this.srcPortPattern = srcPortPattern;
|
||||
}
|
||||
@ExcelField(title="dest_port_pattern",align=2,sort=41,fieldType=Integer.class)
|
||||
public Integer getDestPortPattern() {
|
||||
return destPortPattern;
|
||||
}
|
||||
public void setDestPortPattern(Integer destPortPattern) {
|
||||
this.destPortPattern = destPortPattern;
|
||||
}
|
||||
@ExcelField(title="direction",align=2,sort=110)
|
||||
public Integer getDirection() {
|
||||
|
||||
@@ -71,6 +71,7 @@ public class ScheduleUpdateInterceptor extends BaseInterceptor{
|
||||
EXCLUDE_MAPPER_IDS.add("com.nis.web.dao.basics.ServiceDictInfoDao");
|
||||
EXCLUDE_MAPPER_IDS.add("com.nis.web.dao.configuration.PxyObjKeyringDao.updatePxyObjTrustedCaCrl");
|
||||
EXCLUDE_MAPPER_IDS.add("com.nis.web.dao.configuration.CommonPolicyDao.auditCfgBatch");
|
||||
EXCLUDE_MAPPER_IDS.add("com.nis.web.dao.configuration.CommonPolicyDao.deleteCfgBatch");
|
||||
}
|
||||
/**
|
||||
* is_valid 字段名
|
||||
@@ -161,10 +162,11 @@ public class ScheduleUpdateInterceptor extends BaseInterceptor{
|
||||
//整理需要 insert 的 schedule_cfg 的数据
|
||||
List<ScheduleCfg> scheduleList = Lists.newArrayList();
|
||||
for(BaseCfg<?> baseCfg : cfgList) {
|
||||
baseCfg.setIsValid(0);//设置默认值
|
||||
baseCfg.setIsAudit(0);//设置默认值
|
||||
ScheduleCfg scList = copyScheduleCfgFromBaseCfg(baseCfg, tableName);
|
||||
if(scList!=null){
|
||||
//TODO 定时任务设置默认为isValid=0 isAudit=0,需要考虑允许用户新增isValid=1 isAudit=1的配置下发
|
||||
scList.setIsValid(0);//设置默认值
|
||||
scList.setIsAudit(0);//设置默认值
|
||||
scheduleList.add(scList);
|
||||
}
|
||||
}
|
||||
@@ -199,6 +201,7 @@ public class ScheduleUpdateInterceptor extends BaseInterceptor{
|
||||
sc.setCompileId(compileId);
|
||||
sc.setEditorId(bc.getEditorId());
|
||||
sc.setEditTime(bc.getEditTime());
|
||||
sc.setType(1);
|
||||
sc.setCfgId(cfgId);
|
||||
//根据 compileId 删除之前的
|
||||
MappedStatement statement = configuration.getMappedStatement("com.nis.web.dao.SchedulerDao.deleteByCompileId");
|
||||
@@ -275,6 +278,7 @@ public class ScheduleUpdateInterceptor extends BaseInterceptor{
|
||||
MappedStatement statement = configuration.getMappedStatement("com.nis.web.dao.SchedulerDao.insert");
|
||||
scfg.setIsValid(isValid);
|
||||
scfg.setIsAudit(isAudit);
|
||||
scfg.setType(1);
|
||||
executor.update(statement, scfg);
|
||||
}
|
||||
//手动 审核通过,立即生效时 已经下发,修改 exce_new 表的是否需要下发字段为 不需要 : 0
|
||||
@@ -331,6 +335,7 @@ public class ScheduleUpdateInterceptor extends BaseInterceptor{
|
||||
if(schedule != null ) {
|
||||
BeanUtils.copyProperties(baseCfg, schedule,new String[]{"userRegion1","userRegion2","userRegion3","userRegion4","userRegion5"});
|
||||
schedule.setTableName(tableName);
|
||||
schedule.setType(1);
|
||||
}
|
||||
return schedule;
|
||||
}
|
||||
|
||||
@@ -82,15 +82,21 @@ public class ScheduleCfgJob implements Job {
|
||||
SchedulerDao dao = SpringContextHolder.getBean(SchedulerDao.class);
|
||||
JobDataMap dataMap = context.getJobDetail().getJobDataMap();
|
||||
long scheduleCfgId = dataMap.get("scheduleCfgId") == null ? 0:dataMap.getLong("scheduleCfgId");
|
||||
long limit = dataMap.get("limit") == null ? 1000:dataMap.getLong("limit");
|
||||
long limit = dataMap.get("limit") == null ? Constants.MAAT_JSON_SEND_SIZE:dataMap.getLong("limit");
|
||||
log.info(String.format("定时配置任务开始执行,scheduleCfgId:%s,limit:%s",scheduleCfgId,limit ));
|
||||
List<ScheduleCfg> newlyCfg = null;
|
||||
List<ScheduleCfg> allNewlySche = null;
|
||||
int totalNum = 0;
|
||||
do {
|
||||
newlyCfg = dao.findNewlyCfg(scheduleCfgId, limit);
|
||||
if(newlyCfg != null && newlyCfg.size() > 0) {
|
||||
totalNum += newlyCfg.size();
|
||||
for(ScheduleCfg cfg : newlyCfg) {//先取消之前的定时配置
|
||||
allNewlySche = dao.findNewlyCfg(scheduleCfgId, limit,1,1);
|
||||
if(allNewlySche != null && allNewlySche.size() > 0) {
|
||||
List<ScheduleCfg> allAddSche = new ArrayList<>();
|
||||
totalNum += allNewlySche.size();
|
||||
//先取消之前的定时配置
|
||||
for(ScheduleCfg cfg : allNewlySche) {
|
||||
//获取有效的任务
|
||||
if(cfg.getDelFlag()==1) {
|
||||
allAddSche.add(cfg);
|
||||
}
|
||||
Integer compileId = cfg.getCompileId();
|
||||
try {
|
||||
//取消之前所有的 trigger
|
||||
@@ -106,7 +112,7 @@ public class ScheduleCfgJob implements Job {
|
||||
log.error(String.format("定时任务取消异常,compileId:%s", compileId),e);
|
||||
}
|
||||
}
|
||||
for(ScheduleCfg cfg : newlyCfg) {
|
||||
for(ScheduleCfg cfg : allAddSche) {
|
||||
Integer compileId = cfg.getCompileId();
|
||||
try {
|
||||
//判断状态,重新添加最新的 trigger
|
||||
@@ -123,12 +129,12 @@ public class ScheduleCfgJob implements Job {
|
||||
}
|
||||
}
|
||||
//最后 保存此次 最后的id
|
||||
ScheduleCfg lastCfg = newlyCfg.get(newlyCfg.size() -1);
|
||||
ScheduleCfg lastCfg = allNewlySche.get(allNewlySche.size() -1);
|
||||
scheduleCfgId = lastCfg.getId();
|
||||
dataMap.put("scheduleCfgId", scheduleCfgId);
|
||||
log.info(String.format("加载定时任务,total num :%s", newlyCfg.size()));
|
||||
log.info(String.format("加载定时任务,total num :%s", allNewlySche.size()));
|
||||
}
|
||||
} while (newlyCfg != null && newlyCfg.size() > 0);
|
||||
} while (allNewlySche != null && allNewlySche.size() > 0);
|
||||
log.info(String.format("定时配置任务结束执行,total num:%s",totalNum));
|
||||
}
|
||||
|
||||
@@ -315,6 +321,34 @@ public class ScheduleCfgJob implements Job {
|
||||
Date invalidTime = DateBuilder.todayAt(invalidList.get(0), invalidList.get(1), invalidList.get(2));
|
||||
CalendarIntervalScheduleBuilder intervalBuilder = null;
|
||||
if("EVERYDAY".equalsIgnoreCase(dayOrWeek)) {
|
||||
//开始时间+2分钟
|
||||
Calendar validStartCal=Calendar.getInstance();
|
||||
validStartCal.setTime(validStartTime);
|
||||
validStartCal.add(Calendar.MINUTE, 2);
|
||||
long validStartTimes=validStartCal.getTime().getTime();
|
||||
//结束时间+2分钟
|
||||
Calendar invalidCal=Calendar.getInstance();
|
||||
invalidCal.setTime(invalidTime);
|
||||
invalidCal.add(Calendar.MINUTE, 2);
|
||||
long invalidTimes=invalidCal.getTime().getTime();
|
||||
long currentTimes=new Date().getTime();
|
||||
//开始时间设置为今天已过时,则将开始时间加上周期
|
||||
if((currentTimes-validStartTimes) > 0) {
|
||||
Calendar validStartCalNew=Calendar.getInstance();
|
||||
validStartCalNew.setTime(validStartTime);
|
||||
validStartCalNew.add(Calendar.DAY_OF_MONTH, interval);
|
||||
validStartTime=validStartCalNew.getTime();
|
||||
}
|
||||
|
||||
//结束时间设置为今天已过时,则将开始时间加上周期
|
||||
if((currentTimes-invalidTimes) > 0) {
|
||||
Calendar invalidCalNew=Calendar.getInstance();
|
||||
invalidCalNew.setTime(invalidTime);
|
||||
invalidCalNew.add(Calendar.DAY_OF_MONTH, interval);
|
||||
invalidTime=invalidCalNew.getTime();
|
||||
}
|
||||
|
||||
|
||||
intervalBuilder = CalendarIntervalScheduleBuilder.calendarIntervalSchedule().withIntervalInDays(interval);
|
||||
//valid
|
||||
JobDataMap dataMap = new JobDataMap();
|
||||
@@ -329,6 +363,7 @@ public class ScheduleCfgJob implements Job {
|
||||
.startAt(validStartTime)
|
||||
.build();
|
||||
triList.add(validTri);
|
||||
|
||||
//invalid
|
||||
dataMap = new JobDataMap();
|
||||
dataMap.put("isValid", false);
|
||||
@@ -478,14 +513,25 @@ public class ScheduleCfgJob implements Job {
|
||||
|
||||
|
||||
/**
|
||||
* 查找最近的 星期几 ,包括今天
|
||||
* 查找最近的 星期几 ,包括今天(如果今天的时间点已过,从明天开始算)
|
||||
* @param date
|
||||
* @param w 周一开始 1 -7
|
||||
* @return
|
||||
*/
|
||||
public static Date closestAfterWeek(Date date,int w) {
|
||||
//设置calC为开始时间+2分钟,判断calC时间是否已过,如果小于当前时间则直接从明天开始算
|
||||
Calendar calC = Calendar.getInstance();
|
||||
calC.setTime(date);
|
||||
calC.add(Calendar.MINUTE, 2);
|
||||
long currentDate=new Date().getTime();//当前时间
|
||||
long weekStartDate=calC.getTime().getTime();//周任务开始时间+2分钟
|
||||
|
||||
Calendar cal = Calendar.getInstance();
|
||||
cal.setTime(date);
|
||||
//如果开始时间已过期,则从明天开始算
|
||||
if((currentDate-weekStartDate) > 0) {
|
||||
cal.add(Calendar.DAY_OF_MONTH, 1);
|
||||
}
|
||||
int i = cal.get(Calendar.DAY_OF_WEEK);//周日开始 1-7
|
||||
i = (i==1)? 7: i-1;//转换为 周一到 周日 1-7
|
||||
cal.add(Calendar.DAY_OF_MONTH, (i>w)?(7-(i-w)) : (w-i));
|
||||
|
||||
137
src/main/java/com/nis/quartz/ScheduleStatisticASNIPNumJob.java
Normal file
137
src/main/java/com/nis/quartz/ScheduleStatisticASNIPNumJob.java
Normal file
@@ -0,0 +1,137 @@
|
||||
package com.nis.quartz;
|
||||
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import org.apache.ibatis.session.ExecutorType;
|
||||
import org.apache.ibatis.session.SqlSession;
|
||||
import org.apache.ibatis.session.SqlSessionFactory;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.quartz.DisallowConcurrentExecution;
|
||||
import org.quartz.Job;
|
||||
import org.quartz.JobExecutionContext;
|
||||
import org.quartz.JobExecutionException;
|
||||
import org.quartz.PersistJobDataAfterExecution;
|
||||
|
||||
import com.nis.util.IPUtil;
|
||||
import com.nis.util.StringUtil;
|
||||
import com.nis.web.dao.basics.AsnGroupInfoDao;
|
||||
import com.nis.web.dao.basics.AsnIpCfgDao;
|
||||
import com.nis.web.service.SpringContextHolder;
|
||||
|
||||
/**
|
||||
* 定时任务: 定时统计ASN 下IPv4和IPV6的个数
|
||||
* 1、每 n s 执行一次(两个小时执行一次)
|
||||
* 2、单线程执行
|
||||
* @author ddm
|
||||
*
|
||||
*/
|
||||
@DisallowConcurrentExecution
|
||||
@PersistJobDataAfterExecution
|
||||
public class ScheduleStatisticASNIPNumJob implements Job {
|
||||
private static final Logger logger = Logger.getLogger(ScheduleStatisticASNIPNumJob.class);
|
||||
|
||||
@Override
|
||||
public void execute(JobExecutionContext context) throws JobExecutionException {
|
||||
AsnIpCfgDao asnIpCfgDao = SpringContextHolder.getBean(AsnIpCfgDao.class);
|
||||
logger.info("定时统计ASN IP个数开始。。。。。。。。。。。。。。");
|
||||
long start=System.currentTimeMillis();
|
||||
Map<Integer,Map<String,Long>> asnNumerMap=new HashMap<>();
|
||||
List<Object[]> asnIpList=new ArrayList<>();
|
||||
asnIpList=asnIpCfgDao.findAllAsnIpCfgList();
|
||||
|
||||
getAllASNIPNumber(asnIpList, asnNumerMap);
|
||||
|
||||
updateAllASNIPNumber(asnNumerMap);
|
||||
|
||||
long end=System.currentTimeMillis();
|
||||
logger.info("定时统计ASN IP个数结束:耗时("+(end-start)+"/毫秒)。。。。。。。。。。。。。。");
|
||||
}
|
||||
|
||||
public void getAllASNIPNumber(List<Object[]> asnIpList,Map<Integer,Map<String,Long>> asnNumerMap){
|
||||
logger.info("计算ASN IP开始:asn ip size:"+asnIpList.size()+"。。。。。。。。。。。。。。");
|
||||
long start=System.currentTimeMillis();
|
||||
if(!StringUtil.isEmpty(asnIpList)){
|
||||
try {
|
||||
for (Iterator iterator = asnIpList.iterator(); iterator.hasNext();) {
|
||||
Map asnIpMap=(Map) iterator.next();
|
||||
//groupId
|
||||
Integer asnGroupId = (Integer)asnIpMap.get("asn_ip_group");
|
||||
//ipType(4:v4,6:v6)
|
||||
Integer ipType= (Integer)asnIpMap.get("ip_type");
|
||||
//(1:mask,2:range,3:ip)
|
||||
//Integer ipPattern= (Integer)asnIpMap.get("ip_pattern");
|
||||
//dest_ip_address
|
||||
String ipAddress= (String)asnIpMap.get("dest_ip_address");
|
||||
long IPNumber=0;
|
||||
if(ipType.equals(4)){
|
||||
if(ipAddress.indexOf("/") > -1){
|
||||
Integer mask=Integer.parseInt(ipAddress.split("/")[1]);
|
||||
ipAddress=ipAddress.split("/")[0];
|
||||
IPNumber=IPUtil.getIpNum(ipAddress, mask);
|
||||
}else{
|
||||
IPNumber=1;
|
||||
}
|
||||
//判断组是否已经存在
|
||||
if(asnNumerMap.keySet().contains(asnGroupId)){
|
||||
asnNumerMap.get(asnGroupId).put("v4", asnNumerMap.get(asnGroupId).get("v4")+IPNumber);
|
||||
asnNumerMap.put(asnGroupId, asnNumerMap.get(asnGroupId));
|
||||
}else{
|
||||
Map<String, Long> map=new HashMap<>();
|
||||
map.put("v4", IPNumber);
|
||||
map.put("v6", 0l);
|
||||
asnNumerMap.put(asnGroupId, map);
|
||||
}
|
||||
}else{
|
||||
IPNumber=1;
|
||||
//判断组是否已经存在
|
||||
if(asnNumerMap.keySet().contains(asnGroupId)){
|
||||
asnNumerMap.get(asnGroupId).put("v6", asnNumerMap.get(asnGroupId).get("v6")+IPNumber);
|
||||
asnNumerMap.put(asnGroupId, asnNumerMap.get(asnGroupId));
|
||||
}else{
|
||||
Map<String, Long> map=new HashMap<>();
|
||||
map.put("v4", 0l);
|
||||
map.put("v6", IPNumber);
|
||||
asnNumerMap.put(asnGroupId, map);
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error("计算ASN IP个数失败",e);
|
||||
}
|
||||
}
|
||||
|
||||
long end=System.currentTimeMillis();
|
||||
logger.info("计算ASN IP个数结束:耗时("+(end-start)+"/毫秒)。。。。。。。。。。。。。。");
|
||||
}
|
||||
public void updateAllASNIPNumber(Map<Integer,Map<String,Long>> asnNumerMap) {
|
||||
logger.info("修改ASN IP个数开始:asn size:"+asnNumerMap.size()+"。。。。。。。。。。。。。。");
|
||||
long start=System.currentTimeMillis();
|
||||
if(!StringUtil.isEmpty(asnNumerMap)){
|
||||
int index=0;
|
||||
SqlSessionFactory sqlSessionFactory=SpringContextHolder.getBean(SqlSessionFactory.class);
|
||||
SqlSession batchSqlSession = null;
|
||||
try {
|
||||
batchSqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH, true);
|
||||
for(Entry<Integer,Map<String,Long>> e: asnNumerMap.entrySet()) {
|
||||
((AsnGroupInfoDao) batchSqlSession.getMapper(AsnGroupInfoDao.class)).updateIpNum(e.getValue().get("v4"),e.getValue().get("v6"),e.getKey());
|
||||
batchSqlSession.commit();
|
||||
index++;
|
||||
}
|
||||
}catch (Exception e) {
|
||||
logger.error("修改ASN IP个数失败", e);
|
||||
} finally {
|
||||
if(batchSqlSession != null){
|
||||
batchSqlSession.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
long end=System.currentTimeMillis();
|
||||
logger.info("修改ASN IP个数结束:耗时("+(end-start)+"/毫秒)。。。。。。。。。。。。。。");
|
||||
}
|
||||
}
|
||||
@@ -1,12 +1,20 @@
|
||||
package com.nis.quartz;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.quartz.Job;
|
||||
import org.quartz.JobDataMap;
|
||||
import org.quartz.JobExecutionContext;
|
||||
import org.quartz.JobExecutionException;
|
||||
import org.quartz.Scheduler;
|
||||
import org.quartz.SchedulerException;
|
||||
|
||||
import com.nis.domain.ScheduleCfg;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.util.DateUtil;
|
||||
import com.nis.util.DictUtils;
|
||||
import com.nis.web.dao.SchedulerDao;
|
||||
import com.nis.web.service.ScheduleService;
|
||||
import com.nis.web.service.SpringContextHolder;
|
||||
|
||||
@@ -23,6 +31,33 @@ public class ScheduleStatusJob implements Job{
|
||||
|
||||
@Override
|
||||
public void execute(JobExecutionContext context) throws JobExecutionException {
|
||||
|
||||
//全量同步状态
|
||||
String currentStatus = DictUtils.getDictLabel("currrent_sync_status", "status","0");
|
||||
//0:start:开始 1:init:初始化 2:doing:进行中
|
||||
|
||||
//全量同步过程中未执行的任务进入另一个job中,等待全量同步完成开始执行
|
||||
if(currentStatus.equals("0") || currentStatus.equals("1")||currentStatus.equals("2")) {
|
||||
//配置下发,并修改 配置表的状态,保存下发记录等
|
||||
SchedulerDao schedulerDao = SpringContextHolder.getBean(SchedulerDao.class);
|
||||
//从trigger中 获取 配置信息
|
||||
JobDataMap jobDataMap = context.getTrigger().getJobDataMap();
|
||||
boolean isValid = jobDataMap.getBoolean("isValid");
|
||||
|
||||
ScheduleCfg cfg = (ScheduleCfg)jobDataMap.get("cfg");
|
||||
cfg.setId(null);//新入库一个任务
|
||||
cfg.setType(2);//全量同步中未执行的任务
|
||||
cfg.setUserRegion1("single"); //只执行一次
|
||||
if(isValid) {
|
||||
cfg.setCronValid("1900-01-01 01:01:01"); //无实际效果,仅仅为填充值
|
||||
cfg.setCronInvalid("");
|
||||
}else {
|
||||
cfg.setCronValid("");
|
||||
cfg.setCronInvalid("1900-01-01 01:01:01");//无实际效果,仅仅为填充值
|
||||
}
|
||||
schedulerDao.insert(cfg);
|
||||
|
||||
}else {
|
||||
//从trigger中 获取 配置信息
|
||||
JobDataMap jobDataMap = context.getTrigger().getJobDataMap();
|
||||
boolean isValid = jobDataMap.getBoolean("isValid");
|
||||
@@ -31,8 +66,17 @@ public class ScheduleStatusJob implements Job{
|
||||
log.debug(String.format("任务开始执行,compileId:%s,isValid:%s",compileId,isValid ));
|
||||
//配置下发,并修改 配置表的状态,保存下发记录等
|
||||
ScheduleService scheduleService = SpringContextHolder.getBean(ScheduleService.class);
|
||||
try {
|
||||
scheduleService.issueCompileInfo(cfg, isValid?1:0);
|
||||
log.debug(String.format("任务开始执行,compileId:%s,isValid:%s",compileId,isValid ));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
log.error("定时任务"+cfg.getId()+"执行失败",e);
|
||||
}finally {
|
||||
log.debug(String.format("任务执行完成,compileId:%s,isValid:%s",compileId,isValid ));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
548
src/main/java/com/nis/quartz/ScheduleSyncCfgJob.java
Normal file
548
src/main/java/com/nis/quartz/ScheduleSyncCfgJob.java
Normal file
@@ -0,0 +1,548 @@
|
||||
package com.nis.quartz;
|
||||
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.quartz.CalendarIntervalScheduleBuilder;
|
||||
import org.quartz.CalendarIntervalTrigger;
|
||||
import org.quartz.CronScheduleBuilder;
|
||||
import org.quartz.DateBuilder;
|
||||
import org.quartz.DisallowConcurrentExecution;
|
||||
import org.quartz.Job;
|
||||
import org.quartz.JobBuilder;
|
||||
import org.quartz.JobDataMap;
|
||||
import org.quartz.JobDetail;
|
||||
import org.quartz.JobExecutionContext;
|
||||
import org.quartz.JobExecutionException;
|
||||
import org.quartz.JobKey;
|
||||
import org.quartz.PersistJobDataAfterExecution;
|
||||
import org.quartz.ScheduleBuilder;
|
||||
import org.quartz.Scheduler;
|
||||
import org.quartz.SchedulerException;
|
||||
import org.quartz.SimpleScheduleBuilder;
|
||||
import org.quartz.SimpleTrigger;
|
||||
import org.quartz.Trigger;
|
||||
import org.quartz.TriggerBuilder;
|
||||
import org.quartz.TriggerKey;
|
||||
import org.quartz.impl.matchers.GroupMatcher;
|
||||
import org.quartz.impl.triggers.CalendarIntervalTriggerImpl;
|
||||
import org.quartz.impl.triggers.CronTriggerImpl;
|
||||
import org.quartz.spi.MutableTrigger;
|
||||
|
||||
import com.nis.domain.ScheduleCfg;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.util.DateUtil;
|
||||
import com.nis.util.DateUtils;
|
||||
import com.nis.util.DictUtils;
|
||||
import com.nis.util.StringUtils;
|
||||
import com.nis.web.dao.SchedulerDao;
|
||||
import com.nis.web.service.SpringContextHolder;
|
||||
|
||||
/**
|
||||
* 定时任务 配置全量同步时未执行的定时任务加载
|
||||
* 1、每 n s 执行一次,每次读取 schedule_cfg 最新的数据
|
||||
* 2、删除或新增 定时任务
|
||||
* 3、单线程执行
|
||||
* @author ddm
|
||||
*
|
||||
*/
|
||||
@DisallowConcurrentExecution
|
||||
@PersistJobDataAfterExecution
|
||||
public class ScheduleSyncCfgJob implements Job {
|
||||
SimpleDateFormat sdf=new SimpleDateFormat(Constants.COMMON_DATE_FORMAT);
|
||||
private static final Logger log = Logger.getLogger(ScheduleSyncCfgJob.class);
|
||||
|
||||
/**
|
||||
* 状态组,格式:statusGroup-compileId
|
||||
*/
|
||||
private static final String STATUS_GROUP = "syncGroup-";
|
||||
private static final String STATUS_JOB = "SYNC-JOB";
|
||||
/**
|
||||
* 生效标识:valid-cronexp
|
||||
*/
|
||||
private static final String VALID_KEY = "valid-";
|
||||
/**
|
||||
* 失效标识:invalid-cronexp
|
||||
*/
|
||||
private static final String INVALID_KEY = "invalid-";
|
||||
private static final JobKey STATUS_JOBKEY = JobKey.jobKey(STATUS_JOB, "syncGroup");
|
||||
private static final JobDetail STATUS_JOBDETAIL = JobBuilder.newJob(ScheduleStatusJob.class)
|
||||
.withIdentity(STATUS_JOBKEY)
|
||||
.storeDurably(true)
|
||||
.build();
|
||||
|
||||
@Override
|
||||
public void execute(JobExecutionContext context) throws JobExecutionException {
|
||||
Scheduler scheduler = context.getScheduler();
|
||||
SchedulerDao dao = SpringContextHolder.getBean(SchedulerDao.class);
|
||||
JobDataMap dataMap = context.getJobDetail().getJobDataMap();
|
||||
long scheduleCfgId = dataMap.get("scheduleCfgId") == null ? 0:dataMap.getLong("scheduleCfgId");
|
||||
long limit = dataMap.get("limit") == null ? Constants.MAAT_JSON_SEND_SIZE:dataMap.getLong("limit");
|
||||
log.info(String.format("Sync定时配置任务开始扫描,scheduleCfgId:%s,limit:%s",scheduleCfgId,limit ));
|
||||
List<ScheduleCfg> newlyCfg = null;
|
||||
int totalNum = 0;
|
||||
|
||||
//全量同步当前状态 0:start:开始 1:init:初始化 2:doing:进行中
|
||||
String currentStatus = DictUtils.getDictLabel("currrent_sync_status", "status","0");
|
||||
if(!(currentStatus.equals("0") || currentStatus.equals("1") || currentStatus.equals("2"))) {
|
||||
do {
|
||||
newlyCfg = dao.findNewlyCfg(scheduleCfgId, limit,2,null);
|
||||
if(newlyCfg != null && newlyCfg.size() > 0) {
|
||||
totalNum += newlyCfg.size();
|
||||
for(ScheduleCfg cfg : newlyCfg) {//先取消之前的定时配置
|
||||
Integer compileId = cfg.getCompileId();
|
||||
try {
|
||||
//取消之前所有的 trigger
|
||||
GroupMatcher<TriggerKey> groupMatcher= GroupMatcher.triggerGroupEquals(STATUS_GROUP + compileId);
|
||||
Set<TriggerKey> triggerKeys = scheduler.getTriggerKeys(groupMatcher);
|
||||
if(triggerKeys != null && triggerKeys.size() > 0) {
|
||||
for(TriggerKey tk : triggerKeys) {
|
||||
scheduler.unscheduleJob(tk);
|
||||
}
|
||||
log.info(String.format("Sync定时任务取消成功,compile:%s", compileId));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error(String.format("Sync定时任务取消异常,compileId:%s", compileId),e);
|
||||
}
|
||||
}
|
||||
int index=0;
|
||||
for(ScheduleCfg cfg : newlyCfg) {
|
||||
Integer compileId = cfg.getCompileId();
|
||||
try {
|
||||
//判断状态,重新添加最新的 trigger
|
||||
Integer isValid = cfg.getIsValid();
|
||||
Integer isAudit = cfg.getIsAudit();
|
||||
//添加定时任务的条件
|
||||
if((isValid == 1 && isAudit == 1) || (isValid == 0 && isAudit == 0)) {
|
||||
//添加定时任务,包括valid 和 invalid
|
||||
addJob(scheduler, cfg,index);
|
||||
log.info(String.format("Sync定时任务添加成功,compile:%s", compileId));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error(String.format("Sync定时任务更新异常,compileId:%s", compileId),e);
|
||||
}
|
||||
index++;
|
||||
}
|
||||
//最后 保存此次 最后的id
|
||||
ScheduleCfg lastCfg = newlyCfg.get(newlyCfg.size() -1);
|
||||
scheduleCfgId = lastCfg.getId();
|
||||
dataMap.put("scheduleCfgId", scheduleCfgId);
|
||||
log.info(String.format("Sync加载定时任务,total num :%s", newlyCfg.size()));
|
||||
}
|
||||
} while (newlyCfg != null && newlyCfg.size() > 0);
|
||||
log.info(String.format("Sync定时配置任务结束执行,total num:%s",totalNum));
|
||||
}
|
||||
log.info("全量同步中缓存的定时配置正在扫描(currentStatus:"+currentStatus+")");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 将定时任务信息添加到 定时器框架中调度
|
||||
* @param scheduler
|
||||
* @param cfg
|
||||
* @throws SchedulerException
|
||||
*/
|
||||
/*public static void addJob(Scheduler scheduler,ScheduleCfg cfg) throws SchedulerException {
|
||||
Integer compileId = cfg.getCompileId();
|
||||
String cronValid = cfg.getCronValid();
|
||||
String cronInvalid = cfg.getCronInvalid();
|
||||
Trigger validTrigger = createTrigger(cronValid, compileId, true, cfg);
|
||||
Trigger invalidTrigger = createTrigger(cronInvalid, compileId, false, cfg);
|
||||
boolean jobExist = scheduler.checkExists(STATUS_JOBKEY);
|
||||
if(!jobExist) {//判断 job 是否存在,不存在添加
|
||||
scheduler.addJob(STATUS_JOBDETAIL, false);
|
||||
}
|
||||
boolean checkExists = scheduler.checkExists(validTrigger.getKey());
|
||||
if(!checkExists) {//判断 valid trigger 是否存在,不存在添加
|
||||
scheduler.scheduleJob(validTrigger);
|
||||
}else {
|
||||
log.warn(String.format("Trigger already exists:%s ", validTrigger.getKey().toString()));
|
||||
}
|
||||
checkExists = scheduler.checkExists(invalidTrigger.getKey());
|
||||
if(!checkExists) {//判断 invalid trigger 是否存在,不存在添加
|
||||
scheduler.scheduleJob(invalidTrigger);
|
||||
}else {
|
||||
log.warn(String.format("Trigger already exists:%s ", invalidTrigger.getKey().toString()));
|
||||
}
|
||||
}*/
|
||||
|
||||
|
||||
public static void addJob(Scheduler scheduler,ScheduleCfg cfg,int expire) throws SchedulerException {
|
||||
List<Trigger> triList = createTrigger(cfg,expire);
|
||||
boolean jobExist = scheduler.checkExists(STATUS_JOBKEY);
|
||||
if(!jobExist) {//判断 job 是否存在,不存在添加
|
||||
scheduler.addJob(STATUS_JOBDETAIL, false);
|
||||
}
|
||||
for(Trigger tri : triList) {
|
||||
boolean checkExists = scheduler.checkExists(tri.getKey());
|
||||
if(!checkExists) {//判断 valid trigger 是否存在,不存在添加
|
||||
log.debug(String.format("Sync定时任务添加,%s", tri.getKey()));
|
||||
scheduler.scheduleJob(tri);
|
||||
log.info(String.format("Sync定时任务添加成功,%s", tri.getKey()));
|
||||
}else {
|
||||
log.warn(String.format("Trigger(sync) already exists:%s ", tri.getKey().toString()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 将页面配置的内容 转换成 trigger
|
||||
* @param cfg
|
||||
* @return
|
||||
*/
|
||||
public static List<Trigger> createTrigger(ScheduleCfg cfg,int expire){
|
||||
String mode = cfg.getUserRegion1().toUpperCase();//定时任务运行模式:一次,每天,每周,每月
|
||||
List<Trigger> triList = null;
|
||||
switch (mode) {
|
||||
case "ALWAYS"://单次运行,但只创建单次生效触发器
|
||||
triList = createSimpleTrigger(cfg,expire);
|
||||
break;
|
||||
case "SINGLE"://单次运行
|
||||
triList = createSimpleTrigger(cfg,expire);
|
||||
break;
|
||||
case "EVERYDAY"://每天运行 0 0 0 2/1 * ? ,不符合要求,定义每天都执行,然后在 代码判断 间隔时间
|
||||
triList = createCalendarIntervalTrigger(cfg);
|
||||
break;
|
||||
case "EVERYWEEK"://每周运行
|
||||
triList = createCalendarIntervalTrigger(cfg);
|
||||
break;
|
||||
case "EVERYMONTH"://每月运行
|
||||
triList = createEveryMonthTrigger(cfg);
|
||||
break;
|
||||
default:
|
||||
log.warn(String.format("unknown mode : %s ", mode));
|
||||
break;
|
||||
}
|
||||
return triList;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 将时间转换成 时分秒
|
||||
* @param time
|
||||
* @return
|
||||
*/
|
||||
public static List<Integer> parseTime(String time) {
|
||||
if(StringUtils.isNoneBlank(time)) {
|
||||
String[] split = time.split(":");
|
||||
List<Integer> tl = new ArrayList<Integer>(3);
|
||||
for(String s : split) {
|
||||
tl.add(Integer.valueOf(s));
|
||||
}
|
||||
return tl;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static Trigger createCronTrigger(String cron,Integer compileId,boolean isValid,ScheduleCfg cfg) {
|
||||
String triggerName = isValid ? (VALID_KEY + cron) : (INVALID_KEY + cron);
|
||||
JobDataMap dataMap = new JobDataMap();
|
||||
dataMap.put("isValid", isValid);
|
||||
dataMap.put("cfg", cfg);
|
||||
return TriggerBuilder.newTrigger()
|
||||
.withIdentity(createTiggerKey(triggerName, STATUS_GROUP+compileId))
|
||||
.withSchedule(CronScheduleBuilder.cronSchedule(cron))
|
||||
.usingJobData(dataMap)
|
||||
.forJob(STATUS_JOBDETAIL)
|
||||
.build();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 创建全量同步时未执行的任务,每个任务均为单词任务
|
||||
* @param cfg
|
||||
* @return
|
||||
*/
|
||||
public static List<Trigger> createSimpleTrigger(ScheduleCfg cfg,int expire){
|
||||
List<Trigger> triList = new ArrayList<Trigger>();
|
||||
Integer compileId = cfg.getCompileId();
|
||||
String cronValid = cfg.getCronValid();
|
||||
String cronInvalid = cfg.getCronInvalid();
|
||||
Date validDate = null;
|
||||
Date invalidDate = null;
|
||||
if(StringUtils.isNotBlank(cronValid)){
|
||||
Calendar c = Calendar.getInstance();
|
||||
c.add(Calendar.MINUTE, (expire+1));
|
||||
validDate = c.getTime();
|
||||
|
||||
}
|
||||
if(StringUtils.isNotBlank(cronInvalid)){
|
||||
Calendar c = Calendar.getInstance();
|
||||
c.add(Calendar.MINUTE, (expire+2));
|
||||
invalidDate = c.getTime();
|
||||
}
|
||||
JobDataMap dataMap = new JobDataMap();
|
||||
if(validDate!=null){//生效时间如果不为空,则创建定时生效触发器
|
||||
dataMap.put("isValid", true);
|
||||
dataMap.put("cfg", cfg);
|
||||
String triName = VALID_KEY + cfg.getUserRegion1() + "_" + cronValid;
|
||||
Trigger trigger = TriggerBuilder.newTrigger()
|
||||
.withIdentity(createTiggerKey(triName, STATUS_GROUP+compileId))
|
||||
.withSchedule(SimpleScheduleBuilder.simpleSchedule())
|
||||
.usingJobData(dataMap)
|
||||
.forJob(STATUS_JOBDETAIL)
|
||||
.startAt(validDate)
|
||||
.build();
|
||||
triList.add(trigger);
|
||||
}
|
||||
if(invalidDate!=null){//失效时间如果不为空,则创建定时失效触发器
|
||||
dataMap = new JobDataMap();
|
||||
dataMap.put("isValid", false);
|
||||
dataMap.put("cfg", cfg);
|
||||
String triName = INVALID_KEY + cfg.getUserRegion1() + "_" + cronInvalid;
|
||||
Trigger trigger = TriggerBuilder.newTrigger()
|
||||
.withIdentity(createTiggerKey(triName, STATUS_GROUP+compileId))
|
||||
.withSchedule(SimpleScheduleBuilder.simpleSchedule())
|
||||
.usingJobData(dataMap)
|
||||
.forJob(STATUS_JOBDETAIL)
|
||||
.startAt(invalidDate)
|
||||
.build();
|
||||
triList.add(trigger);
|
||||
}
|
||||
return triList;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 间隔 n 天 或 n 周执行
|
||||
* @param cfg
|
||||
* @return
|
||||
*/
|
||||
public static List<Trigger> createCalendarIntervalTrigger(ScheduleCfg cfg) {
|
||||
List<Trigger> triList = new ArrayList<Trigger>();
|
||||
Integer compileId = cfg.getCompileId();
|
||||
String cronValid = cfg.getCronValid();
|
||||
String cronInvalid = cfg.getCronInvalid();
|
||||
String dayOrWeek = cfg.getUserRegion1();
|
||||
Integer interval = Integer.valueOf(cfg.getUserRegion2());
|
||||
List<Integer> validList = parseTime(cronValid);
|
||||
List<Integer> invalidList = parseTime(cronInvalid);
|
||||
Date validStartTime = DateBuilder.todayAt(validList.get(0), validList.get(1), validList.get(2));
|
||||
Date invalidTime = DateBuilder.todayAt(invalidList.get(0), invalidList.get(1), invalidList.get(2));
|
||||
CalendarIntervalScheduleBuilder intervalBuilder = null;
|
||||
if("EVERYDAY".equalsIgnoreCase(dayOrWeek)) {
|
||||
intervalBuilder = CalendarIntervalScheduleBuilder.calendarIntervalSchedule().withIntervalInDays(interval);
|
||||
//valid
|
||||
JobDataMap dataMap = new JobDataMap();
|
||||
dataMap.put("isValid", true);
|
||||
dataMap.put("cfg", cfg);
|
||||
String triName = VALID_KEY + dayOrWeek+"("+interval+")" + "_" + DateUtils.formatDate(validStartTime, Constants.COMMON_DATE_FORMAT);
|
||||
Trigger validTri = TriggerBuilder.newTrigger()
|
||||
.withIdentity(createTiggerKey(triName, STATUS_GROUP+compileId))
|
||||
.withSchedule(intervalBuilder)
|
||||
.usingJobData(dataMap)
|
||||
.forJob(STATUS_JOBDETAIL)
|
||||
.startAt(validStartTime)
|
||||
.build();
|
||||
triList.add(validTri);
|
||||
//invalid
|
||||
dataMap = new JobDataMap();
|
||||
dataMap.put("isValid", false);
|
||||
dataMap.put("cfg", cfg);
|
||||
triName = INVALID_KEY + dayOrWeek +"("+interval+")" + "_" + DateUtils.formatDate(invalidTime, Constants.COMMON_DATE_FORMAT);
|
||||
validTri = TriggerBuilder.newTrigger()
|
||||
.withIdentity(createTiggerKey(triName, STATUS_GROUP+compileId))
|
||||
.withSchedule(intervalBuilder)
|
||||
.usingJobData(dataMap)
|
||||
.forJob(STATUS_JOBDETAIL)
|
||||
.startAt(invalidTime)
|
||||
.build();
|
||||
triList.add(validTri);
|
||||
}else if("EVERYWEEK".equalsIgnoreCase(dayOrWeek)) {
|
||||
intervalBuilder = CalendarIntervalScheduleBuilder.calendarIntervalSchedule().withIntervalInWeeks(interval);
|
||||
String[] weeks = cfg.getUserRegion3().split(",");
|
||||
for(String week : weeks) {
|
||||
if(StringUtils.isNoneBlank(week)) {
|
||||
Date temp = closestAfterWeek(validStartTime, Integer.valueOf(week));
|
||||
JobDataMap dataMap = new JobDataMap();
|
||||
dataMap.put("isValid", true);
|
||||
dataMap.put("cfg", cfg);
|
||||
String triName = VALID_KEY + dayOrWeek +week+"("+interval+")" + "_" + DateUtils.formatDate(temp, Constants.COMMON_DATE_FORMAT);
|
||||
Trigger validTri = TriggerBuilder.newTrigger()
|
||||
.withIdentity(createTiggerKey(triName, STATUS_GROUP+compileId))
|
||||
.withSchedule(intervalBuilder)
|
||||
.usingJobData(dataMap)
|
||||
.forJob(STATUS_JOBDETAIL)
|
||||
.startAt(temp)
|
||||
.build();
|
||||
triList.add(validTri);
|
||||
//invalid
|
||||
dataMap = new JobDataMap();
|
||||
dataMap.put("isValid", false);
|
||||
dataMap.put("cfg", cfg);
|
||||
temp = closestAfterWeek(invalidTime, Integer.valueOf(week));
|
||||
triName = INVALID_KEY + dayOrWeek +week+"("+interval+")" + "_" + DateUtils.formatDate(temp, Constants.COMMON_DATE_FORMAT);
|
||||
validTri = TriggerBuilder.newTrigger()
|
||||
.withIdentity(createTiggerKey(triName, STATUS_GROUP+compileId))
|
||||
.withSchedule(intervalBuilder)
|
||||
.usingJobData(dataMap)
|
||||
.forJob(STATUS_JOBDETAIL)
|
||||
.startAt(temp)
|
||||
.build();
|
||||
triList.add(validTri);
|
||||
}
|
||||
}
|
||||
}
|
||||
return triList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 每月 执行
|
||||
* @param cfg
|
||||
* @return
|
||||
*/
|
||||
public static List<Trigger> createEveryMonthTrigger(ScheduleCfg cfg){
|
||||
String dayWeek = cfg.getUserRegion3();
|
||||
String cronInvalid = cfg.getCronInvalid();
|
||||
String cronValid = cfg.getCronValid();
|
||||
StringBuilder cronSb = new StringBuilder();
|
||||
Trigger trigger = null;
|
||||
List<Integer> validList = parseTime(cronValid);//time 转换
|
||||
List<Integer> invalidList = parseTime(cronInvalid);//time 转换
|
||||
List<Trigger> triList = new ArrayList<Trigger>();
|
||||
String userRegion4 = cfg.getUserRegion4().toUpperCase();
|
||||
if("day".equalsIgnoreCase(dayWeek)) {//指定天
|
||||
boolean hasL = userRegion4.contains("L");
|
||||
StringBuilder chooseSb = new StringBuilder();
|
||||
for(String str : userRegion4.split(",")) {
|
||||
if(!"L".equalsIgnoreCase(str.trim())) {
|
||||
chooseSb.append(",").append(str);
|
||||
}
|
||||
}
|
||||
chooseSb.deleteCharAt(0);
|
||||
cronSb.append(validList.get(2)).append(" ")//秒
|
||||
.append(validList.get(1)).append(" ")//分
|
||||
.append(validList.get(0)).append(" ")//小时
|
||||
.append(chooseSb.toString()).append(" ")//日
|
||||
.append(cfg.getUserRegion2()).append(" ")//月
|
||||
.append("?").append(" ");//周
|
||||
trigger = createCronTrigger(cronSb.toString(), cfg.getCompileId(), true, cfg);
|
||||
triList.add(trigger);
|
||||
cronSb.setLength(0);
|
||||
cronSb.append(invalidList.get(2)).append(" ")//秒
|
||||
.append(invalidList.get(1)).append(" ")//分
|
||||
.append(invalidList.get(0)).append(" ")//小时
|
||||
.append(chooseSb.toString()).append(" ")//日
|
||||
.append(cfg.getUserRegion2()).append(" ")//月
|
||||
.append("?").append(" ");//周
|
||||
trigger = createCronTrigger(cronSb.toString(), cfg.getCompileId(), false, cfg);
|
||||
triList.add(trigger);
|
||||
if(hasL) {// 月的最后一天,quartz 不支持 1,L 这种指定,所以 L单独处理一下
|
||||
cronSb.setLength(0);
|
||||
cronSb.append(validList.get(2)).append(" ")//秒
|
||||
.append(validList.get(1)).append(" ")//分
|
||||
.append(validList.get(0)).append(" ")//小时
|
||||
.append("L").append(" ")//日
|
||||
.append(cfg.getUserRegion2()).append(" ")//月
|
||||
.append("?").append(" ");//周
|
||||
trigger = createCronTrigger(cronSb.toString(), cfg.getCompileId(), true, cfg);
|
||||
triList.add(trigger);
|
||||
cronSb.setLength(0);
|
||||
cronSb.append(invalidList.get(2)).append(" ")//秒
|
||||
.append(invalidList.get(1)).append(" ")//分
|
||||
.append(invalidList.get(0)).append(" ")//小时
|
||||
.append("L").append(" ")//日
|
||||
.append(cfg.getUserRegion2()).append(" ")//月
|
||||
.append("?").append(" ");//周
|
||||
trigger = createCronTrigger(cronSb.toString(), cfg.getCompileId(), false, cfg);
|
||||
triList.add(trigger);
|
||||
}
|
||||
}else if ("week".equalsIgnoreCase(dayWeek)) {//指定周,1#2: 第一周的周二,4L:最后一周的周四
|
||||
for(String nthWeek : userRegion4.split(",")) {//第几周
|
||||
for(String week : cfg.getUserRegion5().split(",")) {//星期几
|
||||
cronSb.setLength(0);
|
||||
cronSb.append(validList.get(2)).append(" ")//秒
|
||||
.append(validList.get(1)).append(" ")//分
|
||||
.append(validList.get(0)).append(" ")//小时
|
||||
.append("?").append(" ")//日
|
||||
.append(cfg.getUserRegion2()).append(" ");//月
|
||||
if("L".equalsIgnoreCase(nthWeek)) {
|
||||
cronSb.append(week).append("L");//周
|
||||
}else {
|
||||
cronSb.append(week).append("#").append(nthWeek);//周
|
||||
}
|
||||
trigger = createCronTrigger(cronSb.toString(), cfg.getCompileId(), true, cfg);
|
||||
triList.add(trigger);
|
||||
cronSb.setLength(0);
|
||||
cronSb.append(invalidList.get(2)).append(" ")//秒
|
||||
.append(invalidList.get(1)).append(" ")//分
|
||||
.append(invalidList.get(0)).append(" ")//小时
|
||||
.append("?").append(" ")//日
|
||||
.append(cfg.getUserRegion2()).append(" ");//月
|
||||
if("L".equalsIgnoreCase(nthWeek)) {
|
||||
cronSb.append(week).append("L");//周
|
||||
}else {
|
||||
cronSb.append(week).append("#").append(nthWeek);//周
|
||||
}
|
||||
trigger = createCronTrigger(cronSb.toString(), cfg.getCompileId(), false, cfg);
|
||||
triList.add(trigger);
|
||||
}
|
||||
}
|
||||
}
|
||||
return triList;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查找最近的 星期几 ,包括今天
|
||||
* @param date
|
||||
* @param w 周一开始 1 -7
|
||||
* @return
|
||||
*/
|
||||
public static Date closestAfterWeek(Date date,int w) {
|
||||
Calendar cal = Calendar.getInstance();
|
||||
cal.setTime(date);
|
||||
int i = cal.get(Calendar.DAY_OF_WEEK);//周日开始 1-7
|
||||
i = (i==1)? 7: i-1;//转换为 周一到 周日 1-7
|
||||
cal.add(Calendar.DAY_OF_MONTH, (i>w)?(7-(i-w)) : (w-i));
|
||||
return cal.getTime();
|
||||
}
|
||||
|
||||
|
||||
public static TriggerKey createTiggerKey(String name,String group) {
|
||||
TriggerKey key = new TriggerKey(name, group);
|
||||
return key;
|
||||
}
|
||||
|
||||
/**
|
||||
* jquery cron 生成的cron 表达式,quartz 不能直接使用,需要做些修改
|
||||
* @param cron
|
||||
* @return
|
||||
*/
|
||||
public static String modifyCronExp(String cron) {
|
||||
String[] cronArr = cron.split("\\s");
|
||||
if("*".equals(cronArr[4])) {
|
||||
cronArr[4] = "?";
|
||||
}else {
|
||||
cronArr[3] = "*";
|
||||
cronArr[2] = "?";
|
||||
}
|
||||
return "0 " + StringUtils.join(cronArr, " ");
|
||||
}
|
||||
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
CronTriggerImpl cron = new CronTriggerImpl();
|
||||
try {
|
||||
String exp = "0 0 0 ? 1,2 1#4";
|
||||
cron.setCronExpression(exp);
|
||||
System.out.println(cron);
|
||||
} catch (ParseException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -7,6 +7,7 @@ import com.nis.domain.dashboard.SysIspInfo;
|
||||
import com.nis.domain.dashboard.codedic.CodeAppDic;
|
||||
import com.nis.domain.dashboard.codedic.CodeBehaviorTypeDic;
|
||||
import com.nis.domain.dashboard.codedic.CodeBrowserTypeDic;
|
||||
import com.nis.domain.dashboard.codedic.CodeDomainDic;
|
||||
import com.nis.domain.dashboard.codedic.CodeOsTypeDic;
|
||||
import com.nis.domain.dashboard.codedic.CodeProtocolTypeDic;
|
||||
import com.nis.domain.dashboard.codedic.CodeServiceTypeDic;
|
||||
@@ -14,6 +15,7 @@ import com.nis.domain.dashboard.codedic.CodeWebServiceDic;
|
||||
import com.nis.web.dao.dashboard.codedic.CodeAppDicDao;
|
||||
import com.nis.web.dao.dashboard.codedic.CodeBehaviorTypeDicDao;
|
||||
import com.nis.web.dao.dashboard.codedic.CodeBrowserTypeDicDao;
|
||||
import com.nis.web.dao.dashboard.codedic.CodeDomainDicDao;
|
||||
import com.nis.web.dao.dashboard.codedic.CodeOsTypeDicDao;
|
||||
import com.nis.web.dao.dashboard.codedic.CodeProtocolTypeDicDao;
|
||||
import com.nis.web.dao.dashboard.codedic.CodeResult;
|
||||
@@ -31,6 +33,7 @@ public class CodeDicUtils {
|
||||
private final static CodeServiceTypeDicDao codeServiceTypeDicDao = SpringContextHolder.getBean(CodeServiceTypeDicDao.class);
|
||||
private final static CodeWebServiceDicDao codeWebServiceDicDao = SpringContextHolder.getBean(CodeWebServiceDicDao.class);
|
||||
private final static CodeSysIspInfoDicDao codeSysIspInfoDicDao = SpringContextHolder.getBean(CodeSysIspInfoDicDao.class);
|
||||
private final static CodeDomainDicDao codeDomainDicDao = SpringContextHolder.getBean(CodeDomainDicDao.class);
|
||||
|
||||
|
||||
private static final String APP_CODE="appCode";
|
||||
@@ -42,6 +45,7 @@ public class CodeDicUtils {
|
||||
private static final String WEB_CODE="webCode";
|
||||
|
||||
private static final String ISP_CODE="ispCode";
|
||||
private static final String DOMAIN_CODE="domainCode";
|
||||
/**
|
||||
* 适用于大屏图表标签显示
|
||||
*/
|
||||
@@ -178,6 +182,23 @@ public class CodeDicUtils {
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}else if (name.equals(DOMAIN_CODE)) {
|
||||
// List<CodeWebServiceDic> codeDicList = (List<CodeWebServiceDic>) CacheUtils.get(WEB_CODE);
|
||||
// if(StringUtil.isEmpty(codeDicList)){
|
||||
// codeDicList = codeWebServiceDicDao.getCodeDicList();
|
||||
// CacheUtils.put(WEB_CODE, codeDicList);
|
||||
// }
|
||||
List<CodeDomainDic> codeDicList = codeDomainDicDao.getCodeDicList();
|
||||
if(codeDicList!=null&&codeDicList.size()>0){
|
||||
for (int i = 0; i < codeDicList.size(); i++) {
|
||||
CodeResult codeResult = new CodeResult();
|
||||
codeResult.setItem(codeDicList.get(i).getDomain());
|
||||
codeResult.setCode(String.valueOf(codeDicList.get(i).getId()));
|
||||
|
||||
result.add(codeResult);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -1,11 +1,17 @@
|
||||
package com.nis.util;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Type;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
|
||||
import com.google.gson.*;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import com.nis.domain.FunctionServiceDict;
|
||||
import com.nis.domain.configuration.*;
|
||||
import com.nis.web.service.BaseService;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.collections.MapUtils;
|
||||
import org.apache.commons.lang3.StringEscapeUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@@ -15,13 +21,6 @@ import com.google.common.collect.Lists;
|
||||
import com.googlecode.ipv6.IPv6Address;
|
||||
import com.googlecode.ipv6.IPv6Network;
|
||||
import com.nis.domain.basics.AsnIpCfg;
|
||||
import com.nis.domain.configuration.AppIpCfg;
|
||||
import com.nis.domain.configuration.BaseCfg;
|
||||
import com.nis.domain.configuration.BaseIpCfg;
|
||||
import com.nis.domain.configuration.BaseStringCfg;
|
||||
import com.nis.domain.configuration.ComplexkeywordCfg;
|
||||
import com.nis.domain.configuration.FileDigestCfg;
|
||||
import com.nis.domain.configuration.IpPortCfg;
|
||||
import com.nis.domain.maat.MaatCfg.DigestCfg;
|
||||
import com.nis.domain.maat.MaatCfg.GroupCfg;
|
||||
import com.nis.domain.maat.MaatCfg.IpCfg;
|
||||
@@ -233,7 +232,6 @@ public class ConfigConvertUtil {
|
||||
* @param dstList
|
||||
* @param srcList
|
||||
* @param cfgType,1为IP类型,2为字符串类型,3为增强字符串,4数值类型,5摘要类,6回调类[但字符串类域配置和增强字符串域配置在接口参数中同属于strRegionList]
|
||||
* @param baseCfg,配置基本信息
|
||||
* @param groupRelationList
|
||||
* 配置分组列表
|
||||
* @return
|
||||
@@ -248,7 +246,7 @@ public class ConfigConvertUtil {
|
||||
List<Integer> regionIdList = Lists.newArrayList();
|
||||
T srcCfg = srcList.get(i);
|
||||
BaseIpCfg baseIpCfg = new BaseIpCfg();
|
||||
BeanUtils.copyProperties(srcCfg, baseIpCfg);
|
||||
BeanUtils.copyProperties(srcCfg, baseIpCfg,new String[]{"menuNameCode"});
|
||||
regionIdList.add(baseIpCfg.getRegionId());
|
||||
IpCfg cfg = new IpCfg();
|
||||
BeanUtils.copyProperties(baseIpCfg, cfg);
|
||||
@@ -325,10 +323,10 @@ public class ConfigConvertUtil {
|
||||
} else if (cfgType == 4) {
|
||||
for (int i = 0; i < srcList.size(); i++) {
|
||||
BaseCfg baseCfg = new BaseCfg();
|
||||
BeanUtils.copyProperties(srcList.get(i), baseCfg);//拷贝公共属性
|
||||
BeanUtils.copyProperties(srcList.get(i), baseCfg,new String[]{"menuNameCode"});//拷贝公共属性
|
||||
// 一条业务配置创建一个分组
|
||||
com.nis.domain.maat.MaatCfg.NumBoundaryCfg cfg = new com.nis.domain.maat.MaatCfg.NumBoundaryCfg();
|
||||
BeanUtils.copyProperties(srcList.get(i), cfg);
|
||||
BeanUtils.copyProperties(srcList.get(i), cfg,new String[]{"menuNameCode"});
|
||||
GroupCfg group = new GroupCfg();
|
||||
group.setGroupId(baseCfg.getGroupId());
|
||||
group.setCompileId(baseCfg.getCompileId());
|
||||
@@ -344,10 +342,10 @@ public class ConfigConvertUtil {
|
||||
} else if (cfgType == 5) {
|
||||
for (int i = 0; i < srcList.size(); i++) {
|
||||
BaseCfg baseCfg = new BaseCfg();
|
||||
BeanUtils.copyProperties(srcList.get(i), baseCfg);//拷贝公共属性
|
||||
BeanUtils.copyProperties(srcList.get(i), baseCfg,new String[]{"menuNameCode"});//拷贝公共属性
|
||||
// 一条业务配置创建一个分组
|
||||
com.nis.domain.maat.MaatCfg.DigestCfg cfg = new com.nis.domain.maat.MaatCfg.DigestCfg();
|
||||
BeanUtils.copyProperties(srcList.get(i), cfg);
|
||||
BeanUtils.copyProperties(srcList.get(i), cfg,new String[]{"menuNameCode"});
|
||||
GroupCfg group = new GroupCfg();
|
||||
group.setGroupId(baseCfg.getGroupId());
|
||||
group.setCompileId(baseCfg.getCompileId());
|
||||
@@ -395,13 +393,10 @@ public class ConfigConvertUtil {
|
||||
*/
|
||||
public static List<IpCfg> ipConvert(IpCfg dstIp, BaseIpCfg srcIp) {
|
||||
List<IpCfg> ipConvertList = Lists.newArrayList();
|
||||
boolean isRange = ((srcIp.getIpPattern() != null && srcIp.getIpPattern() == 2)
|
||||
|| (srcIp.getSrcIpAddress() != null && srcIp.getSrcIpAddress().indexOf("-") > -1)
|
||||
|| (srcIp.getDestIpAddress() != null && srcIp.getDestIpAddress().indexOf("-") > -1));
|
||||
if (isRange) {
|
||||
List<IpCfg> tempList = Lists.newArrayList();
|
||||
List<IpCfg> tempList1 = Lists.newArrayList();
|
||||
if (srcIp.getIpType().intValue() == 4) {
|
||||
if (srcIp.getIpType().equals(4)) {// IP V4
|
||||
if(srcIp.getSrcIpPattern().equals(2)) {//源IP范围
|
||||
if (srcIp.getSrcIpAddress() != null) {
|
||||
String startIpPart = srcIp.getSrcIpAddress().split("-")[0];
|
||||
String endIpPart = srcIp.getSrcIpAddress().split("-")[1];
|
||||
@@ -419,7 +414,24 @@ public class ConfigConvertUtil {
|
||||
dstIp.setSrcIpMask("255.255.255.255");
|
||||
tempList.add(dstIp);
|
||||
}
|
||||
}else if(srcIp.getSrcIpPattern().equals(1)){
|
||||
Integer srcMaskNum = Integer.parseInt(srcIp.getSrcIpAddress().split("/")[1]);
|
||||
if (srcMaskNum == 0) {
|
||||
dstIp.setSrcIpMask("0.0.0.0");
|
||||
} else {
|
||||
dstIp.setSrcIpMask(IpUtil.convertMask(srcMaskNum));
|
||||
}
|
||||
dstIp.setSrcIp(srcIp.getSrcIpAddress().split("/")[0]);
|
||||
tempList.add(dstIp);
|
||||
}else if(srcIp.getSrcIpPattern().equals(3)){
|
||||
dstIp.setSrcIp(srcIp.getSrcIpAddress());
|
||||
dstIp.setSrcIpMask("255.255.255.255");
|
||||
tempList.add(dstIp);
|
||||
}else {
|
||||
throw new RuntimeException("Unsupported IP Pattern " + srcIp.getSrcIpPattern());
|
||||
}
|
||||
if (srcIp.getDestIpAddress() != null) {
|
||||
if(srcIp.getDestIpPattern().equals(2)) {
|
||||
String startIpPart = srcIp.getDestIpAddress().split("-")[0];
|
||||
String endIpPart = srcIp.getDestIpAddress().split("-")[1];
|
||||
Integer startNum = Integer.parseInt(startIpPart.split("\\.")[3]);
|
||||
@@ -439,6 +451,38 @@ public class ConfigConvertUtil {
|
||||
}
|
||||
}
|
||||
tempList.clear();
|
||||
}else if(srcIp.getDestIpPattern().equals(1)) {
|
||||
Integer dstMaskNum = Integer.parseInt(srcIp.getDestIpAddress().split("/")[1]);
|
||||
for (IpCfg _cfg : tempList) {
|
||||
IpCfg tempIp = new IpCfg();
|
||||
BeanUtils.copyProperties(_cfg, tempIp);
|
||||
if (dstMaskNum == 0) {
|
||||
tempIp.setDstIpMask("0.0.0.0");
|
||||
} else {
|
||||
tempIp.setDstIpMask(IpUtil.convertMask(dstMaskNum));
|
||||
}
|
||||
tempIp.setDstIp(srcIp.getDestIpAddress().split("/")[0]);
|
||||
if (!tempIp.getSrcIp().equals(tempIp.getDstIp())) {
|
||||
// 处理
|
||||
convertPortValues(tempIp, srcIp);
|
||||
tempList1.add(tempIp);
|
||||
}
|
||||
}
|
||||
tempList.clear();
|
||||
}else {
|
||||
for (IpCfg _cfg : tempList) {
|
||||
IpCfg tempIp = new IpCfg();
|
||||
BeanUtils.copyProperties(_cfg, tempIp);
|
||||
tempIp.setDstIp(srcIp.getDestIpAddress());
|
||||
if (!tempIp.getSrcIp().equals(tempIp.getDstIp())) {
|
||||
tempIp.setDstIpMask("255.255.255.255");
|
||||
// 处理
|
||||
convertPortValues(tempIp, srcIp);
|
||||
tempList1.add(tempIp);
|
||||
}
|
||||
}
|
||||
tempList.clear();
|
||||
}
|
||||
}else {
|
||||
for (IpCfg _cfg : tempList) {
|
||||
_cfg.setDstIp("0.0.0.0");
|
||||
@@ -451,206 +495,50 @@ public class ConfigConvertUtil {
|
||||
} else {
|
||||
ipConvertList.addAll(tempList);
|
||||
}
|
||||
} else if (srcIp.getIpType().intValue() == 6) {
|
||||
}else if(srcIp.getIpType().equals(6)){// IP V6
|
||||
if (srcIp.getSrcIpAddress() != null) {
|
||||
if(srcIp.getSrcIpPattern().equals(2)) {
|
||||
IPv6Address address1 = IPv6Address.fromString(srcIp.getSrcIpAddress().split("-")[0]);
|
||||
IPv6Address address2 = IPv6Address.fromString(srcIp.getSrcIpAddress().split("-")[1]);
|
||||
IPv6Network network = IPv6Network.fromTwoAddresses(address1, address2);
|
||||
dstIp.setSrcIp(address1.toString());
|
||||
dstIp.setSrcIpMask(network.getNetmask().asAddress().toString());
|
||||
}else if(srcIp.getSrcIpPattern().equals(1)){// IP/掩码
|
||||
IPv6Network strangeNetwork = IPv6Network.fromString(srcIp.getSrcIpAddress());
|
||||
dstIp.setSrcIp(srcIp.getSrcIpAddress().split("/")[0]);
|
||||
dstIp.setSrcIpMask(strangeNetwork.getNetmask().asAddress().toString());
|
||||
}else {// IP
|
||||
dstIp.setSrcIp(srcIp.getSrcIpAddress());
|
||||
dstIp.setSrcIpMask("FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF");
|
||||
}
|
||||
} else {
|
||||
dstIp.setSrcIp("::");
|
||||
dstIp.setSrcIpMask("FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF");
|
||||
}
|
||||
if (srcIp.getDestIpAddress() != null) {
|
||||
if(srcIp.getDestIpPattern().equals(2)) {
|
||||
IPv6Address address1 = IPv6Address.fromString(srcIp.getDestIpAddress().split("-")[0]);
|
||||
IPv6Address address2 = IPv6Address.fromString(srcIp.getDestIpAddress().split("-")[1]);
|
||||
IPv6Network network = IPv6Network.fromTwoAddresses(address1, address2);
|
||||
dstIp.setDstIp(address1.toString());
|
||||
dstIp.setDstIpMask(network.getNetmask().asAddress().toString());
|
||||
}else if(srcIp.getDestIpPattern().equals(1)) {// IP/掩码
|
||||
IPv6Network strangeNetwork = IPv6Network.fromString(srcIp.getDestIpAddress());
|
||||
dstIp.setDstIp(srcIp.getDestIpAddress().split("/")[0]);
|
||||
dstIp.setDstIpMask(strangeNetwork.getNetmask().asAddress().toString());
|
||||
}else {// IP
|
||||
dstIp.setDstIp(srcIp.getDestIpAddress());
|
||||
dstIp.setDstIpMask("FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF");
|
||||
}
|
||||
} else {
|
||||
dstIp.setDstIp("::");
|
||||
dstIp.setDstIpMask("FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF");
|
||||
}
|
||||
|
||||
convertPortValues(dstIp, srcIp);
|
||||
ipConvertList.add(dstIp);
|
||||
}else {
|
||||
throw new RuntimeException("Unsupported IP type " + srcIp.getIpType());
|
||||
}
|
||||
} else {
|
||||
if (srcIp.getSrcIpAddress() != null) {
|
||||
if (srcIp.getSrcIpAddress().indexOf("/") != -1) {
|
||||
if (srcIp.getIpType() == 4 /* || srcIp.getIpType()==46 */) {// 46表示源ip为ipv4,目的ip为ipv6
|
||||
Integer srcMaskNum = Integer.parseInt(srcIp.getSrcIpAddress().split("/")[1]);
|
||||
if (srcMaskNum == 0) {
|
||||
dstIp.setSrcIpMask("0.0.0.0");
|
||||
} else {
|
||||
dstIp.setSrcIpMask(IpUtil.convertMask(srcMaskNum));
|
||||
}
|
||||
|
||||
dstIp.setSrcIp(srcIp.getSrcIpAddress().split("/")[0]);
|
||||
} else if (srcIp.getIpType() == 6/* || srcIp.getIpType()==64 */) {// 64表示源ip为ipv6,目的ip为ipv4
|
||||
IPv6Network strangeNetwork = IPv6Network.fromString(srcIp.getSrcIpAddress());
|
||||
dstIp.setSrcIp(srcIp.getSrcIpAddress().split("/")[0]);
|
||||
dstIp.setSrcIpMask(strangeNetwork.getNetmask().asAddress().toString());
|
||||
} /*
|
||||
* else { Pattern
|
||||
* patternV4Subnet=Pattern.compile(Constants.IPV4_IP_SUBNET_REGEXP); Pattern
|
||||
* patternV6Subnet=Pattern.compile(Constants.IPV6_IP_SUBNET_REGEXP); Matcher
|
||||
* matchernV4Subnet=patternV4Subnet.matcher(srcIp.getSrcIpAddress()); Matcher
|
||||
* matcherV6Subnet=patternV6Subnet.matcher(srcIp.getSrcIpAddress());
|
||||
* if(matchernV4Subnet.matches()) { Integer srcMaskNum =
|
||||
* Integer.parseInt(srcIp.getSrcIpAddress().split("/")[1]); if(srcMaskNum==0){
|
||||
* dstIp.setSrcIpMask("0.0.0.0"); }else{
|
||||
* dstIp.setSrcIpMask(IpUtil.convertMask(srcMaskNum)); }
|
||||
* dstIp.setSrcIp(srcIp.getSrcIpAddress().split("/")[0]); }else
|
||||
* if(matcherV6Subnet.matches()){ IPv6Network strangeNetwork =
|
||||
* IPv6Network.fromString(srcIp.getSrcIpAddress());
|
||||
* dstIp.setSrcIp(srcIp.getSrcIpAddress().split("/")[0]);
|
||||
* dstIp.setSrcIpMask(strangeNetwork.getNetmask().asAddress().toString()); }else
|
||||
* { throw new RuntimeException("Invalid IP/subnet mask format"); } }
|
||||
*/
|
||||
else {
|
||||
throw new RuntimeException("Unsupported IP type " + srcIp.getIpType());
|
||||
}
|
||||
} else {
|
||||
if (srcIp.getIpType() == 4/* || srcIp.getIpType()==46 */) {// 46表示源ip为ipv4,目的ip为ipv6
|
||||
dstIp.setSrcIp(srcIp.getSrcIpAddress());
|
||||
dstIp.setSrcIpMask("255.255.255.255");
|
||||
} else if (srcIp.getIpType() == 6/* || srcIp.getIpType()==64 */) {// 64表示源ip为ipv6,目的ip为ipv4
|
||||
dstIp.setSrcIp(srcIp.getSrcIpAddress());
|
||||
dstIp.setSrcIpMask("FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF");
|
||||
} /*
|
||||
* else {//all Pattern patternV4=Pattern.compile(Constants.IPV4_IP_REGEXP);
|
||||
* Pattern patternV6=Pattern.compile(Constants.IPV6_IP_REGEXP); Matcher
|
||||
* matcherV4=patternV4.matcher(srcIp.getSrcIpAddress()); Matcher
|
||||
* matcherV6=patternV6.matcher(srcIp.getSrcIpAddress()); if(matcherV4.matches())
|
||||
* { dstIp.setSrcIp(srcIp.getSrcIpAddress());
|
||||
* dstIp.setSrcIpMask("255.255.255.255"); }else if(matcherV6.matches()) {
|
||||
* dstIp.setSrcIp(srcIp.getSrcIpAddress());
|
||||
* dstIp.setSrcIpMask("FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF"); }else { throw
|
||||
* new RuntimeException("Invalid IP format"); } }
|
||||
*/
|
||||
else {
|
||||
throw new RuntimeException("Unsupported IP type " + srcIp.getIpType());
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (srcIp.getIpType() == 4/* || srcIp.getIpType()==46 */) {// 46表示源ip为ipv4,目的ip为ipv6
|
||||
dstIp.setSrcIp(srcIp.getSrcIpAddress());
|
||||
dstIp.setSrcIpMask("255.255.255.255");
|
||||
} else if (srcIp.getIpType() == 6/* || srcIp.getIpType()==64 */) {// 64表示源ip为ipv6,目的ip为ipv4
|
||||
dstIp.setSrcIp(srcIp.getSrcIpAddress());
|
||||
dstIp.setSrcIpMask("FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF");
|
||||
} /*
|
||||
* else {//all dstIp.setSrcIp(srcIp.getSrcIpAddress());
|
||||
* dstIp.setSrcIpMask("255.255.255.255"); }
|
||||
*/
|
||||
else {
|
||||
throw new RuntimeException("Unsupported IP type " + srcIp.getIpType());
|
||||
}
|
||||
}
|
||||
if (srcIp.getDestIpAddress() != null) {
|
||||
if (srcIp.getDestIpAddress().indexOf("/") != -1) {
|
||||
if (srcIp.getIpType() == 4/* || srcIp.getIpType()==64 */) {// 64表示源ip为ipv6,目的ip为ipv4
|
||||
Integer dstMaskNum = Integer.parseInt(srcIp.getDestIpAddress().split("/")[1]);
|
||||
if (dstMaskNum == 0) {
|
||||
dstIp.setDstIpMask("0.0.0.0");
|
||||
} else {
|
||||
dstIp.setDstIpMask(IpUtil.convertMask(dstMaskNum));
|
||||
;
|
||||
}
|
||||
dstIp.setDstIp(srcIp.getDestIpAddress().split("/")[0]);
|
||||
} else if (srcIp.getIpType() == 6/* || srcIp.getIpType()==46 */) {// 46表示源ip为ipv4,目的ip为ipv6
|
||||
IPv6Network strangeNetwork = IPv6Network.fromString(srcIp.getDestIpAddress());
|
||||
dstIp.setDstIp(srcIp.getDestIpAddress().split("/")[0]);
|
||||
dstIp.setDstIpMask(strangeNetwork.getNetmask().asAddress().toString());
|
||||
} /*
|
||||
* else { Pattern
|
||||
* patternV4Subnet=Pattern.compile(Constants.IPV4_IP_SUBNET_REGEXP); Pattern
|
||||
* patternV6Subnet=Pattern.compile(Constants.IPV6_IP_SUBNET_REGEXP); Matcher
|
||||
* matchernV4Subnet=patternV4Subnet.matcher(srcIp.getDestIpAddress()); Matcher
|
||||
* matcherV6Subnet=patternV6Subnet.matcher(srcIp.getDestIpAddress());
|
||||
* if(matchernV4Subnet.matches()) { Integer dstMaskNum =
|
||||
* Integer.parseInt(srcIp.getDestIpAddress().split("/")[1]); if(dstMaskNum==0){
|
||||
* dstIp.setDstIpMask("0.0.0.0"); }else{
|
||||
* dstIp.setDstIpMask(IpUtil.convertMask(dstMaskNum));; }
|
||||
* dstIp.setDstIp(srcIp.getDestIpAddress().split("/")[0]); }else
|
||||
* if(matcherV6Subnet.matches()){ IPv6Network strangeNetwork =
|
||||
* IPv6Network.fromString(srcIp.getDestIpAddress());
|
||||
* dstIp.setDstIp(srcIp.getDestIpAddress().split("/")[0]);
|
||||
* dstIp.setDstIpMask(strangeNetwork.getNetmask().asAddress().toString()); }else
|
||||
* { throw new RuntimeException("Invalid IP/subnet mask format"); } }
|
||||
*/
|
||||
else {
|
||||
throw new RuntimeException("Unsupported IP type " + srcIp.getIpType());
|
||||
}
|
||||
|
||||
} else {
|
||||
if (srcIp.getIpType() == 4/* || srcIp.getIpType()==64 */) {// 64表示源ip为ipv6,目的ip为ipv4
|
||||
dstIp.setDstIp(srcIp.getDestIpAddress());
|
||||
dstIp.setDstIpMask("255.255.255.255");
|
||||
} else if (srcIp.getIpType() == 6/* || srcIp.getIpType()==46 */) {// 46表示源ip为ipv4,目的ip为ipv6
|
||||
dstIp.setDstIp(srcIp.getDestIpAddress());
|
||||
dstIp.setDstIpMask("FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF");
|
||||
} /*
|
||||
* else {//all Pattern patternV4=Pattern.compile(Constants.IPV4_IP_REGEXP);
|
||||
* Pattern patternV6=Pattern.compile(Constants.IPV6_IP_REGEXP); Matcher
|
||||
* matcherV4=patternV4.matcher(srcIp.getDestIpAddress()); Matcher
|
||||
* matcherV6=patternV6.matcher(srcIp.getDestIpAddress());
|
||||
* if(matcherV4.matches()) { dstIp.setDstIp(srcIp.getDestIpAddress());
|
||||
* dstIp.setDstIpMask("255.255.255.255"); }else if(matcherV6.matches()) {
|
||||
* dstIp.setDstIp(srcIp.getDestIpAddress());
|
||||
* dstIp.setDstIpMask("FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF"); }else { throw
|
||||
* new RuntimeException("invalid ip format"); } }
|
||||
*/
|
||||
else {
|
||||
throw new RuntimeException("Unsupported IP type " + srcIp.getIpType());
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (srcIp.getIpType() == 4/* || srcIp.getIpType()==64 */) {// 64表示源ip为ipv6,目的ip为ipv4
|
||||
dstIp.setDstIp(srcIp.getDestIpAddress());
|
||||
dstIp.setDstIpMask("255.255.255.255");
|
||||
} else if (srcIp.getIpType() == 6/* || srcIp.getIpType()==46 */) {// 46表示源ip为ipv4,目的ip为ipv6
|
||||
dstIp.setDstIp(srcIp.getDestIpAddress());
|
||||
dstIp.setDstIpMask("FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF");
|
||||
} /*
|
||||
* else {//all dstIp.setDstIp(srcIp.getDestIpAddress());
|
||||
* dstIp.setDstIpMask("255.255.255.255"); }
|
||||
*/
|
||||
else {
|
||||
throw new RuntimeException("Unsupported IP type " + srcIp.getIpType());
|
||||
}
|
||||
}
|
||||
if (srcIp.getSrcPort() != null) {
|
||||
if (srcIp.getSrcPort().indexOf("/") != -1) {
|
||||
String srcMaskNum = srcIp.getSrcPort().split("/")[1];
|
||||
dstIp.setSrcPortMask(srcMaskNum);
|
||||
dstIp.setSrcPort(srcIp.getSrcPort().split("/")[0]);
|
||||
} else {
|
||||
dstIp.setSrcPort(srcIp.getSrcPort());
|
||||
dstIp.setSrcPortMask("65535");
|
||||
}
|
||||
} else {
|
||||
dstIp.setSrcPort("0");
|
||||
dstIp.setSrcPortMask("65535");
|
||||
}
|
||||
if (srcIp.getDestPort() != null) {
|
||||
if (srcIp.getDestPort().indexOf("/") != -1) {
|
||||
String dstMaskNum = srcIp.getDestPort().split("/")[1];
|
||||
dstIp.setDstPortMask(dstMaskNum);
|
||||
dstIp.setDstPort(srcIp.getDestPort().split("/")[0]);
|
||||
} else {
|
||||
dstIp.setDstPort(srcIp.getDestPort());
|
||||
dstIp.setDstPortMask("65535");
|
||||
}
|
||||
} else {
|
||||
dstIp.setDstPort("0");
|
||||
dstIp.setDstPortMask("65535");
|
||||
}
|
||||
ipConvertList.add(dstIp);
|
||||
}
|
||||
return ipConvertList;
|
||||
}
|
||||
/**
|
||||
@@ -687,4 +575,411 @@ public class ConfigConvertUtil {
|
||||
dstIp.setDstPortMask("65535");
|
||||
}
|
||||
}
|
||||
/**
|
||||
*Obj 组maat配置转换
|
||||
* @param <T>
|
||||
* @param <T>
|
||||
* @param dstList
|
||||
* @param srcList
|
||||
* @param cfgType,1为IP类型,2为字符串类型,3为增强字符串,4数值类型,5摘要类,6回调类[但字符串类域配置和增强字符串域配置在接口参数中同属于strRegionList]
|
||||
* @param baseCfg,配置基本信息
|
||||
* @param groupRelationList
|
||||
* 配置分组列表
|
||||
* @return
|
||||
*/
|
||||
public static <T> Map<String, List> objGroupCfgConvert(Map<Integer,FunctionServiceDict> dictMap,List dstList, List<T> srcList, Integer cfgType, BaseCfg baseCfg,
|
||||
List groupRelationList, Map<String,Object> maatTableMap, Set<Integer> groupIdSet) {
|
||||
long start=System.currentTimeMillis(),end=0l;
|
||||
Map<String, List> map = new HashMap();
|
||||
if (cfgType == 1) {
|
||||
List numRegionList = new ArrayList();
|
||||
int pos=0;
|
||||
Set<Integer> numGroupVals = new HashSet<>();
|
||||
List<Integer> regionIdList = calRangeIps(srcList);//ConfigServiceUtil.getId(3, srcList.size());
|
||||
for (int i = 0; i < srcList.size(); i++) {
|
||||
T srcCfg = srcList.get(i);
|
||||
BaseIpCfg baseIpCfg = new BaseIpCfg();
|
||||
BeanUtils.copyProperties(srcCfg, baseIpCfg);
|
||||
IpCfg cfg = new IpCfg();
|
||||
BeanUtils.copyProperties(baseIpCfg, cfg);
|
||||
// 区域IP配置,多条IP配置属于同一个分组,其他业务配置IP,一条配置一个分组
|
||||
// if(groupId==0 || !cfg.getCfgType().equals(Constants.AREA_REGION)){
|
||||
|
||||
if (!groupIdSet.contains(baseIpCfg.getGroupId())) {
|
||||
GroupCfg group = new GroupCfg();
|
||||
//groupId = ConfigServiceUtil.getId(2, 1).get(0);
|
||||
group.setGroupId(baseIpCfg.getGroupId());
|
||||
group.setCompileId(baseCfg.getCompileId());
|
||||
group.setAuditTime(baseCfg.getAuditTime());
|
||||
group.setIsValid(baseCfg.getIsValid());
|
||||
groupRelationList.add(group);
|
||||
groupIdSet.add(baseIpCfg.getGroupId());
|
||||
}
|
||||
cfg.setGroupId(baseIpCfg.getGroupId());
|
||||
cfg.setAuditTime(baseCfg.getAuditTime());
|
||||
cfg.setIsValid(baseCfg.getIsValid());
|
||||
if(maatTableMap.containsKey("ipMaatTable")){
|
||||
Map<String,String> ipMaatTable=(Map<String,String>)maatTableMap.get("ipMaatTable");
|
||||
cfg.setCfgType(ipMaatTable.get(baseIpCfg.getGroupId().toString()));
|
||||
}
|
||||
List<IpCfg> cfgs = ipConvert(cfg, baseIpCfg);
|
||||
if (cfgs.size() > 1) {
|
||||
List<Integer> ids =regionIdList.subList(pos,pos+cfgs.size());
|
||||
//支持range????
|
||||
for (int j = 1; j < cfgs.size(); j++) {
|
||||
cfgs.get(j).setRegionId(ids.get(j-1));
|
||||
}
|
||||
pos+=cfgs.size();
|
||||
}
|
||||
dstList.addAll(cfgs);
|
||||
|
||||
// 如果protocolId非空非零,需要构造数值型域配置,多条相同协议的IP只需要一条数值域配置(目前没有不同协议IP&情况)
|
||||
//分组复用每个IP组还需要不同的数值域组么????? answer:一个就行了
|
||||
if (baseCfg!=null&&baseCfg.getServiceId()!=null&&baseCfg.getServiceId()>0&&dictMap.containsKey(baseCfg.getServiceId())) {
|
||||
FunctionServiceDict dict=dictMap.get(baseCfg.getServiceId());
|
||||
Integer protocolId=dict.getProtocolId();
|
||||
if (protocolId>0&&!numGroupVals.contains(protocolId)) {
|
||||
GroupCfg group1 = new GroupCfg();
|
||||
group1.setGroupId(ConfigServiceUtil.getId(2, 1).get(0));
|
||||
group1.setCompileId(baseCfg.getCompileId());
|
||||
group1.setAuditTime(baseCfg.getAuditTime());
|
||||
group1.setIsValid(baseCfg.getIsValid());
|
||||
groupRelationList.add(group1);
|
||||
NumBoundaryCfg numCfg = new NumBoundaryCfg();
|
||||
numCfg.initDefaultValue();
|
||||
numCfg.setLowBoundary(protocolId);
|
||||
numCfg.setUpBoundary(protocolId);
|
||||
numCfg.setRegionId(ConfigServiceUtil.getId(3, 1).get(0));
|
||||
numCfg.setAuditTime(baseCfg.getAuditTime());
|
||||
numCfg.setGroupId(group1.getGroupId());
|
||||
numCfg.setIsValid(baseCfg.getIsValid());
|
||||
if(maatTableMap.containsKey("protocolMaatTable")){
|
||||
numCfg.setCfgType(maatTableMap.get("protocolMaatTable").toString());
|
||||
}
|
||||
numRegionList.add(numCfg);
|
||||
map.put("numRegionList", numRegionList);
|
||||
numGroupVals.add(protocolId);
|
||||
}
|
||||
}
|
||||
}
|
||||
regionIdList.clear();
|
||||
} else if (cfgType == 2 || cfgType == 3) {
|
||||
//List<Integer> groupIdList = ConfigServiceUtil.getId(2, srcList.size());
|
||||
//List<Integer> regionIdList = ConfigServiceUtil.getId(3, srcList.size());
|
||||
for (int i = 0; i < srcList.size(); i++) {
|
||||
BaseStringCfg baserStringCfg=new BaseStringCfg();
|
||||
BeanUtils.copyProperties(srcList.get(i),baserStringCfg);
|
||||
if(!groupIdSet.contains(baserStringCfg.getGroupId())){
|
||||
GroupCfg group = new GroupCfg();
|
||||
group.setGroupId(baserStringCfg.getGroupId());
|
||||
group.setCompileId(baseCfg.getCompileId());
|
||||
group.setAuditTime(baseCfg.getAuditTime());
|
||||
group.setIsValid(baseCfg.getIsValid());
|
||||
groupRelationList.add(group);
|
||||
groupIdSet.add(baserStringCfg.getGroupId());
|
||||
}
|
||||
StringCfg cfg = new StringCfg();
|
||||
BeanUtils.copyProperties(srcList.get(i), cfg);
|
||||
cfg.setGroupId(baserStringCfg.getGroupId());
|
||||
cfg.setRegionId(baserStringCfg.getRegionId());
|
||||
cfg.setAuditTime(baseCfg.getAuditTime());
|
||||
cfg.setIsValid(baseCfg.getIsValid());
|
||||
// 处理配置关键字转译
|
||||
cfg.setCfgKeywords(keywordsEscape(cfg.getCfgKeywords()));
|
||||
// 增强字符串转换
|
||||
cfg.setDistrict(keywordsEscape(cfg.getDistrict()));
|
||||
if(maatTableMap.containsKey("stringMaatTable")){
|
||||
Map<String,String> stringMaatTable=(Map<String,String>)maatTableMap.get("stringMaatTable");
|
||||
cfg.setCfgType(stringMaatTable.get(baserStringCfg.getGroupId().toString()));
|
||||
}
|
||||
dstList.add(cfg);
|
||||
}
|
||||
} else if (cfgType == 4) {
|
||||
// List<Integer> groupIdList = ConfigServiceUtil.getId(2, srcList.size());
|
||||
// List<Integer> regionIdList = ConfigServiceUtil.getId(3, srcList.size());
|
||||
for (int i = 0; i < srcList.size(); i++) {
|
||||
// 一条业务配置创建一个分组
|
||||
NumBoundaryCfg cfg = new NumBoundaryCfg();
|
||||
BeanUtils.copyProperties(srcList.get(i), cfg);
|
||||
if(!groupIdSet.contains(cfg.getGroupId())){
|
||||
GroupCfg group = new GroupCfg();
|
||||
group.setGroupId(cfg.getGroupId());
|
||||
group.setCompileId(baseCfg.getCompileId());
|
||||
group.setAuditTime(baseCfg.getAuditTime());
|
||||
group.setIsValid(baseCfg.getIsValid());
|
||||
groupRelationList.add(group);
|
||||
groupIdSet.add(cfg.getGroupId());
|
||||
}
|
||||
cfg.setGroupId(cfg.getGroupId());
|
||||
cfg.setRegionId(cfg.getRegionId());
|
||||
cfg.setAuditTime(baseCfg.getAuditTime());
|
||||
cfg.setIsValid(baseCfg.getIsValid());
|
||||
dstList.add(cfg);
|
||||
}
|
||||
} else if (cfgType == 5) {
|
||||
//List<Integer> groupIdList = ConfigServiceUtil.getId(2, srcList.size());
|
||||
//List<Integer> regionIdList = ConfigServiceUtil.getId(3, srcList.size());
|
||||
for (int i = 0; i < srcList.size(); i++) {
|
||||
// 一条业务配置创建一个分组
|
||||
com.nis.domain.maat.MaatCfg.DigestCfg cfg = new com.nis.domain.maat.MaatCfg.DigestCfg();
|
||||
BeanUtils.copyProperties(srcList.get(i), cfg);
|
||||
if(!groupIdSet.contains(cfg.getGroupId())){
|
||||
GroupCfg group = new GroupCfg();
|
||||
group.setGroupId(cfg.getGroupId());
|
||||
group.setCompileId(baseCfg.getCompileId());
|
||||
group.setAuditTime(baseCfg.getAuditTime());
|
||||
group.setIsValid(baseCfg.getIsValid());
|
||||
groupRelationList.add(group);
|
||||
groupIdSet.add(cfg.getGroupId());
|
||||
}
|
||||
cfg.setGroupId(cfg.getGroupId());
|
||||
cfg.setRegionId(cfg.getRegionId());
|
||||
cfg.setAuditTime(baseCfg.getAuditTime());
|
||||
cfg.setIsValid(baseCfg.getIsValid());
|
||||
dstList.add(cfg);
|
||||
}
|
||||
} else {
|
||||
dstList.addAll(srcList);
|
||||
}
|
||||
map.put("groupList", groupRelationList);
|
||||
map.put("dstList", dstList);
|
||||
end=System.currentTimeMillis();
|
||||
logger.info("objGroupCfgConvert cost:"+(end-start));
|
||||
return map;
|
||||
}
|
||||
/**
|
||||
* 转换成字符串
|
||||
*
|
||||
* @param obj
|
||||
* @return
|
||||
*/
|
||||
public static <T> String gsonToJson(T obj) {
|
||||
Gson gson = new GsonBuilder().disableHtmlEscaping().excludeFieldsWithoutExposeAnnotation()
|
||||
.registerTypeAdapter(Date.class, new JsonSerializer<Date>() {
|
||||
@Override
|
||||
public JsonElement serialize(Date src, Type type, JsonSerializationContext context) {
|
||||
String format = "yyyy-MM-dd HH:mm:ss";
|
||||
long time = ((Date) src).getTime();
|
||||
SimpleDateFormat sdf = new SimpleDateFormat(format);
|
||||
return new JsonPrimitive(sdf.format(time));
|
||||
}
|
||||
}).create();
|
||||
return gson.toJson(obj);
|
||||
}
|
||||
|
||||
/**
|
||||
* 字符串转成对象
|
||||
*
|
||||
* @param jsonString
|
||||
* @param cls
|
||||
* @return
|
||||
*/
|
||||
public static <T> T gsonFromJson(String jsonString, Class<T> cls) {
|
||||
Gson gson = new GsonBuilder().registerTypeAdapter(new TypeToken<Map>() {
|
||||
}.getType(), new BaseService.MapTypeAdapter()).registerTypeAdapter(new TypeToken<List>() {
|
||||
}.getType(), new BaseService.MapTypeAdapter()).create();
|
||||
return gson.fromJson(jsonString, cls);
|
||||
}
|
||||
|
||||
/**
|
||||
* 公共分组生成默认自定义域
|
||||
* @param userRegionMap
|
||||
* @param serviceId
|
||||
* @return
|
||||
*/
|
||||
public static String generateCommonGroupDefaultUserRegion(Map<String,Object> userRegionMap,Integer serviceId){
|
||||
if(userRegionMap==null){
|
||||
userRegionMap=new HashMap<>();
|
||||
}
|
||||
if(serviceId.equals(576)){
|
||||
userRegionMap.put("method","block");
|
||||
userRegionMap.put("code",404);
|
||||
userRegionMap.put("message","");
|
||||
userRegionMap.put("html_profile",0);
|
||||
return gsonToJson(userRegionMap);
|
||||
}else if(serviceId.equals(512)){
|
||||
if(userRegionMap.isEmpty()){
|
||||
//keyring
|
||||
userRegionMap.put("keyring", 1);
|
||||
Map<String,Object> map = new HashMap();
|
||||
//exclusions
|
||||
map.put("ev_cert", 0);
|
||||
map.put("cert_transparency", 0);
|
||||
map.put("pinning", 1);
|
||||
map.put("client_cert_req", 1);
|
||||
map.put("protocol_errors", 1);
|
||||
userRegionMap.put("exclusions", map);
|
||||
//cert_verify
|
||||
Map<String,Object> map1=new HashMap<>();
|
||||
map=new HashMap<>();
|
||||
map.put("cn",1);
|
||||
map.put("issuer",1);
|
||||
map.put("self-signed",1);
|
||||
map.put("expiration",1);
|
||||
map1.put("approach", map);
|
||||
userRegionMap.put("cert_verify", map1);
|
||||
//ssl_ver
|
||||
map=new HashMap<>();
|
||||
map.put("mirror_client", 1);
|
||||
map.put("allow_http2", 1);
|
||||
// map.put("min", "ssl3");
|
||||
// map.put("max", "tls13");
|
||||
userRegionMap.put("ssl_ver", map);
|
||||
//decrypt_mirror
|
||||
map=new HashMap<>();
|
||||
map.put("enable", 0);
|
||||
userRegionMap.put("decrypt_mirror", map);
|
||||
}
|
||||
return gsonToJson(userRegionMap);
|
||||
}else if(serviceId.equals(592)){
|
||||
return "{}";
|
||||
}else{
|
||||
return "0";
|
||||
}
|
||||
}
|
||||
public static Map<String,Object> convertCommonGroupMaatTable(CfgIndexInfo cfgIndexInfo, List<Map<String, Object>> cfgList){
|
||||
Map<String,Object> maatTableMap=new HashMap<>();
|
||||
Map<String,Object> commonGroupIds= MapUtils.isEmpty(cfgIndexInfo.getUserRegion())?(Map<String,Object>)gsonFromJson(cfgIndexInfo.getCommonGroupIds(),Map.class):cfgIndexInfo.getUserRegion();
|
||||
for (Map<String, Object> map : cfgList) {
|
||||
String cfgType = map.get("cfgType").toString();
|
||||
if (cfgType.equals("1")) {
|
||||
if(commonGroupIds.containsKey("ipGroup")&&map.containsKey("maatTable")){
|
||||
Map<String,String> ipMaatMap=new HashMap<>();
|
||||
for(String group:commonGroupIds.get("ipGroup").toString().split(",")){
|
||||
if(StringUtils.isNotBlank(group)){
|
||||
ipMaatMap.put(group,map.get("maatTable").toString());
|
||||
}
|
||||
}
|
||||
maatTableMap.put("ipMaatTable",ipMaatMap);
|
||||
}
|
||||
|
||||
if(map.containsKey("protocolMaatTable")){
|
||||
maatTableMap.put("protocolMaatTable",map.get("protocolMaatTable").toString());
|
||||
}
|
||||
} else if (cfgType.equals("2")) {
|
||||
String _maatTable = map.containsKey("maatTable")?map.get("maatTable").toString():null;
|
||||
Map<String,String> stringMaatMap=new HashMap<>();
|
||||
if(StringUtils.isNotBlank(_maatTable)){
|
||||
if(commonGroupIds.containsKey("urlGroup")&&_maatTable.toUpperCase().contains("URL")){
|
||||
for(String group:commonGroupIds.get("urlGroup").toString().split(",")){
|
||||
if(StringUtils.isNotBlank(group)){
|
||||
stringMaatMap.put(group,_maatTable);
|
||||
}
|
||||
}
|
||||
}
|
||||
if(commonGroupIds.containsKey("domainGroup")&&_maatTable.toUpperCase().contains("DOMAIN")){
|
||||
for(String group:commonGroupIds.get("domainGroup").toString().split(",")){
|
||||
if(StringUtils.isNotBlank(group)){
|
||||
stringMaatMap.put(group,_maatTable);
|
||||
}
|
||||
}
|
||||
}
|
||||
if(commonGroupIds.containsKey("subscribeIdGroup")&&_maatTable.toUpperCase().contains("SUBSCRIBE_ID")){
|
||||
for(String group:commonGroupIds.get("subscribeIdGroup").toString().split(",")){
|
||||
if(StringUtils.isNotBlank(group)){
|
||||
stringMaatMap.put(group,_maatTable);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if(maatTableMap.containsKey("stringMaatTable")){
|
||||
((Map<String,String>)maatTableMap.get("stringMaatTable")).putAll(stringMaatMap);
|
||||
}else{
|
||||
maatTableMap.put("stringMaatTable",stringMaatMap);
|
||||
}
|
||||
}
|
||||
}
|
||||
return maatTableMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取obj-list-group业务的function_service_dict
|
||||
* @param functionId
|
||||
* @return
|
||||
*/
|
||||
public static Map<Integer,FunctionServiceDict> objGetServiceDict(Integer functionId){
|
||||
Map<Integer,FunctionServiceDict> dictMap=new HashMap<>();
|
||||
ServiceConfigTemplateUtil util=new ServiceConfigTemplateUtil();
|
||||
List<Map<String,Object>> list=util.getServiceListByFunctionId(functionId);
|
||||
for(Map<String,Object> map:list){
|
||||
if(map.containsKey("serviceIds")){
|
||||
String serviceIds=map.get("serviceIds").toString();
|
||||
for(String serviceId:serviceIds.split(",")){
|
||||
List<Map<String,Object>> _mapList=util.getServiceListByServiceId(Integer.parseInt(serviceId));
|
||||
for(Map<String,Object> _map:_mapList){
|
||||
if(_map.containsKey("functionId")){
|
||||
List<FunctionServiceDict> dictList=DictUtils.getFunctionServiceDictList(Integer.parseInt(_map.get("functionId").toString()));
|
||||
for(FunctionServiceDict dict:dictList){
|
||||
dictMap.put(dict.getServiceId(),dict);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}else{
|
||||
if(map.containsKey("functionId")){
|
||||
List<FunctionServiceDict> dictList=DictUtils.getFunctionServiceDictList(Integer.parseInt(map.get("functionId").toString()));
|
||||
for(FunctionServiceDict dict:dictList){
|
||||
dictMap.put(dict.getServiceId(),dict);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
return dictMap;
|
||||
}
|
||||
public static <T>List<Integer> calRangeIps(List<T> srcList ){
|
||||
List<Integer> regionIdsList=new ArrayList<>();
|
||||
int total=0;
|
||||
//通过反射获取IP的src ip地址,目的IP地址
|
||||
Class clazz=null;
|
||||
Field srcIpAddressField=null,destIpAddressField=null,ipTypeFild=null;
|
||||
for(T instance:srcList){
|
||||
if(clazz==null&&srcIpAddressField==null&&destIpAddressField==null){
|
||||
try {
|
||||
clazz=instance.getClass();
|
||||
srcIpAddressField=clazz.getDeclaredField("srcIpAddress");
|
||||
srcIpAddressField.setAccessible(true);
|
||||
destIpAddressField=clazz.getDeclaredField("destIpAddress");
|
||||
destIpAddressField.setAccessible(true);
|
||||
ipTypeFild=clazz.getDeclaredField("ipType");
|
||||
ipTypeFild.setAccessible(true);
|
||||
} catch (NoSuchFieldException e) {
|
||||
return regionIdsList;
|
||||
}
|
||||
}
|
||||
try {
|
||||
String srcIpAddressValue=(String)srcIpAddressField.get(instance);
|
||||
String destIpAddressValue=(String)destIpAddressField.get(instance);
|
||||
Integer ipType=(Integer)ipTypeFild.get(instance);
|
||||
if(ipType.equals(4)){
|
||||
long left=1,right=1;
|
||||
if(srcIpAddressValue.indexOf("-")>-1){
|
||||
String[] srcIpAddressValueArray=srcIpAddressValue.split("-");
|
||||
int startPos=0,endPos=0;
|
||||
startPos=Integer.parseInt(srcIpAddressValueArray[0].split("\\.")[3]);
|
||||
endPos=Integer.parseInt(srcIpAddressValueArray[1].split("\\.")[3]);
|
||||
left=endPos-startPos+1;
|
||||
}
|
||||
if(destIpAddressValue.indexOf("-")>-1){
|
||||
String[] destIpAddressValueArray=destIpAddressValue.split("-");
|
||||
int startPos=0,endPos=0;
|
||||
startPos=Integer.parseInt(destIpAddressValueArray[0].split("\\.")[3]);
|
||||
endPos=Integer.parseInt(destIpAddressValueArray[1].split("\\.")[3]);
|
||||
right=endPos-startPos+1;
|
||||
}
|
||||
total+=left*right;
|
||||
}else{
|
||||
continue;
|
||||
}
|
||||
} catch (IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
return regionIdsList;
|
||||
}
|
||||
}
|
||||
if(total>0){
|
||||
regionIdsList=ConfigServiceUtil.getId(3,total);
|
||||
}
|
||||
|
||||
return regionIdsList;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -133,6 +133,7 @@ public class ConfigServiceUtil {
|
||||
result=response.readEntity(String.class);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error("request_service_failed",e);
|
||||
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>");
|
||||
}
|
||||
if(response != null && response.getStatus() == 200){
|
||||
@@ -157,6 +158,7 @@ public class ConfigServiceUtil {
|
||||
long end=System.currentTimeMillis();
|
||||
logger.warn("get ids finish,cost:"+(end-start));
|
||||
} catch (Exception e) {
|
||||
logger.error("getId()",e);
|
||||
throw e;
|
||||
}finally {
|
||||
if (response != null) {
|
||||
@@ -188,6 +190,7 @@ public class ConfigServiceUtil {
|
||||
result=response.readEntity(String.class);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>");
|
||||
}
|
||||
if(response != null && response.getStatus() == 200){
|
||||
@@ -200,6 +203,7 @@ public class ConfigServiceUtil {
|
||||
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+result);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error("postMaatCfg()",e);
|
||||
throw e;
|
||||
}finally {
|
||||
if (response != null) {
|
||||
@@ -232,6 +236,7 @@ public class ConfigServiceUtil {
|
||||
result=response.readEntity(String.class);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>");
|
||||
}
|
||||
if(response != null && response.getStatus() == 200){
|
||||
@@ -241,6 +246,8 @@ public class ConfigServiceUtil {
|
||||
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+result);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.error("postCallbackCfg()",e);
|
||||
throw e;
|
||||
}finally {
|
||||
if (response != null) {
|
||||
@@ -275,6 +282,7 @@ public class ConfigServiceUtil {
|
||||
result=response.readEntity(String.class);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>");
|
||||
}
|
||||
if(response != null && response.getStatus() == 200){
|
||||
@@ -284,6 +292,7 @@ public class ConfigServiceUtil {
|
||||
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>"+result);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error("postFileCfg()",e);
|
||||
throw e;
|
||||
} finally {
|
||||
if (response != null) {
|
||||
@@ -321,6 +330,7 @@ public class ConfigServiceUtil {
|
||||
result=response.readEntity(String.class);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>");
|
||||
}
|
||||
if(response != null && response.getStatus() == 200){
|
||||
@@ -330,6 +340,7 @@ public class ConfigServiceUtil {
|
||||
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+result);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error("delete()",e);
|
||||
throw e;
|
||||
} finally {
|
||||
if (response != null) {
|
||||
@@ -369,6 +380,7 @@ public class ConfigServiceUtil {
|
||||
result=response.readEntity(String.class);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>");
|
||||
}
|
||||
if(response !=null && response.getStatus() == 200){
|
||||
@@ -378,6 +390,7 @@ public class ConfigServiceUtil {
|
||||
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+result);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error("put()",e);
|
||||
throw e;
|
||||
}finally {
|
||||
if (response != null) {
|
||||
@@ -411,9 +424,11 @@ public class ConfigServiceUtil {
|
||||
// bean = (ToMaatResult) JSONObject.toBean(resObject,ToMaatResult.class);
|
||||
//获取响应结果
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+result);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error("patch()",e);
|
||||
throw e;
|
||||
}
|
||||
|
||||
@@ -444,6 +459,7 @@ public class ConfigServiceUtil {
|
||||
result=response.readEntity(String.class);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>");
|
||||
}
|
||||
if(response !=null && response.getStatus() == 200){
|
||||
@@ -455,6 +471,7 @@ public class ConfigServiceUtil {
|
||||
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+result);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error("getFileDigest()",e);
|
||||
throw e;
|
||||
} finally {
|
||||
if (response != null) {
|
||||
@@ -501,6 +518,7 @@ public class ConfigServiceUtil {
|
||||
long end=System.currentTimeMillis();
|
||||
logger.warn("postGroupReuseSources end,cost:"+(end-start));
|
||||
} catch (Exception e) {
|
||||
logger.error("postGroupReuseSources()",e);
|
||||
throw e;
|
||||
} finally {
|
||||
if (response != null) {
|
||||
@@ -559,6 +577,7 @@ public class ConfigServiceUtil {
|
||||
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+result);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error("getReport()",e);
|
||||
throw e;
|
||||
} finally {
|
||||
if (response != null) {
|
||||
@@ -617,6 +636,7 @@ public class ConfigServiceUtil {
|
||||
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+result);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error("getReport()",e);
|
||||
throw e;
|
||||
} finally {
|
||||
if (response != null) {
|
||||
@@ -679,6 +699,7 @@ public class ConfigServiceUtil {
|
||||
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+result);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error("getReport()",e);
|
||||
throw e;
|
||||
} finally {
|
||||
if (response != null) {
|
||||
@@ -744,6 +765,7 @@ public class ConfigServiceUtil {
|
||||
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error("getCGI()",e);
|
||||
throw e;
|
||||
} finally {
|
||||
if (response != null) {
|
||||
@@ -809,7 +831,7 @@ public class ConfigServiceUtil {
|
||||
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+result);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.error("configSyncCmd()",e);
|
||||
throw e;
|
||||
}finally {
|
||||
if (response != null) {
|
||||
@@ -852,6 +874,7 @@ public class ConfigServiceUtil {
|
||||
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+result);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error("configSyncStatus()",e);
|
||||
throw e;
|
||||
}finally {
|
||||
if (response != null) {
|
||||
@@ -898,6 +921,7 @@ public class ConfigServiceUtil {
|
||||
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+result);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error("configSync()",e);
|
||||
throw e;
|
||||
}finally {
|
||||
if (response != null) {
|
||||
@@ -938,11 +962,13 @@ public class ConfigServiceUtil {
|
||||
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+result);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error("configStatusUpdate()",e);
|
||||
throw e;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
try {
|
||||
// getId(1,1);
|
||||
|
||||
@@ -8,6 +8,17 @@ import java.util.regex.Pattern;
|
||||
import com.google.gson.GsonBuilder;
|
||||
|
||||
public final class Constants {
|
||||
/**
|
||||
* json打印长度
|
||||
*/
|
||||
public static Integer JSON_PRINT_LENTH=Configurations.getIntProperty("json_print_length", 100000);
|
||||
/**
|
||||
* obj group list group type
|
||||
*/
|
||||
public static Integer IP_OBJ_GROUP_TYPE=Configurations.getIntProperty("ip_obj_group_type", 5);
|
||||
public static Integer URL_OBJ_GROUP_TYPE=Configurations.getIntProperty("url_obj_group_type", 7);
|
||||
public static Integer SUBID_OBJ_GROUP_TYPE=Configurations.getIntProperty("subid_obj_group_type", 9);
|
||||
public static Integer DOMAIN_OBJ_GROUP_TYPE=Configurations.getIntProperty("domain_obj_group_type", 8);
|
||||
/**
|
||||
* 导入条数限制
|
||||
*/
|
||||
@@ -21,7 +32,7 @@ public final class Constants {
|
||||
* MaatConfig 默认值
|
||||
*/
|
||||
public static Integer MAAT_CFG_DOLOG_DEFAULT=Configurations.getIntProperty("maat_cfg_dolog_default", 2);
|
||||
public static Integer MAAT_CFG_DOLOG_DOBLACKLIST_DEFAULT=Configurations.getIntProperty("maat_cfg_dolog_doblacklist_default", 1);
|
||||
public static Integer MAAT_CFG_DOLOG_DOBLACKLIST_DEFAULT=Configurations.getIntProperty("maat_cfg_dolog_doblacklist_default", 0);
|
||||
public static Integer MAAT_CFG_DOLOG_CONFIGPERCENT_DEFAULT=Configurations.getIntProperty("maat_cfg_dolog_configpercent_default", 100);
|
||||
public static Integer MAAT_CFG_DOLOG_CONFIGOPTION_DEFAULT=Configurations.getIntProperty("maat_cfg_dolog_configoption_default", 1);
|
||||
/**
|
||||
@@ -185,6 +196,22 @@ public final class Constants {
|
||||
* DNS 策略组KEY
|
||||
*/
|
||||
public static final String CACHE_DNSGROUP_DICT = "dnsGroupDict";
|
||||
/**
|
||||
* IP公共组缓存KEY
|
||||
*/
|
||||
public static final String CACHE_IPGROUP_DICT = "ipComGroupDict";
|
||||
/**
|
||||
* URL公共组缓存KEY
|
||||
*/
|
||||
public static final String CACHE_URLGROUP_DICT = "urlComGroupDict";
|
||||
/**
|
||||
* Domain公共组缓存KEY
|
||||
*/
|
||||
public static final String CACHE_DOMAINGROUP_DICT = "domainComGroupDict";
|
||||
/**
|
||||
* ScriberId公共组缓存KEY
|
||||
*/
|
||||
public static final String CACHE_SCRIBERGROUP_DICT = "scriberComGroupDict";
|
||||
/**
|
||||
* 词典数据分类
|
||||
*/
|
||||
@@ -322,56 +349,18 @@ public final class Constants {
|
||||
// public static final boolean IS_USE_HIVE_DB =
|
||||
// Configurations.getBooleanProperty("isUseHiveDb", true);
|
||||
|
||||
/**
|
||||
* 是否获取数据中心查询记录的总条数
|
||||
*/
|
||||
|
||||
public static final boolean IS_GET_HIVECOUNT = Configurations.getBooleanProperty("isGetHiveCount", true);
|
||||
/**
|
||||
* 是否获取数据中心[神通]查询记录的总条数
|
||||
*/
|
||||
|
||||
public static final boolean IS_SELECT_CLUSTER = Configurations.getBooleanProperty("isSelectCluster", false);
|
||||
|
||||
/**
|
||||
* 神通数据库A的数据最早时间
|
||||
*/
|
||||
public static final Long CLUSTER_A_START_TIME = Configurations.getLongProperty("clusterAStartTime", new Date().getTime());
|
||||
|
||||
/**
|
||||
* 神通数据库B的数据最早时间
|
||||
*/
|
||||
public static final Long CLUSTER_B_START_TIME = Configurations.getLongProperty("clusterBStartTime", new Date().getTime());
|
||||
|
||||
/**
|
||||
* 每次获取数据中心多少条数据,咱们在对获取的数据进行分页处理
|
||||
*/
|
||||
public static final Long EVERY_GETHIVEDATANUM = Configurations.getLongProperty("everyGetHiveDataNum", 10000);
|
||||
|
||||
/**
|
||||
* 是否开启基础校验
|
||||
*/
|
||||
public static final boolean BASE_VALIDATE = Configurations.getBooleanProperty("baseValidate", true);
|
||||
|
||||
public static final Long DATACENTER_TIME = Configurations.getLongProperty("dataCenterTime", 48);
|
||||
|
||||
/**
|
||||
* 是否开启业务校验
|
||||
*/
|
||||
public static final boolean SERVICE_VALIDATE = Configurations.getBooleanProperty("serviceValidate", true);
|
||||
/**
|
||||
* 日志本地存储时间
|
||||
*/
|
||||
public static final Long LOG_LOCAL_TIME = Configurations.getLongProperty("logLocalTime", 48);
|
||||
/**
|
||||
* 实时统计默认时间
|
||||
*/
|
||||
public static final Long REPORT_LOCAL_TIME = Configurations.getLongProperty("reportLocalTime", 1);
|
||||
|
||||
/**
|
||||
* 日志是否从hive中查询
|
||||
*/
|
||||
public static final boolean SEL_FROM_HIVE = Configurations.getBooleanProperty("selFromHive", true);
|
||||
public static final boolean ONLY_SEL_FROM_HIVE = Configurations.getBooleanProperty("onlySelFromHive", true);
|
||||
|
||||
/**
|
||||
@@ -385,12 +374,6 @@ public final class Constants {
|
||||
*/
|
||||
public static final String SEARCH_DATEFORMAT = Configurations.getStringProperty("search.dateformat",
|
||||
"yyyy-MM-dd HH:mm:ss");
|
||||
public static final String SEARCH_ES_HOSTANDPORT_A = Configurations.getStringProperty("search.eshostandport_A",
|
||||
null);
|
||||
public static final String SEARCH_ES_HOSTANDPORT_B = Configurations.getStringProperty("search.eshostandport_B",
|
||||
null);
|
||||
public static final String SEARCH_ES_HOSTANDPORT_C = Configurations.getStringProperty("search.eshostandport_C",
|
||||
null);
|
||||
/**
|
||||
* 数据中心A版数据库名称,程序中每次查询时使用的数据库名称 use HIVEADBNAME
|
||||
*/
|
||||
@@ -407,6 +390,7 @@ public final class Constants {
|
||||
public static final String FILE_UPLOAD_CFG = Configurations.getStringProperty("fileUploadCfg","fileUploadSources");
|
||||
public static final String FILE_DIGEST_CFG=Configurations.getStringProperty("fileDigestCfg","fileDigestSources");
|
||||
public static final String CONFIG_ID_SOURCES=Configurations.getStringProperty("configIdSources","configPzIdSources");
|
||||
public static final String DEL_ALL_CFG=Configurations.getStringProperty("delAllCfg","delAllConfig");
|
||||
//日志查询接口URL
|
||||
public static final String LOG_BASE_URL = Configurations.getStringProperty("logBaseUrl","");
|
||||
public static final String NTC_SERVICE_REPORT=Configurations.getStringProperty("ntcServiceReport","ntcServiceReport");
|
||||
@@ -740,8 +724,14 @@ public final class Constants {
|
||||
public static final String CERT_FILE_PATH=Configurations.getStringProperty("cert_file_path", "");
|
||||
//证书校验文件
|
||||
public static final String CERT_VALIDATE_FILE=Configurations.getStringProperty("cert_validate_file", "x509");
|
||||
public static final String CA_CERT_FILE=Configurations.getStringProperty("ca_cert_file", "cacert.sh");
|
||||
public static final String CA_CERT_DIR=Configurations.getStringProperty("ca_cert_dir", "/home/cacert/");
|
||||
//证书校验成功关键字
|
||||
public static final String CERT_VALIDATE_SUCCESS_INFO=Configurations.getStringProperty("cert_validate_success_info", "x509");
|
||||
//内置证书的isser
|
||||
public static final String KEYRING_BUILT_IN_ISSER=Configurations.getStringProperty("keyring_built_in_isser", "||CN=Tango Secure Gateway CA, O=Maserati Solution||CN=Tango Secure Gateway CA UNTRUST, O=Maserati Solution||");
|
||||
//内置证书的指纹
|
||||
public static final String KEYRING_BUILT_IN_FINGERPRINT=Configurations.getStringProperty("keyring_built_in_fingerprint", "||ee23abb40085901c12f574d610153c008d49e6a0||3475833f1a9525b4ad7fbee06dfa3e4a8de0c1e0||");
|
||||
/**
|
||||
* 一些正则的pattern,预先编译,避免多次编译
|
||||
*/
|
||||
@@ -828,5 +818,56 @@ public final class Constants {
|
||||
/**
|
||||
* vpn cgi接口报错信息
|
||||
*/
|
||||
public static final String CGI_ERROR = Configurations.getStringProperty("cgiError","");;
|
||||
public static final String CGI_ERROR = Configurations.getStringProperty("cgiError","");
|
||||
|
||||
/**
|
||||
* 配置保护名单字典key
|
||||
*/
|
||||
public static final String CACHE_PROTECTION_LIST_DICT = "protetionListDict";
|
||||
/**
|
||||
* 管理员用户预警查询服务配置总量接口
|
||||
*/
|
||||
public static final String CONFIG_BY_SERVICE = Configurations.getStringProperty("getConfigByService","");
|
||||
/**
|
||||
* 获取配置统计页面列表的配置总量接口
|
||||
*/
|
||||
public static final String NTC_PZ_COUNT_REPORT = Configurations.getStringProperty("ntcPzCountReport","");
|
||||
/**
|
||||
* 查询的是流量统计菜单-配置统计中BandWidth统计的数据接口
|
||||
*/
|
||||
public static final String TRAFFIC_BANDWIDTH_TRANS_THREE_NEW=Configurations.getStringProperty("trafficBandwidthTransThreeNew","trafficBandwidthTransThreeNew");
|
||||
/**
|
||||
* 查询的是流量统计菜单-配置统计中RulesType统计的数据接口
|
||||
*/
|
||||
public static final String NTC_ACTION_ENTRANCE_REPORT_NEW=Configurations.getStringProperty("ntcActionEntranceReportNew","ntcActionEntranceReportNew");
|
||||
/**
|
||||
* 查询的是流量统计菜单-配置统计中Protocol统计的数据接口
|
||||
*/
|
||||
public static final String TRAFFIC_PROTOCOL_STATISTIC_NEW=Configurations.getStringProperty("trafficProtocolStatisticNew","trafficProtocolStatisticNew");
|
||||
/**
|
||||
* 查询的是流量统计菜单-配置统计中APP统计的数据接口
|
||||
*/
|
||||
public static final String TRAFFIC_APP_STATISTIC_NEW=Configurations.getStringProperty("trafficAppStatisticNew","trafficAppStatisticNew");
|
||||
/**
|
||||
* 查询的是流量统计菜单-配置统计中Domains统计的数据接口
|
||||
*/
|
||||
public static final String TRAFFIC_DOMAIN_STATISTIC_NEW=Configurations.getStringProperty("trafficDomainStatisticNew","trafficDomainStatisticNew");
|
||||
/**
|
||||
* 查询的是流量统计菜单-配置统计中ClientIP统计的数据接口
|
||||
*/
|
||||
public static final String TRAFFIC_SOURCE_IP_STATISTIC_NEW=Configurations.getStringProperty("trafficSourceIPStatisticNew","trafficSourceIPStatisticNew");
|
||||
/**
|
||||
* 查询的是流量统计菜单-配置统计中ServerIP统计的数据接口
|
||||
*/
|
||||
public static final String TRAFFIC_DEST_IP_STATISTIC_NEW=Configurations.getStringProperty("trafficDestIPStatisticNew","trafficDestIPStatisticNew");
|
||||
/**
|
||||
* 查询的是流量统计菜单-配置统计中SubscriberID统计的数据接口
|
||||
*/
|
||||
public static final String TRAFFIC_SUBSCRIBER_ID_STATISTIC_NEW=Configurations.getStringProperty("trafficSubscriberIDStatisticNew","trafficSubscriberIDStatisticNew");
|
||||
/**
|
||||
* HTTP(S)操控日志接口
|
||||
*/
|
||||
public static final String POLICY_EVENT=Configurations.getStringProperty("policyevent","policyevent");
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.nis.util;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -13,12 +14,14 @@ import com.nis.domain.FunctionRegionDict;
|
||||
import com.nis.domain.FunctionServiceDict;
|
||||
import com.nis.domain.SysDataDictionaryItem;
|
||||
import com.nis.domain.SysDataDictionaryName;
|
||||
import com.nis.domain.basics.CommonGroupInfo;
|
||||
import com.nis.domain.basics.PolicyGroupInfo;
|
||||
import com.nis.domain.basics.SysDictInfo;
|
||||
import com.nis.domain.configuration.DnsResStrategy;
|
||||
import com.nis.web.dao.FunctionRegionDictDao;
|
||||
import com.nis.web.dao.FunctionServiceDictDao;
|
||||
import com.nis.web.dao.SysDictDao;
|
||||
import com.nis.web.dao.basics.CommonGroupManageDao;
|
||||
import com.nis.web.dao.basics.PolicyGroupInfoDao;
|
||||
import com.nis.web.dao.basics.SysDictInfoDao;
|
||||
import com.nis.web.dao.configuration.DnsResStrategyDao;
|
||||
@@ -41,6 +44,7 @@ public class DictUtils {
|
||||
private final static FunctionServiceDictDao functionServiceDictDao = SpringContextHolder.getBean(FunctionServiceDictDao.class);
|
||||
private final static DnsResStrategyDao dnsResStrategyDao = SpringContextHolder.getBean(DnsResStrategyDao.class);
|
||||
private final static PolicyGroupInfoDao policyGroupInfoDao = SpringContextHolder.getBean(PolicyGroupInfoDao.class);
|
||||
private final static CommonGroupManageDao commonGroupManageDao = SpringContextHolder.getBean(CommonGroupManageDao.class);
|
||||
|
||||
public static Map<String, List<SysDataDictionaryItem>> getDictData() {
|
||||
|
||||
@@ -97,6 +101,18 @@ public class DictUtils {
|
||||
}
|
||||
return itemList;
|
||||
}
|
||||
public static Map<String,String> getDictMap(String key){
|
||||
Map dictMap=new HashMap<String,String>();
|
||||
List<SysDataDictionaryItem> itemList = getDictData().get(key);
|
||||
if (StringUtil.isEmpty(itemList)) {
|
||||
return dictMap;
|
||||
}else {
|
||||
for(SysDataDictionaryItem item:itemList) {
|
||||
dictMap.put(item.getItemCode(), item.getItemValue());
|
||||
}
|
||||
}
|
||||
return dictMap;
|
||||
}
|
||||
|
||||
public static String getDictLabels(String dictKey, String itemCodes, String defaultValue){
|
||||
|
||||
@@ -388,4 +404,38 @@ public class DictUtils {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取公共组字典缓存
|
||||
*/
|
||||
/*public static List<CommonGroupInfo> getCommonGroups(Integer groupType){
|
||||
String dictKey = Constants.CACHE_IPGROUP_DICT;
|
||||
if(groupType.equals(7)) {
|
||||
dictKey = Constants.CACHE_URLGROUP_DICT;
|
||||
}else if(groupType.equals(8)) {
|
||||
dictKey = Constants.CACHE_DOMAINGROUP_DICT;
|
||||
}else if(groupType.equals(9)) {
|
||||
dictKey = Constants.CACHE_SCRIBERGROUP_DICT;
|
||||
}
|
||||
List<CommonGroupInfo> allDictList = (List<CommonGroupInfo>)CacheUtils.get(dictKey);
|
||||
if(StringUtil.isEmpty(allDictList)){
|
||||
allDictList = commonGroupManageDao.findCommonGroupInfosByType(groupType);
|
||||
CacheUtils.put(dictKey, allDictList);
|
||||
}
|
||||
|
||||
return allDictList;
|
||||
}
|
||||
public static CommonGroupInfo getCommonGroups(Integer groupId, Integer groupType){
|
||||
List<CommonGroupInfo> allDictList = getCommonGroups(groupType);
|
||||
if(StringUtil.isEmpty(allDictList)){
|
||||
}else {
|
||||
for(CommonGroupInfo group:allDictList) {
|
||||
if(group.getServiceGroupId().equals(groupId)) {
|
||||
return group;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}*/
|
||||
|
||||
}
|
||||
|
||||
@@ -1,12 +1,17 @@
|
||||
package com.nis.util;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.lang.reflect.Type;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
|
||||
import com.google.gson.*;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import com.nis.domain.FunctionServiceDict;
|
||||
import com.nis.domain.basics.*;
|
||||
import com.nis.domain.configuration.*;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringEscapeUtils;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.apache.shiro.authc.UsernamePasswordToken;
|
||||
import org.apache.shiro.config.IniSecurityManagerFactory;
|
||||
@@ -18,25 +23,9 @@ import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import com.nis.domain.basics.AsnIpCfg;
|
||||
import com.nis.domain.callback.InlineIp;
|
||||
import com.nis.domain.configuration.AppPolicyCfg;
|
||||
import com.nis.domain.configuration.AvFileSampleCfg;
|
||||
import com.nis.domain.configuration.AvSignSampleCfg;
|
||||
import com.nis.domain.configuration.BaseCfg;
|
||||
import com.nis.domain.configuration.BaseStringCfg;
|
||||
import com.nis.domain.configuration.CfgIndexInfo;
|
||||
import com.nis.domain.configuration.ComplexkeywordCfg;
|
||||
import com.nis.domain.configuration.DdosIpCfg;
|
||||
import com.nis.domain.configuration.DnsIpCfg;
|
||||
import com.nis.domain.configuration.DnsResStrategy;
|
||||
import com.nis.domain.configuration.FileDigestCfg;
|
||||
import com.nis.domain.configuration.IpPortCfg;
|
||||
import com.nis.domain.configuration.PxyObjKeyring;
|
||||
import com.nis.domain.configuration.PxyObjSpoofingIpPool;
|
||||
import com.nis.domain.configuration.PxyObjTrustedCaCert;
|
||||
import com.nis.domain.configuration.PxyObjTrustedCaCrl;
|
||||
import com.nis.domain.maat.MaatCfg;
|
||||
import com.nis.domain.maat.ManipulatActionParam;
|
||||
import com.nis.domain.maat.ToMaatBean;
|
||||
import com.nis.domain.maat.ToMaatResult;
|
||||
import com.nis.domain.maat.ToUpdateMaatBeanStatus;
|
||||
@@ -75,7 +64,7 @@ public class SchedulerTaskUtil {
|
||||
* @throws IllegalAccessException
|
||||
* @throws IllegalArgumentException
|
||||
*/
|
||||
public boolean updateConfigByServiceAndCompile(Integer serviceId,Integer compileId,Integer isValid,Integer isIssueContent,ConfigSynchronizationDao configSynchronizationDao) throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException{
|
||||
public void updateConfigByServiceAndCompile(Integer serviceId,Integer compileId,Integer isValid,Integer isIssueContent,ConfigSynchronizationDao configSynchronizationDao)throws Exception{
|
||||
// SecurityManagerInit();
|
||||
// Subject subject = login("admin","zdjzsoft");
|
||||
// System.out.println(subject.getPrincipal());
|
||||
@@ -89,6 +78,7 @@ public class SchedulerTaskUtil {
|
||||
String tableName = service.get("tableName").toString();
|
||||
String serviceType = service.get("serviceType").toString();
|
||||
String className = service.get("className").toString();
|
||||
String functionId= service.get("functionId").toString();
|
||||
BaseCfg entity = new BaseCfg();
|
||||
entity.setServiceId(serviceId);
|
||||
entity.setTableName(tableName);
|
||||
@@ -118,6 +108,14 @@ public class SchedulerTaskUtil {
|
||||
List<BaseStringCfg> strList = new ArrayList();
|
||||
List<ComplexkeywordCfg> complexStrList = new ArrayList();
|
||||
List<com.nis.domain.configuration.NumBoundaryCfg> numList = new ArrayList();
|
||||
//公共分组
|
||||
boolean isCommonGroup=false;
|
||||
List<IpCommCfg> ipCommCfgList=new ArrayList<>();
|
||||
List<UrlCommCfg> urlCommCfgList=new ArrayList<>();
|
||||
List<ScriberIdCommCfg> scriberIdCommCfgList=new ArrayList<>();
|
||||
List<DomainCommCfg> domainCommCfgList=new ArrayList<>();
|
||||
Map<String,Object> commGroupMap=new HashMap<>();
|
||||
Set<Integer> groupIdSet=new HashSet<>();
|
||||
List<FileDigestCfg> fileList = new ArrayList();
|
||||
maatBean = new ToMaatBean();
|
||||
configCompileList = new ArrayList();
|
||||
@@ -129,18 +127,54 @@ public class SchedulerTaskUtil {
|
||||
List<Map<String,Object>> userRegionList = (List<Map<String, Object>>) service.get("userRegionList");
|
||||
entity.setCompileId(compileId);
|
||||
compileIds.add(compileId);
|
||||
Map<Integer, FunctionServiceDict> serviceDictMap=ConfigConvertUtil.objGetServiceDict(Integer.parseInt(functionId));
|
||||
//查询配置
|
||||
if("cfg_index_info".equals(tableName)){
|
||||
List<CfgIndexInfo> list = configSynchronizationDao.getCfgIndexList(entity);
|
||||
|
||||
if(CollectionUtils.isNotEmpty(list)&&StringUtils.isNotBlank(list.get(0).getCommonGroupIds())){
|
||||
isCommonGroup=true;
|
||||
}
|
||||
if(isIssueContent.equals(1)){
|
||||
//用于存储自定义域为关键字的业务,key=compileId,value=keyword.
|
||||
Map<Integer, BaseStringCfg> keywordMap=new HashMap<>();
|
||||
//查询子域配置详情
|
||||
if(cfgList!=null){
|
||||
if(isCommonGroup){
|
||||
groupIdSet=new HashSet<>();
|
||||
commGroupMap=ConfigConvertUtil.gsonFromJson(list.get(0).getCommonGroupIds(),Map.class);
|
||||
//将组中的域设置到cfg_index_info中
|
||||
covertCommongroupIdsMap(commGroupMap,"ipGroup",list.get(0),configSynchronizationDao,IpCommCfg.class);
|
||||
if(CollectionUtils.isNotEmpty(list.get(0).getIpCommGroupCfgList())){
|
||||
ipCommCfgList.addAll(list.get(0).getIpCommGroupCfgList());
|
||||
}
|
||||
covertCommongroupIdsMap(commGroupMap,"urlGroup",list.get(0),configSynchronizationDao,UrlCommCfg.class);
|
||||
if(CollectionUtils.isNotEmpty(list.get(0).getUrlCommGroupList())){
|
||||
urlCommCfgList.addAll(list.get(0).getUrlCommGroupList());
|
||||
}
|
||||
covertCommongroupIdsMap(commGroupMap,"subscribeIdGroup",list.get(0),configSynchronizationDao,ScriberIdCommCfg.class);
|
||||
if(CollectionUtils.isNotEmpty(list.get(0).getScriberIdCommGroupList())){
|
||||
scriberIdCommCfgList.addAll(list.get(0).getScriberIdCommGroupList());
|
||||
}
|
||||
covertCommongroupIdsMap(commGroupMap,"domainGroup",list.get(0),configSynchronizationDao,DomainCommCfg.class);
|
||||
if(CollectionUtils.isNotEmpty(list.get(0).getDomainCommGroupList())){
|
||||
domainCommCfgList.addAll(list.get(0).getDomainCommGroupList());
|
||||
}
|
||||
}else{
|
||||
for(Map<String,Object> m:cfgList){
|
||||
String regionTable = m.get("tableName").toString();
|
||||
if("1".equals(m.get("cfgType"))){
|
||||
ipList.addAll(configSynchronizationDao.getIpPortList(regionTable, compileIds));
|
||||
}else if("2".equals(m.get("cfgType"))){
|
||||
strList.addAll(configSynchronizationDao.getStrList(regionTable,compileIds));
|
||||
//512/521/514/1026业务的用户自定义域取DOMAIN_STR取自Keyword
|
||||
if(/*entity.getServiceId()==512
|
||||
||*/entity.getServiceId()==521
|
||||
||entity.getServiceId()==514
|
||||
||entity.getServiceId()==1026) {
|
||||
keywordMap=configSynchronizationDao.getCompileIdWithKeyword(regionTable, compileIds);
|
||||
}
|
||||
|
||||
}else if("3".equals(m.get("cfgType"))){
|
||||
complexStrList.addAll(configSynchronizationDao.getComplexStrList(regionTable,compileIds));
|
||||
}else if("4".equals(m.get("cfgType"))){
|
||||
@@ -150,9 +184,14 @@ public class SchedulerTaskUtil {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
//批量获取regionId,groupId(相同编译下的IP类配置多条ip只获取一个组号),分组复用的域配置不需要重新获取regionId,groupId
|
||||
List<Integer> regionIds = ConfigServiceUtil.getId(3, ipList.size()+strList.size()+complexStrList.size()+numList.size()+fileList.size());
|
||||
List<Integer> groupIds = ConfigServiceUtil.getId(2, ipList.size()+strList.size()+complexStrList.size()+numList.size()+fileList.size());
|
||||
List<Integer> regionIds=new ArrayList<>(),groupIds=new ArrayList<>();
|
||||
if(!isCommonGroup){
|
||||
regionIds = ConfigServiceUtil.getId(3, ipList.size()+strList.size()+complexStrList.size()+numList.size()+fileList.size());
|
||||
groupIds = ConfigServiceUtil.getId(2, ipList.size()+strList.size()+complexStrList.size()+numList.size()+fileList.size());
|
||||
}
|
||||
entity.setIsValid(isValid);//将最新的配置状态赋给配置对象
|
||||
entity.setAuditTime(updateTime);
|
||||
for(CfgIndexInfo cfg:list){
|
||||
@@ -162,6 +201,71 @@ public class SchedulerTaskUtil {
|
||||
numRegionList = new ArrayList();
|
||||
digestRegionList = new ArrayList();
|
||||
areaIpRegionList = new ArrayList();
|
||||
if(StringUtils.isNotBlank(cfg.getCommonGroupIds())){//公共分组
|
||||
//处理自定义域
|
||||
StringBuffer userRegion = new StringBuffer();
|
||||
userRegion.append(ConfigConvertUtil.generateCommonGroupDefaultUserRegion(null,cfg.getServiceId()));
|
||||
//子配置
|
||||
Map<String,Object> maatTableMap=ConfigConvertUtil.convertCommonGroupMaatTable(cfg,cfgList);
|
||||
//IP公共分组
|
||||
if(CollectionUtils.isNotEmpty(cfg.getIpCommGroupCfgList())){
|
||||
IpPortCfg _cfg = new IpPortCfg();
|
||||
BeanUtils.copyProperties(cfg, _cfg, new String[]{"cfgId","menuNameCode"});
|
||||
Map<String,List> map = ConfigConvertUtil.objGroupCfgConvert(serviceDictMap,ipRegionList,cfg.getIpCommGroupCfgList(),1,_cfg,groupRelationList,maatTableMap,groupIdSet);
|
||||
groupRelationList=map.get("groupList");
|
||||
ipRegionList=map.get("dstList");
|
||||
if(map.get("numRegionList")!=null){
|
||||
numRegionList.addAll(map.get("numRegionList"));
|
||||
}
|
||||
|
||||
}
|
||||
//URL公共分组
|
||||
if(CollectionUtils.isNotEmpty(cfg.getUrlCommGroupList())){
|
||||
CommonStringCfg _cfg = new CommonStringCfg();
|
||||
BeanUtils.copyProperties(cfg, _cfg, new String[]{"cfgId","menuNameCode"});
|
||||
Map<String,List> map =ConfigConvertUtil.objGroupCfgConvert(serviceDictMap,strRegionList,cfg.getUrlCommGroupList(),2,_cfg,groupRelationList,maatTableMap,groupIdSet);
|
||||
groupRelationList=map.get("groupList");
|
||||
strRegionList=map.get("dstList");
|
||||
}
|
||||
//账号公共分组
|
||||
if(CollectionUtils.isNotEmpty(cfg.getScriberIdCommGroupList())){
|
||||
CommonStringCfg _cfg = new CommonStringCfg();
|
||||
BeanUtils.copyProperties(cfg, _cfg, new String[]{"cfgId","menuNameCode"});
|
||||
|
||||
Map<String,List> map =ConfigConvertUtil.objGroupCfgConvert(serviceDictMap,strRegionList,cfg.getScriberIdCommGroupList(),2,_cfg,groupRelationList,maatTableMap,groupIdSet);
|
||||
groupRelationList=map.get("groupList");
|
||||
strRegionList=map.get("dstList");
|
||||
|
||||
}
|
||||
//域名公共分组
|
||||
if(CollectionUtils.isNotEmpty(cfg.getDomainCommGroupList())){
|
||||
CommonStringCfg _cfg = new CommonStringCfg();
|
||||
BeanUtils.copyProperties(cfg, _cfg, new String[]{"cfgId","menuNameCode"});
|
||||
|
||||
Map<String,List> map =ConfigConvertUtil.objGroupCfgConvert(serviceDictMap,strRegionList,cfg.getDomainCommGroupList(),2,_cfg,groupRelationList,maatTableMap,groupIdSet);
|
||||
groupRelationList=map.get("groupList");
|
||||
strRegionList=map.get("dstList");
|
||||
}
|
||||
BeanUtils.copyProperties(cfg, maatCfg);
|
||||
if(cfg.getServiceId().equals(512)){
|
||||
maatCfg.setAction(2);
|
||||
}else{
|
||||
maatCfg.setAction(cfg.getAction());
|
||||
}
|
||||
maatCfg.setAuditTime(StringUtil.isEmpty(entity.getAuditTime()) ? cfg.getAuditTime():entity.getAuditTime());
|
||||
maatCfg.setIpRegionList(ipRegionList);
|
||||
maatCfg.setStrRegionList(strRegionList);
|
||||
maatCfg.setNumRegionList(numRegionList);
|
||||
maatCfg.setDigestRegionList(digestRegionList);
|
||||
maatCfg.setGroupRelationList(groupRelationList);
|
||||
maatCfg.setGroupNum(groupRelationList.size());
|
||||
maatCfg.setAreaIpRegionList(areaIpRegionList);
|
||||
maatCfg.setIsValid(entity.getIsValid());
|
||||
if(!StringUtil.isEmpty(userRegion.toString())){
|
||||
maatCfg.setUserRegion(userRegion.toString());
|
||||
}
|
||||
configCompileList.add(maatCfg);
|
||||
}else{//非公共分组
|
||||
List list1 = new ArrayList();
|
||||
List<BaseStringCfg> list2 = new ArrayList();
|
||||
List<ComplexkeywordCfg> list3 = new ArrayList();
|
||||
@@ -175,14 +279,14 @@ public class SchedulerTaskUtil {
|
||||
if(userRegionPosition!=null && (userRegionPosition.toString().equals("1")||userRegionPosition.toString().equals("0"))){
|
||||
//通过反射机制获取自定义域字段值
|
||||
String regionColumn = n.get("regionColumn").toString();
|
||||
String regionKey = n.get("regionKey").toString();
|
||||
Object value = "";
|
||||
Class aClass = null;
|
||||
if(userRegionPosition.toString().equals(("0"))){
|
||||
aClass = BaseCfg.class;
|
||||
}else{
|
||||
aClass = CfgIndexInfo.class;
|
||||
}
|
||||
|
||||
Object value = "";
|
||||
if(entity.getServiceId().equals(517)||entity.getServiceId().equals(560)){//代理替换策略
|
||||
String[] regionArray = regionColumn.split(",");
|
||||
for(int r=0;r<regionArray.length;r++){
|
||||
@@ -196,10 +300,23 @@ public class SchedulerTaskUtil {
|
||||
|
||||
}
|
||||
userRegion += n.get("regionKey")+"="+value+Constants.USER_REGION_SPLIT;
|
||||
}else{
|
||||
/*if(regionKey.equals("keyring_id") && StringUtil.isEmpty(value)){
|
||||
value = "0";
|
||||
}else*/ if(regionKey.equals("DOMAIN_STR")) {
|
||||
if(!StringUtil.isEmpty(keywordMap) && !StringUtil.isEmpty(keywordMap.get(cfg.getCompileId()))) {
|
||||
value = keywordMap.get(cfg.getCompileId()).getCfgKeywords();
|
||||
}
|
||||
}else if(regionKey.equals("DOMAIN_ID")) {
|
||||
if(!StringUtil.isEmpty(keywordMap) && !StringUtil.isEmpty(keywordMap.get(cfg.getCompileId()))) {
|
||||
value = cfg.getCompileId();
|
||||
}
|
||||
|
||||
}else {
|
||||
Field field = aClass.getDeclaredField(regionColumn);
|
||||
field.setAccessible(true);
|
||||
value = field.get(cfg);
|
||||
}
|
||||
if(!StringUtil.isEmpty(value)){
|
||||
if(StringUtil.isEmpty(n.get("regionKey"))){
|
||||
userRegion = value.toString();
|
||||
@@ -214,6 +331,25 @@ public class SchedulerTaskUtil {
|
||||
userRegion = userRegion.substring(0, userRegion.length()-1);
|
||||
}
|
||||
}
|
||||
// Proxy Block --xml无法描述的user_region
|
||||
if(entity.getServiceId().equals(576)) {
|
||||
ManipulatActionParam actionParam = new ManipulatActionParam();
|
||||
actionParam.setMethod("block");
|
||||
actionParam.setCode(Integer.valueOf(cfg.getUserRegion1()));
|
||||
actionParam.setMessage(!StringUtil.isBlank(cfg.getUserRegion2()) ? cfg.getUserRegion2():"");
|
||||
actionParam.setHtml_profile(Integer.valueOf(!StringUtil.isBlank(cfg.getUserRegion3()) ? cfg.getUserRegion3():"0"));
|
||||
userRegion = StringEscapeUtils.unescapeJson(BaseService.gsonToJson(actionParam));
|
||||
}
|
||||
|
||||
// Proxy Manipulate
|
||||
if(entity.getServiceId().equals(656)) {
|
||||
userRegion = BaseService.setUserRegionOfMantipulateCfg(cfg, userRegion);
|
||||
}
|
||||
//Intercept Policy、http(s) 监测 、http(s) 白名单
|
||||
else if(entity.getServiceId().equals(521) || entity.getServiceId().equals(592)
|
||||
|| entity.getServiceId().equals(750)) {
|
||||
userRegion="{}";
|
||||
}
|
||||
for(AsnIpCfg ip:asnIpList){//asn不需要再次获取regionId,groupId
|
||||
if(ip.getAsnIpGroup().toString().equals(cfg.getUserRegion4())){//根据组号对应
|
||||
ip.setIsValid(entity.getIsValid());
|
||||
@@ -294,20 +430,23 @@ public class SchedulerTaskUtil {
|
||||
}
|
||||
configCompileList.add(maatCfg);
|
||||
}
|
||||
|
||||
}
|
||||
maatBean.setConfigCompileList(configCompileList);
|
||||
maatBean.setAuditTime(new Date());
|
||||
maatBean.setCreatorName("TaskScheduler");
|
||||
maatBean.setVersion(Constants.MAAT_VERSION);
|
||||
maatBean.setOpAction(Constants.INSERT_ACTION);
|
||||
String json=BaseService.gsonToJson(maatBean);
|
||||
if(json.length()<Constants.JSON_PRINT_LENTH){
|
||||
logger.info("定时任务修改NTC/PROXY策略的MAAT配置内容:"+json);
|
||||
}else{
|
||||
logger.info("定时任务修改NTC/PROXY策略的MAAT配置内容超过"+Constants.JSON_PRINT_LENTH+",不打印");
|
||||
}
|
||||
//调用服务接口修改配置内容与状态
|
||||
ToMaatResult result = ConfigServiceUtil.postMaatCfg(json);
|
||||
if(result!=null){
|
||||
logger.info("定时任务修改NTC/PROXY策略的MAAT配置内容响应信息:"+result.getMsg());
|
||||
return true;
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
}else{
|
||||
/*maatCfg = new MaatCfg();
|
||||
@@ -364,8 +503,8 @@ public class SchedulerTaskUtil {
|
||||
}
|
||||
}
|
||||
//批量获取regionId,groupId(相同编译下的IP类配置多条ip只获取一个组号),分组复用的域配置不需要重新获取regionId,groupId
|
||||
List<Integer> regionIds = ConfigServiceUtil.getId(3, ipList.size()+strList.size()+complexStrList.size()+numList.size()+fileList.size());
|
||||
List<Integer> groupIds = ConfigServiceUtil.getId(2, ipList.size()+strList.size()+complexStrList.size()+numList.size()+fileList.size());
|
||||
List<Integer> regionIds = ConfigServiceUtil.getId(3, ipList.size()+strList.size()+complexStrList.size()+numList.size()+fileList.size()+list.size());
|
||||
List<Integer> groupIds = ConfigServiceUtil.getId(2, ipList.size()+strList.size()+complexStrList.size()+numList.size()+fileList.size()+list.size());
|
||||
entity.setIsValid(isValid);//将最新的配置状态赋给配置对象
|
||||
entity.setAuditTime(updateTime);
|
||||
for(int i=0;i<list.size();i++){
|
||||
@@ -384,7 +523,8 @@ public class SchedulerTaskUtil {
|
||||
areaIpRegionList = new ArrayList();
|
||||
List<DdosIpCfg> list1 = new ArrayList();
|
||||
String userRegion = "";
|
||||
//处理自定义域
|
||||
//处理自定义域【DDOS自定义域组成json结构】
|
||||
Map ddosUserRegion= new HashMap();
|
||||
if(userRegionList!=null){
|
||||
for(Map<String,Object> n:userRegionList){
|
||||
Object userRegionPosition = n.get("userRegionPosition");
|
||||
@@ -401,17 +541,23 @@ public class SchedulerTaskUtil {
|
||||
Field field = aClass.getDeclaredField(regionColumn);
|
||||
field.setAccessible(true);
|
||||
value = field.get(cfg);
|
||||
|
||||
if(!StringUtil.isEmpty(value)){
|
||||
if(StringUtil.isEmpty(n.get("regionKey"))){
|
||||
userRegion = value.toString();
|
||||
}else{
|
||||
userRegion += n.get("regionKey")+"="+value+Constants.USER_REGION_SPLIT;
|
||||
//userRegion += n.get("regionKey")+"="+value+Constants.USER_REGION_SPLIT;
|
||||
ddosUserRegion.put(n.get("regionKey"), value);
|
||||
}
|
||||
}else{
|
||||
ddosUserRegion.put(n.get("regionKey"), "");
|
||||
}
|
||||
}
|
||||
}
|
||||
if(userRegion.endsWith(Constants.USER_REGION_SPLIT)){
|
||||
userRegion = userRegion.substring(0, userRegion.length()-1);
|
||||
}else if(!StringUtil.isEmpty(ddosUserRegion)){
|
||||
userRegion = new Gson().toJson(ddosUserRegion);
|
||||
}
|
||||
}
|
||||
list1.add(cfg);
|
||||
@@ -450,9 +596,6 @@ public class SchedulerTaskUtil {
|
||||
ToMaatResult result = ConfigServiceUtil.postMaatCfg(json);
|
||||
if(result!=null){
|
||||
logger.info("定时任务修改DDOS配置内容响应信息:"+result.getMsg());
|
||||
return true;
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
}else{
|
||||
/*maatCfg = new MaatCfg();
|
||||
@@ -591,9 +734,6 @@ public class SchedulerTaskUtil {
|
||||
ToMaatResult result = ConfigServiceUtil.postMaatCfg(json);
|
||||
if(result!=null){
|
||||
logger.info("定时任务修改文件摘要类配置内容响应信息:"+result.getMsg());
|
||||
return true;
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
}else{
|
||||
/*maatCfg = new MaatCfg();
|
||||
@@ -753,9 +893,6 @@ public class SchedulerTaskUtil {
|
||||
ToMaatResult result = ConfigServiceUtil.postMaatCfg(json);
|
||||
if(result!=null){
|
||||
logger.info("定时任务更新APP POLICY配置内容响应信息:"+result.getMsg());
|
||||
return true;
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
}else{
|
||||
/*maatCfg = new MaatCfg();
|
||||
@@ -795,7 +932,7 @@ public class SchedulerTaskUtil {
|
||||
|
||||
}else{//只修改配置状态
|
||||
//下发并修改配置状态的参数类
|
||||
ToUpdateMaatBeanStatus maatStatusBean = new ToUpdateMaatBeanStatus();
|
||||
/*ToUpdateMaatBeanStatus maatStatusBean = new ToUpdateMaatBeanStatus();
|
||||
UpdateMaatCfgStatus updateCfg = new UpdateMaatCfgStatus();
|
||||
List<UpdateMaatCfgStatus> configCompileStartStopList = new ArrayList();
|
||||
maatStatusBean.setVersion(Constants.MAAT_VERSION);
|
||||
@@ -841,13 +978,45 @@ public class SchedulerTaskUtil {
|
||||
String json=BaseService.gsonToJson(maatStatusBean);
|
||||
logger.info("MAAT类配置启停状态修改内容:"+json);
|
||||
//调用服务启停接口
|
||||
String result = ConfigServiceUtil.configStatusUpdate(json);
|
||||
ToMaatResult result = ConfigServiceUtil.put(json,1);
|
||||
if(result!=null){
|
||||
logger.info("MAAT类配置启停状态修改结果:"+result);
|
||||
logger.info("MAAT类配置启停状态修改结果:"+result.getMsg());
|
||||
}else{
|
||||
return false;
|
||||
}*/
|
||||
|
||||
//ip spoofing
|
||||
if(serviceId.equals(518)){
|
||||
entity.setCompileId(compileId);
|
||||
List<CfgIndexInfo> list = configSynchronizationDao.getCfgIndexList(entity);
|
||||
entity.setCompileId(compileId);
|
||||
for(CfgIndexInfo cfg:list){
|
||||
if(isValid==0){
|
||||
PxyObjSpoofingIpPool pool=new PxyObjSpoofingIpPool();
|
||||
pool.setCfgId(Long.valueOf(cfg.getUserRegion3()));
|
||||
pool = configSynchronizationDao.getPxyObjSpoofingIpPool(pool.getCfgId());
|
||||
List<PxyObjSpoofingIpPool> poolList = new ArrayList<PxyObjSpoofingIpPool>();
|
||||
pool.setIsValid(0);
|
||||
pool.setCompileId(pool.getCompileId());
|
||||
pool.setServiceId(pool.getServiceId());
|
||||
poolList.add(pool);
|
||||
//调用服务接口取消配置
|
||||
String json=BaseService.gsonToJson(poolList);
|
||||
logger.info("欺骗IP池配置配置参数:"+json);
|
||||
//调用服务接口取消配置
|
||||
try {
|
||||
ToMaatResult result = ConfigServiceUtil.put(json, 2);
|
||||
logger.info("欺骗IP池配置响应信息:"+result.getMsg());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.info("欺骗IP池配置配置失败");
|
||||
throw e;
|
||||
}
|
||||
/*maatCfg = new MaatCfg();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
maatCfg = new MaatCfg();
|
||||
maatCfg.initDefaultValue();
|
||||
maatBean = new ToMaatBean();
|
||||
configCompileList = new ArrayList();
|
||||
@@ -857,7 +1026,7 @@ public class SchedulerTaskUtil {
|
||||
configCompileList.add(maatCfg);
|
||||
maatBean.setConfigCompileList(configCompileList);
|
||||
maatBean.setAuditTime(entity.getAuditTime());
|
||||
maatBean.setCreatorName(entity.getCurrentUser().getName());
|
||||
maatBean.setCreatorName("TaskScheduler");
|
||||
maatBean.setVersion(Constants.MAAT_VERSION);
|
||||
maatBean.setOpAction(Constants.UPDATE_ACTION);
|
||||
//调用服务接口取消配置
|
||||
@@ -865,7 +1034,7 @@ public class SchedulerTaskUtil {
|
||||
logger.info("定时器修改配置状态:"+json);
|
||||
//调用服务接口下发配置
|
||||
ToMaatResult result = ConfigServiceUtil.put(json,1);
|
||||
logger.info("定时器修改配置状态响应时间:"+result.getMsg());*/
|
||||
logger.info("定时器修改配置状态响应时间:"+result.getMsg());
|
||||
}
|
||||
|
||||
}else if("2".equals(serviceType)){//回调类配置
|
||||
@@ -925,17 +1094,11 @@ public class SchedulerTaskUtil {
|
||||
//调用服务接口修改回调类配置状态
|
||||
ToMaatResult result = ConfigServiceUtil.put(json,2);
|
||||
logger.info("定时器修改回调类配置状态响应信息:"+result);
|
||||
if(result==null){
|
||||
return false;
|
||||
}else{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
return true;
|
||||
}
|
||||
//定时器非前台业务,需要设置shiro的SecurityManager
|
||||
private void SecurityManagerInit(){
|
||||
@@ -953,5 +1116,28 @@ public class SchedulerTaskUtil {
|
||||
}
|
||||
public static void main(String[] args) {
|
||||
|
||||
}
|
||||
private void covertCommongroupIdsMap(Map commGroupMap,String key,CfgIndexInfo cfg,ConfigSynchronizationDao configSynchronizationDao,Class clazz){
|
||||
if(commGroupMap.containsKey(key)){
|
||||
String groups=commGroupMap.get(key).toString();
|
||||
List<Integer> _groupIds=new ArrayList<>();
|
||||
for(String group:groups.split(",")){
|
||||
if(StringUtils.isNotBlank(group)){
|
||||
_groupIds.add(Integer.parseInt(group));
|
||||
}
|
||||
}
|
||||
if(_groupIds.size()>0){
|
||||
if("IpCommCfg".equals(clazz.getSimpleName())){
|
||||
cfg.setIpCommGroupCfgList(configSynchronizationDao.getIpCommCfgPortList(_groupIds));
|
||||
}else if("UrlCommCfg".equals(clazz.getSimpleName())){
|
||||
cfg.setUrlCommGroupList(configSynchronizationDao.getUrlCommCfgPortList(_groupIds));
|
||||
}else if("ScriberIdCommCfg".equals(clazz.getSimpleName())){
|
||||
cfg.setScriberIdCommGroupList(configSynchronizationDao.getSubscribeIdCommCfgPortList(_groupIds));
|
||||
}else if("DomainCommCfg".equals(clazz.getSimpleName())){
|
||||
cfg.setDomainCommGroupList(configSynchronizationDao.getDomainCommCfgPortList(_groupIds));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -230,6 +230,24 @@ public class ServiceConfigTemplateUtil {
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
public static Set<String> getAllTableName(){
|
||||
//Set<String> tableName = getCompileTableName();
|
||||
Set<String> result = Sets.newHashSet();
|
||||
List<Map<String, Object>> serviceList = getServiceList();
|
||||
for (Map<String, Object> serviceNode : serviceList) {
|
||||
result.add(serviceNode.get("tableName").toString().trim());
|
||||
List<Map<String,Object>> cfgList = (List<Map<String, Object>>) serviceNode.get("cfgList");
|
||||
if(cfgList != null) {
|
||||
for (Map<String, Object> map : cfgList) {
|
||||
result.add(map.get("tableName").toString().trim());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
try {
|
||||
ServiceConfigTemplateUtil serviceTemplate = new ServiceConfigTemplateUtil();
|
||||
|
||||
@@ -306,12 +306,31 @@ public class ExcelCsv {
|
||||
dict="block_drop";
|
||||
val = msgProp.getProperty(dict,dict);
|
||||
}
|
||||
if ("action".equals(ef.title()) && dict.equals("action_reject")
|
||||
&& (Reflections.invokeGetter(e, "service").toString().equals("35")
|
||||
|| Reflections.invokeGetter(e, "service").toString().equals("33")
|
||||
|| Reflections.invokeGetter(e, "service").toString().equals("36"))) {
|
||||
dict="block_drop";
|
||||
val = msgProp.getProperty(dict,dict);
|
||||
}
|
||||
//ip spoofing redirect动作修改为Spoofing
|
||||
if(ef.title().equals("block_type")
|
||||
&& (Reflections.invokeGetter(e, "serviceId").toString().equals("518"))) {
|
||||
dict="action_spoofing";
|
||||
val = msgProp.getProperty(dict,dict);
|
||||
}
|
||||
//http(s) manipulate 导出action修改为Manipulate
|
||||
if(ef.title().equals("block_type")
|
||||
&& dict.equals("action_redirect")
|
||||
&& (Reflections.invokeGetter(e, "serviceId").toString().equals("656"))) {
|
||||
dict="action_manipulate";
|
||||
val = msgProp.getProperty(dict,dict);
|
||||
}
|
||||
if(ef.title().equals("action")
|
||||
&& dict.equals("action_redirect")) {
|
||||
dict="action_manipulate";
|
||||
val = msgProp.getProperty(dict,dict);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@ import java.util.Set;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.poi.ss.usermodel.Cell;
|
||||
import org.apache.poi.ss.usermodel.CellStyle;
|
||||
@@ -39,15 +40,19 @@ import org.apache.poi.xssf.usermodel.XSSFClientAnchor;
|
||||
import org.apache.poi.xssf.usermodel.XSSFRichTextString;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Maps;
|
||||
import com.nis.domain.FunctionRegionDict;
|
||||
import com.nis.domain.FunctionServiceDict;
|
||||
import com.nis.domain.SysDataDictionaryItem;
|
||||
import com.nis.domain.basics.PolicyGroupInfo;
|
||||
import com.nis.domain.basics.ServiceDictInfo;
|
||||
import com.nis.domain.basics.SysDictInfo;
|
||||
import com.nis.domain.callback.ProxyFileTrafficMirrorCfg;
|
||||
import com.nis.domain.configuration.DnsResStrategy;
|
||||
import com.nis.domain.configuration.PxyObjKeyring;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.util.DictUtils;
|
||||
import com.nis.util.Encodes;
|
||||
@@ -56,6 +61,8 @@ import com.nis.util.StringUtil;
|
||||
import com.nis.web.dao.basics.PolicyGroupInfoDao;
|
||||
import com.nis.web.dao.basics.SysDictInfoDao;
|
||||
import com.nis.web.dao.configuration.DnsResStrategyDao;
|
||||
import com.nis.web.dao.configuration.ProxyFileTrafficMirrorDao;
|
||||
import com.nis.web.dao.configuration.PxyObjKeyringDao;
|
||||
import com.nis.web.service.SpringContextHolder;
|
||||
|
||||
/**
|
||||
@@ -70,6 +77,8 @@ public class ExportExcel {
|
||||
private static DnsResStrategyDao dnsResStrategyDao = SpringContextHolder.getBean(DnsResStrategyDao.class);
|
||||
private static PolicyGroupInfoDao policyGroupInfoDao = SpringContextHolder.getBean(PolicyGroupInfoDao.class);
|
||||
private static SysDictInfoDao sysDictInfoDao = SpringContextHolder.getBean(SysDictInfoDao.class);
|
||||
private static PxyObjKeyringDao pxyObjKeyringDao = SpringContextHolder.getBean(PxyObjKeyringDao.class);
|
||||
private static ProxyFileTrafficMirrorDao proxyFileDao = SpringContextHolder.getBean(ProxyFileTrafficMirrorDao.class);
|
||||
|
||||
/**
|
||||
* 工作薄对象
|
||||
@@ -264,6 +273,9 @@ public class ExportExcel {
|
||||
commentStr=commentStr+msgProp.getProperty("rule_desc_tip")+":\n";
|
||||
index++;
|
||||
//1、非空
|
||||
commentStr=commentStr+"▶"+msgProp.getProperty("https_url_format_tip")+"\n";
|
||||
index++;
|
||||
//1、非空
|
||||
commentStr=commentStr+"▶"+msgProp.getProperty("required")+"\n";
|
||||
index++;
|
||||
}
|
||||
@@ -290,7 +302,7 @@ public class ExportExcel {
|
||||
}
|
||||
}
|
||||
/*** HTTP(s)替换 搜索区域 ***/
|
||||
if(("replace_zone".equals(headerStr)) && (region.getFunctionId().equals(209))){
|
||||
if(("replace_zone".equals(headerStr)) && (region.getFunctionId().equals(209) || region.getAction().equals(80))){
|
||||
commentStr="";
|
||||
List<SysDataDictionaryItem> dict=DictUtils.getDictList("CONTROL_REPLACE_ZONE");
|
||||
if(dict !=null && dict.size()>0){
|
||||
@@ -453,6 +465,28 @@ public class ExportExcel {
|
||||
}
|
||||
|
||||
}
|
||||
// IP、URL、Domain和ScriberId公共组
|
||||
if("group_name".equals(headerStr)) {
|
||||
commentStr="";
|
||||
List<PolicyGroupInfo> list = null;
|
||||
if(region.getFunctionId().equals(605)) {
|
||||
list=policyGroupInfoDao.findPolicyGroupInfosByType(Constants.IP_OBJ_GROUP_TYPE);
|
||||
}else if(region.getFunctionId().equals(606)) {
|
||||
list=policyGroupInfoDao.findPolicyGroupInfosByType(Constants.URL_OBJ_GROUP_TYPE);
|
||||
}else if(region.getFunctionId().equals(607)) {
|
||||
list=policyGroupInfoDao.findPolicyGroupInfosByType(Constants.DOMAIN_OBJ_GROUP_TYPE);
|
||||
}else if(region.getFunctionId().equals(608)) {
|
||||
list=policyGroupInfoDao.findPolicyGroupInfosByType(Constants.SUBID_OBJ_GROUP_TYPE);
|
||||
}
|
||||
if(!StringUtil.isEmpty(list)){
|
||||
for (PolicyGroupInfo policyGroupInfo : list) {
|
||||
commentStr=commentStr+policyGroupInfo.getGroupName()+"\n";
|
||||
index++;
|
||||
}
|
||||
}
|
||||
commentStr=msgProp.getProperty("select")+":\n"+commentStr;
|
||||
index++;
|
||||
}
|
||||
if("isp".equals(headerStr)) {
|
||||
commentStr="";
|
||||
List<Integer> itTypeList = new ArrayList<Integer>();
|
||||
@@ -536,29 +570,6 @@ public class ExportExcel {
|
||||
index++;
|
||||
}
|
||||
}
|
||||
//doBlackList
|
||||
if("doBlacklist".equals(headerStr)) {
|
||||
commentStr="";
|
||||
List<SysDataDictionaryItem> dict=DictUtils.getDictList("DO_BLACKLIST");
|
||||
if(dict !=null && dict.size()>0){
|
||||
for (SysDataDictionaryItem sysDataDictionaryItem : dict) {
|
||||
String itemCode = sysDataDictionaryItem.getItemCode();
|
||||
commentStr=commentStr+itemCode+"("+msgProp.getProperty(sysDataDictionaryItem.getItemValue(),sysDataDictionaryItem.getItemValue())+")\n";
|
||||
index++;
|
||||
}
|
||||
defaultValue = String.valueOf(Constants.MAAT_CFG_DOLOG_DOBLACKLIST_DEFAULT);
|
||||
}
|
||||
commentStr=msgProp.getProperty("select")+":\n"+commentStr;
|
||||
index++;
|
||||
commentStr=commentStr+"\n"+msgProp.getProperty("rule_desc_tip")+":\n";
|
||||
index++;
|
||||
if(!StringUtil.isEmpty(defaultValue)){
|
||||
//1、默认值说明
|
||||
commentStr=commentStr+"▶"+msgProp.getProperty("default_value")+":"+defaultValue+"\n";
|
||||
index++;
|
||||
index++;
|
||||
}
|
||||
}
|
||||
|
||||
/** Ip Spoofing **/
|
||||
if("spoofing".equals(headerStr) && (region.getFunctionId().equals(214))){
|
||||
@@ -592,7 +603,393 @@ public class ExportExcel {
|
||||
commentStr=commentStr+"▶"+msgProp.getProperty("ip_check")+"(IPv4)\n";
|
||||
index++;
|
||||
}
|
||||
/**********************************************************************pxy intercept************************************************************************************************************/
|
||||
//pxy intercept
|
||||
if("pxy_intercept_monit_keyring".equals(headerStr)) {
|
||||
commentStr="";
|
||||
List<PxyObjKeyring> certificateList=pxyObjKeyringDao.findList(null,1,1,"ip");
|
||||
if(CollectionUtils.isNotEmpty(certificateList)) {
|
||||
for (PxyObjKeyring certificate : certificateList) {
|
||||
commentStr=commentStr+certificate.getCompileId()+"("+certificate.getCfgDesc()+")\n";
|
||||
index++;
|
||||
}
|
||||
}
|
||||
if(StringUtil.isEmpty(headerStr)){
|
||||
headerStr="";
|
||||
commentStr="";
|
||||
}else{
|
||||
commentStr=msgProp.getProperty("select")+":\n"+commentStr;
|
||||
index++;
|
||||
index++;
|
||||
commentStr=commentStr+"\n"+msgProp.getProperty("rule_desc_tip")+":\n";
|
||||
index++;
|
||||
/*//2、默认值说明
|
||||
commentStr=commentStr+"▶"+msgProp.getProperty("default_value")+":0\n";
|
||||
index++;*/
|
||||
index++;
|
||||
}
|
||||
}
|
||||
//ev_cert
|
||||
if("exclusions_ev_cert".equals(headerStr)) {
|
||||
commentStr="";
|
||||
commentStr=msgProp.getProperty("select")+":\n"+commentStr;
|
||||
index++;
|
||||
commentStr+=1+"("+msgProp.getProperty("yes")+")\n";
|
||||
index++;
|
||||
commentStr+=0+"("+msgProp.getProperty("no")+")\n";
|
||||
index++;
|
||||
if(StringUtil.isEmpty(headerStr)){
|
||||
headerStr="";
|
||||
commentStr="";
|
||||
}else{
|
||||
index++;
|
||||
commentStr=commentStr+"\n"+msgProp.getProperty("rule_desc_tip")+":\n";
|
||||
index++;
|
||||
//2、默认值说明
|
||||
commentStr=commentStr+"▶"+msgProp.getProperty("default_value")+":0\n";
|
||||
index++;
|
||||
index++;
|
||||
}
|
||||
}
|
||||
//cert_transparency
|
||||
if("exclusions_cert_transparency".equals(headerStr)) {
|
||||
commentStr="";
|
||||
commentStr=msgProp.getProperty("select")+":\n"+commentStr;
|
||||
index++;
|
||||
commentStr+=1+"("+msgProp.getProperty("yes")+")\n";
|
||||
index++;
|
||||
commentStr+=0+"("+msgProp.getProperty("no")+")\n";
|
||||
index++;
|
||||
if(StringUtil.isEmpty(headerStr)){
|
||||
headerStr="";
|
||||
commentStr="";
|
||||
}else{
|
||||
index++;
|
||||
commentStr=commentStr+"\n"+msgProp.getProperty("rule_desc_tip")+":\n";
|
||||
index++;
|
||||
//2、默认值说明
|
||||
commentStr=commentStr+"▶"+msgProp.getProperty("default_value")+":0\n";
|
||||
index++;
|
||||
index++;
|
||||
}
|
||||
}
|
||||
//client_cert_req
|
||||
if("exclusions_client_cert_req".equals(headerStr)) {
|
||||
commentStr="";
|
||||
commentStr=msgProp.getProperty("select")+":\n"+commentStr;
|
||||
index++;
|
||||
commentStr+=1+"("+msgProp.getProperty("yes")+")\n";
|
||||
index++;
|
||||
commentStr+=0+"("+msgProp.getProperty("no")+")\n";
|
||||
index++;
|
||||
if(StringUtil.isEmpty(headerStr)){
|
||||
headerStr="";
|
||||
commentStr="";
|
||||
}else{
|
||||
index++;
|
||||
commentStr=commentStr+"\n"+msgProp.getProperty("rule_desc_tip")+":\n";
|
||||
index++;
|
||||
//2、默认值说明
|
||||
commentStr=commentStr+"▶"+msgProp.getProperty("default_value")+":1\n";
|
||||
index++;
|
||||
index++;
|
||||
}
|
||||
}
|
||||
//pinning
|
||||
if("exclusions_pinning".equals(headerStr)) {
|
||||
commentStr="";
|
||||
commentStr=msgProp.getProperty("select")+":\n"+commentStr;
|
||||
index++;
|
||||
commentStr+=1+"("+msgProp.getProperty("yes")+")\n";
|
||||
index++;
|
||||
commentStr+=0+"("+msgProp.getProperty("no")+")\n";
|
||||
index++;
|
||||
if(StringUtil.isEmpty(headerStr)){
|
||||
headerStr="";
|
||||
commentStr="";
|
||||
}else{
|
||||
index++;
|
||||
commentStr=commentStr+"\n"+msgProp.getProperty("rule_desc_tip")+":\n";
|
||||
index++;
|
||||
//2、默认值说明
|
||||
commentStr=commentStr+"▶"+msgProp.getProperty("default_value")+":1\n";
|
||||
index++;
|
||||
index++;
|
||||
}
|
||||
}
|
||||
//pinning
|
||||
if("exclusions_protocol_errors".equals(headerStr)) {
|
||||
commentStr="";
|
||||
commentStr=msgProp.getProperty("select")+":\n"+commentStr;
|
||||
index++;
|
||||
commentStr+=1+"("+msgProp.getProperty("yes")+")\n";
|
||||
index++;
|
||||
commentStr+=0+"("+msgProp.getProperty("no")+")\n";
|
||||
index++;
|
||||
if(StringUtil.isEmpty(headerStr)){
|
||||
headerStr="";
|
||||
commentStr="";
|
||||
}else{
|
||||
index++;
|
||||
commentStr=commentStr+"\n"+msgProp.getProperty("rule_desc_tip")+":\n";
|
||||
index++;
|
||||
//2、默认值说明
|
||||
commentStr=commentStr+"▶"+msgProp.getProperty("default_value")+":1\n";
|
||||
index++;
|
||||
index++;
|
||||
}
|
||||
}
|
||||
//cn
|
||||
if("cert_verify_approach_cn".equals(headerStr)) {
|
||||
commentStr="";
|
||||
commentStr=msgProp.getProperty("select")+":\n"+commentStr;
|
||||
index++;
|
||||
commentStr+=1+"("+msgProp.getProperty("yes")+")\n";
|
||||
index++;
|
||||
commentStr+=0+"("+msgProp.getProperty("no")+")\n";
|
||||
index++;
|
||||
if(StringUtil.isEmpty(headerStr)){
|
||||
headerStr="";
|
||||
commentStr="";
|
||||
}else{
|
||||
index++;
|
||||
commentStr=commentStr+"\n"+msgProp.getProperty("rule_desc_tip")+":\n";
|
||||
index++;
|
||||
//2、默认值说明
|
||||
commentStr=commentStr+"▶"+msgProp.getProperty("default_value")+":1\n";
|
||||
index++;
|
||||
index++;
|
||||
}
|
||||
}
|
||||
//issuer
|
||||
if("cert_verify_approach_issuer".equals(headerStr)) {
|
||||
commentStr="";
|
||||
commentStr=msgProp.getProperty("select")+":\n"+commentStr;
|
||||
index++;
|
||||
commentStr+=1+"("+msgProp.getProperty("yes")+")\n";
|
||||
index++;
|
||||
commentStr+=0+"("+msgProp.getProperty("no")+")\n";
|
||||
index++;
|
||||
if(StringUtil.isEmpty(headerStr)){
|
||||
headerStr="";
|
||||
commentStr="";
|
||||
}else{
|
||||
index++;
|
||||
commentStr=commentStr+"\n"+msgProp.getProperty("rule_desc_tip")+":\n";
|
||||
index++;
|
||||
//2、默认值说明
|
||||
commentStr=commentStr+"▶"+msgProp.getProperty("default_value")+":1\n";
|
||||
index++;
|
||||
index++;
|
||||
}
|
||||
}
|
||||
//self-signed
|
||||
if("cert_verify_approach_self_signed".equals(headerStr)) {
|
||||
commentStr="";
|
||||
commentStr=msgProp.getProperty("select")+":\n"+commentStr;
|
||||
index++;
|
||||
commentStr+=1+"("+msgProp.getProperty("yes")+")\n";
|
||||
index++;
|
||||
commentStr+=0+"("+msgProp.getProperty("no")+")\n";
|
||||
index++;
|
||||
if(StringUtil.isEmpty(headerStr)){
|
||||
headerStr="";
|
||||
commentStr="";
|
||||
}else{
|
||||
index++;
|
||||
commentStr=commentStr+"\n"+msgProp.getProperty("rule_desc_tip")+":\n";
|
||||
index++;
|
||||
//2、默认值说明
|
||||
commentStr=commentStr+"▶"+msgProp.getProperty("default_value")+":1\n";
|
||||
index++;
|
||||
index++;
|
||||
}
|
||||
}
|
||||
//expiration
|
||||
if("cert_verify_approach_expiration".equals(headerStr)) {
|
||||
commentStr="";
|
||||
commentStr=msgProp.getProperty("select")+":\n"+commentStr;
|
||||
index++;
|
||||
commentStr+=1+"("+msgProp.getProperty("yes")+")\n";
|
||||
index++;
|
||||
commentStr+=0+"("+msgProp.getProperty("no")+")\n";
|
||||
index++;
|
||||
if(StringUtil.isEmpty(headerStr)){
|
||||
headerStr="";
|
||||
commentStr="";
|
||||
}else{
|
||||
index++;
|
||||
commentStr=commentStr+"\n"+msgProp.getProperty("rule_desc_tip")+":\n";
|
||||
index++;
|
||||
//2、默认值说明
|
||||
commentStr=commentStr+"▶"+msgProp.getProperty("default_value")+":1\n";
|
||||
index++;
|
||||
index++;
|
||||
}
|
||||
}
|
||||
//fail_method
|
||||
if("cert_verify_fail_method".equals(headerStr)) {
|
||||
commentStr="";
|
||||
defaultValue="pass-through";
|
||||
List<SysDataDictionaryItem> failMethods=DictUtils.getDictList("FAIL_METHOD");
|
||||
if(CollectionUtils.isNotEmpty(failMethods)){
|
||||
for (SysDataDictionaryItem failMethod : failMethods) {
|
||||
commentStr=commentStr+failMethod.getItemCode()+"("+msgProp.getProperty(failMethod.getItemValue(),failMethod.getItemValue())+")"+"\n";
|
||||
index++;
|
||||
}
|
||||
if(StringUtil.isEmpty(commentStr)){
|
||||
headerStr="";
|
||||
commentStr="";
|
||||
}
|
||||
if(StringUtil.isEmpty(defaultValue)){
|
||||
defaultValue = region.getConfigDirection().split(",")[0];
|
||||
}
|
||||
|
||||
}
|
||||
commentStr=msgProp.getProperty("select")+":\n"+commentStr;
|
||||
index++;
|
||||
commentStr=commentStr+msgProp.getProperty("rule_desc_tip")+":\n";
|
||||
index++;
|
||||
//1、默认值说明
|
||||
if(!StringUtil.isEmpty(defaultValue)){
|
||||
commentStr=commentStr+"▶"+msgProp.getProperty("default_value")+":"+defaultValue+"\n";
|
||||
index++;
|
||||
}
|
||||
}
|
||||
//fail_method
|
||||
if("ssl_ver_mirror_client".equals(headerStr)) {
|
||||
commentStr="";
|
||||
defaultValue="1";
|
||||
commentStr=msgProp.getProperty("select")+":\n"+commentStr;
|
||||
index++;
|
||||
commentStr+=1+"("+msgProp.getProperty("yes")+")\n";
|
||||
index++;
|
||||
commentStr+=0+"("+msgProp.getProperty("no")+")\n";
|
||||
index++;
|
||||
commentStr=commentStr+msgProp.getProperty("rule_desc_tip")+":\n";
|
||||
index++;
|
||||
//1、默认值说明
|
||||
if(!StringUtil.isEmpty(defaultValue)){
|
||||
commentStr=commentStr+"▶"+msgProp.getProperty("default_value")+":"+defaultValue+"\n";
|
||||
index++;
|
||||
}
|
||||
commentStr=commentStr+"▶"+msgProp.getProperty("ssl_ver_mirror_client_on","if the mirror client option value is '1', the min SSL version and the max SSL version will be ignored")+"\n";
|
||||
index++;
|
||||
}
|
||||
//min
|
||||
if("ssl_ver_min".equals(headerStr)) {
|
||||
commentStr="";
|
||||
defaultValue="ssl3";
|
||||
List<SysDataDictionaryItem> sslversions=DictUtils.getDictList("SSL_VERSION");
|
||||
if(CollectionUtils.isNotEmpty(sslversions)){
|
||||
for (SysDataDictionaryItem sslversion : sslversions) {
|
||||
commentStr=commentStr+sslversion.getItemCode()+"("+msgProp.getProperty(sslversion.getItemValue(),sslversion.getItemValue())+")"+"\n";
|
||||
index++;
|
||||
}
|
||||
if(StringUtil.isEmpty(commentStr)){
|
||||
headerStr="";
|
||||
commentStr="";
|
||||
}
|
||||
}
|
||||
commentStr=msgProp.getProperty("select")+":\n"+commentStr;
|
||||
index++;
|
||||
commentStr=commentStr+msgProp.getProperty("rule_desc_tip")+":\n";
|
||||
index++;
|
||||
//1、默认值说明
|
||||
if(!StringUtil.isEmpty(defaultValue)){
|
||||
commentStr=commentStr+"▶"+msgProp.getProperty("default_value")+":"+defaultValue+"\n";
|
||||
index++;
|
||||
}
|
||||
}
|
||||
//max
|
||||
if("ssl_ver_max".equals(headerStr)) {
|
||||
commentStr="";
|
||||
defaultValue="tls13";
|
||||
List<SysDataDictionaryItem> sslversions=DictUtils.getDictList("SSL_VERSION");
|
||||
if(CollectionUtils.isNotEmpty(sslversions)){
|
||||
for (SysDataDictionaryItem sslversion : sslversions) {
|
||||
commentStr=commentStr+sslversion.getItemCode()+"("+msgProp.getProperty(sslversion.getItemValue(),sslversion.getItemValue())+")"+"\n";
|
||||
index++;
|
||||
}
|
||||
if(StringUtil.isEmpty(commentStr)){
|
||||
headerStr="";
|
||||
commentStr="";
|
||||
}
|
||||
|
||||
}
|
||||
commentStr=msgProp.getProperty("select")+":\n"+commentStr;
|
||||
index++;
|
||||
commentStr=commentStr+msgProp.getProperty("rule_desc_tip")+":\n";
|
||||
index++;
|
||||
//1、默认值说明
|
||||
if(!StringUtil.isEmpty(defaultValue)){
|
||||
commentStr=commentStr+"▶"+msgProp.getProperty("default_value")+":"+defaultValue+"\n";
|
||||
index++;
|
||||
}
|
||||
}
|
||||
//allow_http2
|
||||
if("ssl_ver_allow_http2".equals(headerStr)) {
|
||||
commentStr="";
|
||||
defaultValue="1";
|
||||
commentStr=msgProp.getProperty("select")+":\n"+commentStr;
|
||||
index++;
|
||||
commentStr+=1+"("+msgProp.getProperty("yes")+")\n";
|
||||
index++;
|
||||
commentStr+=0+"("+msgProp.getProperty("no")+")\n";
|
||||
index++;
|
||||
commentStr=commentStr+msgProp.getProperty("rule_desc_tip")+":\n";
|
||||
index++;
|
||||
//1、默认值说明
|
||||
if(!StringUtil.isEmpty(defaultValue)){
|
||||
commentStr=commentStr+"▶"+msgProp.getProperty("default_value")+":"+defaultValue+"\n";
|
||||
index++;
|
||||
}
|
||||
index++;
|
||||
}
|
||||
if("decrypt_mirror_enable".equals(headerStr)) {
|
||||
commentStr="";
|
||||
defaultValue="0";
|
||||
commentStr=msgProp.getProperty("select")+":\n"+commentStr;
|
||||
index++;
|
||||
commentStr+=1+"("+msgProp.getProperty("yes")+")\n";
|
||||
index++;
|
||||
commentStr+=0+"("+msgProp.getProperty("no")+")\n";
|
||||
index++;
|
||||
commentStr=commentStr+msgProp.getProperty("rule_desc_tip")+":\n";
|
||||
index++;
|
||||
//1、默认值说明
|
||||
if(!StringUtil.isEmpty(defaultValue)){
|
||||
commentStr=commentStr+"▶"+msgProp.getProperty("default_value")+":"+defaultValue+"\n";
|
||||
index++;
|
||||
}
|
||||
commentStr=commentStr+"▶"+msgProp.getProperty("decrypt_mirror_enable_on","if the enable option value is '1', the Mirror profile is needed")+"\n";
|
||||
index++;
|
||||
}
|
||||
if("decrypt_mirror_mirror_profile".equals(headerStr)) {
|
||||
commentStr="";
|
||||
List<ProxyFileTrafficMirrorCfg> mirrorProfileList=proxyFileDao.findMirrorList(null,1,1);
|
||||
if(CollectionUtils.isNotEmpty(mirrorProfileList)) {
|
||||
for (ProxyFileTrafficMirrorCfg mirrorProfile : mirrorProfileList) {
|
||||
commentStr=commentStr+mirrorProfile.getCompileId()+"("+mirrorProfile.getCfgDesc()+")\n";
|
||||
index++;
|
||||
}
|
||||
}
|
||||
if(StringUtil.isEmpty(headerStr)){
|
||||
headerStr="";
|
||||
commentStr="";
|
||||
}else{
|
||||
commentStr=msgProp.getProperty("select")+":\n"+commentStr;
|
||||
index++;
|
||||
index++;
|
||||
commentStr=commentStr+"\n"+msgProp.getProperty("rule_desc_tip")+":\n";
|
||||
index++;
|
||||
/*//2、默认值说明
|
||||
commentStr=commentStr+"▶"+msgProp.getProperty("default_value")+":0\n";
|
||||
index++;*/
|
||||
index++;
|
||||
}
|
||||
}
|
||||
/**********************************************************************pxy intercept************************************************************************************************************/
|
||||
if(region.getRegionType().equals(1)){//IP配置
|
||||
//ip配置需要导入的信息:srcIp srcPort destIp destPort Protocol Direction
|
||||
//确定需要导入的srcIp srcPort destIp destPort信息
|
||||
@@ -606,25 +1003,28 @@ public class ExportExcel {
|
||||
commentStr="";
|
||||
}
|
||||
}else{
|
||||
String[] ipPatterns=region.getConfigIpPattern().split(";");
|
||||
if("client_ip".equals(headerStr)){
|
||||
Assert.isTrue(ipPatterns.length==2);
|
||||
String srcIpPattern=ipPatterns[0];
|
||||
if(((","+region.getConfigIpPortShow()+",").indexOf(",1,") > -1) ){
|
||||
commentStr="";
|
||||
if((","+region.getConfigIpType()+",").indexOf(",4,") > -1){
|
||||
if((","+region.getConfigIpPattern()+",").indexOf(",3,") > -1){
|
||||
if((","+srcIpPattern+",").indexOf(",3,") > -1){
|
||||
commentStr=commentStr+Constants.IPV4_DEFAULT_IP_VALUE+"(IPv4)"+"\n";
|
||||
if(StringUtil.isEmpty(defaultValue)){
|
||||
defaultValue=Constants.IPV4_DEFAULT_IP_VALUE;
|
||||
}
|
||||
index++;
|
||||
}
|
||||
if((","+region.getConfigIpPattern()+",").indexOf(",2,") > -1){
|
||||
if((","+srcIpPattern+",").indexOf(",2,") > -1){
|
||||
commentStr=commentStr+Constants.IPV4_DEFAULT_IP_RANGE_VALUE+"("+msgProp.getProperty("ipv4_range_tip")+")"+"\n";
|
||||
if(StringUtil.isEmpty(defaultValue)){
|
||||
defaultValue=Constants.IPV4_DEFAULT_IP_RANGE_VALUE;
|
||||
}
|
||||
index++;
|
||||
}
|
||||
if((","+region.getConfigIpPattern()+",").indexOf(",1,") > -1){
|
||||
if((","+srcIpPattern+",").indexOf(",1,") > -1){
|
||||
commentStr=commentStr+Constants.IPV4_DEFAULT_IP_SUBNET_VALUE+"("+msgProp.getProperty("ipv4_subnet_tip")+")"+"\n";
|
||||
if(StringUtil.isEmpty(defaultValue)){
|
||||
defaultValue=Constants.IPV4_DEFAULT_IP_SUBNET_VALUE;
|
||||
@@ -633,21 +1033,21 @@ public class ExportExcel {
|
||||
}
|
||||
}
|
||||
if((","+region.getConfigIpType()+",").indexOf(",6,") > -1){
|
||||
if((","+region.getConfigIpPattern()+",").indexOf(",3,") > -1){
|
||||
if((","+srcIpPattern+",").indexOf(",3,") > -1){
|
||||
commentStr=commentStr+Constants.IPV6_DEFAULT_IP_VALUE+"(IPv6)"+"\n";
|
||||
if(StringUtil.isEmpty(defaultValue)){
|
||||
defaultValue=Constants.IPV6_DEFAULT_IP_VALUE;
|
||||
}
|
||||
index++;
|
||||
}
|
||||
if((","+region.getConfigIpPattern()+",").indexOf(",2,") > -1){
|
||||
if((","+srcIpPattern+",").indexOf(",2,") > -1){
|
||||
commentStr=commentStr+Constants.IPV6_DEFAULT_IP_RANGE_VALUE+"("+msgProp.getProperty("ipv6_range_tip")+")"+"\n";
|
||||
if(StringUtil.isEmpty(defaultValue)){
|
||||
defaultValue=Constants.IPV6_DEFAULT_IP_RANGE_VALUE;
|
||||
}
|
||||
index++;
|
||||
}
|
||||
if((","+region.getConfigIpPattern()+",").indexOf(",1,") > -1){
|
||||
if((","+srcIpPattern+",").indexOf(",1,") > -1){
|
||||
commentStr=commentStr+Constants.IPV6_DEFAULT_IP_SUBNET_VALUE+"("+msgProp.getProperty("ipv6_subnet_tip")+")"+"\n\n";
|
||||
if(StringUtil.isEmpty(defaultValue)){
|
||||
defaultValue=Constants.IPV6_DEFAULT_IP_SUBNET_VALUE;
|
||||
@@ -696,12 +1096,12 @@ public class ExportExcel {
|
||||
,msgProp.getProperty("serverip"))+"\n";
|
||||
index++;
|
||||
index++;
|
||||
commentStr=commentStr+"▶"+String.format(msgProp.getProperty("the_same_ip_type_pattern"))+"\n";
|
||||
commentStr=commentStr+"▶"+String.format(msgProp.getProperty("the_same_ip_type"))+"\n";
|
||||
index++;
|
||||
index++;
|
||||
}
|
||||
//4、IP Range 开始IP和结束IP必须在同一网段
|
||||
if(((","+region.getConfigIpPattern()+",").indexOf(",2,") > -1)){
|
||||
if(((","+srcIpPattern+",").indexOf(",2,") > -1)){
|
||||
commentStr=commentStr+"▶"+msgProp.getProperty("ip_range")+","+msgProp.getProperty("ip_range_bit_field")+"\n";
|
||||
index++;
|
||||
index++;
|
||||
@@ -712,7 +1112,7 @@ public class ExportExcel {
|
||||
}
|
||||
|
||||
//6、IPv4 Mask 掩码范围16-32
|
||||
if(((","+region.getConfigIpPattern()+",").indexOf(",1,") > -1)){
|
||||
if(((","+srcIpPattern+",").indexOf(",1,") > -1)){
|
||||
if(((","+region.getConfigIpType()+",").indexOf(",4,") > -1)){
|
||||
commentStr=commentStr+"▶"+msgProp.getProperty("ipv4_subnet_tip")+","+msgProp.getProperty("ipv4_mask_range_tip")+"\n";
|
||||
index++;
|
||||
@@ -728,24 +1128,25 @@ public class ExportExcel {
|
||||
|
||||
}
|
||||
if("server_ip".equals(headerStr)){
|
||||
String destIpPattern=ipPatterns[1];
|
||||
if((","+region.getConfigIpPortShow()+",").indexOf(",3,") > -1){
|
||||
commentStr="";
|
||||
if((","+region.getConfigIpType()+",").indexOf(",4,") > -1){
|
||||
if((","+region.getConfigIpPattern()+",").indexOf(",3,") > -1){
|
||||
if((","+destIpPattern+",").indexOf(",3,") > -1){
|
||||
commentStr=commentStr+Constants.IPV4_DEFAULT_IP_VALUE+"(IPv4)"+"\n";
|
||||
if(StringUtil.isEmpty(defaultValue)){
|
||||
defaultValue=Constants.IPV4_DEFAULT_IP_VALUE;
|
||||
}
|
||||
index++;
|
||||
}
|
||||
if((","+region.getConfigIpPattern()+",").indexOf(",2,") > -1){
|
||||
if((","+destIpPattern+",").indexOf(",2,") > -1){
|
||||
commentStr=commentStr+Constants.IPV4_DEFAULT_IP_RANGE_VALUE+"("+msgProp.getProperty("ipv4_range_tip")+")"+"\n";
|
||||
if(StringUtil.isEmpty(defaultValue)){
|
||||
defaultValue=Constants.IPV4_DEFAULT_IP_RANGE_VALUE;
|
||||
}
|
||||
index++;
|
||||
}
|
||||
if((","+region.getConfigIpPattern()+",").indexOf(",1,") > -1){
|
||||
if((","+destIpPattern+",").indexOf(",1,") > -1){
|
||||
commentStr=commentStr+Constants.IPV4_DEFAULT_IP_SUBNET_VALUE+"("+msgProp.getProperty("ipv4_subnet_tip")+")"+"\n";
|
||||
if(StringUtil.isEmpty(defaultValue)){
|
||||
defaultValue=Constants.IPV4_DEFAULT_IP_SUBNET_VALUE;
|
||||
@@ -754,21 +1155,21 @@ public class ExportExcel {
|
||||
}
|
||||
}
|
||||
if((","+region.getConfigIpType()+",").indexOf(",6,") > -1){
|
||||
if((","+region.getConfigIpPattern()+",").indexOf(",3,") > -1){
|
||||
if((","+destIpPattern+",").indexOf(",3,") > -1){
|
||||
commentStr=commentStr+Constants.IPV6_DEFAULT_IP_VALUE+"(IPv6)"+"\n";
|
||||
if(StringUtil.isEmpty(defaultValue)){
|
||||
defaultValue=Constants.IPV6_DEFAULT_IP_VALUE;
|
||||
}
|
||||
index++;
|
||||
}
|
||||
if((","+region.getConfigIpPattern()+",").indexOf(",2,") > -1){
|
||||
if((","+destIpPattern+",").indexOf(",2,") > -1){
|
||||
commentStr=commentStr+Constants.IPV6_DEFAULT_IP_RANGE_VALUE+"("+msgProp.getProperty("ipv6_range_tip")+")"+"\n";
|
||||
if(StringUtil.isEmpty(defaultValue)){
|
||||
defaultValue=Constants.IPV6_DEFAULT_IP_RANGE_VALUE;
|
||||
}
|
||||
index++;
|
||||
}
|
||||
if((","+region.getConfigIpPattern()+",").indexOf(",1,") > -1){
|
||||
if((","+destIpPattern+",").indexOf(",1,") > -1){
|
||||
commentStr=commentStr+Constants.IPV6_DEFAULT_IP_SUBNET_VALUE+"("+msgProp.getProperty("ipv6_subnet_tip")+")"+"\n\n";
|
||||
if(StringUtil.isEmpty(defaultValue)){
|
||||
defaultValue=Constants.IPV6_DEFAULT_IP_SUBNET_VALUE;
|
||||
@@ -801,12 +1202,12 @@ public class ExportExcel {
|
||||
,msgProp.getProperty("serverip"))+"\n";
|
||||
index++;
|
||||
index++;
|
||||
commentStr=commentStr+"▶"+String.format(msgProp.getProperty("the_same_ip_type_pattern"))+"\n";
|
||||
commentStr=commentStr+"▶"+String.format(msgProp.getProperty("the_same_ip_type"))+"\n";
|
||||
index++;
|
||||
index++;
|
||||
}
|
||||
//4、IP Range 开始IP和结束IP必须在同一网段
|
||||
if(((","+region.getConfigIpPattern()+",").indexOf(",2,") > -1)){
|
||||
if(((","+destIpPattern+",").indexOf(",2,") > -1)){
|
||||
commentStr=commentStr+"▶"+msgProp.getProperty("ip_range")+","+msgProp.getProperty("ip_range_bit_field")+"\n";
|
||||
index++;
|
||||
index++;
|
||||
@@ -817,7 +1218,7 @@ public class ExportExcel {
|
||||
}
|
||||
|
||||
//6、IPv4 Mask 掩码范围16-32
|
||||
if(((","+region.getConfigIpPattern()+",").indexOf(",1,") > -1)){
|
||||
if(((","+destIpPattern+",").indexOf(",1,") > -1)){
|
||||
if(((","+region.getConfigIpType()+",").indexOf(",4,") > -1)){
|
||||
commentStr=commentStr+"▶"+msgProp.getProperty("ipv4_subnet_tip")+","+msgProp.getProperty("ipv4_mask_range_tip")+"\n";
|
||||
index++;
|
||||
@@ -843,17 +1244,20 @@ public class ExportExcel {
|
||||
}else{
|
||||
protocol=region.getConfigProtocol();
|
||||
}
|
||||
String[] portPatterns=region.getConfigPortPattern().split(";");
|
||||
Assert.isTrue(portPatterns.length==2);
|
||||
if("client_port".equals(headerStr)){
|
||||
String srcPortPattern=portPatterns[0];
|
||||
if(((","+region.getConfigIpPortShow()+",").indexOf(",2,") > -1)){
|
||||
commentStr="";
|
||||
if((","+region.getConfigPortPattern()+",").indexOf(",1,") > -1){
|
||||
if((","+srcPortPattern+",").indexOf(",1,") > -1){
|
||||
commentStr=commentStr+Constants.PORT_DEFAULT+"(Port)"+"\n";
|
||||
if(StringUtil.isEmpty(defaultValue)){
|
||||
defaultValue=Constants.PORT_DEFAULT;
|
||||
}
|
||||
index++;
|
||||
}
|
||||
if((","+region.getConfigPortPattern()+",").indexOf(",2,") > -1){
|
||||
if((","+srcPortPattern+",").indexOf(",2,") > -1){
|
||||
commentStr=commentStr+Constants.PORT_MASK_DEFAULT+"(Port/"+msgProp.getProperty("port_mask")+")"+"\n\n";
|
||||
if(StringUtil.isEmpty(defaultValue)){
|
||||
defaultValue=Constants.PORT_MASK_DEFAULT;
|
||||
@@ -879,11 +1283,11 @@ public class ExportExcel {
|
||||
index++;
|
||||
}
|
||||
//2、源端口、目的端口格式必须一致
|
||||
if(((","+region.getConfigIpPortShow()+",").indexOf(",2,") > -1) && ((","+region.getConfigIpPortShow()+",").indexOf(",4,") > -1)){
|
||||
commentStr=commentStr+"▶"+msgProp.getProperty("the_same_port_pattern")+"\n";
|
||||
index++;
|
||||
index++;
|
||||
}
|
||||
// if(((","+region.getConfigIpPortShow()+",").indexOf(",2,") > -1) && ((","+region.getConfigIpPortShow()+",").indexOf(",4,") > -1)){
|
||||
// commentStr=commentStr+"▶"+msgProp.getProperty("the_same_port_pattern")+"\n";
|
||||
// index++;
|
||||
// index++;
|
||||
// }
|
||||
//3、端口和端口掩码范围0-65535
|
||||
commentStr=commentStr+"▶"+msgProp.getProperty("port_mask_comment_tip")+"\n";
|
||||
index++;
|
||||
@@ -918,16 +1322,17 @@ public class ExportExcel {
|
||||
}
|
||||
}
|
||||
if("server_port".equals(headerStr)){
|
||||
String destPortPattern=portPatterns[1];
|
||||
if((","+region.getConfigIpPortShow()+",").indexOf(",4,") > -1){
|
||||
commentStr="";
|
||||
if((","+region.getConfigPortPattern()+",").indexOf(",1,") > -1){
|
||||
if((","+destPortPattern+",").indexOf(",1,") > -1){
|
||||
commentStr=commentStr+Constants.PORT_DEFAULT+"(Port)"+"\n";
|
||||
if(StringUtil.isEmpty(defaultValue)){
|
||||
defaultValue=Constants.PORT_DEFAULT;
|
||||
}
|
||||
index++;
|
||||
}
|
||||
if((","+region.getConfigPortPattern()+",").indexOf(",2,") > -1){
|
||||
if((","+destPortPattern+",").indexOf(",2,") > -1){
|
||||
commentStr=commentStr+Constants.PORT_MASK_DEFAULT+"(Port/"+msgProp.getProperty("port_mask")+")"+"\n\n";
|
||||
if(StringUtil.isEmpty(defaultValue)){
|
||||
defaultValue=Constants.PORT_MASK_DEFAULT;
|
||||
@@ -953,11 +1358,11 @@ public class ExportExcel {
|
||||
index++;
|
||||
}
|
||||
//2、源端口、目的端口格式必须一致
|
||||
if(((","+region.getConfigIpPortShow()+",").indexOf(",2,") > -1) && ((","+region.getConfigIpPortShow()+",").indexOf(",4,") > -1)){
|
||||
commentStr=commentStr+"▶"+msgProp.getProperty("the_same_port_pattern")+"\n";
|
||||
index++;
|
||||
index++;
|
||||
}
|
||||
// if(((","+region.getConfigIpPortShow()+",").indexOf(",2,") > -1) && ((","+region.getConfigIpPortShow()+",").indexOf(",4,") > -1)){
|
||||
// commentStr=commentStr+"▶"+msgProp.getProperty("the_same_port_pattern")+"\n";
|
||||
// index++;
|
||||
// index++;
|
||||
// }
|
||||
//3、端口和端口掩码范围0-65535
|
||||
commentStr=commentStr+"▶"+msgProp.getProperty("port_mask_comment_tip")+"\n";
|
||||
index++;
|
||||
@@ -1166,6 +1571,11 @@ public class ExportExcel {
|
||||
/*||(region.getConfigDistrict().split(",").length==1)*/){
|
||||
headerStr="";
|
||||
commentStr="";
|
||||
}else{
|
||||
if((region.getAction()!=null) && (region.getAction()==85 || region.getAction()==90)) {
|
||||
commentStr=commentStr+"Content-Type"+"\n";
|
||||
index++;
|
||||
defaultValue="Content-Type";
|
||||
}else {
|
||||
for (String districtStr : region.getConfigDistrict().split(",")) {
|
||||
commentStr=commentStr+districtStr+"\n";
|
||||
@@ -1173,6 +1583,7 @@ public class ExportExcel {
|
||||
}
|
||||
defaultValue=region.getConfigDistrict().split(",")[0];
|
||||
}
|
||||
}
|
||||
if(StringUtil.isEmpty(commentStr)){
|
||||
headerStr="";
|
||||
commentStr="";
|
||||
@@ -1427,7 +1838,7 @@ public class ExportExcel {
|
||||
commentStr=commentStr+msgProp.getProperty("rule_desc_tip")+":\n";
|
||||
index++;
|
||||
//2、默认值说明
|
||||
if(region.getFunctionId().equals(200)) {
|
||||
if(region.getFunctionId().equals(200) || region.getFunctionId().equals(607)) {
|
||||
commentStr=commentStr+"▶"+msgProp.getProperty("default_value")+":1\n";
|
||||
}else {
|
||||
commentStr=commentStr+"▶"+msgProp.getProperty("default_value")+":0\n";
|
||||
@@ -2256,7 +2667,9 @@ public class ExportExcel {
|
||||
* @return list 数据列表
|
||||
*/
|
||||
public <E> ExportExcel setDataList(Properties msgProp, Map<String,List> dataMap, Map<Object,Object> map){
|
||||
long start=System.currentTimeMillis(),end=System.currentTimeMillis();
|
||||
Set<String> keyList=dataMap.keySet();
|
||||
Map<String,Map<String,String>> dictMaps=Maps.newConcurrentMap();
|
||||
for (String key : keyList) {
|
||||
List<E> list=dataMap.get(key);
|
||||
for (E e : list){
|
||||
@@ -2286,7 +2699,16 @@ public class ExportExcel {
|
||||
val = getBasicInfo(ef.dictType(),map,valStr);
|
||||
}else{
|
||||
//字典数据已做国际化处理
|
||||
String dict=DictUtils.getDictLabel(ef.dictType(), valStr, valStr);
|
||||
String dict="";
|
||||
if(dictMaps.containsKey(ef.dictType())) {
|
||||
Map<String,String> dictM=dictMaps.get(ef.dictType());
|
||||
dict=dictM.containsKey(valStr)?dictM.get(valStr):valStr;
|
||||
}else {
|
||||
Map<String,String> dictM=DictUtils.getDictMap(ef.dictType());
|
||||
dictMaps.put(ef.dictType(), dictM);
|
||||
dict=dictM.containsKey(valStr)?dictM.get(valStr):valStr;
|
||||
}
|
||||
//String dict=DictUtils.getDictLabel(ef.dictType(), valStr, valStr);
|
||||
//如果找不到字典国际化值,把字典本身作为默认值放进去,不然导出就是空了
|
||||
val = msgProp.getProperty(dict,dict);
|
||||
//业务配置-stream 阻断类型中 阻断 改为 封堵(丢弃)
|
||||
@@ -2297,15 +2719,38 @@ public class ExportExcel {
|
||||
dict="block_drop";
|
||||
val = msgProp.getProperty(dict,dict);
|
||||
}
|
||||
if ("action".equals(ef.title()) && dict.equals("action_reject")
|
||||
&& (Reflections.invokeGetter(e, "service").toString().equals("35")
|
||||
|| Reflections.invokeGetter(e, "service").toString().equals("33")
|
||||
|| Reflections.invokeGetter(e, "service").toString().equals("36"))) {
|
||||
dict="block_drop";
|
||||
val = msgProp.getProperty(dict,dict);
|
||||
}
|
||||
//ip spoofing redirect动作修改为Spoofing
|
||||
if(ef.title().equals("block_type")
|
||||
&& (Reflections.invokeGetter(e, "serviceId").toString().equals("518"))) {
|
||||
dict="action_spoofing";
|
||||
val = msgProp.getProperty(dict,dict);
|
||||
}
|
||||
//http(s) manipulate 导出action修改为Manipulate
|
||||
if(ef.title().equals("block_type")
|
||||
&& dict.equals("action_redirect")
|
||||
&& (Reflections.invokeGetter(e, "serviceId").toString().equals("656"))) {
|
||||
dict="action_manipulate";
|
||||
val = msgProp.getProperty(dict,dict);
|
||||
}
|
||||
if(ef.title().equals("action")
|
||||
&& dict.equals("action_redirect")) {
|
||||
dict="action_manipulate";
|
||||
val = msgProp.getProperty(dict,dict);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
if(ef.title().equals("do_log")
|
||||
&& (Reflections.invokeGetter(e, "serviceId").toString().equals("512"))) {
|
||||
val = "";
|
||||
}
|
||||
if(ef.title().equals("whether_area_block")&&!StringUtil.isEmpty(val)){
|
||||
Integer whetherAreaBlock=Integer.parseInt(valStr);
|
||||
if(whetherAreaBlock.equals(0)){
|
||||
@@ -2355,6 +2800,8 @@ public class ExportExcel {
|
||||
log.debug("Write success: ["+row.getRowNum()+"] "+sb.toString());
|
||||
}
|
||||
}
|
||||
end=System.currentTimeMillis();
|
||||
System.err.println("setDataList cost:"+(end-start));
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
@@ -2480,13 +2927,14 @@ public class ExportExcel {
|
||||
/**
|
||||
* 构造函数
|
||||
* @param msgProp 国际化配置
|
||||
* @param title sheet名称
|
||||
* @param cls 实体对象,通过annotation.ExportField获取标题
|
||||
* @param titleList sheet名称
|
||||
* @param clsMap 实体对象,通过annotation.ExportField获取标题
|
||||
* @param type 导出类型(1:导出数据;2:导出模板)
|
||||
* @param groups 导入分组
|
||||
* @return
|
||||
*/
|
||||
public ExportExcel(Properties msgProp,List<String> titleList,Map<String,String> noExportMap,Map<String, Class<?>> clsMap, int type,String titleTime, int... groups){
|
||||
long start=System.currentTimeMillis(),end=System.currentTimeMillis();
|
||||
Map<String, List<String>> headerMap=new HashMap<String, List<String>>();
|
||||
Map<String, List<String>> commentMap=new HashMap<String, List<String>>();
|
||||
for (String title : titleList) {
|
||||
@@ -2612,6 +3060,8 @@ public class ExportExcel {
|
||||
annotationMap.put(title, annotationList);
|
||||
}
|
||||
initializeMultiSheet(msgProp,titleList, headerMap,commentMap,titleTime);
|
||||
end=System.currentTimeMillis();
|
||||
System.err.println("ExportExcel cost:"+(end-start));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -423,7 +423,7 @@ public class ImportBigExcel extends XLSXCovertCSVReader{
|
||||
throw new RuntimeException("regionDict is null!");
|
||||
}
|
||||
if(dataList.size()==0) {
|
||||
throw new ServiceException(props.getProperty("noneData", "noneData"));
|
||||
throw new ServiceException(props.getProperty("no_data", "no_data"));
|
||||
}else if(this.hasImportLimit&&dataList.size()>(Constants.IMPORT_LIMIT+1)) {
|
||||
throw new ServiceException(props.getProperty("import_limit_is", "The maximum import size is")+" "+Constants.IMPORT_LIMIT);
|
||||
}
|
||||
@@ -488,11 +488,11 @@ public class ImportBigExcel extends XLSXCovertCSVReader{
|
||||
if (valType == String.class){
|
||||
String s = String.valueOf(val.toString().trim());
|
||||
//0.0.0.0表示任意IP的含义
|
||||
if(StringUtils.endsWith(s, ".0") && !s.endsWith("0.0.0.0")){
|
||||
val = StringUtils.substringBefore(s, ".0");
|
||||
}else{
|
||||
// if(StringUtils.endsWith(s, ".0") && !s.endsWith("0.0.0.0")){
|
||||
// val = StringUtils.substringBefore(s, ".0");
|
||||
// }else{
|
||||
val=val == null ? "" : StringEscapeUtils.escapeHtml4(val.toString().trim());
|
||||
}
|
||||
// }
|
||||
}else if (valType == Integer.class){
|
||||
val = Double.valueOf(val.toString().trim()).intValue();
|
||||
}else if (valType == Long.class){
|
||||
|
||||
@@ -91,6 +91,10 @@ public class CheckComplexStringFormatThread implements Callable<String>{
|
||||
throw new RuntimeException("Found String region,but mulityKeywords is Empty");
|
||||
}
|
||||
String dirtrictP = regionDict.getConfigDistrict();
|
||||
// 代理-操控业务hijack、insert
|
||||
if("85".equals(regionDict.getAction()+"") || "90".equals(regionDict.getAction()+"")) {
|
||||
dirtrictP = "Content-Type";
|
||||
}
|
||||
StringBuffer errTip = new StringBuffer();
|
||||
Pattern pattern = Pattern.compile("\t|\r|\n|\b|\f");
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
@@ -111,8 +115,7 @@ public class CheckComplexStringFormatThread implements Callable<String>{
|
||||
|
||||
// doLog属性检验
|
||||
this.validDoLog(baseStringCfg,errInfo);
|
||||
//doBlackList属性检验
|
||||
this.validDoBlackList(baseStringCfg, errInfo);
|
||||
|
||||
if (regionDict.getRegionType().equals(3)) {
|
||||
if (regionDict.getFunctionId().equals(7)) {
|
||||
Long dnsStrategyId = baseStringCfg.getDnsStrategyId();
|
||||
@@ -128,7 +131,7 @@ public class CheckComplexStringFormatThread implements Callable<String>{
|
||||
}
|
||||
}
|
||||
// 代理HTTP(s)阻断
|
||||
if (regionDict.getFunctionId().equals(207)) {
|
||||
if (regionDict.getFunctionId().equals(207) || "16".equals(regionDict.getAction()+"")) {
|
||||
if(StringUtils.isBlank(baseStringCfg.getUserRegion1())) {
|
||||
baseStringCfg.setUserRegion1("404");
|
||||
}
|
||||
@@ -154,9 +157,9 @@ public class CheckComplexStringFormatThread implements Callable<String>{
|
||||
|
||||
}
|
||||
// 代理 HTTP(s)重定向
|
||||
if (regionDict.getFunctionId().equals(208)) {
|
||||
if (regionDict.getFunctionId().equals(208) || "48".equals(regionDict.getAction()+"")) {
|
||||
if(StringUtils.isBlank(baseStringCfg.getUserRegion1())) {
|
||||
baseStringCfg.setUserRegion1("301");
|
||||
baseStringCfg.setUserRegion1("302");
|
||||
}
|
||||
String userRegion1 = baseStringCfg.getUserRegion1();// 重定向应答码
|
||||
String userRegion2 = baseStringCfg.getUserRegion2();// 重定向URL
|
||||
@@ -189,7 +192,7 @@ public class CheckComplexStringFormatThread implements Callable<String>{
|
||||
}
|
||||
}
|
||||
// 代理HTTP(s)替换
|
||||
if (regionDict.getFunctionId().equals(209)) {
|
||||
if (regionDict.getFunctionId().equals(209) || "80".equals(regionDict.getAction()+"")) {
|
||||
if(StringUtils.isBlank(baseStringCfg.getUserRegion1())) {
|
||||
baseStringCfg.setUserRegion1("http_resp_body");
|
||||
}
|
||||
@@ -467,44 +470,11 @@ public class CheckComplexStringFormatThread implements Callable<String>{
|
||||
}
|
||||
Integer doLog = baseStringCfg.getDoLog();
|
||||
if(!doLogOption.contains(doLog+"")) {
|
||||
if(configDoLog.startsWith("0")) {
|
||||
baseStringCfg.setDoLog(Integer.parseInt(defaultValue));
|
||||
}else {
|
||||
errInfo.append(
|
||||
String.format(prop.getProperty("is_incorrect"), prop.getProperty("do_log"))
|
||||
+ ";");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
/**
|
||||
* doBlackList属性校验
|
||||
* @param baseStringCfg
|
||||
* @param errInfo
|
||||
*/
|
||||
public void validDoBlackList(ComplexkeywordCfg baseStringCfg, StringBuffer errInfo) {
|
||||
if((regionDict.getFunctionId().equals(34)||regionDict.getFunctionId().equals(6)||
|
||||
regionDict.getFunctionId().equals(635)||regionDict.getFunctionId().equals(8)
|
||||
)&&serviceDict.getAction().equals(16)
|
||||
) {
|
||||
List<SysDataDictionaryItem> dict=DictUtils.getDictList("DO_BLACKLIST");
|
||||
if(baseStringCfg.getDoBlackList()==null) {
|
||||
baseStringCfg.setDoBlackList(Constants.MAAT_CFG_DOLOG_DOBLACKLIST_DEFAULT);
|
||||
}
|
||||
String dobalcklistVals=new String();
|
||||
if(dict !=null && dict.size()>0){
|
||||
for (SysDataDictionaryItem sysDataDictionaryItem : dict) {
|
||||
String itemCode = sysDataDictionaryItem.getItemCode();
|
||||
dobalcklistVals+=itemCode+",";
|
||||
}
|
||||
}
|
||||
Integer doBlackList = baseStringCfg.getDoBlackList();
|
||||
if(!dobalcklistVals.contains(doBlackList+"")) {
|
||||
errInfo.append(
|
||||
String.format(prop.getProperty("is_incorrect"), prop.getProperty("do_blacklist"))
|
||||
+ ";");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,7 +1,9 @@
|
||||
package com.nis.util.excel.thread;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.BlockingQueue;
|
||||
@@ -19,9 +21,17 @@ import com.beust.jcommander.internal.Sets;
|
||||
import com.nis.domain.FunctionRegionDict;
|
||||
import com.nis.domain.FunctionServiceDict;
|
||||
import com.nis.domain.SysDataDictionaryItem;
|
||||
import com.nis.domain.basics.CommonGroupInfo;
|
||||
import com.nis.domain.basics.PolicyGroupInfo;
|
||||
import com.nis.domain.callback.ProxyFileTrafficMirrorCfg;
|
||||
import com.nis.domain.configuration.BaseStringCfg;
|
||||
import com.nis.domain.configuration.PxyObjKeyring;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.util.DictUtils;
|
||||
import com.nis.web.dao.configuration.ProxyFileTrafficMirrorDao;
|
||||
import com.nis.web.dao.configuration.PxyObjKeyringDao;
|
||||
import com.nis.web.service.BaseService;
|
||||
import com.nis.web.service.SpringContextHolder;
|
||||
|
||||
public class CheckStringFormatThread implements Callable<String>{
|
||||
private Logger logger=Logger.getLogger(CheckStringFormatThread.class);
|
||||
@@ -31,6 +41,8 @@ public class CheckStringFormatThread implements Callable<String>{
|
||||
// private DnsResStrategyDao dnsResStrategyDao;
|
||||
private FunctionServiceDict serviceDict;
|
||||
private FunctionRegionDict regionDict;
|
||||
private static PxyObjKeyringDao pxyObjKeyringDao = SpringContextHolder.getBean(PxyObjKeyringDao.class);
|
||||
private static ProxyFileTrafficMirrorDao proxyFileDao = SpringContextHolder.getBean(ProxyFileTrafficMirrorDao.class);
|
||||
public CheckStringFormatThread(FunctionServiceDict serviceDict,FunctionRegionDict regionDict,Properties prop,BlockingQueue<? extends Object> srcQueue,BlockingQueue<BaseStringCfg<?>> destQueue) {
|
||||
this.serviceDict=serviceDict;
|
||||
this.regionDict=regionDict;
|
||||
@@ -90,6 +102,16 @@ public class CheckStringFormatThread implements Callable<String>{
|
||||
StringBuffer errTip = new StringBuffer();
|
||||
Pattern pattern = Pattern.compile("\t|\r|\n|\b|\f");
|
||||
Pattern domainPattern = Pattern.compile("^[a-zA-Z0-9.-]*$");
|
||||
List<SysDataDictionaryItem> sslversions = new ArrayList<>();
|
||||
List<SysDataDictionaryItem> failmethods = new ArrayList<>();
|
||||
List<PxyObjKeyring> certificateList=new ArrayList<>();
|
||||
List<ProxyFileTrafficMirrorCfg> mirrorProfileList=new ArrayList<>();
|
||||
if(serviceDict!=null&&serviceDict.getServiceId().equals(512)) {
|
||||
certificateList=pxyObjKeyringDao.findList(null,1,1,"ip");
|
||||
sslversions=DictUtils.getDictList("SSL_VERSION");
|
||||
failmethods=DictUtils.getDictList("FAIL_METHOD");
|
||||
mirrorProfileList=proxyFileDao.findMirrorList(null, 1, 1);
|
||||
}
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
StringBuffer errInfo = new StringBuffer();
|
||||
BaseStringCfg baseStringCfg = new BaseStringCfg();
|
||||
@@ -103,15 +125,20 @@ public class CheckStringFormatThread implements Callable<String>{
|
||||
errInfo.append(prop.getProperty("config_describe")+prop.getProperty("length_error")+" "+String.format(prop.getProperty("max_length")+":128") + ";");
|
||||
}
|
||||
|
||||
if(regionDict.getFunctionId().equals(606) || regionDict.getFunctionId().equals(607) || regionDict.getFunctionId().equals(608)) {
|
||||
if(StringUtils.isBlank(baseStringCfg.getGroupName())) {
|
||||
errInfo.append(
|
||||
String.format(prop.getProperty("can_not_null"), prop.getProperty("group_name")) + ";");
|
||||
}
|
||||
}
|
||||
if(regionDict.getFunctionId().equals(200)) {
|
||||
if(!serviceDict.getAction().equals(1)) {
|
||||
if(!serviceDict.getAction().equals(2)) {
|
||||
baseStringCfg.setDoLog(0);
|
||||
}
|
||||
}
|
||||
// doLog属性检验
|
||||
this.validDoLog(baseStringCfg,errInfo);
|
||||
// doBlackList校验
|
||||
this.validDoBlackList(baseStringCfg,errInfo);
|
||||
|
||||
if (regionDict.getRegionType().equals(2)) {
|
||||
if (regionDict.getFunctionId().equals(510) && "p2p_hash".equals(regionDict.getConfigServiceType())) {
|
||||
String userRegion1 = baseStringCfg.getUserRegion1();
|
||||
@@ -132,7 +159,7 @@ public class CheckStringFormatThread implements Callable<String>{
|
||||
}
|
||||
// 代理-域名拦截
|
||||
if (regionDict.getFunctionId().equals(200) && "intercept_domain".equals(regionDict.getConfigServiceType())) {
|
||||
if(serviceDict.getAction().equals(1)) {
|
||||
/*if(serviceDict.getAction().equals(1)) {
|
||||
if(StringUtils.isBlank(baseStringCfg.getUserRegion5())) {
|
||||
baseStringCfg.setUserRegion5("1");
|
||||
}
|
||||
@@ -152,7 +179,7 @@ public class CheckStringFormatThread implements Callable<String>{
|
||||
}
|
||||
}
|
||||
|
||||
}else if(serviceDict.getAction().equals(64)) {
|
||||
}else*/ if(serviceDict.getAction().equals(64)) {
|
||||
baseStringCfg.setUserRegion1("0");// limit_rate_type(限速方式默认值)
|
||||
if(StringUtils.isBlank(baseStringCfg.getUserRegion2())) {
|
||||
baseStringCfg.setUserRegion2("0.1");
|
||||
@@ -177,7 +204,7 @@ public class CheckStringFormatThread implements Callable<String>{
|
||||
|
||||
}
|
||||
// 代理HTTP(s)阻断
|
||||
if (regionDict.getFunctionId().equals(207)) {
|
||||
if (regionDict.getFunctionId().equals(207) || "16".equals(regionDict.getAction()+"")) {
|
||||
if(StringUtils.isBlank(baseStringCfg.getUserRegion1())) {
|
||||
baseStringCfg.setUserRegion1("404");
|
||||
}
|
||||
@@ -203,9 +230,9 @@ public class CheckStringFormatThread implements Callable<String>{
|
||||
|
||||
}
|
||||
// 代理 HTTP(s)重定向
|
||||
if (regionDict.getFunctionId().equals(208)) {
|
||||
if (regionDict.getFunctionId().equals(208) || "48".equals(regionDict.getAction()+"")) {
|
||||
if(StringUtils.isBlank(baseStringCfg.getUserRegion1())) {
|
||||
baseStringCfg.setUserRegion1("301");
|
||||
baseStringCfg.setUserRegion1("302");
|
||||
}
|
||||
String userRegion1 = baseStringCfg.getUserRegion1();// 重定向应答码
|
||||
String userRegion2 = baseStringCfg.getUserRegion2();// 重定向URL
|
||||
@@ -238,7 +265,7 @@ public class CheckStringFormatThread implements Callable<String>{
|
||||
}
|
||||
}
|
||||
// 代理HTTP(s)替换
|
||||
if (regionDict.getFunctionId().equals(209)) {
|
||||
if (regionDict.getFunctionId().equals(209) || "80".equals(regionDict.getAction()+"")) {
|
||||
if(StringUtils.isBlank(baseStringCfg.getUserRegion1())) {
|
||||
baseStringCfg.setUserRegion1("http_resp_body");
|
||||
}
|
||||
@@ -277,7 +304,7 @@ public class CheckStringFormatThread implements Callable<String>{
|
||||
}
|
||||
|
||||
String keyword = baseStringCfg.getCfgKeywords();
|
||||
if (!regionDict.getFunctionId().equals(403) && !regionDict.getFunctionId().equals(200)) {// 201域名拦截
|
||||
if (!regionDict.getFunctionId().equals(403) && !regionDict.getFunctionId().equals(200) && !regionDict.getFunctionId().equals(607)) {// 201域名拦截
|
||||
if (StringUtils.isBlank(keyword)) {
|
||||
errInfo.append(
|
||||
String.format(prop.getProperty("can_not_null"), prop.getProperty("key_word") + " ") + ";");
|
||||
@@ -494,6 +521,252 @@ public class CheckStringFormatThread implements Callable<String>{
|
||||
}
|
||||
|
||||
}
|
||||
if(serviceDict!=null&&serviceDict.getServiceId().equals(512)) {
|
||||
Integer kering=baseStringCfg.getKeyring();
|
||||
Integer evCet=baseStringCfg.getEvCert();
|
||||
Integer certTransparency=baseStringCfg.getCertTransparency();
|
||||
Integer clientCertReq=baseStringCfg.getClientCertReq();
|
||||
Integer pinning=baseStringCfg.getPinning();
|
||||
Integer protocolErrors=baseStringCfg.getProtocolErrors();
|
||||
Integer cn=baseStringCfg.getCn();
|
||||
Integer issuer=baseStringCfg.getIssuer();
|
||||
Integer selfSigned=baseStringCfg.getSelfSigned();
|
||||
Integer expiration=baseStringCfg.getExpiration();
|
||||
String failMethod=baseStringCfg.getFailMethod();
|
||||
String min=baseStringCfg.getMin();
|
||||
String max=baseStringCfg.getMax();
|
||||
Integer mirrorClient=baseStringCfg.getMirrorClient();
|
||||
Integer allowHttp2=baseStringCfg.getAllowHttp2();
|
||||
Integer enable=baseStringCfg.getEnable();
|
||||
Integer mirrorProfile=baseStringCfg.getMirrorProfile();
|
||||
Map<String,Object> userRegionMap=new HashMap<>();
|
||||
Map<String,Object> map=new HashMap<>();
|
||||
if(kering!=null) {
|
||||
boolean has=false;
|
||||
for(PxyObjKeyring keyring:certificateList) {
|
||||
if(keyring.getCompileId().toString().equals(kering.toString())) {
|
||||
has=true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(has) {
|
||||
userRegionMap.put("keyring", kering);
|
||||
}else {
|
||||
errInfo.append(String.format(prop.getProperty("is_incorrect"),
|
||||
prop.getProperty("pxy_intercept_monit_keyring") + " ") + ";");
|
||||
}
|
||||
}else {
|
||||
userRegionMap.put("keyring", 1);
|
||||
}
|
||||
if(evCet!=null) {
|
||||
if(evCet!=0&&evCet!=1) {
|
||||
errInfo.append(String.format(prop.getProperty("is_incorrect"),
|
||||
prop.getProperty("exclusions_ev_cert","exclusions ev cert") + " ") + ";");
|
||||
}else {
|
||||
map.put("ev_cert", evCet);
|
||||
}
|
||||
|
||||
}else {
|
||||
map.put("ev_cert", 0);
|
||||
}
|
||||
if(certTransparency!=null) {
|
||||
if(certTransparency!=0&&certTransparency!=1) {
|
||||
errInfo.append(String.format(prop.getProperty("is_incorrect"),
|
||||
prop.getProperty("exclusions_cert_transparency","exclusions cert transparency") + " ") + ";");
|
||||
}else {
|
||||
map.put("cert_transparency", certTransparency);
|
||||
}
|
||||
|
||||
}else {
|
||||
map.put("cert_transparency", 0);
|
||||
}
|
||||
if(clientCertReq!=null) {
|
||||
if(clientCertReq!=0&&clientCertReq!=1) {
|
||||
errInfo.append(String.format(prop.getProperty("is_incorrect"),
|
||||
prop.getProperty("exclusions_client_cert_req","exclusions client cert req") + " ") + ";");
|
||||
}else {
|
||||
map.put("client_cert_req", clientCertReq);
|
||||
}
|
||||
|
||||
}else {
|
||||
map.put("client_cert_req", 1);
|
||||
}
|
||||
|
||||
if(pinning!=null) {
|
||||
if(pinning!=0&&pinning!=1) {
|
||||
errInfo.append(String.format(prop.getProperty("is_incorrect"),
|
||||
prop.getProperty("exclusions_pinning","exclusions pinning") + " ") + ";");
|
||||
}else {
|
||||
map.put("pinning", pinning);
|
||||
}
|
||||
}else {
|
||||
map.put("pinning", 1);
|
||||
}
|
||||
if(protocolErrors!=null) {
|
||||
if(protocolErrors!=0&&protocolErrors!=1) {
|
||||
errInfo.append(String.format(prop.getProperty("is_incorrect"),
|
||||
prop.getProperty("exclusions_protocol_errors","exclusions protocol errors") + " ") + ";");
|
||||
}else {
|
||||
map.put("protocol_errors", protocolErrors);
|
||||
}
|
||||
}else {
|
||||
map.put("protocol_errors", 1);
|
||||
}
|
||||
userRegionMap.put("exclusions", map);
|
||||
map=new HashMap<>();
|
||||
Map<String,Object> map1=new HashMap<>();
|
||||
if(cn!=null) {
|
||||
if(cn!=0&&cn!=1) {
|
||||
errInfo.append(String.format(prop.getProperty("is_incorrect"),
|
||||
prop.getProperty("cert_verify_approach_cn","cert verify approach cn") + " ") + ";");
|
||||
}else {
|
||||
map1.put("cn", cn);
|
||||
}
|
||||
}else {
|
||||
map1.put("cn", 1);
|
||||
}
|
||||
if(issuer!=null) {
|
||||
if(issuer!=0&&issuer!=1) {
|
||||
errInfo.append(String.format(prop.getProperty("is_incorrect"),
|
||||
prop.getProperty("cert_verify_approach_issuer","cert verify approach issuer") + " ") + ";");
|
||||
}else {
|
||||
map1.put("issuer", issuer);
|
||||
}
|
||||
}else {
|
||||
map1.put("issuer", 1);
|
||||
}
|
||||
if(selfSigned!=null) {
|
||||
if(selfSigned!=0&&selfSigned!=1) {
|
||||
errInfo.append(String.format(prop.getProperty("is_incorrect"),
|
||||
prop.getProperty("cert_verify_approach_self_signed","cert verify approach self signed") + " ") + ";");
|
||||
}else {
|
||||
map1.put("self-signed", selfSigned);
|
||||
}
|
||||
}else {
|
||||
map1.put("self-signed", 1);
|
||||
}
|
||||
if(expiration!=null) {
|
||||
if(expiration!=0&&expiration!=1) {
|
||||
errInfo.append(String.format(prop.getProperty("is_incorrect"),
|
||||
prop.getProperty("cert_verify_approach_expiration","cert verify approach expiration") + " ") + ";");
|
||||
}else {
|
||||
map1.put("expiration", expiration);
|
||||
}
|
||||
}else {
|
||||
map1.put("expiration", 1);
|
||||
}
|
||||
map.put("approach", map1);
|
||||
if(StringUtils.isBlank(failMethod)) {
|
||||
map.put("fail_method", "pass-through");
|
||||
}else {
|
||||
boolean has=false;
|
||||
for(SysDataDictionaryItem fail: failmethods) {
|
||||
if(fail.getItemCode().equals(failMethod)) {
|
||||
has=true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(!has) {
|
||||
errInfo.append(String.format(prop.getProperty("is_incorrect"),
|
||||
prop.getProperty("cert_verify_fail_method","cert verify fail method") + " ") + ";");
|
||||
}
|
||||
map.put("fail_method", failMethod);
|
||||
}
|
||||
userRegionMap.put("cert_verify", map);
|
||||
map=new HashMap<>();
|
||||
|
||||
if(mirrorClient==null) {
|
||||
mirrorClient=1;
|
||||
map.put("mirror_client", 1);
|
||||
}else {
|
||||
if(mirrorClient!=0&&mirrorClient!=1) {
|
||||
errInfo.append(String.format(prop.getProperty("is_incorrect"),
|
||||
prop.getProperty("ssl_ver_mirror_client","SSL version mirror client") + " ") + ";");
|
||||
}else {
|
||||
map.put("mirror_client", mirrorClient);
|
||||
}
|
||||
}
|
||||
if(allowHttp2==null) {
|
||||
allowHttp2=1;
|
||||
map.put("allow_http2", allowHttp2);
|
||||
}else {
|
||||
if(allowHttp2!=0&&allowHttp2!=1) {
|
||||
errInfo.append(String.format(prop.getProperty("is_incorrect"),
|
||||
prop.getProperty("ssl_ver_allow_http2","SSL version allow http2") + " ") + ";");
|
||||
}else {
|
||||
map.put("allow_http2", allowHttp2);
|
||||
}
|
||||
}
|
||||
if(mirrorClient==0) {
|
||||
int minSort=0,maxSort=0;
|
||||
if(StringUtils.isBlank(min)) {
|
||||
min="ssl3";
|
||||
}
|
||||
if(StringUtils.isBlank(max)) {
|
||||
max="tls13";
|
||||
}
|
||||
for(SysDataDictionaryItem sslversion: sslversions) {
|
||||
if(sslversion.getItemCode().equals(min)) {
|
||||
minSort=sslversion.getItemSort();
|
||||
}
|
||||
if(sslversion.getItemCode().equals(max)) {
|
||||
maxSort=sslversion.getItemSort();
|
||||
}
|
||||
}
|
||||
if(minSort==0) {
|
||||
errInfo.append(String.format(prop.getProperty("is_incorrect"),
|
||||
prop.getProperty("ssl_ver_min","min SSL version") + " ") + ";");
|
||||
|
||||
}
|
||||
if(maxSort==0) {
|
||||
errInfo.append(String.format(prop.getProperty("is_incorrect"),
|
||||
prop.getProperty("ssl_ver_max","max SSL version") + " ") + ";");
|
||||
}
|
||||
if(minSort>maxSort) {
|
||||
errInfo.append(prop.getProperty("min_should_less_than_max","the min SSL version should less than the max SSL version") + ";");
|
||||
}
|
||||
map.put("min", min);
|
||||
map.put("max", max);
|
||||
}
|
||||
userRegionMap.put("ssl_ver", map);
|
||||
map=new HashMap<>();
|
||||
if(enable==null) {
|
||||
enable=0;
|
||||
map.put("enable", 0);
|
||||
}else {
|
||||
if(enable!=0&&enable!=1) {
|
||||
errInfo.append(String.format(prop.getProperty("is_incorrect"),
|
||||
prop.getProperty("decrypt_mirror_enable","decrypt mirror enable") + " ") + ";");
|
||||
}else {
|
||||
map.put("enable", enable);
|
||||
}
|
||||
|
||||
}
|
||||
//enable==1的时候才设置mirror_profile
|
||||
if(enable==1) {
|
||||
if(mirrorProfile==null) {
|
||||
errInfo.append(String.format(prop.getProperty("is_incorrect"),
|
||||
prop.getProperty("decrypt_mirror_mirror_profile") + " ") + ";");
|
||||
}else {
|
||||
boolean has=false;
|
||||
for(ProxyFileTrafficMirrorCfg _mirrorProfile:mirrorProfileList) {
|
||||
if(_mirrorProfile.getCompileId().toString().equals(mirrorProfile.toString())) {
|
||||
has=true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(has) {
|
||||
map.put("mirror_profile", mirrorProfile);
|
||||
}else {
|
||||
errInfo.append(String.format(prop.getProperty("is_incorrect"),
|
||||
prop.getProperty("decrypt_mirror_mirror_profile") + " ") + ";");
|
||||
}
|
||||
map.put("mirror_profile", mirrorProfile);
|
||||
}
|
||||
}
|
||||
userRegionMap.put("decrypt_mirror", map);
|
||||
baseStringCfg.setUserRegion1(BaseService.gsonToJson(userRegionMap));
|
||||
}
|
||||
if (errInfo.toString().length() > 0) {//
|
||||
errTip.append(String.format(prop.getProperty("line"), baseStringCfg.getIndex()) + ",");
|
||||
errTip.append(errInfo);
|
||||
@@ -518,6 +791,7 @@ public class CheckStringFormatThread implements Callable<String>{
|
||||
* @param errInfo
|
||||
*/
|
||||
public void validDoLog(BaseStringCfg baseStringCfg, StringBuffer errInfo) {
|
||||
|
||||
String configDoLog = serviceDict.getConfigDoLog();
|
||||
if(StringUtils.isNotBlank(configDoLog)) {
|
||||
String defaultValue = configDoLog.substring(configDoLog.lastIndexOf(";")+1);
|
||||
@@ -527,45 +801,11 @@ public class CheckStringFormatThread implements Callable<String>{
|
||||
}
|
||||
Integer doLog = baseStringCfg.getDoLog();
|
||||
if(!doLogOption.contains(doLog+"")) {
|
||||
if(configDoLog.startsWith("0")) {
|
||||
baseStringCfg.setDoLog(Integer.parseInt(defaultValue));
|
||||
}else {
|
||||
errInfo.append(
|
||||
String.format(prop.getProperty("is_incorrect"), prop.getProperty("do_log"))
|
||||
+ ";");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
/**
|
||||
* doBlackList属性校验
|
||||
* @param baseStringCfg
|
||||
* @param errInfo
|
||||
*/
|
||||
public void validDoBlackList(BaseStringCfg baseStringCfg, StringBuffer errInfo) {
|
||||
if((regionDict.getFunctionId().equals(34)||regionDict.getFunctionId().equals(6)||
|
||||
regionDict.getFunctionId().equals(635)||regionDict.getFunctionId().equals(8)
|
||||
||regionDict.getFunctionId().equals(51)||regionDict.getFunctionId().equals(510))
|
||||
&&serviceDict.getAction().equals(16)) {
|
||||
List<SysDataDictionaryItem> dict=DictUtils.getDictList("DO_BLACKLIST");
|
||||
if(baseStringCfg.getDoBlackList()==null) {
|
||||
baseStringCfg.setDoBlackList(Constants.MAAT_CFG_DOLOG_DOBLACKLIST_DEFAULT);
|
||||
}
|
||||
String dobalcklistVals=new String();
|
||||
if(dict !=null && dict.size()>0){
|
||||
for (SysDataDictionaryItem sysDataDictionaryItem : dict) {
|
||||
String itemCode = sysDataDictionaryItem.getItemCode();
|
||||
dobalcklistVals+=itemCode+",";
|
||||
}
|
||||
}
|
||||
Integer doBlackList = baseStringCfg.getDoBlackList();
|
||||
if(!dobalcklistVals.contains(doBlackList+"")) {
|
||||
errInfo.append(
|
||||
String.format(prop.getProperty("is_incorrect"), prop.getProperty("do_blacklist"))
|
||||
+ ";");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@ import javax.ws.rs.client.Invocation.Builder;
|
||||
import javax.ws.rs.core.MediaType;
|
||||
import javax.ws.rs.core.Response;
|
||||
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.http.HttpStatus;
|
||||
import org.apache.http.client.ClientProtocolException;
|
||||
import org.apache.http.client.config.RequestConfig;
|
||||
@@ -37,6 +38,7 @@ import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
|
||||
import org.apache.http.util.EntityUtils;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.nis.exceptions.MaatConvertException;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.util.Encodes;
|
||||
@@ -84,7 +86,10 @@ public class HttpClientUtil {
|
||||
throw new ConnectException("流量统计服务接口连接错误"+response);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
throw e;
|
||||
// e.printStackTrace();
|
||||
logger.error("获取消息失败,相应内容如下: " + response);
|
||||
logger.error("获取消息失败 ", e);
|
||||
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:");
|
||||
}finally {
|
||||
if (response != null) {
|
||||
try {
|
||||
@@ -236,6 +241,7 @@ public class HttpClientUtil {
|
||||
* @return 查询结果数据json
|
||||
*/
|
||||
public static String getMsg(String destUrl, Map<String, Object> params, HttpServletRequest req) throws IOException {
|
||||
long start=System.currentTimeMillis(), end=System.currentTimeMillis();
|
||||
// RequestContext requestContext = new RequestContext(req);
|
||||
|
||||
// CloseableHttpResponse response = null;
|
||||
@@ -283,6 +289,7 @@ public class HttpClientUtil {
|
||||
logger.error("获取消息失败,相应内容如下: " + result);
|
||||
throw new MaatConvertException(status+"");
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.error("获取消息失败,相应内容如下: " + result);
|
||||
@@ -292,6 +299,8 @@ public class HttpClientUtil {
|
||||
if (response != null) {
|
||||
response.close();
|
||||
}
|
||||
end=System.currentTimeMillis();
|
||||
logger.warn("getMsg cost:"+(end-start)+"ms");
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -302,12 +311,14 @@ public class HttpClientUtil {
|
||||
* @return
|
||||
*/
|
||||
public static String galaxyMessageFormat(String recv){
|
||||
JSONObject jobj = JSONObject.fromObject(recv);
|
||||
long start=System.currentTimeMillis(),end=System.currentTimeMillis();
|
||||
//JSONObject jobj = JSONObject.fromObject(recv);
|
||||
com.alibaba.fastjson.JSONObject jobj = JSON.parseObject(recv);
|
||||
Map<String, Object> parse = (Map<String, Object>)jobj;
|
||||
Map map = (Map) parse.get("data");
|
||||
List reslist=new ArrayList();
|
||||
List<Map<String,Object>> list= (List)map.get("list");
|
||||
if(list!=null&&list.size()>0){
|
||||
if(CollectionUtils.isNotEmpty(list)){
|
||||
for (Map<String,Object> m : list) {
|
||||
Map recvMap = new HashMap();
|
||||
Iterator<Entry<String, Object>> iterator = m.entrySet().iterator();
|
||||
@@ -316,12 +327,12 @@ public class HttpClientUtil {
|
||||
String key = next.getKey().toString();
|
||||
Object value = next.getValue();
|
||||
//处理字段为“null”情况
|
||||
if(value!=null&&"null".equals(value)){
|
||||
if("null".equals(value)){
|
||||
value="";
|
||||
}
|
||||
//处理时间字段为“0”情况
|
||||
if("foundTime".equals(key)||"recvTime".equals(key)){
|
||||
if(null!=value&&"0".equals(value)){
|
||||
if("0".equals(value)){
|
||||
value="";
|
||||
}
|
||||
}
|
||||
@@ -337,6 +348,8 @@ public class HttpClientUtil {
|
||||
parse.put("data", map);
|
||||
recv = parse.toString();
|
||||
}
|
||||
end=System.currentTimeMillis();
|
||||
logger.info("galaxyMessageFormat cost:"+(end-start));
|
||||
return recv;
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -29,6 +29,7 @@ import com.google.gson.reflect.TypeToken;
|
||||
import com.nis.util.Configurations;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.util.CookieUtil;
|
||||
import com.nis.util.LogUtils;
|
||||
import com.nis.util.StringUtil;
|
||||
import com.nis.util.StringUtils;
|
||||
import com.nis.util.httpclient.HttpClientUtil;
|
||||
@@ -87,6 +88,7 @@ public class LoginController extends BaseController {
|
||||
CookieUtil.addCookie(response, "LOGINED", "false");
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
e.printStackTrace();
|
||||
LogUtils.saveLog(request, null, e, null);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -173,6 +175,7 @@ public class LoginController extends BaseController {
|
||||
}
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
e.printStackTrace();
|
||||
LogUtils.saveLog(request, null, e, null);
|
||||
}
|
||||
|
||||
|
||||
@@ -212,6 +215,7 @@ public class LoginController extends BaseController {
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
LogUtils.saveLog(request, null, e, null);
|
||||
}
|
||||
|
||||
return "redirect:"+request.getParameter("url");
|
||||
@@ -230,6 +234,7 @@ public class LoginController extends BaseController {
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
LogUtils.saveLog(request, null, e, null);
|
||||
}
|
||||
|
||||
return "redirect:"+request.getParameter("url");
|
||||
|
||||
@@ -16,6 +16,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import com.nis.domain.SysMenu;
|
||||
import com.nis.domain.configuration.HelpInfo;
|
||||
import com.nis.util.LogUtils;
|
||||
import com.nis.util.StringUtil;
|
||||
import com.nis.util.StringUtils;
|
||||
import com.nis.web.security.UserUtils;
|
||||
@@ -106,6 +107,7 @@ public class SystemController extends BaseController{
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error("help error",e);
|
||||
LogUtils.saveLog(request, null, e, null);
|
||||
}
|
||||
logger.info("menuSize:"+newList.size());
|
||||
model.addAttribute("menuList",newList);
|
||||
@@ -139,6 +141,7 @@ public class SystemController extends BaseController{
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error("save helpInfo error",e);
|
||||
LogUtils.saveLog(request, null, e, null);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -167,6 +170,7 @@ public class SystemController extends BaseController{
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error("view helpInfo error",e);
|
||||
LogUtils.saveLog(request, null, e, null);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@@ -195,7 +199,21 @@ public class SystemController extends BaseController{
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error("view helpBakInfo error",e);
|
||||
LogUtils.saveLog(request, null, e, null);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@RequestMapping("clearPolicies")
|
||||
@ResponseBody
|
||||
public boolean clearPolicies(HttpServletRequest request, HttpServletResponse response) {
|
||||
try {
|
||||
systemService.clearPolicies();
|
||||
return true;
|
||||
} catch (Exception e) {
|
||||
logger.error("Clear Policies Error",e);
|
||||
LogUtils.saveLog(request, null, e, null);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ import com.nis.domain.Page;
|
||||
import com.nis.domain.basics.AsnGroupInfo;
|
||||
import com.nis.domain.basics.AsnIpCfg;
|
||||
import com.nis.domain.specific.ConfigGroupInfo;
|
||||
import com.nis.util.LogUtils;
|
||||
import com.nis.util.StringUtil;
|
||||
import com.nis.web.controller.BaseController;
|
||||
/**
|
||||
@@ -67,7 +68,7 @@ public class AsnGroupController extends BaseController {
|
||||
//@RequiresPermissions(value={"basics:classification:add","basics:attribute:add","basics:label:add","basics:classification:edit","basics:attribute:edit","basics:label:edit"},logical=Logical.OR)
|
||||
@RequestMapping(value = "saveOrUpdate")
|
||||
public String saveOrUpdate(AsnGroupInfo cfg,Model model,
|
||||
RedirectAttributes redirectAttributes,String itType) {
|
||||
RedirectAttributes redirectAttributes,String itType,HttpServletRequest request) {
|
||||
|
||||
try {
|
||||
AsnGroupInfo asnGroup=asnGroupInfoService.getGroupIdByNameAndASNId(cfg.getOrganization().trim(), cfg.getCountry().trim(), cfg.getAsnId());
|
||||
@@ -80,6 +81,7 @@ public class AsnGroupController extends BaseController {
|
||||
} catch (Exception e) {
|
||||
logger.error("新增失败",e);
|
||||
addMessage(redirectAttributes,"error","save_failed");
|
||||
LogUtils.saveLog(request, null, e, null);
|
||||
}
|
||||
|
||||
return "redirect:" + adminPath + "/basics/asnGroup/asnGroupList";
|
||||
@@ -94,13 +96,14 @@ public class AsnGroupController extends BaseController {
|
||||
*/
|
||||
//@RequiresPermissions(value={"basics:classification:del","basics:attribute:del","basics:label:del"},logical=Logical.OR)
|
||||
@RequestMapping(value={"delete"})
|
||||
public String delete(RedirectAttributes redirectAttributes,String ids,String asnIds) {
|
||||
public String delete(RedirectAttributes redirectAttributes,String ids,String asnIds,HttpServletRequest request) {
|
||||
try {
|
||||
asnGroupInfoService.delete(ids,asnIds);
|
||||
addMessage(redirectAttributes,"success","delete_success");
|
||||
} catch (Exception e) {
|
||||
logger.error("删除失败",e);
|
||||
addMessage(redirectAttributes,"error","delete_failed");
|
||||
LogUtils.saveLog(request, null, e, null);
|
||||
}
|
||||
return "redirect:" + adminPath + "/basics/asnGroup/asnGroupList";
|
||||
}
|
||||
|
||||
@@ -32,6 +32,7 @@ import com.nis.exceptions.MaatConvertException;
|
||||
//import com.nis.util.AsnCacheUtils;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.util.DictUtils;
|
||||
import com.nis.util.LogUtils;
|
||||
import com.nis.util.StringUtil;
|
||||
import com.nis.web.controller.BaseController;
|
||||
import com.nis.web.security.UserUtils;
|
||||
@@ -79,15 +80,21 @@ public class AsnIpController extends BaseController{
|
||||
public String save(Model model,HttpServletRequest request,HttpServletResponse response,@ModelAttribute("cfg")CfgIndexInfo cfg,RedirectAttributes redirectAttributes){
|
||||
try{
|
||||
asnIpCfgService.saveAsnIpCfg(cfg);
|
||||
//配置仅保存
|
||||
if(StringUtil.isEmpty(cfg.getIsValid()) || cfg.getIsValid()!=1) {
|
||||
addMessage(redirectAttributes, "success", "save_success");
|
||||
}catch(Exception e){
|
||||
logger.error("信息保存失败",e);
|
||||
e.printStackTrace();
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error",e.getMessage());
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error","save_failed");
|
||||
//配置直接生效
|
||||
addMessage(redirectAttributes, "success", "audit_success");
|
||||
}
|
||||
} catch (MaatConvertException e) {
|
||||
logger.error("ASN IP配置下发失败:",e);
|
||||
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||
LogUtils.saveLog(request, null, e, null);
|
||||
} catch (Exception e) {
|
||||
logger.error("ASN IP配置保存失败:",e);
|
||||
addMessage(redirectAttributes, "error", "save_failed");
|
||||
LogUtils.saveLog(request, null, e, null);
|
||||
}
|
||||
|
||||
return "redirect:" + adminPath +"/basics/asn/list?functionId="+cfg.getFunctionId();
|
||||
@@ -98,11 +105,21 @@ public class AsnIpController extends BaseController{
|
||||
try{
|
||||
|
||||
asnIpCfgService.update(cfg);
|
||||
//配置仅保存
|
||||
if(StringUtil.isEmpty(cfg.getIsValid()) || cfg.getIsValid()!=1) {
|
||||
addMessage(redirectAttributes, "success", "save_success");
|
||||
}else {
|
||||
//配置直接生效
|
||||
addMessage(redirectAttributes, "success", "audit_success");
|
||||
}
|
||||
} catch (MaatConvertException e) {
|
||||
logger.error("ASN IP配置下发失败:",e);
|
||||
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||
LogUtils.saveLog(request, null, e, null);
|
||||
} catch (Exception e) {
|
||||
logger.error("信息保存失败",e);
|
||||
e.printStackTrace();
|
||||
logger.error("ASN IP配置保存失败:",e);
|
||||
addMessage(redirectAttributes, "error", "save_failed");
|
||||
LogUtils.saveLog(request, null, e, null);
|
||||
}
|
||||
|
||||
return "redirect:" + adminPath +"/basics/asn/list?functionId="+cfg.getFunctionId();
|
||||
@@ -135,7 +152,7 @@ public class AsnIpController extends BaseController{
|
||||
asnIpMap.put(Long.parseLong(asnIpCfg.getUserRegion1()), _asnIps);
|
||||
}
|
||||
}
|
||||
asnIpCfgService.auditIpBatch(asnIpMap,isValid);
|
||||
asnIpCfgService.auditIpBatch(asnIpMap,isAudit);
|
||||
}else {
|
||||
//条件下所有配置审核
|
||||
Page<AsnIpCfg> searchPage=new Page<AsnIpCfg>(request,response,"r");
|
||||
@@ -148,8 +165,10 @@ public class AsnIpController extends BaseController{
|
||||
logger.error("配置下发失败:",e);
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
||||
LogUtils.saveLog(request, null, e, null);
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error", "audit_failed");
|
||||
LogUtils.saveLog(request, null, e, null);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -160,18 +179,25 @@ public class AsnIpController extends BaseController{
|
||||
}
|
||||
@RequestMapping(value = {"/delete"})
|
||||
@RequiresPermissions(value={"asn:ip:config"})
|
||||
public String delete(Integer isValid
|
||||
,String ids,Integer functionId
|
||||
,RedirectAttributes redirectAttributes){
|
||||
public String delete(Integer isValid, String ids, Integer functionId, RedirectAttributes redirectAttributes,
|
||||
HttpServletRequest request, HttpServletResponse response, @ModelAttribute("cfg")AsnIpCfg cfg){
|
||||
try{
|
||||
if (!StringUtil.isEmpty(ids)) {
|
||||
asnIpCfgService.delete(ids);
|
||||
addMessage(redirectAttributes,"success","delete_success");
|
||||
}else {
|
||||
// 批量删除
|
||||
Page<CfgIndexInfo> searchPage = new Page<CfgIndexInfo>(request, response, "a");
|
||||
deleteAll(searchPage, functionId, cfg);
|
||||
}
|
||||
}catch(Exception e){
|
||||
logger.error("Delete failed",e);
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error",e.getMessage());
|
||||
LogUtils.saveLog(request, null, e, null);
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error","delete_failed");
|
||||
LogUtils.saveLog(request, null, e, null);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -260,6 +286,7 @@ public class AsnIpController extends BaseController{
|
||||
} catch (Exception e) {
|
||||
logger.error("asnIp export failed",e);
|
||||
addMessage(redirectAttributes,"error","export_failed");
|
||||
LogUtils.saveLog(request, null, e, null);
|
||||
}
|
||||
//return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,158 @@
|
||||
package com.nis.web.controller.basics;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
||||
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.basics.CommonGroupInfo;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.util.LogUtils;
|
||||
import com.nis.util.StringUtil;
|
||||
import com.nis.web.controller.BaseController;
|
||||
import com.nis.web.service.basics.CommonGroupManageService;
|
||||
/**
|
||||
* 公共组管理
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping(value = "${adminPath}/basics/commonGroup")
|
||||
public class CommonGroupManageController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private CommonGroupManageService commonGroupManageService;
|
||||
|
||||
@RequestMapping(value = {"list"})
|
||||
public String policyGroupList(CommonGroupInfo cfg, Model model, HttpServletRequest request, HttpServletResponse response) {
|
||||
if(cfg == null)cfg=new CommonGroupInfo();
|
||||
Page<CommonGroupInfo> pageCondition = new Page<CommonGroupInfo>(request, response,"r");
|
||||
Page page = commonGroupManageService.findCommonGroupInfoList(pageCondition,cfg);
|
||||
|
||||
model.addAttribute("cfg", cfg);
|
||||
model.addAttribute("page", page);
|
||||
return "/basics/commonGroupList";
|
||||
}
|
||||
|
||||
@RequestMapping(value={"/form"})
|
||||
public String form(Integer groupType,String ids,Model model,String doAction,RedirectAttributes redirectAttributes) {
|
||||
CommonGroupInfo groupInfo = new CommonGroupInfo();
|
||||
if(!StringUtil.isEmpty(ids)){
|
||||
groupInfo = commonGroupManageService.getById(Integer.parseInt(ids));
|
||||
}
|
||||
//groupInfo.setGroupType(groupType);
|
||||
model.addAttribute("_cfg", groupInfo);
|
||||
return "/basics/commonGroupForm";
|
||||
}
|
||||
|
||||
@RequestMapping(value = "saveOrUpdate")
|
||||
public String saveOrUpdate(CommonGroupInfo cfg, Model model, RedirectAttributes redirectAttributes,
|
||||
String itType,Integer groupType,HttpServletRequest request) {
|
||||
try {
|
||||
commonGroupManageService.saveOrUpdate(cfg);
|
||||
addMessage(redirectAttributes,"success","save_success");
|
||||
} catch (Exception e) {
|
||||
logger.error("新增失败",e);
|
||||
addMessage(redirectAttributes,"error","save_failed");
|
||||
LogUtils.saveLog(request, null, e, null);
|
||||
}
|
||||
return "redirect:" + adminPath + "/basics/commonGroup/list";
|
||||
}
|
||||
|
||||
@RequestMapping(value={"delete"})
|
||||
public String delete(RedirectAttributes redirectAttributes, String groupTypes, String ids, int isValid,HttpServletRequest request) {
|
||||
try {
|
||||
commonGroupManageService.deldete(ids, isValid, groupTypes);
|
||||
addMessage(redirectAttributes,"success","delete_success");
|
||||
} catch (Exception e) {
|
||||
logger.error("删除失败",e);
|
||||
addMessage(redirectAttributes,"error","delete_failed");
|
||||
LogUtils.saveLog(request, null, e, null);
|
||||
}
|
||||
return "redirect:" + adminPath + "/basics/commonGroup/list";
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@RequestMapping(value="ajaxCheckIsLastOneCfg",method=RequestMethod.POST)
|
||||
public List<Integer> ajaxCheckIsLastOneCfg(Model model, String grouIdAndCfgId, Integer groupType){
|
||||
return commonGroupManageService.ajaxCheckIsLastOneCfg(grouIdAndCfgId, groupType);
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@RequestMapping(value="ajaxGetGroupInfoByType",method=RequestMethod.GET)
|
||||
public List<CommonGroupInfo> ajaxGetGroupInfoByType(Integer groupType){
|
||||
return commonGroupManageService.findCommonGroupInfosByType(groupType);
|
||||
}
|
||||
|
||||
// 数据导出
|
||||
@RequestMapping(value = "exportGroup")
|
||||
public void exportGroup(Model model,@ModelAttribute("cfg")CommonGroupInfo entity,String ids,RedirectAttributes redirectAttributes,
|
||||
HttpServletRequest request,HttpServletResponse response){
|
||||
try {
|
||||
entity.setMenuNameCode("common_group_manage");
|
||||
List<String> titleList=new ArrayList<String>();
|
||||
Map<String, Class<?>> classMap=new HashMap<String, Class<?>>();
|
||||
Map<String, List> dataMap=new HashMap<String, List>();
|
||||
Map<String, String> noExportMap=new HashMap<String, String>();
|
||||
List<CommonGroupInfo> list = new ArrayList<CommonGroupInfo>();
|
||||
if (!StringUtil.isEmpty(ids)) {
|
||||
list = commonGroupManageService.findGroupInfoList(ids);
|
||||
} else {
|
||||
Page<CommonGroupInfo> pageInfo=new Page<CommonGroupInfo>(request, response,"r");
|
||||
pageInfo.setPageNo(1);
|
||||
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
|
||||
Page page = commonGroupManageService.findCommonGroupInfoList(pageInfo,entity);
|
||||
list=page.getList();
|
||||
}
|
||||
|
||||
titleList.add(entity.getMenuNameCode());
|
||||
classMap.put(entity.getMenuNameCode(), CommonGroupInfo.class);
|
||||
String cfgIndexInfoNoExport=",config_describe,cfg_id,block_type,do_log,action,valid_identifier,is_audit"
|
||||
+ ",auditor,audit_time,letter,whether_area_block,classification,attribute,label"
|
||||
+",userregion1,userregion2,userregion3,userregion4,userregion5,ir_type,";
|
||||
// 时间过滤
|
||||
if (entity.getSearch_create_time_start() == null ) {
|
||||
cfgIndexInfoNoExport = ",config_time" + cfgIndexInfoNoExport;
|
||||
}
|
||||
if (entity.getSearch_edit_time_start() == null) {
|
||||
cfgIndexInfoNoExport = ",edit_time" + cfgIndexInfoNoExport;
|
||||
}
|
||||
|
||||
if (!StringUtil.isEmpty(entity.gethColumns())) {
|
||||
cfgIndexInfoNoExport = "," + entity.gethColumns() + "," + cfgIndexInfoNoExport;
|
||||
}
|
||||
noExportMap.put(entity.getMenuNameCode(),cfgIndexInfoNoExport);
|
||||
dataMap.put(entity.getMenuNameCode(), list);
|
||||
String timeRange = initTimeMap(entity);
|
||||
noExportMap.put("timeRange", timeRange);
|
||||
|
||||
if ("csv".equals(entity.getExType())) {
|
||||
this._exportCsv(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||
classMap, dataMap, noExportMap);
|
||||
} else {
|
||||
this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||
classMap, dataMap, noExportMap);
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
logger.error("Group export failed",e);
|
||||
addMessage(redirectAttributes,"error","export_failed");
|
||||
LogUtils.saveLog(request, null, e, null);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,318 @@
|
||||
package com.nis.web.controller.basics;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.BlockingQueue;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.jets3t.service.ServiceException;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
||||
|
||||
import com.beust.jcommander.internal.Lists;
|
||||
import com.nis.domain.FunctionRegionDict;
|
||||
import com.nis.domain.FunctionServiceDict;
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.basics.CommonGroupInfo;
|
||||
import com.nis.domain.basics.DomainCommCfg;
|
||||
import com.nis.domain.configuration.BaseStringCfg;
|
||||
import com.nis.domain.configuration.CfgIndexInfo;
|
||||
import com.nis.domain.configuration.template.DomainCommCfgTemplate;
|
||||
import com.nis.exceptions.MaatConvertException;
|
||||
import com.nis.util.ConfigServiceUtil;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.util.DictUtils;
|
||||
import com.nis.util.StringUtil;
|
||||
import com.nis.util.excel.ImportBigExcel;
|
||||
import com.nis.web.controller.BaseController;
|
||||
import com.nis.web.security.UserUtils;
|
||||
import com.nis.web.service.basics.DomainCommGroupService;
|
||||
|
||||
@Controller
|
||||
@RequestMapping(value = "${adminPath}/basics/domain")
|
||||
public class DomainCommGroupController extends BaseController{
|
||||
|
||||
@Autowired
|
||||
private DomainCommGroupService domainCommGroupService;
|
||||
|
||||
@RequestMapping(value = {"/list"})
|
||||
public String list(Model model, @ModelAttribute("cfg")DomainCommCfg entity, HttpServletRequest request,HttpServletResponse response){
|
||||
Page<DomainCommCfg> page = domainCommGroupService.findPage(new Page<DomainCommCfg>(request, response,"r"), entity);
|
||||
List<FunctionRegionDict> regionList = DictUtils.getFunctionRegionDictList(entity.getFunctionId());
|
||||
List<FunctionServiceDict> serviceList = DictUtils.getFunctionServiceDictList(entity.getFunctionId());
|
||||
List<CommonGroupInfo> groupInfos = commonGroupManageService.findCommonGroupInfosByType(Constants.DOMAIN_OBJ_GROUP_TYPE);
|
||||
|
||||
model.addAttribute("page", page);
|
||||
model.addAttribute("regionList", regionList);
|
||||
model.addAttribute("serviceList", serviceList);
|
||||
model.addAttribute("policyGroupInfos", groupInfos);
|
||||
return "/basics/domainCommGroupList";
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"/addForm"})
|
||||
public String addForm(Model model, @ModelAttribute("cfg")CfgIndexInfo cfg, RedirectAttributes redirectAttributes,
|
||||
HttpServletRequest request, HttpServletResponse response){
|
||||
initFormCondition(model,cfg);
|
||||
/* List<CommonGroupInfo> groupInfos=commonGroupManageService.findCommonGroupInfosByType(Constants.DOMAIN_OBJ_GROUP_TYPE);
|
||||
model.addAttribute("policyGroupInfos", groupInfos);*/
|
||||
|
||||
model.addAttribute("_cfg", cfg);
|
||||
return "/basics/domainCommGroupFormAdd";
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"/save"})
|
||||
public String save(Model model, @ModelAttribute("cfg")CfgIndexInfo cfg,RedirectAttributes redirectAttributes,
|
||||
HttpServletRequest request,HttpServletResponse response){
|
||||
try{
|
||||
domainCommGroupService.saveCommGroupCfg(cfg);
|
||||
addMessage(redirectAttributes,"success","save_success");
|
||||
}catch(Exception e){
|
||||
logger.error("信息保存失败",e);
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error",e.getMessage());
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error","save_failed");
|
||||
}
|
||||
}
|
||||
|
||||
return "redirect:" + adminPath +"/basics/domain/list?functionId="+cfg.getFunctionId();
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"/updateForm"})
|
||||
public String updateForm(Model model,HttpServletRequest request
|
||||
,HttpServletResponse response,String ids,@ModelAttribute("cfg")DomainCommCfg cfg
|
||||
,RedirectAttributes redirectAttributes){
|
||||
cfg = domainCommGroupService.get(Long.parseLong(ids));
|
||||
initUpdateFormCondition(model,cfg);
|
||||
List<CommonGroupInfo> groupInfos=commonGroupManageService.findCommonGroupInfosByType(Constants.DOMAIN_OBJ_GROUP_TYPE);
|
||||
model.addAttribute("policyGroupInfos", groupInfos);
|
||||
model.addAttribute("_cfg", cfg);
|
||||
return "/basics/domainCommGroupFormUpdate";
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"/update"})
|
||||
public String update(Model model,HttpServletRequest request,HttpServletResponse response,@ModelAttribute("cfg")DomainCommCfg cfg,RedirectAttributes redirectAttributes){
|
||||
try{
|
||||
domainCommGroupService.update(cfg);
|
||||
addMessage(redirectAttributes,"success","save_success");
|
||||
}catch(Exception e){
|
||||
logger.error("信息保存失败",e);
|
||||
addMessage(redirectAttributes,"error","save_failed");
|
||||
}
|
||||
|
||||
return "redirect:" + adminPath +"/basics/domain/list?functionId="+cfg.getFunctionId();
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"/delete"})
|
||||
public String delete(String groupIds, String ids, Integer functionId, RedirectAttributes redirectAttributes,
|
||||
HttpServletRequest request, HttpServletResponse response, @ModelAttribute("cfg")DomainCommCfg cfg){
|
||||
try{
|
||||
domainCommGroupService.delete(ids, groupIds, cfg, request, response);
|
||||
addMessage(redirectAttributes,"success","delete_success");
|
||||
}catch(Exception e){
|
||||
logger.error("Delete failed",e);
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error",e.getMessage());
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error","delete_failed");
|
||||
}
|
||||
}
|
||||
|
||||
return "redirect:" + adminPath +"/basics/domain/list?functionId="+functionId;
|
||||
}
|
||||
|
||||
// 批量删除前获取提示信息
|
||||
@ResponseBody
|
||||
@RequestMapping(value="ajaxCheckIsLastOneCfgBatch",method=RequestMethod.POST)
|
||||
public List<Integer> ajaxCheckIsLastOneCfgBatch(Model model, DomainCommCfg searchCfg){
|
||||
return domainCommGroupService.ajaxCheckIsLastOneCfgBatch(searchCfg);
|
||||
}
|
||||
|
||||
// 数据导入
|
||||
@RequestMapping(value = "import", method=RequestMethod.POST)
|
||||
public String importIp(HttpServletRequest request,HttpServletResponse response,RedirectAttributes redirectAttributes,
|
||||
@RequestParam("files") MultipartFile[] files, Integer serviceDictId ,Integer requestId ,String attribute ,String classify
|
||||
,String regionDictIds ,String importPath) {
|
||||
logger.warn("import start...");
|
||||
long start=System.currentTimeMillis();
|
||||
ImportBigExcel ei=null;
|
||||
try {
|
||||
FunctionServiceDict serviceDict = DictUtils.getFunctionServiceDict(serviceDictId);
|
||||
StringBuffer errTip=new StringBuffer();
|
||||
BlockingQueue<BaseStringCfg<?>> stringCfgs =null;
|
||||
|
||||
for (int i = 0; i < files.length; i++) {
|
||||
MultipartFile file = files[i];
|
||||
ei = new ImportBigExcel(file, 0, 1);
|
||||
FunctionRegionDict regionDict = DictUtils.getFunctionRegionDict(Integer.parseInt(regionDictIds.split(",")[i]));
|
||||
//加载模板
|
||||
loadTemplate(ei,regionDict, serviceDict);
|
||||
//------------------------------------check format start----------------------------
|
||||
if (regionDict.getRegionType().equals(2)) {
|
||||
BlockingQueue<DomainCommCfgTemplate> list = ei.getDataList(DomainCommCfgTemplate.class );
|
||||
stringCfgs = this.checkStringCfgMulity(errTip, serviceDict, regionDict, list);
|
||||
}
|
||||
//删除文件
|
||||
if(ei.getUploadFile()!=null&&ei.getUploadFile().exists()) {
|
||||
ei.getUploadFile().delete();
|
||||
}
|
||||
//------------------------------------check format end----------------------------
|
||||
Date date = new Date();
|
||||
//String isSend = request.getParameter("isSend")==null?"":request.getParameter("isSend");
|
||||
|
||||
if (regionDict.getRegionType().equals(2)) {
|
||||
List<BaseStringCfg<?>> _stringCfgs=Lists.newArrayList(Constants.MAAT_JSON_SEND_SIZE);
|
||||
while(!stringCfgs.isEmpty()) {
|
||||
stringCfgs.drainTo(_stringCfgs, Constants.MAAT_JSON_SEND_SIZE);
|
||||
|
||||
List<Integer> regionIds = Lists.newArrayList(_stringCfgs.size());
|
||||
try {
|
||||
regionIds = ConfigServiceUtil.getId(3,_stringCfgs.size());
|
||||
} catch (Exception e) {
|
||||
logger.error("获取域ID出错");
|
||||
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+e.getMessage());
|
||||
}
|
||||
|
||||
int index = 0;
|
||||
Set<String> countSet = new HashSet<String>();
|
||||
for (BaseStringCfg<?> cfg : _stringCfgs) {
|
||||
cfg.setAction(serviceDict==null?null:serviceDict.getAction());
|
||||
cfg.setCfgRegionCode(regionDict.getConfigRegionCode());
|
||||
cfg.setCfgType(regionDict.getConfigRegionValue());
|
||||
cfg.setCreateTime(date);
|
||||
cfg.setCreatorId(UserUtils.getUser().getId());
|
||||
//cfg.setDoLog(2);
|
||||
cfg.setCompileId(0);
|
||||
cfg.setFunctionId(regionDict.getFunctionId());
|
||||
cfg.setIsAudit(Constants.AUDIT_NOT_YET);
|
||||
cfg.setIsValid(Constants.VALID_NO);
|
||||
cfg.setIsAreaEffective(0);
|
||||
cfg.setLable("0");
|
||||
cfg.setRequestId(StringUtil.isEmpty(requestId) ? 0 : requestId);
|
||||
cfg.setAttribute(attribute);
|
||||
cfg.setClassify(classify);
|
||||
cfg.setServiceId(serviceDict==null?null:serviceDict.getServiceId());
|
||||
cfg.setTableName("domain_comm_cfg");
|
||||
cfg.setRegionId(regionIds.get(index));
|
||||
cfg.setGroupName(cfg.getGroupName().toUpperCase());
|
||||
countSet.add(cfg.getGroupName());
|
||||
index++;
|
||||
|
||||
}
|
||||
|
||||
List<CommonGroupInfo> insertGroupList = new ArrayList<CommonGroupInfo>();
|
||||
Map<String, Integer> groupIdMap = commonGroupManageService.getCountByGroupName(countSet, insertGroupList, Constants.DOMAIN_OBJ_GROUP_TYPE); // 调用服务接口获取GroupId
|
||||
domainCommGroupService.saveAndSend(regionDict, serviceDict, _stringCfgs, groupIdMap, insertGroupList);
|
||||
_stringCfgs.clear();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
if(errTip.toString().length()>0) {
|
||||
addMessage(redirectAttributes,"error", errTip.toString());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
if(ei!=null) {
|
||||
if(ei.getUploadFile().exists()) {
|
||||
ei.getUploadFile().delete();
|
||||
}
|
||||
}
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
||||
}else if(e instanceof ServiceException) {
|
||||
addMessage(redirectAttributes,"error", e.getMessage());
|
||||
}else if(e instanceof IndexOutOfBoundsException){
|
||||
addMessage(redirectAttributes,"error", "template_error");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error", "import_failed");
|
||||
}
|
||||
logger.error("import failed", e);
|
||||
}
|
||||
long end=System.currentTimeMillis();
|
||||
logger.warn("import finish,cost:"+(end-start));
|
||||
return "redirect:" + adminPath+ importPath;
|
||||
}
|
||||
|
||||
// 数据导出
|
||||
@RequestMapping(value = "/exportGroupInfo")
|
||||
public void exportGroupInfo(Model model,HttpServletRequest request,HttpServletResponse response,
|
||||
@ModelAttribute("cfg")DomainCommCfg entity,String ids,RedirectAttributes redirectAttributes){
|
||||
try {
|
||||
List<String> titleList=new ArrayList<String>();
|
||||
Map<String, Class<?>> classMap=new HashMap<String, Class<?>>();
|
||||
Map<String, List> dataMap=new HashMap<String, List>();
|
||||
Map<String, String> noExportMap=new HashMap<String, String>();
|
||||
List<DomainCommCfg> list = new ArrayList<DomainCommCfg>();
|
||||
if (!StringUtil.isEmpty(ids)) {
|
||||
list = domainCommGroupService.findByPage(ids);
|
||||
} else {
|
||||
Page<DomainCommCfg> pageInfo=new Page<DomainCommCfg>(request, response,"r");
|
||||
pageInfo.setPageNo(1);
|
||||
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
|
||||
Page<DomainCommCfg> page = domainCommGroupService.findPage(pageInfo, entity);
|
||||
list=page.getList();
|
||||
}
|
||||
|
||||
CommonGroupInfo groupInfo = new CommonGroupInfo();
|
||||
for (DomainCommCfg cfg : list) {
|
||||
groupInfo.setServiceGroupId(cfg.getGroupId());
|
||||
CommonGroupInfo commonGroupInfo = commonGroupManageService.getGroupInfo(groupInfo);
|
||||
cfg.setGroupName(commonGroupInfo.getGroupName());
|
||||
|
||||
}
|
||||
|
||||
titleList.add(entity.getMenuNameCode());
|
||||
classMap.put(entity.getMenuNameCode(), DomainCommCfg.class);
|
||||
String cfgIndexInfoNoExport=",block_type,do_log,action,letter,whether_area_block,classification,attribute,label"
|
||||
+ ",userregion1,userregion2,userregion3,userregion4,userregion5,ir_type,asn_no,"
|
||||
+ "is_hex,is_case_insenstive,cfg_id,is_audit,auditor,valid_identifier,";
|
||||
// 时间过滤
|
||||
if (entity.getSearch_create_time_start() == null ) {
|
||||
cfgIndexInfoNoExport = ",config_time" + cfgIndexInfoNoExport;
|
||||
}
|
||||
if (entity.getSearch_edit_time_start() == null) {
|
||||
cfgIndexInfoNoExport = ",edit_time" + cfgIndexInfoNoExport;
|
||||
}
|
||||
if (entity.getSearch_audit_time_start() == null) {
|
||||
cfgIndexInfoNoExport = ",audit_time" + cfgIndexInfoNoExport;
|
||||
}
|
||||
if (!StringUtil.isEmpty(entity.gethColumns())) {
|
||||
cfgIndexInfoNoExport = "," + entity.gethColumns() + "," + cfgIndexInfoNoExport;
|
||||
}
|
||||
|
||||
noExportMap.put(entity.getMenuNameCode(),cfgIndexInfoNoExport);
|
||||
dataMap.put(entity.getMenuNameCode(), list);
|
||||
String timeRange = initTimeMap(entity);
|
||||
noExportMap.put("timeRange", timeRange);
|
||||
|
||||
if ("csv".equals(entity.getExType())) {
|
||||
this._exportCsv(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||
classMap, dataMap, noExportMap);
|
||||
} else {
|
||||
this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||
classMap, dataMap, noExportMap);
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
logger.error("domainGroupConfig export failed",e);
|
||||
addMessage(redirectAttributes,"error","export_failed");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,110 @@
|
||||
package com.nis.web.controller.basics;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
||||
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.basics.ProtectionListInfo;
|
||||
import com.nis.util.LogUtils;
|
||||
import com.nis.util.StringUtil;
|
||||
import com.nis.web.controller.BaseController;
|
||||
|
||||
/**
|
||||
* 内置配置保护名单管理
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping(value = "${adminPath}/basics/innerProtectionList")
|
||||
public class InnerProtectionListController extends BaseController{
|
||||
|
||||
@RequestMapping(value = {"/list", ""})
|
||||
public String policyGroupList(ProtectionListInfo cfg,HttpServletRequest request, HttpServletResponse response, Model model,
|
||||
RedirectAttributes redirectAttributes) {
|
||||
if(cfg == null)cfg=new ProtectionListInfo();
|
||||
Page<ProtectionListInfo> pageCondition = new Page<ProtectionListInfo>(request, response,"r");
|
||||
Page page = innerProtectionListService.findProtectionInfoList(pageCondition,cfg);
|
||||
|
||||
model.addAttribute("cfg", cfg);
|
||||
model.addAttribute("page", page);
|
||||
return "/basics/protectionInfoList";
|
||||
}
|
||||
|
||||
@RequestMapping(value={"/form"})
|
||||
public String form(Integer groupType,String ids,Model model,String doAction,RedirectAttributes redirectAttributes) {
|
||||
ProtectionListInfo protectionListInfo = new ProtectionListInfo();
|
||||
if(!StringUtil.isEmpty(ids)){
|
||||
protectionListInfo = innerProtectionListService.getById(Integer.parseInt(ids));
|
||||
}
|
||||
model.addAttribute("_cfg", protectionListInfo);
|
||||
return "/basics/protectionInfoForm";
|
||||
}
|
||||
|
||||
@RequestMapping(value = "saveOrUpdate")
|
||||
public String saveOrUpdate(ProtectionListInfo cfg,Model model,String itType,Integer groupType,
|
||||
RedirectAttributes redirectAttributes,HttpServletRequest request) {
|
||||
try {
|
||||
innerProtectionListService.saveOrUpdate(cfg);
|
||||
addMessage(redirectAttributes,"success","save_success");
|
||||
} catch (Exception e) {
|
||||
logger.error("新增失败",e);
|
||||
addMessage(redirectAttributes,"error","save_failed");
|
||||
LogUtils.saveLog(request, null, e, null);
|
||||
}
|
||||
return "redirect:" + adminPath + "/basics/innerProtectionList/list";
|
||||
}
|
||||
|
||||
@RequestMapping(value={"delete"})
|
||||
public String delete(RedirectAttributes redirectAttributes,String ids,int isValid,HttpServletRequest request) {
|
||||
try {
|
||||
innerProtectionListService.deldete(ids,isValid);
|
||||
addMessage(redirectAttributes,"success","delete_success");
|
||||
} catch (Exception e) {
|
||||
logger.error("删除失败",e);
|
||||
addMessage(redirectAttributes,"error","delete_failed");
|
||||
LogUtils.saveLog(request, null, e, null);
|
||||
}
|
||||
return "redirect:" + adminPath + "/basics/innerProtectionList/list";
|
||||
}
|
||||
|
||||
@RequestMapping(value="ajaxGetAllInfo",method=RequestMethod.GET)
|
||||
@ResponseBody
|
||||
public Map<String,List<String>> ajaxGetAllInfo(HttpServletRequest request, HttpServletResponse response){
|
||||
return innerProtectionListService.ajaxGetAllInfo();
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验配置是否已存在
|
||||
* @param cfg
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@ResponseBody
|
||||
@RequestMapping(value = {"/checkKeywordExist"})
|
||||
public boolean checkKeywordExist(ProtectionListInfo cfg, HttpServletRequest request, HttpServletResponse response){
|
||||
if(!StringUtil.isEmpty(cfg.getProId())){ // 修改操作
|
||||
ProtectionListInfo info = innerProtectionListService.getById(cfg.getProId());
|
||||
if(info != null && info.getKeyword().equals(cfg.getKeyword()) && info.getTargetType().equals(cfg.getTargetType())){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
Map<String, List<String>> map = innerProtectionListService.ajaxGetAllInfo();
|
||||
List<String> list = map.get(cfg.getTargetType());
|
||||
if(list != null) {
|
||||
if(list.contains(cfg.getKeyword())) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,326 @@
|
||||
package com.nis.web.controller.basics;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.BlockingQueue;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.jets3t.service.ServiceException;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
||||
|
||||
import com.beust.jcommander.internal.Lists;
|
||||
import com.nis.domain.FunctionRegionDict;
|
||||
import com.nis.domain.FunctionServiceDict;
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.basics.CommonGroupInfo;
|
||||
import com.nis.domain.basics.IpCommCfg;
|
||||
import com.nis.domain.configuration.BaseIpCfg;
|
||||
import com.nis.domain.configuration.CfgIndexInfo;
|
||||
import com.nis.domain.configuration.template.IpCommCfgTemplate;
|
||||
import com.nis.exceptions.MaatConvertException;
|
||||
import com.nis.util.ConfigServiceUtil;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.util.DictUtils;
|
||||
import com.nis.util.StringUtil;
|
||||
import com.nis.util.excel.ImportBigExcel;
|
||||
import com.nis.web.controller.BaseController;
|
||||
import com.nis.web.security.UserUtils;
|
||||
import com.nis.web.service.basics.IpCommGroupCfgService;
|
||||
|
||||
@Controller
|
||||
@RequestMapping(value = "${adminPath}/basics/ip")
|
||||
public class IpCommGroupController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private IpCommGroupCfgService ipCommGroupCfgService;
|
||||
|
||||
@RequestMapping(value = { "/list" })
|
||||
public String list(Model model, @ModelAttribute("cfg") IpCommCfg entity, HttpServletRequest request, HttpServletResponse response) {
|
||||
Page<IpCommCfg> page = ipCommGroupCfgService.findPage(new Page<IpCommCfg>(request, response, "r"),entity);
|
||||
List<FunctionRegionDict> regionList = DictUtils.getFunctionRegionDictList(entity.getFunctionId());
|
||||
List<FunctionServiceDict> serviceList = DictUtils.getFunctionServiceDictList(entity.getFunctionId());
|
||||
List<CommonGroupInfo> policyGroupInfos=commonGroupManageService.findCommonGroupInfosByType(Constants.IP_OBJ_GROUP_TYPE);
|
||||
|
||||
model.addAttribute("page", page);
|
||||
model.addAttribute("regionList", regionList);
|
||||
model.addAttribute("serviceList", serviceList);
|
||||
model.addAttribute("policyGroupInfos", policyGroupInfos);
|
||||
|
||||
return "/basics/ipCommonGroupCfgList";
|
||||
}
|
||||
|
||||
@RequestMapping(value = { "/addForm" })
|
||||
public String addForm(Model model, @ModelAttribute("cfg") CfgIndexInfo cfg, RedirectAttributes redirectAttributes,
|
||||
HttpServletRequest request, HttpServletResponse response) {
|
||||
cfg.setGroupType(5);
|
||||
initFormCondition(model, cfg);
|
||||
|
||||
/*List<CommonGroupInfo> groupInfos=commonGroupManageService.findCommonGroupInfosByType(5);
|
||||
model.addAttribute("policyGroupInfos", groupInfos);*/
|
||||
model.addAttribute("_cfg", cfg);
|
||||
return "/basics/ipCommGroupFormAdd";
|
||||
}
|
||||
|
||||
@RequestMapping(value = { "/save" })
|
||||
@RequiresPermissions(value = { "ip:common:config" })
|
||||
public String save(Model model, @ModelAttribute("cfg") CfgIndexInfo cfg, RedirectAttributes redirectAttributes,
|
||||
HttpServletRequest request, HttpServletResponse response) {
|
||||
try {
|
||||
ipCommGroupCfgService.saveIpCommGroupCfg(cfg);
|
||||
addMessage(redirectAttributes, "success", "save_success");
|
||||
} catch (Exception e) {
|
||||
logger.error("信息保存失败", e);
|
||||
if (e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes, "error", e.getMessage());
|
||||
} else {
|
||||
addMessage(redirectAttributes, "error", "save_failed");
|
||||
}
|
||||
}
|
||||
|
||||
return "redirect:" + adminPath + "/basics/ip/list?functionId=" + cfg.getFunctionId();
|
||||
}
|
||||
|
||||
@RequestMapping(value = { "/updateForm" })
|
||||
public String updateForm(Model model, @ModelAttribute("cfg") IpCommCfg cfg, RedirectAttributes redirectAttributes, String ids,
|
||||
HttpServletRequest request, HttpServletResponse response) {
|
||||
cfg = ipCommGroupCfgService.get(Long.parseLong(ids));
|
||||
cfg.setGroupType(5);
|
||||
|
||||
initUpdateFormCondition(model, cfg);
|
||||
List<CommonGroupInfo> groupInfos = commonGroupManageService.findCommonGroupInfosByType(Constants.IP_OBJ_GROUP_TYPE);
|
||||
model.addAttribute("policyGroupInfos", groupInfos);
|
||||
model.addAttribute("_cfg", cfg);
|
||||
return "/basics/ipCommGroupFormUpdate";
|
||||
}
|
||||
|
||||
@RequestMapping(value = { "/update" })
|
||||
@RequiresPermissions(value = { "ip:common:config" })
|
||||
public String update(Model model, @ModelAttribute("cfg") IpCommCfg cfg, RedirectAttributes redirectAttributes,
|
||||
HttpServletRequest request, HttpServletResponse response) {
|
||||
try {
|
||||
ipCommGroupCfgService.update(cfg);
|
||||
addMessage(redirectAttributes, "success", "save_success");
|
||||
} catch (Exception e) {
|
||||
logger.error("信息保存失败", e);
|
||||
addMessage(redirectAttributes, "error", "save_failed");
|
||||
}
|
||||
|
||||
return "redirect:" + adminPath + "/basics/ip/list?functionId=" + cfg.getFunctionId();
|
||||
}
|
||||
|
||||
@RequestMapping(value = { "/delete" })
|
||||
@RequiresPermissions(value = { "ip:common:config" })
|
||||
public String delete(String groupIds, String ids, Integer functionId, RedirectAttributes redirectAttributes,
|
||||
HttpServletRequest request, HttpServletResponse response, @ModelAttribute("cfg")IpCommCfg cfg) {
|
||||
try {
|
||||
ipCommGroupCfgService.delete(ids, groupIds, cfg, request, response);
|
||||
addMessage(redirectAttributes, "success", "delete_success");
|
||||
} catch (Exception e) {
|
||||
logger.error("Delete failed", e);
|
||||
if (e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes, "error", e.getMessage());
|
||||
} else {
|
||||
addMessage(redirectAttributes, "error", "delete_failed");
|
||||
}
|
||||
}
|
||||
|
||||
return "redirect:" + adminPath + "/basics/ip/list?functionId=" + functionId;
|
||||
}
|
||||
|
||||
// 批量删除前获取提示信息
|
||||
@ResponseBody
|
||||
@RequestMapping(value="ajaxCheckIsLastOneCfgBatch",method=RequestMethod.POST)
|
||||
public List<Integer> ajaxCheckIsLastOneCfgBatch(Model model, IpCommCfg searchCfg){
|
||||
return ipCommGroupCfgService.ajaxCheckIsLastOneCfgBatch(searchCfg);
|
||||
}
|
||||
|
||||
// 数据导出
|
||||
@RequestMapping(value = "/exportIpComm")
|
||||
public void exportIpCommonCfg(Model model, @ModelAttribute("cfg") IpCommCfg entity, String ids, RedirectAttributes redirectAttributes,
|
||||
HttpServletRequest request, HttpServletResponse response) {
|
||||
try {
|
||||
List<String> titleList = new ArrayList<String>();
|
||||
Map<String, Class<?>> classMap = new HashMap<String, Class<?>>();
|
||||
Map<String, List> dataMap = new HashMap<String, List>();
|
||||
Map<String, String> noExportMap = new HashMap<String, String>();
|
||||
List<IpCommCfg> list = new ArrayList<IpCommCfg>();
|
||||
if (!StringUtil.isEmpty(ids)) {
|
||||
list = ipCommGroupCfgService.findByPage(ids);
|
||||
} else {
|
||||
Page<IpCommCfg> pageInfo = new Page<IpCommCfg>(request, response, "r");
|
||||
pageInfo.setPageNo(1);
|
||||
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
|
||||
Page<IpCommCfg> page = ipCommGroupCfgService.findPage(pageInfo, entity);
|
||||
list = page.getList();
|
||||
}
|
||||
|
||||
CommonGroupInfo groupInfo = new CommonGroupInfo();
|
||||
for (IpCommCfg cfg : list) {
|
||||
groupInfo.setServiceGroupId(cfg.getGroupId());
|
||||
CommonGroupInfo commonGroupInfo = commonGroupManageService.getGroupInfo(groupInfo);
|
||||
cfg.setGroupName(commonGroupInfo.getGroupName());
|
||||
|
||||
}
|
||||
|
||||
titleList.add(entity.getMenuNameCode());
|
||||
classMap.put(entity.getMenuNameCode(), IpCommCfg.class);
|
||||
String cfgIndexInfoNoExport = ",block_type,do_log,action"
|
||||
+ ",letter,whether_area_block,classification,attribute,label,userregion1,userregion2,userregion3,userregion4,userregion5"
|
||||
+ ",cfg_id,is_audit,auditor,valid_identifier,ir_type,";
|
||||
// 时间过滤
|
||||
if (entity.getSearch_create_time_start() == null) {
|
||||
cfgIndexInfoNoExport = ",config_time" + cfgIndexInfoNoExport;
|
||||
}
|
||||
if (entity.getSearch_edit_time_start() == null) {
|
||||
cfgIndexInfoNoExport = ",edit_time" + cfgIndexInfoNoExport;
|
||||
}
|
||||
if (entity.getSearch_audit_time_start() == null) {
|
||||
cfgIndexInfoNoExport = ",audit_time" + cfgIndexInfoNoExport;
|
||||
}
|
||||
if (!StringUtil.isEmpty(entity.gethColumns())) {
|
||||
cfgIndexInfoNoExport = "," + entity.gethColumns() + "," + cfgIndexInfoNoExport;
|
||||
}
|
||||
|
||||
noExportMap.put(entity.getMenuNameCode(), cfgIndexInfoNoExport);
|
||||
dataMap.put(entity.getMenuNameCode(), list);
|
||||
String timeRange = initTimeMap(entity);
|
||||
noExportMap.put("timeRange", timeRange);
|
||||
|
||||
if ("csv".equals(entity.getExType())) {
|
||||
this._exportCsv(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||
classMap, dataMap, noExportMap);
|
||||
} else {
|
||||
this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||
classMap, dataMap, noExportMap);
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
logger.error("IpCommGroupCfg export failed", e);
|
||||
addMessage(redirectAttributes, "error", "export_failed");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// 数据导入
|
||||
@RequestMapping(value = "import", method=RequestMethod.POST)
|
||||
public String importIp(HttpServletRequest request,HttpServletResponse response,RedirectAttributes redirectAttributes,
|
||||
@RequestParam("files") MultipartFile[] files, Integer serviceDictId ,Integer requestId ,String attribute ,String classify
|
||||
,String regionDictIds ,String importPath) {
|
||||
logger.warn("import start...");
|
||||
long start=System.currentTimeMillis();
|
||||
ImportBigExcel ei=null;
|
||||
try {
|
||||
FunctionServiceDict serviceDict = DictUtils.getFunctionServiceDict(serviceDictId);
|
||||
StringBuffer errTip=new StringBuffer();
|
||||
BlockingQueue<BaseIpCfg> ipPortCfgs =null;
|
||||
|
||||
for (int i = 0; i < files.length; i++) {
|
||||
MultipartFile file = files[i];
|
||||
ei = new ImportBigExcel(file, 0, 1);
|
||||
FunctionRegionDict regionDict = DictUtils.getFunctionRegionDict(Integer.parseInt(regionDictIds.split(",")[i]));
|
||||
//加载模板
|
||||
loadTemplate(ei,regionDict, serviceDict);
|
||||
//------------------------------------check format start----------------------------
|
||||
if (regionDict.getRegionType().equals(1)) {// IP
|
||||
BlockingQueue<IpCommCfgTemplate> list = ei.getDataList(IpCommCfgTemplate.class );
|
||||
ipPortCfgs=this.checkIpCfgMulity(errTip,serviceDict, regionDict, null,null, list);
|
||||
}
|
||||
//删除文件
|
||||
if(ei.getUploadFile()!=null&&ei.getUploadFile().exists()) {
|
||||
ei.getUploadFile().delete();
|
||||
}
|
||||
//------------------------------------check format end----------------------------
|
||||
Date date = new Date();
|
||||
//String isSend = request.getParameter("isSend")==null?"":request.getParameter("isSend");
|
||||
|
||||
if (regionDict.getRegionType().equals(1)) {// IP
|
||||
List<BaseIpCfg> _ipPortCfgs=Lists.newArrayList(Constants.MAAT_JSON_SEND_SIZE);
|
||||
while(!ipPortCfgs.isEmpty()) {
|
||||
ipPortCfgs.drainTo(_ipPortCfgs, Constants.MAAT_JSON_SEND_SIZE);
|
||||
List<Integer> regionIds = Lists.newArrayList(_ipPortCfgs.size());
|
||||
try {
|
||||
regionIds = ConfigServiceUtil.getId(3,_ipPortCfgs.size());
|
||||
} catch (Exception e) {
|
||||
logger.error("获取域ID出错");
|
||||
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+e.getMessage());
|
||||
}
|
||||
|
||||
int index = 0;
|
||||
Set<String> countSet = new HashSet<String>();
|
||||
for (BaseIpCfg cfg : _ipPortCfgs) {
|
||||
cfg.setAction(serviceDict==null?null:serviceDict.getAction());
|
||||
cfg.setCfgRegionCode(regionDict.getConfigRegionCode());
|
||||
cfg.setCfgType(regionDict.getConfigRegionValue());
|
||||
cfg.setCreateTime(date);
|
||||
cfg.setCreatorId(UserUtils.getUser().getId());
|
||||
//cfg.setDoLog(2);
|
||||
cfg.setCompileId(0);
|
||||
cfg.setFunctionId(regionDict.getFunctionId());
|
||||
cfg.setIsAudit(Constants.AUDIT_NOT_YET);
|
||||
cfg.setIsValid(Constants.VALID_NO);
|
||||
cfg.setIsAreaEffective(0);
|
||||
cfg.setLable("0");
|
||||
cfg.setRequestId(StringUtil.isEmpty(requestId) ? 0 : requestId);
|
||||
cfg.setAttribute(attribute);
|
||||
cfg.setClassify(classify);
|
||||
cfg.setServiceId(serviceDict==null?null:serviceDict.getServiceId());
|
||||
cfg.setTableName("ip_comm_cfg");
|
||||
cfg.setRegionId(regionIds.get(index));
|
||||
cfg.setGroupName(cfg.getGroupName().toUpperCase());
|
||||
countSet.add(cfg.getGroupName());
|
||||
index++;
|
||||
|
||||
}
|
||||
|
||||
List<CommonGroupInfo> insertGroupList = new ArrayList<CommonGroupInfo>();
|
||||
Map<String, Integer> groupIdMap = commonGroupManageService.getCountByGroupName(countSet, insertGroupList, Constants.IP_OBJ_GROUP_TYPE); // 调用服务接口获取GroupId
|
||||
ipCommGroupCfgService.saveAndSend(regionDict, serviceDict, _ipPortCfgs, groupIdMap, insertGroupList);
|
||||
_ipPortCfgs.clear();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
if(errTip.toString().length()>0) {
|
||||
addMessage(redirectAttributes,"error", errTip.toString());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
if(ei!=null) {
|
||||
if(ei.getUploadFile().exists()) {
|
||||
ei.getUploadFile().delete();
|
||||
}
|
||||
}
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
||||
}else if(e instanceof ServiceException) {
|
||||
addMessage(redirectAttributes,"error", e.getMessage());
|
||||
}else if(e instanceof IndexOutOfBoundsException){
|
||||
addMessage(redirectAttributes,"error", "template_error");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error", "import_failed");
|
||||
}
|
||||
logger.error("import failed", e);
|
||||
}
|
||||
long end=System.currentTimeMillis();
|
||||
logger.warn("import finish,cost:"+(end-start));
|
||||
return "redirect:" + adminPath+ importPath;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -20,6 +20,7 @@ import com.nis.domain.basics.IpReuseIpCfg;
|
||||
import com.nis.domain.configuration.CfgIndexInfo;
|
||||
import com.nis.exceptions.MaatConvertException;
|
||||
import com.nis.util.DictUtils;
|
||||
import com.nis.util.LogUtils;
|
||||
import com.nis.web.controller.BaseController;
|
||||
@Controller
|
||||
@RequestMapping(value = "${adminPath}/basics/vpn")
|
||||
@@ -75,6 +76,7 @@ public class IpReuseIpCfgController extends BaseController{
|
||||
logger.error("信息保存失败",e);
|
||||
e.printStackTrace();
|
||||
addMessage(redirectAttributes,"error","save_failed");
|
||||
LogUtils.saveLog(request, null, e, null);
|
||||
}
|
||||
return "redirect:" + adminPath +"/basics/vpn/list?functionId="+entity.getFunctionId();
|
||||
}
|
||||
@@ -91,6 +93,7 @@ public class IpReuseIpCfgController extends BaseController{
|
||||
logger.error("信息保存失败",e);
|
||||
e.printStackTrace();
|
||||
addMessage(redirectAttributes,"error","save_failed");
|
||||
LogUtils.saveLog(request, null, e, null);
|
||||
}
|
||||
return "redirect:" + adminPath +"/basics/vpn/list?functionId="+cfg.getFunctionId();
|
||||
}
|
||||
@@ -98,7 +101,7 @@ public class IpReuseIpCfgController extends BaseController{
|
||||
@RequiresPermissions(value={"asn:ip:config"})
|
||||
public String delete(Integer isValid
|
||||
,String ids,Integer functionId
|
||||
,RedirectAttributes redirectAttributes){
|
||||
,RedirectAttributes redirectAttributes,HttpServletRequest request){
|
||||
try{
|
||||
ipReuseIpCfgService.delete(isValid,ids);
|
||||
addMessage(redirectAttributes,"success","delete_success");
|
||||
@@ -106,8 +109,10 @@ public class IpReuseIpCfgController extends BaseController{
|
||||
logger.error("Delete failed",e);
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error",e.getMessage());
|
||||
LogUtils.saveLog(request, null, e, null);
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error","delete_failed");
|
||||
LogUtils.saveLog(request, null, e, null);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@ import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.basics.PolicyGroupInfo;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.util.LogUtils;
|
||||
import com.nis.util.StringUtil;
|
||||
import com.nis.web.controller.BaseController;
|
||||
/**
|
||||
@@ -71,7 +72,7 @@ public class PolicyGroupController extends BaseController {
|
||||
//@RequiresPermissions(value={"basics:classification:add","basics:attribute:add","basics:label:add","basics:classification:edit","basics:attribute:edit","basics:label:edit"},logical=Logical.OR)
|
||||
@RequestMapping(value = "saveOrUpdate")
|
||||
public String saveOrUpdate(PolicyGroupInfo cfg,Model model,
|
||||
RedirectAttributes redirectAttributes,String itType,Integer groupType) {
|
||||
RedirectAttributes redirectAttributes,String itType,Integer groupType,HttpServletRequest request) {
|
||||
|
||||
try {
|
||||
policyGroupInfoService.saveOrUpdate(cfg);
|
||||
@@ -79,6 +80,7 @@ public class PolicyGroupController extends BaseController {
|
||||
} catch (Exception e) {
|
||||
logger.error("新增失败",e);
|
||||
addMessage(redirectAttributes,"error","save_failed");
|
||||
LogUtils.saveLog(request, null, e, null);
|
||||
}
|
||||
|
||||
return "redirect:" + adminPath + "/basics/policyGroup/policyGroupList?groupType="+groupType;
|
||||
@@ -93,13 +95,14 @@ public class PolicyGroupController extends BaseController {
|
||||
*/
|
||||
//@RequiresPermissions(value={"basics:classification:del","basics:attribute:del","basics:label:del"},logical=Logical.OR)
|
||||
@RequestMapping(value={"delete"})
|
||||
public String delete(RedirectAttributes redirectAttributes, Integer groupType,String ids,int isValid) {
|
||||
public String delete(RedirectAttributes redirectAttributes, Integer groupType,String ids,int isValid,HttpServletRequest request) {
|
||||
try {
|
||||
policyGroupInfoService.deldete(ids,isValid);
|
||||
addMessage(redirectAttributes,"success","delete_success");
|
||||
} catch (Exception e) {
|
||||
logger.error("删除失败",e);
|
||||
addMessage(redirectAttributes,"error","delete_failed");
|
||||
LogUtils.saveLog(request, null, e, null);
|
||||
}
|
||||
return "redirect:" + adminPath + "/basics/policyGroup/policyGroupList?groupType="+groupType;
|
||||
}
|
||||
@@ -194,6 +197,7 @@ public class PolicyGroupController extends BaseController {
|
||||
} catch (Exception e) {
|
||||
logger.error("Group export failed",e);
|
||||
addMessage(redirectAttributes,"error","export_failed");
|
||||
LogUtils.saveLog(request, null, e, null);
|
||||
}
|
||||
//return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,318 @@
|
||||
package com.nis.web.controller.basics;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.BlockingQueue;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.jets3t.service.ServiceException;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
||||
|
||||
import com.beust.jcommander.internal.Lists;
|
||||
import com.nis.domain.FunctionRegionDict;
|
||||
import com.nis.domain.FunctionServiceDict;
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.basics.CommonGroupInfo;
|
||||
import com.nis.domain.basics.ScriberIdCommCfg;
|
||||
import com.nis.domain.configuration.BaseStringCfg;
|
||||
import com.nis.domain.configuration.CfgIndexInfo;
|
||||
import com.nis.domain.configuration.template.ScriberIdCommCfgTemplate;
|
||||
import com.nis.exceptions.MaatConvertException;
|
||||
import com.nis.util.ConfigServiceUtil;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.util.DictUtils;
|
||||
import com.nis.util.StringUtil;
|
||||
import com.nis.util.excel.ImportBigExcel;
|
||||
import com.nis.web.controller.BaseController;
|
||||
import com.nis.web.security.UserUtils;
|
||||
import com.nis.web.service.basics.ScriberIdCommGroupService;
|
||||
|
||||
@Controller
|
||||
@RequestMapping(value = "${adminPath}/basics/scriberId")
|
||||
public class ScriberIdCommGroupController extends BaseController{
|
||||
|
||||
@Autowired
|
||||
private ScriberIdCommGroupService scriberIdCommGroupService;
|
||||
|
||||
@RequestMapping(value = {"/list"})
|
||||
public String list(Model model, @ModelAttribute("cfg")ScriberIdCommCfg entity, HttpServletRequest request,HttpServletResponse response){
|
||||
Page<ScriberIdCommCfg> page = scriberIdCommGroupService.findPage(new Page<ScriberIdCommCfg>(request, response,"r"), entity);
|
||||
List<FunctionRegionDict> regionList = DictUtils.getFunctionRegionDictList(entity.getFunctionId());
|
||||
List<FunctionServiceDict> serviceList = DictUtils.getFunctionServiceDictList(entity.getFunctionId());
|
||||
List<CommonGroupInfo> groupInfos = commonGroupManageService.findCommonGroupInfosByType(Constants.SUBID_OBJ_GROUP_TYPE);
|
||||
|
||||
model.addAttribute("page", page);
|
||||
model.addAttribute("regionList", regionList);
|
||||
model.addAttribute("serviceList", serviceList);
|
||||
model.addAttribute("policyGroupInfos", groupInfos);
|
||||
return "/basics/scriberidCommGroupList";
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"/addForm"})
|
||||
public String addForm(Model model, @ModelAttribute("cfg")CfgIndexInfo cfg, RedirectAttributes redirectAttributes,
|
||||
HttpServletRequest request, HttpServletResponse response){
|
||||
initFormCondition(model,cfg);
|
||||
/*List<CommonGroupInfo> groupInfos=commonGroupManageService.findCommonGroupInfosByType(Constants.SUBID_OBJ_GROUP_TYPE);
|
||||
model.addAttribute("policyGroupInfos", groupInfos);*/
|
||||
|
||||
model.addAttribute("_cfg", cfg);
|
||||
return "/basics/scriberidCommGroupFormAdd";
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"/save"})
|
||||
public String save(Model model, @ModelAttribute("cfg")CfgIndexInfo cfg,RedirectAttributes redirectAttributes,
|
||||
HttpServletRequest request,HttpServletResponse response){
|
||||
try{
|
||||
scriberIdCommGroupService.saveCommGroupCfg(cfg);
|
||||
addMessage(redirectAttributes,"success","save_success");
|
||||
}catch(Exception e){
|
||||
logger.error("信息保存失败",e);
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error",e.getMessage());
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error","save_failed");
|
||||
}
|
||||
}
|
||||
|
||||
return "redirect:" + adminPath +"/basics/scriberId/list?functionId="+cfg.getFunctionId();
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"/updateForm"})
|
||||
public String updateForm(Model model,HttpServletRequest request
|
||||
,HttpServletResponse response,String ids,@ModelAttribute("cfg")ScriberIdCommCfg cfg
|
||||
,RedirectAttributes redirectAttributes){
|
||||
cfg = scriberIdCommGroupService.get(Long.parseLong(ids));
|
||||
initUpdateFormCondition(model,cfg);
|
||||
List<CommonGroupInfo> groupInfos=commonGroupManageService.findCommonGroupInfosByType(Constants.SUBID_OBJ_GROUP_TYPE);
|
||||
model.addAttribute("policyGroupInfos", groupInfos);
|
||||
model.addAttribute("_cfg", cfg);
|
||||
return "/basics/scriberidCommGroupFormUpdate";
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"/update"})
|
||||
public String update(Model model,HttpServletRequest request,HttpServletResponse response,@ModelAttribute("cfg")ScriberIdCommCfg cfg,RedirectAttributes redirectAttributes){
|
||||
try{
|
||||
scriberIdCommGroupService.update(cfg);
|
||||
addMessage(redirectAttributes,"success","save_success");
|
||||
}catch(Exception e){
|
||||
logger.error("信息保存失败",e);
|
||||
addMessage(redirectAttributes,"error","save_failed");
|
||||
}
|
||||
|
||||
return "redirect:" + adminPath +"/basics/scriberId/list?functionId="+cfg.getFunctionId();
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"/delete"})
|
||||
public String delete(String groupIds, String ids, Integer functionId, RedirectAttributes redirectAttributes,
|
||||
HttpServletRequest request, HttpServletResponse response, @ModelAttribute("cfg")ScriberIdCommCfg cfg){
|
||||
try{
|
||||
scriberIdCommGroupService.delete(ids, groupIds, cfg, request, response);
|
||||
addMessage(redirectAttributes,"success","delete_success");
|
||||
}catch(Exception e){
|
||||
logger.error("Delete failed",e);
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error",e.getMessage());
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error","delete_failed");
|
||||
}
|
||||
}
|
||||
|
||||
return "redirect:" + adminPath +"/basics/scriberId/list?functionId="+functionId;
|
||||
}
|
||||
|
||||
// 批量删除前获取提示信息
|
||||
@ResponseBody
|
||||
@RequestMapping(value="ajaxCheckIsLastOneCfgBatch",method=RequestMethod.POST)
|
||||
public List<Integer> ajaxCheckIsLastOneCfgBatch(Model model, ScriberIdCommCfg searchCfg){
|
||||
return scriberIdCommGroupService.ajaxCheckIsLastOneCfgBatch(searchCfg);
|
||||
}
|
||||
|
||||
// 数据导入
|
||||
@RequestMapping(value = "import", method=RequestMethod.POST)
|
||||
public String importIp(HttpServletRequest request,HttpServletResponse response,RedirectAttributes redirectAttributes,
|
||||
@RequestParam("files") MultipartFile[] files, Integer serviceDictId ,Integer requestId ,String attribute ,String classify
|
||||
,String regionDictIds ,String importPath) {
|
||||
logger.warn("import start...");
|
||||
long start=System.currentTimeMillis();
|
||||
ImportBigExcel ei=null;
|
||||
try {
|
||||
FunctionServiceDict serviceDict = DictUtils.getFunctionServiceDict(serviceDictId);
|
||||
StringBuffer errTip=new StringBuffer();
|
||||
BlockingQueue<BaseStringCfg<?>> stringCfgs =null;
|
||||
|
||||
for (int i = 0; i < files.length; i++) {
|
||||
MultipartFile file = files[i];
|
||||
ei = new ImportBigExcel(file, 0, 1);
|
||||
FunctionRegionDict regionDict = DictUtils.getFunctionRegionDict(Integer.parseInt(regionDictIds.split(",")[i]));
|
||||
//加载模板
|
||||
loadTemplate(ei,regionDict, serviceDict);
|
||||
//------------------------------------check format start----------------------------
|
||||
if (regionDict.getRegionType().equals(2)) {
|
||||
BlockingQueue<ScriberIdCommCfgTemplate> list = ei.getDataList(ScriberIdCommCfgTemplate.class );
|
||||
stringCfgs = this.checkStringCfgMulity(errTip, serviceDict, regionDict, list);
|
||||
}
|
||||
//删除文件
|
||||
if(ei.getUploadFile()!=null&&ei.getUploadFile().exists()) {
|
||||
ei.getUploadFile().delete();
|
||||
}
|
||||
//------------------------------------check format end----------------------------
|
||||
Date date = new Date();
|
||||
//String isSend = request.getParameter("isSend")==null?"":request.getParameter("isSend");
|
||||
|
||||
if (regionDict.getRegionType().equals(2)) {
|
||||
List<BaseStringCfg<?>> _stringCfgs=Lists.newArrayList(Constants.MAAT_JSON_SEND_SIZE);
|
||||
while(!stringCfgs.isEmpty()) {
|
||||
stringCfgs.drainTo(_stringCfgs, Constants.MAAT_JSON_SEND_SIZE);
|
||||
|
||||
List<Integer> regionIds = Lists.newArrayList(_stringCfgs.size());
|
||||
try {
|
||||
regionIds = ConfigServiceUtil.getId(3,_stringCfgs.size());
|
||||
} catch (Exception e) {
|
||||
logger.error("获取域ID出错");
|
||||
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+e.getMessage());
|
||||
}
|
||||
|
||||
int index = 0;
|
||||
Set<String> countSet = new HashSet<String>();
|
||||
for (BaseStringCfg<?> cfg : _stringCfgs) {
|
||||
cfg.setAction(serviceDict==null?null:serviceDict.getAction());
|
||||
cfg.setCfgRegionCode(regionDict.getConfigRegionCode());
|
||||
cfg.setCfgType(regionDict.getConfigRegionValue());
|
||||
cfg.setCreateTime(date);
|
||||
cfg.setCreatorId(UserUtils.getUser().getId());
|
||||
//cfg.setDoLog(2);
|
||||
cfg.setCompileId(0);
|
||||
cfg.setFunctionId(regionDict.getFunctionId());
|
||||
cfg.setIsAudit(Constants.AUDIT_NOT_YET);
|
||||
cfg.setIsValid(Constants.VALID_NO);
|
||||
cfg.setIsAreaEffective(0);
|
||||
cfg.setLable("0");
|
||||
cfg.setRequestId(StringUtil.isEmpty(requestId) ? 0 : requestId);
|
||||
cfg.setAttribute(attribute);
|
||||
cfg.setClassify(classify);
|
||||
cfg.setServiceId(serviceDict==null?null:serviceDict.getServiceId());
|
||||
cfg.setTableName("scriberid_comm_cfg");
|
||||
cfg.setRegionId(regionIds.get(index));
|
||||
cfg.setGroupName(cfg.getGroupName().toUpperCase());
|
||||
countSet.add(cfg.getGroupName());
|
||||
index++;
|
||||
|
||||
}
|
||||
|
||||
List<CommonGroupInfo> insertGroupList = new ArrayList<CommonGroupInfo>();
|
||||
Map<String, Integer> groupIdMap = commonGroupManageService.getCountByGroupName(countSet, insertGroupList, Constants.SUBID_OBJ_GROUP_TYPE); // 调用服务接口获取GroupId
|
||||
scriberIdCommGroupService.saveAndSend(regionDict, serviceDict, _stringCfgs, groupIdMap, insertGroupList);
|
||||
_stringCfgs.clear();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
if(errTip.toString().length()>0) {
|
||||
addMessage(redirectAttributes,"error", errTip.toString());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
if(ei!=null) {
|
||||
if(ei.getUploadFile().exists()) {
|
||||
ei.getUploadFile().delete();
|
||||
}
|
||||
}
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
||||
}else if(e instanceof ServiceException) {
|
||||
addMessage(redirectAttributes,"error", e.getMessage());
|
||||
}else if(e instanceof IndexOutOfBoundsException){
|
||||
addMessage(redirectAttributes,"error", "template_error");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error", "import_failed");
|
||||
}
|
||||
logger.error("import failed", e);
|
||||
}
|
||||
long end=System.currentTimeMillis();
|
||||
logger.warn("import finish,cost:"+(end-start));
|
||||
return "redirect:" + adminPath+ importPath;
|
||||
}
|
||||
|
||||
// 数据导出
|
||||
@RequestMapping(value = "/exportGroupInfo")
|
||||
public void exportGroupInfo(Model model,HttpServletRequest request,HttpServletResponse response,
|
||||
@ModelAttribute("cfg")ScriberIdCommCfg entity,String ids,RedirectAttributes redirectAttributes){
|
||||
try {
|
||||
List<String> titleList=new ArrayList<String>();
|
||||
Map<String, Class<?>> classMap=new HashMap<String, Class<?>>();
|
||||
Map<String, List> dataMap=new HashMap<String, List>();
|
||||
Map<String, String> noExportMap=new HashMap<String, String>();
|
||||
List<ScriberIdCommCfg> list = new ArrayList<ScriberIdCommCfg>();
|
||||
if (!StringUtil.isEmpty(ids)) {
|
||||
list = scriberIdCommGroupService.findByPage(ids);
|
||||
} else {
|
||||
Page<ScriberIdCommCfg> pageInfo=new Page<ScriberIdCommCfg>(request, response,"r");
|
||||
pageInfo.setPageNo(1);
|
||||
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
|
||||
Page<ScriberIdCommCfg> page = scriberIdCommGroupService.findPage(pageInfo, entity);
|
||||
list=page.getList();
|
||||
}
|
||||
|
||||
CommonGroupInfo groupInfo = new CommonGroupInfo();
|
||||
for (ScriberIdCommCfg cfg : list) {
|
||||
groupInfo.setServiceGroupId(cfg.getGroupId());
|
||||
CommonGroupInfo commonGroupInfo = commonGroupManageService.getGroupInfo(groupInfo);
|
||||
cfg.setGroupName(commonGroupInfo.getGroupName());
|
||||
|
||||
}
|
||||
|
||||
titleList.add(entity.getMenuNameCode());
|
||||
classMap.put(entity.getMenuNameCode(), ScriberIdCommCfg.class);
|
||||
String cfgIndexInfoNoExport=",block_type,do_log,action,letter,whether_area_block,classification,attribute,label"
|
||||
+ ",userregion1,userregion2,userregion3,userregion4,userregion5,ir_type,asn_no,"
|
||||
+ "is_hex,is_case_insenstive,cfg_id,is_audit,auditor,valid_identifier,";
|
||||
// 时间过滤
|
||||
if (entity.getSearch_create_time_start() == null ) {
|
||||
cfgIndexInfoNoExport = ",config_time" + cfgIndexInfoNoExport;
|
||||
}
|
||||
if (entity.getSearch_edit_time_start() == null) {
|
||||
cfgIndexInfoNoExport = ",edit_time" + cfgIndexInfoNoExport;
|
||||
}
|
||||
if (entity.getSearch_audit_time_start() == null) {
|
||||
cfgIndexInfoNoExport = ",audit_time" + cfgIndexInfoNoExport;
|
||||
}
|
||||
if (!StringUtil.isEmpty(entity.gethColumns())) {
|
||||
cfgIndexInfoNoExport = "," + entity.gethColumns() + "," + cfgIndexInfoNoExport;
|
||||
}
|
||||
|
||||
noExportMap.put(entity.getMenuNameCode(),cfgIndexInfoNoExport);
|
||||
dataMap.put(entity.getMenuNameCode(), list);
|
||||
String timeRange = initTimeMap(entity);
|
||||
noExportMap.put("timeRange", timeRange);
|
||||
|
||||
if ("csv".equals(entity.getExType())) {
|
||||
this._exportCsv(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||
classMap, dataMap, noExportMap);
|
||||
} else {
|
||||
this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||
classMap, dataMap, noExportMap);
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
logger.error("scriberidGroupConfig export failed",e);
|
||||
addMessage(redirectAttributes,"error","export_failed");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -29,6 +29,7 @@ import com.nis.util.ConfigDictUtils;
|
||||
import com.nis.util.Configurations;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.util.DateUtils;
|
||||
import com.nis.util.LogUtils;
|
||||
import com.nis.util.StringUtil;
|
||||
import com.nis.util.StringUtils;
|
||||
import com.nis.web.controller.BaseController;
|
||||
@@ -52,7 +53,7 @@ public class ServiceDictInfoController extends BaseController {
|
||||
|
||||
@ResponseBody
|
||||
@RequestMapping(value="requestCancleInfoAjax", method = RequestMethod.POST)
|
||||
public String requestCancleInfoAjax(Integer cancelRequestId,String ids,String indexTable){
|
||||
public String requestCancleInfoAjax(Integer cancelRequestId,String ids,String indexTable,HttpServletRequest request){
|
||||
if(!StringUtil.isEmpty(ids)){
|
||||
String[] idArray = ids.split(",");
|
||||
for(String id :idArray){
|
||||
@@ -61,6 +62,7 @@ public class ServiceDictInfoController extends BaseController {
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.error("审核添加取消来函信息失败",e);
|
||||
LogUtils.saveLog(request, null, e, null);
|
||||
return "false";
|
||||
}
|
||||
}
|
||||
@@ -76,7 +78,7 @@ public class ServiceDictInfoController extends BaseController {
|
||||
*/
|
||||
@ResponseBody
|
||||
@RequestMapping(value="requestCancleInfoNumber")
|
||||
public Map requestCancleInfoNumber(String ids,String indexTable){
|
||||
public Map requestCancleInfoNumber(String ids,String indexTable,HttpServletRequest request){
|
||||
List list = new ArrayList();
|
||||
String requestTitle="";
|
||||
Map map=new HashMap();
|
||||
@@ -94,6 +96,7 @@ public class ServiceDictInfoController extends BaseController {
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.error("查询取消审核来函信息失败",e);
|
||||
LogUtils.saveLog(request, null, e, null);
|
||||
return map;
|
||||
}
|
||||
// }
|
||||
@@ -207,7 +210,7 @@ public class ServiceDictInfoController extends BaseController {
|
||||
*/
|
||||
@RequiresPermissions(value={"basics:classification:add","basics:attribute:add","basics:label:add","basics:vpn_ip:add","basics:classification:edit","basics:attribute:edit","basics:label:edit","basics:vpn_ip:edit"},logical=Logical.OR)
|
||||
@RequestMapping(value = "saveOrUpdate")
|
||||
public String saveOrUpdate(ServiceDictInfo serviceDictInfo,Model model, RedirectAttributes redirectAttributes,String itType) {
|
||||
public String saveOrUpdate(ServiceDictInfo serviceDictInfo,Model model, RedirectAttributes redirectAttributes,String itType,HttpServletRequest request) {
|
||||
|
||||
try {
|
||||
serviceDictInfoService.saveOrUpdate(serviceDictInfo);
|
||||
@@ -215,6 +218,7 @@ public class ServiceDictInfoController extends BaseController {
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
addMessage(redirectAttributes,"error", "save_failed");
|
||||
LogUtils.saveLog(request, null, e, null);
|
||||
}
|
||||
|
||||
return "redirect:" + adminPath + "/basics/serviceDictInfo/list?itType="+itType;
|
||||
@@ -231,7 +235,7 @@ public class ServiceDictInfoController extends BaseController {
|
||||
*/
|
||||
@RequiresPermissions(value={"basics:classification:del","basics:attribute:del","basics:label:del","basics:vpn_ip:del"},logical=Logical.OR)
|
||||
@RequestMapping(value={"delete"})
|
||||
public String delete(ServiceDictInfo serviceDictInfo, RedirectAttributes redirectAttributes, String itType, String mulitId) {
|
||||
public String delete(ServiceDictInfo serviceDictInfo, RedirectAttributes redirectAttributes, String itType, String mulitId,HttpServletRequest request) {
|
||||
try {
|
||||
String exIp="";
|
||||
String id="";
|
||||
@@ -266,6 +270,7 @@ public class ServiceDictInfoController extends BaseController {
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
addMessage(redirectAttributes,"error", "delete_failed");
|
||||
LogUtils.saveLog(request, null, e, null);
|
||||
}
|
||||
return "redirect:" + adminPath + "/basics/serviceDictInfo/list?itType="+itType;
|
||||
}
|
||||
@@ -586,6 +591,7 @@ public class ServiceDictInfoController extends BaseController {
|
||||
} catch (Exception e) {
|
||||
logger.error("dict white export failed", e);
|
||||
addMessage(redirectAttributes, "error", "export_failed");
|
||||
LogUtils.saveLog(request, null, e, null);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -25,6 +25,7 @@ import com.nis.domain.basics.ServiceDictInfo;
|
||||
import com.nis.domain.basics.SysDictInfo;
|
||||
import com.nis.util.ConfigDictUtils;
|
||||
import com.nis.util.Configurations;
|
||||
import com.nis.util.LogUtils;
|
||||
import com.nis.util.StringUtil;
|
||||
import com.nis.util.StringUtils;
|
||||
import com.nis.web.controller.BaseController;
|
||||
@@ -151,7 +152,7 @@ public class SysDictInfoController extends BaseController {
|
||||
*/
|
||||
@RequiresPermissions(value={"basics:area:add","basics:isp:add","basics:scope:add","basics:area:edit","basics:isp:edit","basics:scope:edit"},logical=Logical.OR)
|
||||
@RequestMapping(value = "saveOrUpdate")
|
||||
public String saveOrUpdate(SysDictInfo sysDictInfo,Model model, RedirectAttributes redirectAttributes, String itType) {
|
||||
public String saveOrUpdate(SysDictInfo sysDictInfo,Model model, RedirectAttributes redirectAttributes, String itType,HttpServletRequest request) {
|
||||
|
||||
try {
|
||||
sysDictInfoService.saveOrUpdate(sysDictInfo);
|
||||
@@ -159,6 +160,7 @@ public class SysDictInfoController extends BaseController {
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
addMessage(redirectAttributes,"error", "save_failed");
|
||||
LogUtils.saveLog(request, null, e, null);
|
||||
}
|
||||
|
||||
return "redirect:" + adminPath + "/basics/sysDictInfo/list?itType="+itType;
|
||||
@@ -172,13 +174,14 @@ public class SysDictInfoController extends BaseController {
|
||||
*/
|
||||
@RequiresPermissions(value={"basics:area:del","basics:isp:del","basics:scope:del"},logical=Logical.OR)
|
||||
@RequestMapping(value={"delete"})
|
||||
public String delete(SysDictInfo sysDictInfo, RedirectAttributes redirectAttributes, String itType, String mulitId) {
|
||||
public String delete(SysDictInfo sysDictInfo, RedirectAttributes redirectAttributes, String itType, String mulitId,HttpServletRequest request) {
|
||||
try {
|
||||
sysDictInfoService.deleteDict(mulitId);
|
||||
addMessage(redirectAttributes,"success", "delete_success");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
addMessage(redirectAttributes,"error", "delete_failed");
|
||||
LogUtils.saveLog(request, null, e, null);
|
||||
}
|
||||
return "redirect:" + adminPath + "/basics/sysDictInfo/list?itType="+itType;
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@ import com.nis.domain.configuration.RequestInfo;
|
||||
import com.nis.domain.configuration.TaskInfo;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.util.DateUtils;
|
||||
import com.nis.util.LogUtils;
|
||||
import com.nis.util.StringUtil;
|
||||
import com.nis.util.excel.ExcelField;
|
||||
import com.nis.web.controller.BaseController;
|
||||
@@ -90,6 +91,7 @@ public class TaskInfoController extends BaseController{
|
||||
logger.error(e.getMessage());
|
||||
e.printStackTrace();
|
||||
addMessage(redirectAttributes,"error", "save_failed");
|
||||
LogUtils.saveLog(request, null, e, null);
|
||||
}
|
||||
return "redirect:" + adminPath + "/basics/taskInfo/list?functionId="+taskInfo.getFunctionId()+"&repage";
|
||||
}
|
||||
@@ -233,6 +235,7 @@ public class TaskInfoController extends BaseController{
|
||||
} catch (Exception e) {
|
||||
logger.error("ip addr export failed",e);
|
||||
addMessage(redirectAttributes,"error", "export_failed");
|
||||
LogUtils.saveLog(request, null, e, null);
|
||||
}
|
||||
//return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,318 @@
|
||||
package com.nis.web.controller.basics;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.BlockingQueue;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.jets3t.service.ServiceException;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
||||
|
||||
import com.beust.jcommander.internal.Lists;
|
||||
import com.nis.domain.FunctionRegionDict;
|
||||
import com.nis.domain.FunctionServiceDict;
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.basics.CommonGroupInfo;
|
||||
import com.nis.domain.basics.UrlCommCfg;
|
||||
import com.nis.domain.configuration.BaseStringCfg;
|
||||
import com.nis.domain.configuration.CfgIndexInfo;
|
||||
import com.nis.domain.configuration.template.UrlCommCfgTemplate;
|
||||
import com.nis.exceptions.MaatConvertException;
|
||||
import com.nis.util.ConfigServiceUtil;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.util.DictUtils;
|
||||
import com.nis.util.StringUtil;
|
||||
import com.nis.util.excel.ImportBigExcel;
|
||||
import com.nis.web.controller.BaseController;
|
||||
import com.nis.web.security.UserUtils;
|
||||
import com.nis.web.service.basics.UrlCommGroupService;
|
||||
|
||||
@Controller
|
||||
@RequestMapping(value = "${adminPath}/basics/url")
|
||||
public class UrlCommGroupController extends BaseController{
|
||||
|
||||
@Autowired
|
||||
private UrlCommGroupService urlCommGroupService;
|
||||
|
||||
@RequestMapping(value = {"/list"})
|
||||
public String list(Model model, @ModelAttribute("cfg")UrlCommCfg entity, HttpServletRequest request,HttpServletResponse response){
|
||||
Page<UrlCommCfg> page = urlCommGroupService.findPage(new Page<UrlCommCfg>(request, response,"r"), entity);
|
||||
List<FunctionRegionDict> regionList = DictUtils.getFunctionRegionDictList(entity.getFunctionId());
|
||||
List<FunctionServiceDict> serviceList = DictUtils.getFunctionServiceDictList(entity.getFunctionId());
|
||||
List<CommonGroupInfo> groupInfos = commonGroupManageService.findCommonGroupInfosByType(Constants.URL_OBJ_GROUP_TYPE);
|
||||
|
||||
model.addAttribute("page", page);
|
||||
model.addAttribute("regionList", regionList);
|
||||
model.addAttribute("serviceList", serviceList);
|
||||
model.addAttribute("policyGroupInfos", groupInfos);
|
||||
return "/basics/urlCommGroupList";
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"/addForm"})
|
||||
public String addForm(Model model, @ModelAttribute("cfg")CfgIndexInfo cfg, RedirectAttributes redirectAttributes,
|
||||
HttpServletRequest request, HttpServletResponse response){
|
||||
initFormCondition(model,cfg);
|
||||
/*List<CommonGroupInfo> groupInfos=commonGroupManageService.findCommonGroupInfosByType(Constants.URL_OBJ_GROUP_TYPE);
|
||||
model.addAttribute("policyGroupInfos", groupInfos);*/
|
||||
|
||||
model.addAttribute("_cfg", cfg);
|
||||
return "/basics/urlCommGroupFormAdd";
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"/save"})
|
||||
public String save(Model model, @ModelAttribute("cfg")CfgIndexInfo cfg,RedirectAttributes redirectAttributes,
|
||||
HttpServletRequest request,HttpServletResponse response){
|
||||
try{
|
||||
urlCommGroupService.saveUrlCommGroupCfg(cfg);
|
||||
addMessage(redirectAttributes,"success","save_success");
|
||||
}catch(Exception e){
|
||||
logger.error("信息保存失败",e);
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error",e.getMessage());
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error","save_failed");
|
||||
}
|
||||
}
|
||||
|
||||
return "redirect:" + adminPath +"/basics/url/list?functionId="+cfg.getFunctionId();
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"/updateForm"})
|
||||
public String updateForm(Model model,HttpServletRequest request
|
||||
,HttpServletResponse response,String ids,@ModelAttribute("cfg")UrlCommCfg cfg
|
||||
,RedirectAttributes redirectAttributes){
|
||||
cfg = urlCommGroupService.get(Long.parseLong(ids));
|
||||
initUpdateFormCondition(model,cfg);
|
||||
List<CommonGroupInfo> groupInfos=commonGroupManageService.findCommonGroupInfosByType(Constants.URL_OBJ_GROUP_TYPE);
|
||||
model.addAttribute("policyGroupInfos", groupInfos);
|
||||
model.addAttribute("_cfg", cfg);
|
||||
return "/basics/urlCommGroupFormUpdate";
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"/update"})
|
||||
public String update(Model model,HttpServletRequest request,HttpServletResponse response,@ModelAttribute("cfg")UrlCommCfg cfg,RedirectAttributes redirectAttributes){
|
||||
try{
|
||||
urlCommGroupService.update(cfg);
|
||||
addMessage(redirectAttributes,"success","save_success");
|
||||
}catch(Exception e){
|
||||
logger.error("信息保存失败",e);
|
||||
addMessage(redirectAttributes,"error","save_failed");
|
||||
}
|
||||
|
||||
return "redirect:" + adminPath +"/basics/url/list?functionId="+cfg.getFunctionId();
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"/delete"})
|
||||
public String delete(String groupIds, String ids, Integer functionId, RedirectAttributes redirectAttributes,
|
||||
HttpServletRequest request, HttpServletResponse response, @ModelAttribute("cfg")UrlCommCfg cfg){
|
||||
try{
|
||||
urlCommGroupService.delete(ids, groupIds, cfg, request, response);
|
||||
addMessage(redirectAttributes,"success","delete_success");
|
||||
}catch(Exception e){
|
||||
logger.error("Delete failed",e);
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error",e.getMessage());
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error","delete_failed");
|
||||
}
|
||||
}
|
||||
|
||||
return "redirect:" + adminPath +"/basics/url/list?functionId="+functionId;
|
||||
}
|
||||
|
||||
// 批量删除前获取提示信息
|
||||
@ResponseBody
|
||||
@RequestMapping(value="ajaxCheckIsLastOneCfgBatch",method=RequestMethod.POST)
|
||||
public List<Integer> ajaxCheckIsLastOneCfgBatch(Model model, UrlCommCfg searchCfg){
|
||||
return urlCommGroupService.ajaxCheckIsLastOneCfgBatch(searchCfg);
|
||||
}
|
||||
|
||||
// 数据导入
|
||||
@RequestMapping(value = "import", method=RequestMethod.POST)
|
||||
public String importIp(HttpServletRequest request,HttpServletResponse response,RedirectAttributes redirectAttributes,
|
||||
@RequestParam("files") MultipartFile[] files, Integer serviceDictId ,Integer requestId ,String attribute ,String classify
|
||||
,String regionDictIds ,String importPath) {
|
||||
logger.warn("import start...");
|
||||
long start=System.currentTimeMillis();
|
||||
ImportBigExcel ei=null;
|
||||
try {
|
||||
FunctionServiceDict serviceDict = DictUtils.getFunctionServiceDict(serviceDictId);
|
||||
StringBuffer errTip=new StringBuffer();
|
||||
BlockingQueue<BaseStringCfg<?>> stringCfgs =null;
|
||||
|
||||
for (int i = 0; i < files.length; i++) {
|
||||
MultipartFile file = files[i];
|
||||
ei = new ImportBigExcel(file, 0, 1);
|
||||
FunctionRegionDict regionDict = DictUtils.getFunctionRegionDict(Integer.parseInt(regionDictIds.split(",")[i]));
|
||||
//加载模板
|
||||
loadTemplate(ei,regionDict, serviceDict);
|
||||
//------------------------------------check format start----------------------------
|
||||
if (regionDict.getRegionType().equals(2)) {
|
||||
BlockingQueue<UrlCommCfgTemplate> list = ei.getDataList(UrlCommCfgTemplate.class );
|
||||
stringCfgs = this.checkStringCfgMulity(errTip, serviceDict, regionDict, list);
|
||||
}
|
||||
//删除文件
|
||||
if(ei.getUploadFile()!=null&&ei.getUploadFile().exists()) {
|
||||
ei.getUploadFile().delete();
|
||||
}
|
||||
//------------------------------------check format end----------------------------
|
||||
Date date = new Date();
|
||||
//String isSend = request.getParameter("isSend")==null?"":request.getParameter("isSend");
|
||||
|
||||
if (regionDict.getRegionType().equals(2)) {
|
||||
List<BaseStringCfg<?>> _stringCfgs=Lists.newArrayList(Constants.MAAT_JSON_SEND_SIZE);
|
||||
while(!stringCfgs.isEmpty()) {
|
||||
stringCfgs.drainTo(_stringCfgs, Constants.MAAT_JSON_SEND_SIZE);
|
||||
|
||||
List<Integer> regionIds = Lists.newArrayList(_stringCfgs.size());
|
||||
try {
|
||||
regionIds = ConfigServiceUtil.getId(3,_stringCfgs.size());
|
||||
} catch (Exception e) {
|
||||
logger.error("获取域ID出错");
|
||||
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+e.getMessage());
|
||||
}
|
||||
|
||||
int index = 0;
|
||||
Set<String> countSet = new HashSet<String>();
|
||||
for (BaseStringCfg<?> cfg : _stringCfgs) {
|
||||
cfg.setAction(serviceDict==null?null:serviceDict.getAction());
|
||||
cfg.setCfgRegionCode(regionDict.getConfigRegionCode());
|
||||
cfg.setCfgType(regionDict.getConfigRegionValue());
|
||||
cfg.setCreateTime(date);
|
||||
cfg.setCreatorId(UserUtils.getUser().getId());
|
||||
//cfg.setDoLog(2);
|
||||
cfg.setCompileId(0);
|
||||
cfg.setFunctionId(regionDict.getFunctionId());
|
||||
cfg.setIsAudit(Constants.AUDIT_NOT_YET);
|
||||
cfg.setIsValid(Constants.VALID_NO);
|
||||
cfg.setIsAreaEffective(0);
|
||||
cfg.setLable("0");
|
||||
cfg.setRequestId(StringUtil.isEmpty(requestId) ? 0 : requestId);
|
||||
cfg.setAttribute(attribute);
|
||||
cfg.setClassify(classify);
|
||||
cfg.setServiceId(serviceDict==null?null:serviceDict.getServiceId());
|
||||
cfg.setTableName("url_comm_cfg");
|
||||
cfg.setRegionId(regionIds.get(index));
|
||||
cfg.setGroupName(cfg.getGroupName().toUpperCase());
|
||||
countSet.add(cfg.getGroupName());
|
||||
index++;
|
||||
|
||||
}
|
||||
|
||||
List<CommonGroupInfo> insertGroupList = new ArrayList<CommonGroupInfo>();
|
||||
Map<String, Integer> groupIdMap = commonGroupManageService.getCountByGroupName(countSet, insertGroupList, Constants.URL_OBJ_GROUP_TYPE); // 调用服务接口获取GroupId
|
||||
urlCommGroupService.saveAndSend(regionDict, serviceDict, _stringCfgs, groupIdMap, insertGroupList);
|
||||
_stringCfgs.clear();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
if(errTip.toString().length()>0) {
|
||||
addMessage(redirectAttributes,"error", errTip.toString());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
if(ei!=null) {
|
||||
if(ei.getUploadFile().exists()) {
|
||||
ei.getUploadFile().delete();
|
||||
}
|
||||
}
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
||||
}else if(e instanceof ServiceException) {
|
||||
addMessage(redirectAttributes,"error", e.getMessage());
|
||||
}else if(e instanceof IndexOutOfBoundsException){
|
||||
addMessage(redirectAttributes,"error", "template_error");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error", "import_failed");
|
||||
}
|
||||
logger.error("import failed", e);
|
||||
}
|
||||
long end=System.currentTimeMillis();
|
||||
logger.warn("import finish,cost:"+(end-start));
|
||||
return "redirect:" + adminPath+ importPath;
|
||||
}
|
||||
|
||||
// 数据导出
|
||||
@RequestMapping(value = "/exportUrlComm")
|
||||
public void exportUrlComm(Model model,HttpServletRequest request,HttpServletResponse response,
|
||||
@ModelAttribute("cfg")UrlCommCfg entity,String ids,RedirectAttributes redirectAttributes){
|
||||
try {
|
||||
List<String> titleList=new ArrayList<String>();
|
||||
Map<String, Class<?>> classMap=new HashMap<String, Class<?>>();
|
||||
Map<String, List> dataMap=new HashMap<String, List>();
|
||||
Map<String, String> noExportMap=new HashMap<String, String>();
|
||||
List<UrlCommCfg> list = new ArrayList<UrlCommCfg>();
|
||||
if (!StringUtil.isEmpty(ids)) {
|
||||
list = urlCommGroupService.findByPage(ids);
|
||||
} else {
|
||||
Page<UrlCommCfg> pageInfo=new Page<UrlCommCfg>(request, response,"r");
|
||||
pageInfo.setPageNo(1);
|
||||
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
|
||||
Page<UrlCommCfg> page = urlCommGroupService.findPage(pageInfo, entity);
|
||||
list=page.getList();
|
||||
}
|
||||
|
||||
CommonGroupInfo groupInfo = new CommonGroupInfo();
|
||||
for (UrlCommCfg cfg : list) {
|
||||
groupInfo.setServiceGroupId(cfg.getGroupId());
|
||||
CommonGroupInfo commonGroupInfo = commonGroupManageService.getGroupInfo(groupInfo);
|
||||
cfg.setGroupName(commonGroupInfo.getGroupName());
|
||||
|
||||
}
|
||||
|
||||
titleList.add(entity.getMenuNameCode());
|
||||
classMap.put(entity.getMenuNameCode(), UrlCommCfg.class);
|
||||
String cfgIndexInfoNoExport=",block_type,do_log,action,letter,whether_area_block,classification,attribute,label"
|
||||
+ ",userregion1,userregion2,userregion3,userregion4,userregion5,ir_type,asn_no,"
|
||||
+ "is_hex,is_case_insenstive,cfg_id,is_audit,auditor,valid_identifier,";
|
||||
// 时间过滤
|
||||
if (entity.getSearch_create_time_start() == null ) {
|
||||
cfgIndexInfoNoExport = ",config_time" + cfgIndexInfoNoExport;
|
||||
}
|
||||
if (entity.getSearch_edit_time_start() == null) {
|
||||
cfgIndexInfoNoExport = ",edit_time" + cfgIndexInfoNoExport;
|
||||
}
|
||||
if (entity.getSearch_audit_time_start() == null) {
|
||||
cfgIndexInfoNoExport = ",audit_time" + cfgIndexInfoNoExport;
|
||||
}
|
||||
if (!StringUtil.isEmpty(entity.gethColumns())) {
|
||||
cfgIndexInfoNoExport = "," + entity.gethColumns() + "," + cfgIndexInfoNoExport;
|
||||
}
|
||||
|
||||
noExportMap.put(entity.getMenuNameCode(),cfgIndexInfoNoExport);
|
||||
dataMap.put(entity.getMenuNameCode(), list);
|
||||
String timeRange = initTimeMap(entity);
|
||||
noExportMap.put("timeRange", timeRange);
|
||||
|
||||
if ("csv".equals(entity.getExType())) {
|
||||
this._exportCsv(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||
classMap, dataMap, noExportMap);
|
||||
} else {
|
||||
this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||
classMap, dataMap, noExportMap);
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
logger.error("urlGroupConfig export failed",e);
|
||||
addMessage(redirectAttributes,"error","export_failed");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user