fix(配置文件)增加开发环境,清除中文空格问题
This commit is contained in:
@@ -29,6 +29,7 @@ import com.nis.restful.RestServiceException;
|
||||
import com.nis.restful.ServiceRuntimeException;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.util.FileUtils;
|
||||
import com.nis.util.MinioUtil;
|
||||
import com.nis.util.StringUtil;
|
||||
import com.nis.util.StringUtils;
|
||||
import com.nis.web.controller.BaseRestController;
|
||||
@@ -289,16 +290,20 @@ public class ConfigSourcesController extends BaseRestController {
|
||||
throw new RestServiceException("checksum与文件MD5值不一致", RestBusinessCode.CheckSumIsWrong.getValue());
|
||||
}
|
||||
String ext = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".") + 1);
|
||||
FastDFSFile fdsfile = new FastDFSFile(file.getBytes(), file.getOriginalFilename(), ext);
|
||||
// NameValuePair[] meta_list = new NameValuePair[5];
|
||||
// meta_list[0] = new NameValuePair("fileName", file.getOriginalFilename());
|
||||
// meta_list[1] = new NameValuePair("fileLength",
|
||||
// String.valueOf(file.getSize()));
|
||||
// meta_list[2] = new NameValuePair("fileExt", ext);
|
||||
// meta_list[3] = new NameValuePair("fileAuthor", "rkg");
|
||||
// meta_list[4] = new NameValuePair("fileMd5", md5);
|
||||
logger.info("-----------------调用接口上传文件---------------");
|
||||
filePath = FileManager.upload(fdsfile, null);
|
||||
if(Constants.IS_USE_MINIO){
|
||||
filePath = MinioUtil.uploadFile(file.getInputStream(), file.getOriginalFilename(), ext);
|
||||
}else{
|
||||
FastDFSFile fdsfile = new FastDFSFile(file.getBytes(), file.getOriginalFilename(), ext);
|
||||
// NameValuePair[] meta_list = new NameValuePair[5];
|
||||
// meta_list[0] = new NameValuePair("fileName", file.getOriginalFilename());
|
||||
// meta_list[1] = new NameValuePair("fileLength",
|
||||
// String.valueOf(file.getSize()));
|
||||
// meta_list[2] = new NameValuePair("fileExt", ext);
|
||||
// meta_list[3] = new NameValuePair("fileAuthor", "rkg");
|
||||
// meta_list[4] = new NameValuePair("fileMd5", md5);
|
||||
filePath = FileManager.upload(fdsfile, null);
|
||||
}
|
||||
}
|
||||
}catch (IOException e) {
|
||||
// TODO Auto-generated catch block
|
||||
@@ -337,6 +342,7 @@ public class ConfigSourcesController extends BaseRestController {
|
||||
AuditLogThread thread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_POST, request,
|
||||
file, null);
|
||||
JSONObject resultObject = new JSONObject();
|
||||
String filePath="";
|
||||
try {
|
||||
if (file == null) {
|
||||
throw new RestServiceException("请上传获取摘要的文件到file参数", RestBusinessCode.FileIsNull.getValue());
|
||||
@@ -353,9 +359,20 @@ public class ConfigSourcesController extends BaseRestController {
|
||||
RestBusinessCode.CheckSumIsWrong.getValue());
|
||||
}
|
||||
String ext = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".") + 1);
|
||||
FastDFSFile fdsfile = new FastDFSFile(file.getBytes(), file.getOriginalFilename(), ext);
|
||||
logger.info("-----------------调用接口上传文件---------------");
|
||||
String filePath = FileManager.upload(fdsfile, null);
|
||||
if(Constants.IS_USE_MINIO){
|
||||
filePath = MinioUtil.uploadFile(file.getInputStream(), file.getOriginalFilename(), ext);
|
||||
}else{
|
||||
FastDFSFile fdsfile = new FastDFSFile(file.getBytes(), file.getOriginalFilename(), ext);
|
||||
// NameValuePair[] meta_list = new NameValuePair[5];
|
||||
// meta_list[0] = new NameValuePair("fileName", file.getOriginalFilename());
|
||||
// meta_list[1] = new NameValuePair("fileLength",
|
||||
// String.valueOf(file.getSize()));
|
||||
// meta_list[2] = new NameValuePair("fileExt", ext);
|
||||
// meta_list[3] = new NameValuePair("fileAuthor", "rkg");
|
||||
// meta_list[4] = new NameValuePair("fileMd5", md5);
|
||||
filePath = FileManager.upload(fdsfile, null);
|
||||
}
|
||||
resultObject.put("accessUrl", filePath);
|
||||
}
|
||||
}catch (IOException e) {
|
||||
|
||||
@@ -11,7 +11,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.nis.domain.restful.TrafficNmsServerStatistic;
|
||||
import com.nis.domain.restful.NmsDiRuleList;
|
||||
import com.nis.domain.restful.TrafficNetflowPortInfoList;
|
||||
import com.nis.domain.restful.TrafficNmsServerStatisticList;
|
||||
import com.nis.restful.RestBusinessCode;
|
||||
import com.nis.restful.RestServiceException;
|
||||
@@ -19,6 +20,8 @@ import com.nis.util.Constants;
|
||||
import com.nis.web.controller.BaseRestController;
|
||||
import com.nis.web.service.AuditLogThread;
|
||||
import com.nis.web.service.ServicesRequestLogService;
|
||||
import com.nis.web.service.restful.NmsDiRuleService;
|
||||
import com.nis.web.service.restful.TrafficNetflowPortInfoService;
|
||||
import com.nis.web.service.restful.TrafficNmsServerStatisticService;
|
||||
import com.wordnik.swagger.annotations.Api;
|
||||
import com.wordnik.swagger.annotations.ApiOperation;
|
||||
@@ -32,6 +35,10 @@ public class NmsInfoController extends BaseRestController {
|
||||
protected ServicesRequestLogService servicesRequestLogService;
|
||||
@Autowired
|
||||
TrafficNmsServerStatisticService trafficNmsServerStatisticService;
|
||||
@Autowired
|
||||
NmsDiRuleService nmsDiRuleService;
|
||||
@Autowired
|
||||
TrafficNetflowPortInfoService trafficNetflowPortInfoService;
|
||||
|
||||
@RequestMapping(value = "/nms/v1/saveServerStatus", method = RequestMethod.POST)
|
||||
@ApiOperation(value = "存储NMS系统上报的服务器状态接口", httpMethod = "POST", response = Map.class, notes = "接收NMS系统上报的服务器状态信息")
|
||||
@@ -60,4 +67,55 @@ public class NmsInfoController extends BaseRestController {
|
||||
Constants.IS_DEBUG ? trafficNmsServerStatisticList : null);
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/nms/v1/saveNmsDiRule", method = RequestMethod.POST)
|
||||
@ApiOperation(value = "存储NmsDiRule接口", httpMethod = "POST", response = Map.class, notes = "接收NMS系统上报的di信息")
|
||||
@ApiParam(value = "存储NmsDiRule接口", name = "saveServerStatus", required = true)
|
||||
public Map<String, Object> saveNmsDiRule(@RequestBody NmsDiRuleList nmsDiRuleList, HttpServletRequest request,
|
||||
HttpServletResponse response) {
|
||||
long start = System.currentTimeMillis();
|
||||
AuditLogThread thread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_POST, request,
|
||||
nmsDiRuleList);
|
||||
try {
|
||||
if (nmsDiRuleList != null && nmsDiRuleList.getNmsDiRuleList() != null
|
||||
&& nmsDiRuleList.getNmsDiRuleList().size() > 0) {
|
||||
nmsDiRuleService.saveNmsDiRuleInfo(nmsDiRuleList.getNmsDiRuleList());
|
||||
} else {
|
||||
throw new RestServiceException(thread, System.currentTimeMillis() - start, "参数nmsDiRuleList不能为空",
|
||||
RestBusinessCode.missing_args.getValue());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
throw new RestServiceException(thread, System.currentTimeMillis() - start,
|
||||
"上报NmsDiRule信息异常:" + e.getMessage(), RestBusinessCode.unknow_error.getValue());
|
||||
}
|
||||
return compileServiceResponse(thread, System.currentTimeMillis() - start, request, response, "上报NmsDiRule信息成功",
|
||||
Constants.IS_DEBUG ? nmsDiRuleList : null);
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/nms/v1/rafficNetflowPortInfo", method = RequestMethod.POST)
|
||||
@ApiOperation(value = "存储trafficNetflowPortInfo接口", httpMethod = "POST", response = Map.class, notes = "接收NMS系统上报的trafficNetflowPort信息")
|
||||
@ApiParam(value = "存储trafficNetflowPortInfo接口", name = "saveTrafficNetflowPortInfo", required = true)
|
||||
public Map<String, Object> saveTrafficNetflowPortInfo(
|
||||
@RequestBody TrafficNetflowPortInfoList trafficNetflowPortInfoList, HttpServletRequest request,
|
||||
HttpServletResponse response) {
|
||||
long start = System.currentTimeMillis();
|
||||
AuditLogThread thread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_POST, request,
|
||||
trafficNetflowPortInfoList);
|
||||
try {
|
||||
if (trafficNetflowPortInfoList != null && trafficNetflowPortInfoList.getTrafficNetflowPortInfoList() != null
|
||||
&& trafficNetflowPortInfoList.getTrafficNetflowPortInfoList().size() > 0) {
|
||||
trafficNetflowPortInfoService
|
||||
.saveTrafficNetflowPortInfo(trafficNetflowPortInfoList.getTrafficNetflowPortInfoList());
|
||||
} else {
|
||||
throw new RestServiceException(thread, System.currentTimeMillis() - start,
|
||||
"参数trafficNetflowPortInfoList不能为空", RestBusinessCode.missing_args.getValue());
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
throw new RestServiceException(thread, System.currentTimeMillis() - start,
|
||||
"上报trafficNetflowPort信息异常:" + e.getMessage(), RestBusinessCode.unknow_error.getValue());
|
||||
}
|
||||
return compileServiceResponse(thread, System.currentTimeMillis() - start, request, response,
|
||||
"上报trafficNetflowPort信息成功", Constants.IS_DEBUG ? trafficNetflowPortInfoList : null);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
7
src/main/java/com/nis/web/dao/NmsDiRuleDao.java
Normal file
7
src/main/java/com/nis/web/dao/NmsDiRuleDao.java
Normal file
@@ -0,0 +1,7 @@
|
||||
package com.nis.web.dao;
|
||||
|
||||
import com.nis.domain.restful.NmsDiRule;
|
||||
|
||||
@MyBatisDao
|
||||
public interface NmsDiRuleDao extends CrudDao<NmsDiRule> {
|
||||
}
|
||||
44
src/main/java/com/nis/web/dao/NmsDiRuleDao.xml
Normal file
44
src/main/java/com/nis/web/dao/NmsDiRuleDao.xml
Normal file
@@ -0,0 +1,44 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.nis.web.dao.NmsDiRuleDao">
|
||||
<insert id="insert" parameterType="nmsDiRule">
|
||||
INSERT INTO
|
||||
nms_di_rule(detection_info_id ,
|
||||
serviceindex ,
|
||||
servicecode ,
|
||||
servicedesc,
|
||||
agedtime ,
|
||||
clientnum ,
|
||||
refluxport ,
|
||||
rulenumber ,
|
||||
usedrulenum ,
|
||||
leftrulenum ,
|
||||
hittotalnum ,
|
||||
detectioned_state ,
|
||||
seq_id ,
|
||||
detection_set_info_id ,
|
||||
data_check_time ,
|
||||
data_arrive_time ,
|
||||
data_check_time_digital ,
|
||||
data_arrive_time_digital
|
||||
) VALUES (
|
||||
#{detectionInfoId},
|
||||
#{serviceIndex},
|
||||
#{serviceCode},
|
||||
#{serviceDesc},
|
||||
#{agedTime},
|
||||
#{clientNum},
|
||||
#{refluxPort},
|
||||
#{ruleNumber},
|
||||
#{usedRuleNum},
|
||||
#{leftRuleNum},
|
||||
#{hitTotalNum},
|
||||
#{detectionedState},
|
||||
#{seqId},
|
||||
#{detectionSetInfoId},
|
||||
#{dataCheckTime},
|
||||
#{dataArriveTime},
|
||||
#{dataCheckTimeDigital},
|
||||
#{dataArriveTimeDigital})
|
||||
</insert>
|
||||
</mapper>
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.nis.web.dao;
|
||||
|
||||
import com.nis.domain.restful.TrafficNetflowPortInfo;
|
||||
|
||||
@MyBatisDao
|
||||
public interface TrafficNetflowPortInfoDao extends CrudDao<TrafficNetflowPortInfo> {
|
||||
}
|
||||
32
src/main/java/com/nis/web/dao/TrafficNetflowPortInfoDao.xml
Normal file
32
src/main/java/com/nis/web/dao/TrafficNetflowPortInfoDao.xml
Normal file
@@ -0,0 +1,32 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.nis.web.dao.TrafficNetflowPortInfoDao">
|
||||
<insert id="insert" parameterType="trafficNetflowPortInfo">
|
||||
INSERT INTO
|
||||
traffic_netflow_port_info(PORT ,
|
||||
NODE_NAME ,
|
||||
NODE_IP ,
|
||||
PORT_DESC,
|
||||
BANDWIDTH ,
|
||||
INOCTETS ,
|
||||
OUTOCTETS ,
|
||||
INOCTETS_SPEED ,
|
||||
OUTOCTETS_SPEED ,
|
||||
INPKTS_SPEED ,
|
||||
OUTPKTS_SPEED ,
|
||||
RECV_TIME
|
||||
) VALUES (
|
||||
#{port},
|
||||
#{nodeName},
|
||||
#{nodeIp},
|
||||
#{portDesc},
|
||||
#{bandwidth},
|
||||
#{inoctets},
|
||||
#{outoctets},
|
||||
#{inoctetsSpeed},
|
||||
#{outoctetsSpeed},
|
||||
#{inpktsSpeed},
|
||||
#{outpktsSpeed},
|
||||
#{recvTime})
|
||||
</insert>
|
||||
</mapper>
|
||||
@@ -21,6 +21,7 @@ import com.nis.domain.restful.MaatConfig;
|
||||
import com.nis.restful.RestBusinessCode;
|
||||
import com.nis.restful.ServiceRuntimeException;
|
||||
import com.nis.util.Configurations;
|
||||
import com.nis.util.File2Redis;
|
||||
import com.nis.util.JedisUtils;
|
||||
import com.nis.util.ReadMaatXmlUtil;
|
||||
import com.nis.util.ServiceAndRDBIndexReal;
|
||||
@@ -89,10 +90,38 @@ public class ConfigJedisServiceimpl implements ConfigRedisService {
|
||||
}
|
||||
StringBuffer valBF = new StringBuffer();
|
||||
String[] valSplit = maatXmlExpr.getValueExpression().split(";");
|
||||
// List<String> urlList = new ArrayList<String>();
|
||||
for (String valStr : valSplit) {
|
||||
if (!StringUtils.isEmpty(valStr) && valStr.trim().startsWith("[")) {
|
||||
valStr = valStr.trim().replace("[", "").replace("]", "");
|
||||
valBF.append(map.get(valStr));
|
||||
// if (service == 520) {
|
||||
// if (valStr.equals("private_key_file")
|
||||
// || valStr.equals("public_key_file")) {
|
||||
// String fileUrl = map.get(valStr);
|
||||
// urlList.add(fileUrl);
|
||||
// }
|
||||
// }
|
||||
// if(valStr.equals("op_time")) {
|
||||
// if (urlList.size() > 0) {
|
||||
// for (String fileUrl : urlList) {
|
||||
// String key = File2Redis.file2Redis(fileUrl, transaction);
|
||||
// logger.info("向{}号redis数据库添加了一条文件配置,key是{}",redisDBIndex,key);
|
||||
// valBF.append(key);
|
||||
// valBF.append("\t");
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
if (valStr.contains("redisFile_")) {
|
||||
String key = File2Redis.file2Redis(map.get(valStr),
|
||||
transaction);
|
||||
logger.info("向{}号redis数据库添加了一条文件配置,key是{}", redisDBIndex,
|
||||
key);
|
||||
valBF.append(key);
|
||||
// valBF.append("\t");
|
||||
} else {
|
||||
valBF.append(map.get(valStr));
|
||||
}
|
||||
} else if (valStr.equals(" ")) {
|
||||
valBF.append(" ");
|
||||
} else if (valStr.equals("\\t")) {// xml中是字符串的\t这里判断的时候需要转义为\\t,但是添加的时候需要添加\t不是\\t
|
||||
@@ -161,7 +190,7 @@ public class ConfigJedisServiceimpl implements ConfigRedisService {
|
||||
}
|
||||
|
||||
/**
|
||||
* 下发配置时,需要记录编译,组,域等配置id的对应关系,以便于在取消配置时可以根据配置id查找对应的编译,分组,域的关系
|
||||
* 下发配置时,需要记录编译,组,域等配置id的对应关系,以便于在取消配置时可以根据配置id查找对应的编译,分组,域的关系
|
||||
*/
|
||||
private void addMaatRelation(Map<Integer, List<MaatConfig>> configMap, Transaction transaction) {
|
||||
if (configMap != null && configMap.size() > 0) {
|
||||
@@ -260,6 +289,7 @@ public class ConfigJedisServiceimpl implements ConfigRedisService {
|
||||
* 单独找一个redis-db记录配置信息,方便实时统计程序获取所有配置的分类性质,标签等内容,(为什么实时统计不从配置库redisdb获取呢,
|
||||
* 因为配置有多分发的情况,会发送到不同的redisdb,每个redisdb的配置条数不一定相同,有的配置所有的redisdb都有,有的只在某一个redisdb中有,实时统计程序不好获取配置这些配置内容,
|
||||
* 最重要的是,前端机不需要这些属性,所以在配置库有可能不带分类性质,标签等属性,maat.xml如果配置了则有,没有配置则就没有这些属性.所以单独找一个reidsdb存放带分类性质,标签等属性的配置)
|
||||
*
|
||||
* @param configMap
|
||||
*/
|
||||
private void addStatisticsReal(Map<Integer, List<MaatConfig>> configMap, Transaction transaction) {
|
||||
@@ -270,7 +300,7 @@ public class ConfigJedisServiceimpl implements ConfigRedisService {
|
||||
&& redisStatisticsRealDBIndex < Configurations.getIntProperty("maxRedisDBIndex", 16)) {
|
||||
List<MaatConfig> list = configMap.get(redisDBIndex);
|
||||
if (list != null && list.size() > 0) {
|
||||
transaction.select(redisStatisticsRealDBIndex);//选择实时统计库
|
||||
transaction.select(redisStatisticsRealDBIndex);// 选择实时统计库
|
||||
String redisStatisticsReal = Configurations.getStringProperty("redis-statisticsReal",
|
||||
"[COMPILE_ID];\t;[SERVICE];\t;[ACTION];\t;[CONT_TYPE];\t;[ATTR_TYPE];\t;[CONT_LABEL];\t;[TASK_ID];\t;[AFFAIR_ID];\t;[DO_BLACKLIST];\t;[DO_LOG];\t;[EFFECTIVE_RANGE];\t;[START_TIME];\t;[END_TIME];\t;[USER_REGION];\t;[IS_VALID];\t;[GROUP_NUM];\t;[FATHER_CFG_ID];\t;[OP_TIME]");
|
||||
String[] redisStatisticsRealArr = redisStatisticsReal.split(";");
|
||||
@@ -379,6 +409,7 @@ public class ConfigJedisServiceimpl implements ConfigRedisService {
|
||||
|
||||
/**
|
||||
* 封装组id与域id对应关系并添加到对象中
|
||||
*
|
||||
* @param regionMapList
|
||||
* @param compileAndGroupRelations
|
||||
*/
|
||||
@@ -461,11 +492,13 @@ public class ConfigJedisServiceimpl implements ConfigRedisService {
|
||||
int service = maatConfig.getService();
|
||||
if (ServiceAndRDBIndexReal.isAddASU(service)) {
|
||||
if (!keySet.contains(TAPREDISDB)) {
|
||||
throw new ServiceRuntimeException("业务类型:" + service + ",需要向阀门" + TAPREDISDB + "号库分发,但是当前只往"
|
||||
+ keySet + "库下发,请检查阀门编号或者当前业务对应的配置文件是否正确",RestBusinessCode.PropertiesIsError.getValue());
|
||||
throw new ServiceRuntimeException(
|
||||
"业务类型:" + service + ",需要向阀门" + TAPREDISDB + "号库分发,但是当前只往" + keySet
|
||||
+ "库下发,请检查阀门编号或者当前业务对应的配置文件是否正确",
|
||||
RestBusinessCode.PropertiesIsError.getValue());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
MaatXmlConfig maatXmlConfig = ReadMaatXmlUtil.getMaatConfigByService(service);
|
||||
setConfig(maatConfig, maatXmlConfig, maatVersion, service, transaction,
|
||||
redisDBIndex);
|
||||
@@ -515,6 +548,7 @@ public class ConfigJedisServiceimpl implements ConfigRedisService {
|
||||
|
||||
/**
|
||||
* 将编译,分组,域等配置拆开分别添加到redis中
|
||||
*
|
||||
* @param maatConfig
|
||||
* @param maatXmlConfig
|
||||
* @param maatVersion
|
||||
@@ -558,6 +592,7 @@ public class ConfigJedisServiceimpl implements ConfigRedisService {
|
||||
|
||||
/**
|
||||
* 将整理好的数据添加到redis中,如果是分组复用时,则去临时库将对应的域找到复制过来,如果当前库存在则不复制了(在复制就重复了)
|
||||
*
|
||||
* @param maatXmlConfig
|
||||
* @param map
|
||||
* @param type
|
||||
@@ -566,7 +601,8 @@ public class ConfigJedisServiceimpl implements ConfigRedisService {
|
||||
* @param redisTemplate
|
||||
* @param redisDBIndex
|
||||
* @param compileId
|
||||
* @param isReuse 是否是分组复用
|
||||
* @param isReuse
|
||||
* 是否是分组复用
|
||||
*/
|
||||
private void setCommonConfig(MaatXmlConfig maatXmlConfig, Map<String, String> map, int type, Double maatVersion,
|
||||
int service, Transaction transaction, Integer redisDBIndex, String compileId, boolean isReuse) {
|
||||
@@ -695,7 +731,7 @@ public class ConfigJedisServiceimpl implements ConfigRedisService {
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (isReuse && (type == 12 || type == 13 || type == 14|| type == 15|| type == 18)) {// 将数据往临时库复制一份,无论临时库里有没有都可以直接写,有则覆盖,不影响
|
||||
} else if (isReuse && (type == 12 || type == 13 || type == 14 || type == 15 || type == 18)) {// 将数据往临时库复制一份,无论临时库里有没有都可以直接写,有则覆盖,不影响
|
||||
int tmpStorageReuseRegionDB = Configurations.getIntProperty("tmpStorageReuseRegionDB", 15);
|
||||
transaction.select(tmpStorageReuseRegionDB);
|
||||
transaction.set(maatKey.toUpperCase(), valBF.toString());
|
||||
@@ -750,8 +786,8 @@ public class ConfigJedisServiceimpl implements ConfigRedisService {
|
||||
for (Integer service : serviceConfigMap.keySet()) {
|
||||
List<Long> compileIdList = serviceConfigMap.get(service);
|
||||
if (compileIdList != null && compileIdList.size() > 0) {
|
||||
MaatXmlConfig maatXmlConfig = ReadMaatXmlUtil.getMaatConfigByService(service);
|
||||
for (Long id : compileIdList) {
|
||||
MaatXmlConfig maatXmlConfig = ReadMaatXmlUtil.getMaatConfigByService(service);
|
||||
if (maatXmlConfig != null) {
|
||||
List<MaatXmlExpr> expressionList = maatXmlConfig.getExpressionList();
|
||||
String maatKey = null;
|
||||
@@ -1009,6 +1045,7 @@ public class ConfigJedisServiceimpl implements ConfigRedisService {
|
||||
|
||||
/**
|
||||
* 获取关联关系中每个关系中的-前部分
|
||||
*
|
||||
* @param compileStrVal
|
||||
* @return
|
||||
*/
|
||||
@@ -1022,12 +1059,18 @@ public class ConfigJedisServiceimpl implements ConfigRedisService {
|
||||
|
||||
/**
|
||||
* 删除maat类配置
|
||||
* @param id 配置id
|
||||
* @param maatXmlConfig maat.xml中关于当前业务类型的key和value写法的对象
|
||||
* @param maatVersion 版本号
|
||||
* @param service 业务类型
|
||||
* @param redisTemplate
|
||||
* @param maatRelation id对应关系对象
|
||||
*
|
||||
* @param id
|
||||
* 配置id
|
||||
* @param maatXmlConfig
|
||||
* maat.xml中关于当前业务类型的key和value写法的对象
|
||||
* @param maatVersion
|
||||
* 版本号
|
||||
* @param service
|
||||
* 业务类型
|
||||
* @param redisTemplate
|
||||
* @param maatRelation
|
||||
* id对应关系对象
|
||||
*/
|
||||
private void removeConfig(Long id, MaatXmlConfig maatXmlConfig, Double maatVersion, int service,
|
||||
Transaction transaction, int redisDBIndex, int idRelaRedisDBIndex) {
|
||||
@@ -1104,6 +1147,7 @@ public class ConfigJedisServiceimpl implements ConfigRedisService {
|
||||
|
||||
/**
|
||||
* 删除maat配置时,对redis进行相关操作,主要是重命名key和记录相关状态
|
||||
*
|
||||
* @param maatXmlConfig
|
||||
* @param idList
|
||||
* @param type
|
||||
@@ -1171,6 +1215,7 @@ public class ConfigJedisServiceimpl implements ConfigRedisService {
|
||||
|
||||
/**
|
||||
* 删除域配置,重名key,记录相关信息MAAT_UPDATE_STATUS,MAAT_RULE_TIMER等
|
||||
*
|
||||
* @param maatXmlConfig
|
||||
* @param regionArr
|
||||
* @param maatVersion
|
||||
@@ -1207,8 +1252,7 @@ public class ConfigJedisServiceimpl implements ConfigRedisService {
|
||||
}
|
||||
|
||||
/**
|
||||
* 编译配置用于实时统计
|
||||
* 取消分类性质,标签等信息
|
||||
* 编译配置用于实时统计 取消分类性质,标签等信息
|
||||
*/
|
||||
private boolean removeStatisticsReal(Map<Integer, List<Long>> map, Transaction transaction) {
|
||||
if (map != null && map.size() > 0) {
|
||||
@@ -1271,6 +1315,7 @@ public class ConfigJedisServiceimpl implements ConfigRedisService {
|
||||
|
||||
/**
|
||||
* 删除配置成功后,需要更新编译,组,域等配置id的对应关系
|
||||
*
|
||||
* @param idMap
|
||||
*/
|
||||
private boolean removeMaatRelation(Map<Integer, List<Long>> map, Transaction transaction) {
|
||||
@@ -1563,7 +1608,8 @@ public class ConfigJedisServiceimpl implements ConfigRedisService {
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加分组和域的关联关系
|
||||
* 添加分组和域的关联关系
|
||||
*
|
||||
* @param maatConfig
|
||||
* @param transaction
|
||||
* @param redisDBIndex
|
||||
@@ -1607,13 +1653,21 @@ public class ConfigJedisServiceimpl implements ConfigRedisService {
|
||||
|
||||
/**
|
||||
* 保存域配置信息,供分组复用单独添加域和普通maat配置添加域
|
||||
* @param maatConfig 配置信息
|
||||
* @param maatXmlConfig 配置的表达式
|
||||
* @param maatVersion 版本号
|
||||
* @param service 业务类型
|
||||
* @param transaction redis连接
|
||||
* @param redisDBIndex redis编号
|
||||
* @param isReuseSaveRegion 是否是分组复用单独添加域配置
|
||||
*
|
||||
* @param maatConfig
|
||||
* 配置信息
|
||||
* @param maatXmlConfig
|
||||
* 配置的表达式
|
||||
* @param maatVersion
|
||||
* 版本号
|
||||
* @param service
|
||||
* 业务类型
|
||||
* @param transaction
|
||||
* redis连接
|
||||
* @param redisDBIndex
|
||||
* redis编号
|
||||
* @param isReuseSaveRegion
|
||||
* 是否是分组复用单独添加域配置
|
||||
*/
|
||||
private Integer addRegion(MaatConfig maatConfig, MaatXmlConfig maatXmlConfig, Double maatVersion, int service,
|
||||
Transaction transaction, Integer redisDBIndex, boolean isReuseSaveRegion) {
|
||||
@@ -1687,6 +1741,7 @@ public class ConfigJedisServiceimpl implements ConfigRedisService {
|
||||
|
||||
/**
|
||||
* 从临时库删除分组复用域配置,如果该域被引用了,则去对应的redisdb中删除,并将关联库中记录的信息删除
|
||||
*
|
||||
* @param groupId
|
||||
* @param regionList
|
||||
* @param transaction
|
||||
@@ -1816,6 +1871,7 @@ public class ConfigJedisServiceimpl implements ConfigRedisService {
|
||||
|
||||
/**
|
||||
* 添加和删除时更新MAAT_*状态信息
|
||||
*
|
||||
* @param list
|
||||
* @param maatKey
|
||||
* @param transaction
|
||||
|
||||
@@ -482,7 +482,7 @@ public class ConfigSourcesService extends BaseService {
|
||||
maatTableName.substring(maatTableName.lastIndexOf("_") + 1));
|
||||
dstStr = dstPath.replace("{fileName}", dstStr.substring(dstStr.lastIndexOf("/") + 1));
|
||||
} else if ("file_id".equals(commonSourceFieldCfg.getDstName())) {
|
||||
dstStr = dstStr.substring(dstStr.indexOf("group"));
|
||||
//dstStr = dstStr.substring(dstStr.indexOf("group"));
|
||||
}
|
||||
}
|
||||
switch (commonSourceFieldCfg.getFieldType()) {
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.nis.web.service.restful;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.nis.domain.restful.NmsDiRule;
|
||||
import com.nis.web.dao.NmsDiRuleDao;
|
||||
|
||||
@Service
|
||||
public class NmsDiRuleService {
|
||||
@Autowired
|
||||
NmsDiRuleDao nmsDiRuleDao;
|
||||
|
||||
@Transactional
|
||||
public void saveNmsDiRuleInfo(List<NmsDiRule> nmsDiRuleList) {
|
||||
for (NmsDiRule nmsDiRule : nmsDiRuleList) {
|
||||
nmsDiRuleDao.insert(nmsDiRule);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.nis.web.service.restful;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.nis.domain.restful.TrafficNetflowPortInfo;
|
||||
import com.nis.web.dao.TrafficNetflowPortInfoDao;
|
||||
|
||||
@Service
|
||||
public class TrafficNetflowPortInfoService {
|
||||
@Autowired
|
||||
TrafficNetflowPortInfoDao trafficNetflowPortInfoDao;
|
||||
|
||||
@Transactional
|
||||
public void saveTrafficNetflowPortInfo(List<TrafficNetflowPortInfo> trafficNetflowPortInfoList) {
|
||||
for (TrafficNetflowPortInfo trafficNetflowPortInfo : trafficNetflowPortInfoList) {
|
||||
trafficNetflowPortInfoDao.insert(trafficNetflowPortInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -21,6 +21,5 @@ public class TrafficNmsServerStatisticService {
|
||||
trafficNmsServerStatisticDao.insertAbnormalMachine(trafficNmsServerStatistic.getId(),
|
||||
trafficNmsServerStatistic.getAbnormalMachineList());
|
||||
}
|
||||
Integer.parseInt(null);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user