1:按照ysp数据库文档修改各个业务类型对应的表名
2:修改maatConfig中域和分组map为list<map> 3:删除maat.xml中关于redisDBIndex的配置
This commit is contained in:
@@ -8,7 +8,7 @@ public class MaatXmlExpr implements Serializable {
|
||||
private String keyExpression;
|
||||
private String valueExpression;
|
||||
private Integer type;
|
||||
private Integer redisDB;
|
||||
//private Integer redisDB;
|
||||
|
||||
public String getKeyExpression() {
|
||||
return keyExpression;
|
||||
@@ -26,9 +26,6 @@ public class MaatXmlExpr implements Serializable {
|
||||
this.valueExpression = valueExpression;
|
||||
}
|
||||
|
||||
public Integer getRedisDB() {
|
||||
return redisDB;
|
||||
}
|
||||
|
||||
public Integer getType() {
|
||||
return type;
|
||||
@@ -38,8 +35,5 @@ public class MaatXmlExpr implements Serializable {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public void setRedisDB(Integer redisDB) {
|
||||
this.redisDB = redisDB;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ public class MaatXmlSeq implements Serializable {
|
||||
|
||||
private String sequenceKey;
|
||||
private Integer operation;
|
||||
private Integer redisDB;
|
||||
// private Integer redisDB;
|
||||
|
||||
public String getSequenceKey() {
|
||||
return sequenceKey;
|
||||
@@ -26,12 +26,4 @@ public class MaatXmlSeq implements Serializable {
|
||||
this.operation = operation;
|
||||
}
|
||||
|
||||
public Integer getRedisDB() {
|
||||
return redisDB;
|
||||
}
|
||||
|
||||
public void setRedisDB(Integer redisDB) {
|
||||
this.redisDB = redisDB;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.nis.domain.restful;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
@@ -22,23 +23,31 @@ public class MaatConfig implements Serializable {
|
||||
/**
|
||||
* 分组配置
|
||||
*/
|
||||
private Map<String, String> groupMap;
|
||||
private List<Map<String, String>> groupMapList;
|
||||
/**
|
||||
* ip域配置
|
||||
*/
|
||||
private Map<String, String> ipRegionMap;
|
||||
private List<Map<String, String>> ipRegionMapList;
|
||||
/**
|
||||
* 数值域配置
|
||||
*/
|
||||
private Map<String, String> numRegionMap;
|
||||
private List<Map<String, String>> numRegionMapList;
|
||||
/**
|
||||
* 字符串域配置
|
||||
*/
|
||||
private Map<String, String> strRegionMap;
|
||||
private List<Map<String, String>> strRegionMapList;
|
||||
/**
|
||||
* 增强字符串域配置
|
||||
*/
|
||||
private Map<String, String> strStrRegionMap;
|
||||
private List<Map<String, String>> strStrRegionMapList;
|
||||
/**
|
||||
* 文件摘要类域配置
|
||||
*/
|
||||
private List<Map<String, String>> fileDigestRegionMapList;
|
||||
/**
|
||||
* 文本相似性域配置
|
||||
*/
|
||||
private List<Map<String, String>> fileLikeRegionMapList;
|
||||
|
||||
/**
|
||||
* 业务类型
|
||||
@@ -53,44 +62,60 @@ public class MaatConfig implements Serializable {
|
||||
this.compileMap = compileMap;
|
||||
}
|
||||
|
||||
public Map<String, String> getGroupMap() {
|
||||
return groupMap;
|
||||
public List<Map<String, String>> getGroupMapList() {
|
||||
return groupMapList;
|
||||
}
|
||||
|
||||
public void setGroupMap(Map<String, String> groupMap) {
|
||||
this.groupMap = groupMap;
|
||||
public void setGroupMapList(List<Map<String, String>> groupMapList) {
|
||||
this.groupMapList = groupMapList;
|
||||
}
|
||||
|
||||
public Map<String, String> getIpRegionMap() {
|
||||
return ipRegionMap;
|
||||
public List<Map<String, String>> getIpRegionMapList() {
|
||||
return ipRegionMapList;
|
||||
}
|
||||
|
||||
public void setIpRegionMap(Map<String, String> ipRegionMap) {
|
||||
this.ipRegionMap = ipRegionMap;
|
||||
public void setIpRegionMapList(List<Map<String, String>> ipRegionMapList) {
|
||||
this.ipRegionMapList = ipRegionMapList;
|
||||
}
|
||||
|
||||
public Map<String, String> getNumRegionMap() {
|
||||
return numRegionMap;
|
||||
public List<Map<String, String>> getNumRegionMapList() {
|
||||
return numRegionMapList;
|
||||
}
|
||||
|
||||
public void setNumRegionMap(Map<String, String> numRegionMap) {
|
||||
this.numRegionMap = numRegionMap;
|
||||
public void setNumRegionMapList(List<Map<String, String>> numRegionMapList) {
|
||||
this.numRegionMapList = numRegionMapList;
|
||||
}
|
||||
|
||||
public Map<String, String> getStrRegionMap() {
|
||||
return strRegionMap;
|
||||
public List<Map<String, String>> getStrRegionMapList() {
|
||||
return strRegionMapList;
|
||||
}
|
||||
|
||||
public void setStrRegionMap(Map<String, String> strRegionMap) {
|
||||
this.strRegionMap = strRegionMap;
|
||||
public void setStrRegionMapList(List<Map<String, String>> strRegionMapList) {
|
||||
this.strRegionMapList = strRegionMapList;
|
||||
}
|
||||
|
||||
public Map<String, String> getStrStrRegionMap() {
|
||||
return strStrRegionMap;
|
||||
public List<Map<String, String>> getStrStrRegionMapList() {
|
||||
return strStrRegionMapList;
|
||||
}
|
||||
|
||||
public void setStrStrRegionMap(Map<String, String> strStrRegionMap) {
|
||||
this.strStrRegionMap = strStrRegionMap;
|
||||
public void setStrStrRegionMapList(List<Map<String, String>> strStrRegionMapList) {
|
||||
this.strStrRegionMapList = strStrRegionMapList;
|
||||
}
|
||||
|
||||
public List<Map<String, String>> getFileDigestRegionMapList() {
|
||||
return fileDigestRegionMapList;
|
||||
}
|
||||
|
||||
public void setFileDigestRegionMapList(List<Map<String, String>> fileDigestRegionMapList) {
|
||||
this.fileDigestRegionMapList = fileDigestRegionMapList;
|
||||
}
|
||||
|
||||
public List<Map<String, String>> getFileLikeRegionMapList() {
|
||||
return fileLikeRegionMapList;
|
||||
}
|
||||
|
||||
public void setFileLikeRegionMapList(List<Map<String, String>> fileLikeRegionMapList) {
|
||||
this.fileLikeRegionMapList = fileLikeRegionMapList;
|
||||
}
|
||||
|
||||
public Integer getService() {
|
||||
|
||||
154
src/main/java/com/nis/domain/restful/MaatRelation.java
Normal file
154
src/main/java/com/nis/domain/restful/MaatRelation.java
Normal file
@@ -0,0 +1,154 @@
|
||||
package com.nis.domain.restful;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class MaatRelation implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Map<Long, List<Long>> compileAndGroupMap;
|
||||
private Map<Long, List<Long>> groupAndCompileMap;
|
||||
// private Map<Long, List<Long>> regionAndGroupMap;
|
||||
private Map<Long, List<Long>> groupAndRegionMap;
|
||||
|
||||
public Map<Long, List<Long>> getCompileAndGroupMap() {
|
||||
return compileAndGroupMap;
|
||||
}
|
||||
|
||||
public void setCompileAndGroupMap(Map<Long, List<Long>> compileAndGroupMap) {
|
||||
this.compileAndGroupMap = compileAndGroupMap;
|
||||
}
|
||||
|
||||
public Map<Long, List<Long>> getGroupAndCompileMap() {
|
||||
return groupAndCompileMap;
|
||||
}
|
||||
|
||||
public void setGroupAndCompileMap(Map<Long, List<Long>> groupAndCompileMap) {
|
||||
this.groupAndCompileMap = groupAndCompileMap;
|
||||
}
|
||||
|
||||
public Map<Long, List<Long>> getGroupAndRegionMap() {
|
||||
return groupAndRegionMap;
|
||||
}
|
||||
|
||||
public void setGroupAndRegionMap(Map<Long, List<Long>> groupAndRegionMap) {
|
||||
this.groupAndRegionMap = groupAndRegionMap;
|
||||
}
|
||||
|
||||
public static void removKey(MaatRelation maatRelation, long compileId) {
|
||||
|
||||
if (maatRelation.getCompileAndGroupMap().containsKey(compileId)) {
|
||||
List<Long> list = maatRelation.getCompileAndGroupMap().get(compileId);
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
Long groupId = list.get(i);
|
||||
// }
|
||||
// for (Long groupId: list.size()) {
|
||||
if (maatRelation.getGroupAndCompileMap().containsKey(groupId)) {
|
||||
// && maatRelation.getGroupAndCompileMap().get(groupId).size() == 1
|
||||
// && maatRelation.getGroupAndCompileMap().get(groupId).get(0).longValue() ==
|
||||
// compileId) {
|
||||
List<Long> compileIdList = maatRelation.getGroupAndCompileMap().get(groupId);
|
||||
if (compileIdList.size() == 1) {// 当前的groupid只属于当前的compileid,没有被分组复用,需要将编译配置,分组关系,域配置,置无效
|
||||
for (Long id : compileIdList) {
|
||||
if (id.longValue() == compileId) {
|
||||
// 这个group没有被分组复用,所以需要将这个组下面的域配置置为无效,组也要置为无效
|
||||
if (maatRelation.getGroupAndRegionMap().containsKey(groupId)) {
|
||||
// 把当前组置为无效,把当前组下的所有域置为无效
|
||||
maatRelation.getGroupAndRegionMap().remove(groupId);// 删除组对应的域
|
||||
maatRelation.getGroupAndCompileMap().remove(groupId);// 删除当前组所对应的编译
|
||||
// maatRelation.getCompileAndGroupMap().get(compileId).indexOf(groupId);
|
||||
// maatRelation.getCompileAndGroupMap().get(compileId)
|
||||
list.remove(maatRelation.getCompileAndGroupMap().get(compileId).indexOf(groupId));// 删除编译下面的组
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
// 这个组对应了多个编译配置被分组复用了,这时将这个组和编译的关系置为无效,编译置为无效
|
||||
list.remove(maatRelation.getCompileAndGroupMap().get(compileId).indexOf(groupId));// 删除编译下面的这个组
|
||||
maatRelation.getGroupAndCompileMap().get(groupId)
|
||||
.remove(maatRelation.getGroupAndCompileMap().get(groupId).indexOf(compileId));// 删除分组关系中的组和编译关系
|
||||
}
|
||||
} else {
|
||||
// 当前的groupid属于多个组,被分组复用了,所以不对这个组进行操作,也不对这个组下面的域进行操作
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public static void syso(MaatRelation maatRelation) {
|
||||
Map<Long, List<Long>> getCompileAndGroupMap = maatRelation.getCompileAndGroupMap();
|
||||
for (Long compile : getCompileAndGroupMap.keySet()) {
|
||||
List<Long> groupList = getCompileAndGroupMap.get(compile);
|
||||
for (Long group : groupList) {
|
||||
System.out.println("编译:" + compile + "组:" + group);
|
||||
}
|
||||
}
|
||||
Map<Long, List<Long>> getGroupAndCompileMap = maatRelation.getGroupAndCompileMap();
|
||||
for (Long group : getGroupAndCompileMap.keySet()) {
|
||||
List<Long> compileList = getGroupAndCompileMap.get(group);
|
||||
for (Long compile : compileList) {
|
||||
System.out.println("组:" + group + "编译:" + compile);
|
||||
}
|
||||
}
|
||||
Map<Long, List<Long>> getGroupAndRegionMap = maatRelation.getGroupAndRegionMap();
|
||||
for (Long group : getGroupAndRegionMap.keySet()) {
|
||||
List<Long> regionList = getGroupAndRegionMap.get(group);
|
||||
for (Long region : regionList) {
|
||||
System.out.println("组:" + group + "域:" + region);
|
||||
}
|
||||
}
|
||||
|
||||
System.out.println();
|
||||
System.out.println();
|
||||
System.out.println();
|
||||
System.out.println();
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
MaatRelation maatRelation = getMaat();
|
||||
syso(maatRelation);
|
||||
|
||||
long compileId = 11;
|
||||
removKey(maatRelation, compileId);
|
||||
syso(maatRelation);
|
||||
|
||||
compileId = 2;
|
||||
removKey(maatRelation, compileId);
|
||||
syso(maatRelation);
|
||||
}
|
||||
|
||||
public static MaatRelation getMaat() {
|
||||
MaatRelation maatRelation = new MaatRelation();
|
||||
Map<Long, List<Long>> compileAndGroupMap = new HashMap<Long, List<Long>>();
|
||||
List<Long> list = new ArrayList<Long>();
|
||||
list.add(1l);
|
||||
compileAndGroupMap.put(1l, list);
|
||||
list = new ArrayList<Long>();
|
||||
list.add(1l);
|
||||
compileAndGroupMap.put(2l, list);
|
||||
Map<Long, List<Long>> groupAndCompileMap = new HashMap<Long, List<Long>>();
|
||||
list = new ArrayList<Long>();
|
||||
list.add(1l);
|
||||
list.add(2l);
|
||||
groupAndCompileMap.put(1l, list);
|
||||
// Map<Long, List<Long>> regionAndGroupMap = new HashMap<Long, List<Long>>();
|
||||
list = new ArrayList<Long>();
|
||||
list.add(1l);
|
||||
// regionAndGroupMap.put(1l, list);
|
||||
Map<Long, List<Long>> groupAndRegionMap = new HashMap<Long, List<Long>>();
|
||||
groupAndRegionMap.put(1l, list);
|
||||
maatRelation.setCompileAndGroupMap(compileAndGroupMap);
|
||||
maatRelation.setGroupAndCompileMap(groupAndCompileMap);
|
||||
maatRelation.setGroupAndRegionMap(groupAndRegionMap);
|
||||
// maatRelation.setRegionAndGroupMap(regionAndGroupMap);
|
||||
|
||||
return maatRelation;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -57,12 +57,12 @@ public class ReadMaatXmlUtil {
|
||||
MaatXmlConfig maatXmlConfig = map.get(key);
|
||||
List<MaatXmlExpr> expressionList = maatXmlConfig.getExpressionList();
|
||||
for (MaatXmlExpr maatXmlExpr : expressionList) {
|
||||
System.out.println("service=" + key + " redisDB=" + maatXmlExpr.getRedisDB() + " key="
|
||||
System.out.println("service=" + key + " key="
|
||||
+ maatXmlExpr.getKeyExpression() + " value=" + maatXmlExpr.getValueExpression());
|
||||
}
|
||||
List<MaatXmlSeq> sequenceList = maatXmlConfig.getSequenceList();
|
||||
for (MaatXmlSeq maatXmlSeq : sequenceList) {
|
||||
System.out.println("service=" + key + " redisDB=" + maatXmlSeq.getRedisDB() + " key="
|
||||
System.out.println("service=" + key + " key="
|
||||
+ maatXmlSeq.getSequenceKey() + " operation=" + maatXmlSeq.getOperation());
|
||||
}
|
||||
}
|
||||
@@ -97,9 +97,9 @@ public class ReadMaatXmlUtil {
|
||||
if (ele.getName().toLowerCase().equals("operation")) {
|
||||
maatXmlSeq.setOperation(Integer.parseInt(ele.getTextTrim()));
|
||||
}
|
||||
if (ele.getName().toLowerCase().equals("redisdb")) {
|
||||
maatXmlSeq.setRedisDB(Integer.parseInt(ele.getTextTrim()));
|
||||
}
|
||||
// if (ele.getName().toLowerCase().equals("redisdb")) {
|
||||
// maatXmlSeq.setRedisDB(Integer.parseInt(ele.getTextTrim()));
|
||||
// }
|
||||
if (ele.getName().toLowerCase().equals("sequencekey")) {
|
||||
maatXmlSeq.setSequenceKey(ele.getTextTrim());
|
||||
}
|
||||
@@ -126,16 +126,20 @@ public class ReadMaatXmlUtil {
|
||||
maatXmlExpr.setType(14);
|
||||
} else if (ele.getTextTrim().contains("str_str_region_table_name")) {
|
||||
maatXmlExpr.setType(15);
|
||||
} else {
|
||||
} else if (ele.getTextTrim().contains("file_digest_table_name")) {
|
||||
maatXmlExpr.setType(16);
|
||||
} else if (ele.getTextTrim().contains("file_like_table_name")) {
|
||||
maatXmlExpr.setType(17);
|
||||
} else {
|
||||
maatXmlExpr.setType(0);
|
||||
}
|
||||
}
|
||||
if (ele.getName().toLowerCase().equals("valueexpression")) {
|
||||
maatXmlExpr.setValueExpression(ele.getTextTrim());
|
||||
}
|
||||
if (ele.getName().toLowerCase().equals("redisdb")) {
|
||||
maatXmlExpr.setRedisDB(Integer.parseInt(ele.getTextTrim()));
|
||||
}
|
||||
// if (ele.getName().toLowerCase().equals("redisdb")) {
|
||||
// maatXmlExpr.setRedisDB(Integer.parseInt(ele.getTextTrim()));
|
||||
// }
|
||||
|
||||
}
|
||||
exprList.add(maatXmlExpr);
|
||||
|
||||
@@ -29,7 +29,6 @@ import com.nis.web.controller.BaseRestController;
|
||||
import com.nis.web.service.SaveRequestLogThread;
|
||||
import com.nis.web.service.ServicesRequestLogService;
|
||||
import com.nis.web.service.restful.ConfigRedisService;
|
||||
import com.nis.web.service.restful.ConfigRedisServiceimpl;
|
||||
import com.nis.web.service.restful.ConfigSourcesService;
|
||||
import com.wordnik.swagger.annotations.Api;
|
||||
import com.wordnik.swagger.annotations.ApiOperation;
|
||||
@@ -120,7 +119,8 @@ public class ConfigSourcesController extends BaseRestController {
|
||||
Map<String, String> configMap = new HashMap<String, String>();
|
||||
long seq_compileid = configRedisService.getIncrId("SEQ_COMPILEID");
|
||||
long seq_groupid = configRedisService.getIncrId("SEQ_GROUPID");
|
||||
long seq_regionid = configRedisService.getIncrId("SEQ_REGIONID");
|
||||
long seq_regionid1 = configRedisService.getIncrId("SEQ_REGIONID");
|
||||
long seq_regionid2 = configRedisService.getIncrId("SEQ_REGIONID");
|
||||
// int id=2;
|
||||
configMap.put("cfg_id", seq_compileid + "");
|
||||
configMap.put("service", service + "");
|
||||
@@ -133,16 +133,22 @@ public class ConfigSourcesController extends BaseRestController {
|
||||
configMap.put("group_num", "1");
|
||||
configMap.put("father_cfg_id", "0");
|
||||
configMap.put("op_time", time);
|
||||
|
||||
List<Map<String, String>> groupMapList = new ArrayList<Map<String, String>>();
|
||||
Map<String, String> groupMap = new HashMap<String, String>();
|
||||
groupMap.put("group_id", seq_groupid + "");
|
||||
groupMap.put("cfg_id", seq_compileid + "");
|
||||
groupMap.put("is_valid", "1");
|
||||
groupMap.put("op_time", time);
|
||||
groupMap.put("service", service + "");
|
||||
Map<String, String> strMap = new HashMap<String, String>();
|
||||
|
||||
groupMapList.add(groupMap);
|
||||
|
||||
List<Map<String, String>> ipRegionMapList = new ArrayList<Map<String, String>>();
|
||||
|
||||
Map<String, String> strMap = new HashMap<String, String>();
|
||||
strMap.put("group_id", seq_groupid + "");
|
||||
strMap.put("region_id", seq_regionid + "");
|
||||
strMap.put("region_id", seq_regionid1 + "");
|
||||
strMap.put("addr_type", "4");
|
||||
strMap.put("src_ip", "0.0.0.0");
|
||||
strMap.put("mask_src_ip", "255.255.255.255");
|
||||
@@ -158,11 +164,32 @@ public class ConfigSourcesController extends BaseRestController {
|
||||
strMap.put("op_time", time);
|
||||
strMap.put("service", service + "");
|
||||
|
||||
ipRegionMapList.add(strMap);
|
||||
|
||||
strMap = new HashMap<String, String>();
|
||||
strMap.put("group_id", seq_groupid + "");
|
||||
strMap.put("region_id", seq_regionid2 + "");
|
||||
strMap.put("addr_type", "4");
|
||||
strMap.put("src_ip", "0.0.0.0");
|
||||
strMap.put("mask_src_ip", "255.255.255.255");
|
||||
strMap.put("src_port", "0");
|
||||
strMap.put("mask_src_port", "0");
|
||||
strMap.put("dst_ip", "0.0.0.0");
|
||||
strMap.put("mask_dst_ip", "255.255.255.255");
|
||||
strMap.put("dst_port", "0");
|
||||
strMap.put("mask_dst_port", "0");
|
||||
strMap.put("protocol", "0");
|
||||
strMap.put("direction", "0");
|
||||
strMap.put("is_valid", "1");
|
||||
strMap.put("op_time", time);
|
||||
strMap.put("service", service + "");
|
||||
ipRegionMapList.add(strMap);
|
||||
|
||||
MaatConfig maatConfig = new MaatConfig();
|
||||
maatConfig.setCompileMap(configMap);
|
||||
maatConfig.setGroupMap(groupMap);
|
||||
maatConfig.setGroupMapList(groupMapList);
|
||||
maatConfig.setService(service);
|
||||
maatConfig.setIpRegionMap(strMap);
|
||||
maatConfig.setIpRegionMapList(ipRegionMapList);
|
||||
return maatConfig;
|
||||
}
|
||||
|
||||
|
||||
@@ -68,14 +68,13 @@ public class ConfigRedisServiceimpl extends BaseRedisDao<String, String> impleme
|
||||
@Transactional
|
||||
public void saveUnMaatConfig(List<Map<String, String>> listMap, int service) {
|
||||
if (listMap != null && listMap.size() > 0) {
|
||||
DynamicJedisDataBase.setRedisDataBase(getRedisDBByService(service), redisTemplate);
|
||||
String maatVersionStr = operRedisService.getMaatVersion(getRedisDBByService(service));
|
||||
if (maatVersionStr != null) {
|
||||
Long maatVersion = Long.valueOf(maatVersionStr) + 1;
|
||||
|
||||
for (Map<String, String> map : listMap) {
|
||||
// String serviceStr = map.get("service");
|
||||
// int service = Integer.parseInt(serviceStr);
|
||||
DynamicJedisDataBase.setRedisDataBase(getRedisDBByService(service), redisTemplate);
|
||||
MaatXmlConfig maatXmlConfig = ReadMaatXmlUtil.getMaatConfigByService(service);
|
||||
if (maatXmlConfig != null) {
|
||||
List<MaatXmlExpr> expressionList = maatXmlConfig.getExpressionList();
|
||||
@@ -170,7 +169,7 @@ public class ConfigRedisServiceimpl extends BaseRedisDao<String, String> impleme
|
||||
for (int i = 20; i < 30; i++) {
|
||||
redisTemplate.boundZSetOps("1").add("a" + i, i);
|
||||
if (i == 25) {
|
||||
int a = 1 / 0;
|
||||
// int a = 1 / 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -197,16 +196,48 @@ public class ConfigRedisServiceimpl extends BaseRedisDao<String, String> impleme
|
||||
public void setConfig(MaatConfig maatConfig, MaatXmlConfig maatXmlConfig, Long maatVersion, int service) {
|
||||
Map<String, String> compileMap = maatConfig.getCompileMap();
|
||||
setCommonConfig(maatXmlConfig, compileMap, 10, maatVersion.doubleValue(), service);// 10代表是编译配置
|
||||
Map<String, String> groupMap = maatConfig.getGroupMap();
|
||||
setCommonConfig(maatXmlConfig, groupMap, 11, maatVersion.doubleValue(), service);// 11代表是分组配置
|
||||
Map<String, String> ipRegionMap = maatConfig.getIpRegionMap();
|
||||
setCommonConfig(maatXmlConfig, ipRegionMap, 12, maatVersion.doubleValue(), service);// 12代表是ip类域配置
|
||||
Map<String, String> numRegionMap = maatConfig.getNumRegionMap();
|
||||
setCommonConfig(maatXmlConfig, numRegionMap, 13, maatVersion.doubleValue(), service);// 13代表是数值类配置
|
||||
Map<String, String> strRegionMap = maatConfig.getStrRegionMap();
|
||||
setCommonConfig(maatXmlConfig, strRegionMap, 14, maatVersion.doubleValue(), service);// 14代表是字符串类域配置
|
||||
Map<String, String> strStrRegionMap = maatConfig.getStrStrRegionMap();
|
||||
setCommonConfig(maatXmlConfig, strStrRegionMap, 15, maatVersion.doubleValue(), service);// 15代表是增强字符串类域配置
|
||||
List<Map<String, String>> groupMapList = maatConfig.getGroupMapList();
|
||||
if (groupMapList != null && groupMapList.size() > 0) {
|
||||
for (Map<String, String> map : groupMapList) {
|
||||
setCommonConfig(maatXmlConfig, map, 11, maatVersion.doubleValue(), service);// 11代表是分组配置
|
||||
}
|
||||
}
|
||||
List<Map<String, String>> ipRegionMapList = maatConfig.getIpRegionMapList();
|
||||
if (ipRegionMapList != null && ipRegionMapList.size() > 0) {
|
||||
for (Map<String, String> map : ipRegionMapList) {
|
||||
setCommonConfig(maatXmlConfig, map, 12, maatVersion.doubleValue(), service);// 12代表是ip类域配置
|
||||
}
|
||||
}
|
||||
List<Map<String, String>> numRegionMapList = maatConfig.getNumRegionMapList();
|
||||
if (numRegionMapList != null && numRegionMapList.size() > 0) {
|
||||
for (Map<String, String> map : numRegionMapList) {
|
||||
setCommonConfig(maatXmlConfig, map, 13, maatVersion.doubleValue(), service);// 13代表是数值类配置
|
||||
}
|
||||
}
|
||||
List<Map<String, String>> strRegionMapList = maatConfig.getStrRegionMapList();
|
||||
if (strRegionMapList != null && strRegionMapList.size() > 0) {
|
||||
for (Map<String, String> map : strRegionMapList) {
|
||||
setCommonConfig(maatXmlConfig, map, 14, maatVersion.doubleValue(), service);// 14代表是字符串类域配置
|
||||
}
|
||||
}
|
||||
List<Map<String, String>> strStrRegionMapList = maatConfig.getStrStrRegionMapList();
|
||||
if (strStrRegionMapList != null && strStrRegionMapList.size() > 0) {
|
||||
for (Map<String, String> map : strStrRegionMapList) {
|
||||
setCommonConfig(maatXmlConfig, map, 15, maatVersion.doubleValue(), service);// 15代表是增强字符串类域配置
|
||||
}
|
||||
}
|
||||
List<Map<String, String>> fileDigestRegionMapList = maatConfig.getFileDigestRegionMapList();
|
||||
if (fileDigestRegionMapList != null && fileDigestRegionMapList.size() > 0) {
|
||||
for (Map<String, String> map : fileDigestRegionMapList) {
|
||||
setCommonConfig(maatXmlConfig, map, 16, maatVersion.doubleValue(), service);// 16代表是文件摘要类域配置
|
||||
}
|
||||
}
|
||||
List<Map<String, String>> fileLikeRegionMapList = maatConfig.getFileLikeRegionMapList();
|
||||
if (fileLikeRegionMapList != null && fileLikeRegionMapList.size() > 0) {
|
||||
for (Map<String, String> map : fileLikeRegionMapList) {
|
||||
setCommonConfig(maatXmlConfig, map, 17, maatVersion.doubleValue(), service);// 17代表是文本相似性域配置
|
||||
}
|
||||
}
|
||||
updateCommonKey(maatXmlConfig);
|
||||
}
|
||||
|
||||
@@ -290,7 +321,7 @@ public class ConfigRedisServiceimpl extends BaseRedisDao<String, String> impleme
|
||||
}
|
||||
|
||||
public Long getIncrId(String key) {
|
||||
//DynamicJedisDataBase.setRedisDataBase(getRedisDBByService(service), redisTemplate);
|
||||
DynamicJedisDataBase.setRedisDataBase(2, redisTemplate);
|
||||
// RedisAtomicLong atomicLong = new RedisAtomicLong(key,
|
||||
// redisTemplate.getConnectionFactory());
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user