1、回调类配置取消改为配置状态更新,一次请求isvalid必须一致;

2、添加原始日志接口;
This commit is contained in:
zhangdongxu
2018-07-17 17:59:07 +08:00
parent bb5fda045e
commit c96a483bed
14 changed files with 938 additions and 47 deletions

View File

@@ -16,43 +16,74 @@ public class DkBehaviorLog extends LogEntity<DkBehaviorLog> {
private static final long serialVersionUID = -589390375816690510L;
@ApiModelProperty(value = "协议标签", required = true)
protected Integer appLabel;
@ApiModelProperty(value = "c2s包数", required = true)
protected String c2sPktNum;
@ApiModelProperty(value = "s2c包数", required = true)
protected String s2cPktNum;
@ApiModelProperty(value = "c2s字节数", required = true)
protected String c2sByteNum;
@ApiModelProperty(value = "s2c字节数", required = true)
protected String s2cByteNum;
@ApiModelProperty(value = "发送c2s包数", required = true)
protected String c2sSendPktNum;
@ApiModelProperty(value = "发送s2c包数", required = true)
protected String s2cSendPktNum;
@ApiModelProperty(value = "发送c2s字节数", required = true)
protected String c2sSendByteNum;
@ApiModelProperty(value = "发送s2c字节数", required = true)
protected String s2cSendByteNum;
@ApiModelProperty(value = "接收c2s包数", required = true)
protected String c2sRecvSendPktNum;
@ApiModelProperty(value = "接收s2c包数", required = true)
protected String s2cRecvSendPktNum;
@ApiModelProperty(value = "接收c2s字节数", required = true)
protected String c2sRecvByteNum;
@ApiModelProperty(value = "接收s2c字节数", required = true)
protected String s2cRecvByteNum;
public Integer getAppLabel() {
return appLabel;
}
public void setAppLabel(Integer appLabel) {
this.appLabel = appLabel;
}
public String getC2sPktNum() {
return c2sPktNum;
public String getC2sSendPktNum() {
return c2sSendPktNum;
}
public void setC2sPktNum(String c2sPktNum) {
this.c2sPktNum = c2sPktNum;
public void setC2sSendPktNum(String c2sSendPktNum) {
this.c2sSendPktNum = c2sSendPktNum;
}
public String getS2cPktNum() {
return s2cPktNum;
public String getS2cSendPktNum() {
return s2cSendPktNum;
}
public void setS2cPktNum(String s2cPktNum) {
this.s2cPktNum = s2cPktNum;
public void setS2cSendPktNum(String s2cSendPktNum) {
this.s2cSendPktNum = s2cSendPktNum;
}
public String getC2sByteNum() {
return c2sByteNum;
public String getC2sSendByteNum() {
return c2sSendByteNum;
}
public void setC2sByteNum(String c2sByteNum) {
this.c2sByteNum = c2sByteNum;
public void setC2sSendByteNum(String c2sSendByteNum) {
this.c2sSendByteNum = c2sSendByteNum;
}
public String getS2cByteNum() {
return s2cByteNum;
public String getS2cSendByteNum() {
return s2cSendByteNum;
}
public void setS2cByteNum(String s2cByteNum) {
this.s2cByteNum = s2cByteNum;
public void setS2cSendByteNum(String s2cSendByteNum) {
this.s2cSendByteNum = s2cSendByteNum;
}
public String getC2sRecvSendPktNum() {
return c2sRecvSendPktNum;
}
public void setC2sRecvSendPktNum(String c2sRecvSendPktNum) {
this.c2sRecvSendPktNum = c2sRecvSendPktNum;
}
public String getS2cRecvSendPktNum() {
return s2cRecvSendPktNum;
}
public void setS2cRecvSendPktNum(String s2cRecvSendPktNum) {
this.s2cRecvSendPktNum = s2cRecvSendPktNum;
}
public String getC2sRecvByteNum() {
return c2sRecvByteNum;
}
public void setC2sRecvByteNum(String c2sRecvByteNum) {
this.c2sRecvByteNum = c2sRecvByteNum;
}
public String getS2cRecvByteNum() {
return s2cRecvByteNum;
}
public void setS2cRecvByteNum(String s2cRecvByteNum) {
this.s2cRecvByteNum = s2cRecvByteNum;
}
}

View File

@@ -0,0 +1,72 @@
package com.nis.domain.restful;
import com.nis.domain.LogEntity;
import com.wordnik.swagger.annotations.ApiModelProperty;
/**
* @ClassName:MmAvIpLog
* @Description:TODO(这里用一句话描述这个类的作用)
* @author (zdx)
* @date 2018年7月16日 下午2:54:23
* @version V1.0
*/
public class MmAvIpLog extends LogEntity<MmAvIpLog> {
private static final long serialVersionUID = -6177790560553329386L;
@ApiModelProperty(value="节目ID", required=true)
protected String pid;
@ApiModelProperty(value="节目访问地址", required=true)
protected String url;
@ApiModelProperty(value="封堵现场片段路径", required=true)
protected String logUri;
@ApiModelProperty(value="入口页面", required=true)
protected String refer;
@ApiModelProperty(value="有害级别", required=true)
protected Integer level;
@ApiModelProperty(value="封堵类型", required=true)
protected Integer fdType;
@ApiModelProperty(value="协议", required=true)
protected String protocol;
public String getPid() {
return pid;
}
public void setPid(String pid) {
this.pid = pid;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public String getLogUri() {
return logUri;
}
public void setLogUri(String logUri) {
this.logUri = logUri;
}
public String getRefer() {
return refer;
}
public void setRefer(String refer) {
this.refer = refer;
}
public Integer getLevel() {
return level;
}
public void setLevel(Integer level) {
this.level = level;
}
public Integer getFdType() {
return fdType;
}
public void setFdType(Integer fdType) {
this.fdType = fdType;
}
public String getProtocol() {
return protocol;
}
public void setProtocol(String protocol) {
this.protocol = protocol;
}
}

View File

@@ -0,0 +1,72 @@
package com.nis.domain.restful;
import com.nis.domain.LogEntity;
import com.wordnik.swagger.annotations.ApiModelProperty;
/**
* @ClassName:MmAvUrlLog
* @Description:TODO(这里用一句话描述这个类的作用)
* @author (zdx)
* @date 2018年7月16日 下午3:11:42
* @version V1.0
*/
public class MmAvUrlLog extends LogEntity<MmAvUrlLog> {
private static final long serialVersionUID = 1446933545638550170L;
@ApiModelProperty(value="节目ID", required=true)
protected String pid;
@ApiModelProperty(value="节目访问地址", required=true)
protected String url;
@ApiModelProperty(value="封堵现场片段路径", required=true)
protected String logUri;
@ApiModelProperty(value="入口页面", required=true)
protected String refer;
@ApiModelProperty(value="有害级别", required=true)
protected Integer level;
@ApiModelProperty(value="封堵类型", required=true)
protected Integer fdType;
@ApiModelProperty(value="协议", required=true)
protected String protocol;
public String getPid() {
return pid;
}
public void setPid(String pid) {
this.pid = pid;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public String getLogUri() {
return logUri;
}
public void setLogUri(String logUri) {
this.logUri = logUri;
}
public String getRefer() {
return refer;
}
public void setRefer(String refer) {
this.refer = refer;
}
public Integer getLevel() {
return level;
}
public void setLevel(Integer level) {
this.level = level;
}
public Integer getFdType() {
return fdType;
}
public void setFdType(Integer fdType) {
this.fdType = fdType;
}
public String getProtocol() {
return protocol;
}
public void setProtocol(String protocol) {
this.protocol = protocol;
}
}

View File

@@ -0,0 +1,72 @@
package com.nis.domain.restful;
import com.nis.domain.LogEntity;
import com.wordnik.swagger.annotations.ApiModelProperty;
/**
* @ClassName:MmPicIpLog
* @Description:TODO(这里用一句话描述这个类的作用)
* @author (zdx)
* @date 2018年7月16日 下午3:11:20
* @version V1.0
*/
public class MmPicIpLog extends LogEntity<MmPicIpLog> {
private static final long serialVersionUID = -3097221323074572913L;
@ApiModelProperty(value="节目ID", required=true)
protected String pid;
@ApiModelProperty(value="节目访问地址", required=true)
protected String url;
@ApiModelProperty(value="封堵现场片段路径", required=true)
protected String logUri;
@ApiModelProperty(value="入口页面", required=true)
protected String refer;
@ApiModelProperty(value="有害级别", required=true)
protected Integer level;
@ApiModelProperty(value="封堵类型", required=true)
protected Integer fdType;
@ApiModelProperty(value="协议", required=true)
protected String protocol;
public String getPid() {
return pid;
}
public void setPid(String pid) {
this.pid = pid;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public String getLogUri() {
return logUri;
}
public void setLogUri(String logUri) {
this.logUri = logUri;
}
public String getRefer() {
return refer;
}
public void setRefer(String refer) {
this.refer = refer;
}
public Integer getLevel() {
return level;
}
public void setLevel(Integer level) {
this.level = level;
}
public Integer getFdType() {
return fdType;
}
public void setFdType(Integer fdType) {
this.fdType = fdType;
}
public String getProtocol() {
return protocol;
}
public void setProtocol(String protocol) {
this.protocol = protocol;
}
}

View File

@@ -0,0 +1,72 @@
package com.nis.domain.restful;
import com.nis.domain.LogEntity;
import com.wordnik.swagger.annotations.ApiModelProperty;
/**
* @ClassName:MmPicUrlLog
* @Description:TODO(这里用一句话描述这个类的作用)
* @author (zdx)
* @date 2018年7月16日 下午3:11:03
* @version V1.0
*/
public class MmPicUrlLog extends LogEntity<MmPicUrlLog> {
private static final long serialVersionUID = 4660530265759121390L;
@ApiModelProperty(value="节目ID", required=true)
protected String pid;
@ApiModelProperty(value="节目访问地址", required=true)
protected String url;
@ApiModelProperty(value="封堵现场片段路径", required=true)
protected String logUri;
@ApiModelProperty(value="入口页面", required=true)
protected String refer;
@ApiModelProperty(value="有害级别", required=true)
protected Integer level;
@ApiModelProperty(value="封堵类型", required=true)
protected Integer fdType;
@ApiModelProperty(value="协议", required=true)
protected String protocol;
public String getPid() {
return pid;
}
public void setPid(String pid) {
this.pid = pid;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public String getLogUri() {
return logUri;
}
public void setLogUri(String logUri) {
this.logUri = logUri;
}
public String getRefer() {
return refer;
}
public void setRefer(String refer) {
this.refer = refer;
}
public Integer getLevel() {
return level;
}
public void setLevel(Integer level) {
this.level = level;
}
public Integer getFdType() {
return fdType;
}
public void setFdType(Integer fdType) {
this.fdType = fdType;
}
public String getProtocol() {
return protocol;
}
public void setProtocol(String protocol) {
this.protocol = protocol;
}
}

View File

@@ -0,0 +1,131 @@
package com.nis.domain.restful;
import com.nis.domain.LogEntity;
import com.wordnik.swagger.annotations.ApiModelProperty;
/**
* @ClassName:MmVoipIpLog
* @Description:TODO(这里用一句话描述这个类的作用)
* @author (zdx)
* @date 2018年7月16日 下午2:57:12
* @version V1.0
*/
public class MmVoipLog extends LogEntity<MmVoipLog> {
private static final long serialVersionUID = -6131067803206270492L;
// @ApiModelProperty(value="VOIP接收时间", required=true)
// protected String recvTime;
@ApiModelProperty(value="VOIP通话时长", required=true)
protected String duation;
@ApiModelProperty(value="VOIP协议", required=true)
protected String protocol;
@ApiModelProperty(value="主叫VOIP账号", required=true)
protected String callingAccount;
@ApiModelProperty(value="被叫VOIP账号", required=true)
protected String calledAccount;
@ApiModelProperty(value="VOIP主叫电信号码", required=true)
protected String callingNumber;
@ApiModelProperty(value="VOIP被叫电信号码", required=true)
protected String calledNumber;
@ApiModelProperty(value="主叫VOIP语音文件存放服务器IP", required=true)
protected String fromToStoreIp;
@ApiModelProperty(value="主叫VOIP语音文件存放服务器URL", required=true)
protected String fromToStoreUrl;
@ApiModelProperty(value="被叫VOIP语音文件存放服务器IP", required=true)
protected String toFromStoreIp;
@ApiModelProperty(value="被叫VOIP语音文件存放服务器URL", required=true)
protected String toFromStoreUrl;
@ApiModelProperty(value="节目ID", required=true)
protected String pid;
@ApiModelProperty(value="节目访问地址", required=true)
protected String url;
@ApiModelProperty(value="封堵现场片段路径", required=true)
protected String logUri;
@ApiModelProperty(value="封堵类型", required=true)
protected Integer fdType;
public String getPid() {
return pid;
}
public void setPid(String pid) {
this.pid = pid;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public String getLogUri() {
return logUri;
}
public void setLogUri(String logUri) {
this.logUri = logUri;
}
public Integer getFdType() {
return fdType;
}
public void setFdType(Integer fdType) {
this.fdType = fdType;
}
public String getProtocol() {
return protocol;
}
public void setProtocol(String protocol) {
this.protocol = protocol;
}
public String getDuation() {
return duation;
}
public void setDuation(String duation) {
this.duation = duation;
}
public String getCallingAccount() {
return callingAccount;
}
public void setCallingAccount(String callingAccount) {
this.callingAccount = callingAccount;
}
public String getCalledAccount() {
return calledAccount;
}
public void setCalledAccount(String calledAccount) {
this.calledAccount = calledAccount;
}
public String getCallingNumber() {
return callingNumber;
}
public void setCallingNumber(String callingNumber) {
this.callingNumber = callingNumber;
}
public String getCalledNumber() {
return calledNumber;
}
public void setCalledNumber(String calledNumber) {
this.calledNumber = calledNumber;
}
public String getFromToStoreIp() {
return fromToStoreIp;
}
public void setFromToStoreIp(String fromToStoreIp) {
this.fromToStoreIp = fromToStoreIp;
}
public String getFromToStoreUrl() {
return fromToStoreUrl;
}
public void setFromToStoreUrl(String fromToStoreUrl) {
this.fromToStoreUrl = fromToStoreUrl;
}
public String getToFromStoreIp() {
return toFromStoreIp;
}
public void setToFromStoreIp(String toFromStoreIp) {
this.toFromStoreIp = toFromStoreIp;
}
public String getToFromStoreUrl() {
return toFromStoreUrl;
}
public void setToFromStoreUrl(String toFromStoreUrl) {
this.toFromStoreUrl = toFromStoreUrl;
}
}

View File

@@ -350,6 +350,10 @@ public enum RestBusinessCode {
* 配置的service与action关系不存在
*/
Service2ActionIsNull(4002010, "配置的service与action关系不存在"),
/**
* 状态更新操作所有配置的isValid值必须相同
*/
IsValidNonUniq(4002011, "状态更新操作所有配置的isValid值必须相同"),
/**
* 配置分组中同一groupId出现多次

View File

@@ -191,4 +191,9 @@ public final class Constants {
public static final String DIGEST_GEN_TOOL_PATH = Configurations.getStringProperty("digest.gen.tool.path", "maat-redis/digest_gen");
/**
* 样例文件存放目录
*/
public static final String MM_SAMPLE_DST_PATH = Configurations.getStringProperty("mmSampleDstPath", "/home/mesasoft/{tableType}/full/{fileName}");
}

View File

@@ -19,6 +19,11 @@ import org.springframework.web.bind.annotation.RestController;
import com.nis.domain.LogEntity;
import com.nis.domain.Page;
import com.nis.domain.restful.DkBehaviorLog;
import com.nis.domain.restful.MmAvIpLog;
import com.nis.domain.restful.MmAvUrlLog;
import com.nis.domain.restful.MmPicIpLog;
import com.nis.domain.restful.MmPicUrlLog;
import com.nis.domain.restful.MmVoipLog;
import com.nis.domain.restful.NtcAppLog;
import com.nis.domain.restful.NtcAttrTypeReport;
import com.nis.domain.restful.NtcDdosLog;
@@ -885,15 +890,10 @@ public class LogController extends BaseRestController {
logPage.setList(new ArrayList());
} else {
List list = tableMapping.get("obj");
// if (tableMapping.get("obj").size() > page.getPageSize()) {
// list = tableMapping.get("obj").subList(0, page.getPageSize());
// } else {
// list = tableMapping.get("obj").subList(0, tableMapping.get("obj").size());
// }
if (list.size() > 0) {
String jsonString = JsonMapper.toJsonString(list);
List<DkBehaviorLog> List = (java.util.List<DkBehaviorLog>) JsonMapper.fromJsonList(jsonString,
NtcDdosLog.class);
DkBehaviorLog.class);
logPage.setList(List);
logPage.setCount(List.size());
@@ -913,6 +913,272 @@ public class LogController extends BaseRestController {
return serviceLogResponse(auditLogThread, System.currentTimeMillis() - start, request, "行为识别日志检索成功",
logPage, 0);
}
@RequestMapping(value = "/mmAvIpLogs", method = RequestMethod.GET)
@ApiOperation(value = "音视频IP日志查询", httpMethod = "GET", notes = "对日志功能“音视频IP日志”提供数据基础查询服务")
public Map<String, ?> mmAvIpLogs(Page page, MmAvIpLog mmAvIpLog, Model model, HttpServletRequest request,
HttpServletResponse response) {
long start = System.currentTimeMillis();
SaveRequestLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET,
request, null);
Page<MmAvIpLog> logPage = null;
try {
resetTime(mmAvIpLog);
testService.queryConditionCheck(auditLogThread, start, mmAvIpLog, MmAvIpLog.class, page);
logPage = new Page<MmAvIpLog>();
logPage.setPageNo(page.getPageNo());
logPage.setPageSize(page.getPageSize());
String orderBy = "";
if (null != page.getOrderBy() && !page.getOrderBy().equals("")) {
orderBy = Page.getOrderBySql(MmAvIpLog.class.getSimpleName(), page.getOrderBy());
} else {
orderBy = "found_Time";
}
ResultSet rs = HiveSqlService.getResultSet(page, mmAvIpLog,
Configurations.getStringProperty(MmAvIpLog.class.getSimpleName() + "HiveTable", "MM_AV_IP_LOG"),
getCol2Col(), orderBy, null);
Map<String, List> tableMapping = HiveJDBC.tableMapping(page, null, rs, MmAvIpLog.class, "foundTime",
"recvTime");
if (tableMapping == null) {
logPage.setList(new ArrayList());
} else {
List list = tableMapping.get("obj");
if (list.size() > 0) {
String jsonString = JsonMapper.toJsonString(list);
List<MmAvIpLog> List = (java.util.List<MmAvIpLog>) JsonMapper.fromJsonList(jsonString,
MmAvIpLog.class);
logPage.setList(List);
logPage.setCount(List.size());
} else {
logPage.setList(new ArrayList());
}
}
} catch (Exception e) {
e.printStackTrace();
auditLogThread.setExceptionInfo(e.getMessage() + " " + e.getCause());
logger.error(e);
if (!(e instanceof RestServiceException)) {
e = new RestServiceException(auditLogThread, System.currentTimeMillis() - start, "音视频IP日志检索失败");
}
throw ((RestServiceException) e);
}
return serviceLogResponse(auditLogThread, System.currentTimeMillis() - start, request, "音视频IP日志检索成功",
logPage, 0);
}
@RequestMapping(value = "/mmAvUrlLogs", method = RequestMethod.GET)
@ApiOperation(value = "音视频URL日志查询", httpMethod = "GET", notes = "对日志功能“音视频URL日志”提供数据基础查询服务")
public Map<String, ?> mmAvUrlLogs(Page page, MmAvUrlLog mmAvUrlLog, Model model, HttpServletRequest request,
HttpServletResponse response) {
long start = System.currentTimeMillis();
SaveRequestLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET,
request, null);
Page<MmAvUrlLog> logPage = null;
try {
resetTime(mmAvUrlLog);
testService.queryConditionCheck(auditLogThread, start, mmAvUrlLog, MmAvUrlLog.class, page);
logPage = new Page<MmAvUrlLog>();
logPage.setPageNo(page.getPageNo());
logPage.setPageSize(page.getPageSize());
String orderBy = "";
if (null != page.getOrderBy() && !page.getOrderBy().equals("")) {
orderBy = Page.getOrderBySql(MmAvIpLog.class.getSimpleName(), page.getOrderBy());
} else {
orderBy = "found_Time";
}
ResultSet rs = HiveSqlService.getResultSet(page, mmAvUrlLog,
Configurations.getStringProperty(MmAvUrlLog.class.getSimpleName() + "HiveTable", "MM_AV_URL_LOG"),
getCol2Col(), orderBy, null);
Map<String, List> tableMapping = HiveJDBC.tableMapping(page, null, rs, MmAvIpLog.class, "foundTime",
"recvTime");
if (tableMapping == null) {
logPage.setList(new ArrayList());
} else {
List list = tableMapping.get("obj");
if (list.size() > 0) {
String jsonString = JsonMapper.toJsonString(list);
List<MmAvUrlLog> List = (java.util.List<MmAvUrlLog>) JsonMapper.fromJsonList(jsonString,
MmAvUrlLog.class);
logPage.setList(List);
logPage.setCount(List.size());
} else {
logPage.setList(new ArrayList());
}
}
} catch (Exception e) {
e.printStackTrace();
auditLogThread.setExceptionInfo(e.getMessage() + " " + e.getCause());
logger.error(e);
if (!(e instanceof RestServiceException)) {
e = new RestServiceException(auditLogThread, System.currentTimeMillis() - start, "音视频URL日志检索失败");
}
throw ((RestServiceException) e);
}
return serviceLogResponse(auditLogThread, System.currentTimeMillis() - start, request, "音视频URL日志检索成功",
logPage, 0);
}
@RequestMapping(value = "/mmPicIpLogs", method = RequestMethod.GET)
@ApiOperation(value = "图片IP日志查询", httpMethod = "GET", notes = "对日志功能“图片IP日志”提供数据基础查询服务")
public Map<String, ?> mmPicIpLogs(Page page, MmPicIpLog mmPicIpLog, Model model, HttpServletRequest request,
HttpServletResponse response) {
long start = System.currentTimeMillis();
SaveRequestLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET,
request, null);
Page<MmPicIpLog> logPage = null;
try {
resetTime(mmPicIpLog);
testService.queryConditionCheck(auditLogThread, start, mmPicIpLog, MmPicIpLog.class, page);
logPage = new Page<MmPicIpLog>();
logPage.setPageNo(page.getPageNo());
logPage.setPageSize(page.getPageSize());
String orderBy = "";
if (null != page.getOrderBy() && !page.getOrderBy().equals("")) {
orderBy = Page.getOrderBySql(MmPicIpLog.class.getSimpleName(), page.getOrderBy());
} else {
orderBy = "found_Time";
}
ResultSet rs = HiveSqlService.getResultSet(page, mmPicIpLog,
Configurations.getStringProperty(MmPicIpLog.class.getSimpleName() + "HiveTable", "MM_PIC_IP_LOG"),
getCol2Col(), orderBy, null);
Map<String, List> tableMapping = HiveJDBC.tableMapping(page, null, rs, MmPicIpLog.class, "foundTime",
"recvTime");
if (tableMapping == null) {
logPage.setList(new ArrayList());
} else {
List list = tableMapping.get("obj");
if (list.size() > 0) {
String jsonString = JsonMapper.toJsonString(list);
List<MmPicIpLog> List = (java.util.List<MmPicIpLog>) JsonMapper.fromJsonList(jsonString,
MmPicIpLog.class);
logPage.setList(List);
logPage.setCount(List.size());
} else {
logPage.setList(new ArrayList());
}
}
} catch (Exception e) {
e.printStackTrace();
auditLogThread.setExceptionInfo(e.getMessage() + " " + e.getCause());
logger.error(e);
if (!(e instanceof RestServiceException)) {
e = new RestServiceException(auditLogThread, System.currentTimeMillis() - start, "图片IP日志检索失败");
}
throw ((RestServiceException) e);
}
return serviceLogResponse(auditLogThread, System.currentTimeMillis() - start, request, "图片IP日志检索成功",
logPage, 0);
}
@RequestMapping(value = "/mmPicUrlLogs", method = RequestMethod.GET)
@ApiOperation(value = "图片URL日志查询", httpMethod = "GET", notes = "对日志功能“图片URL日志”提供数据基础查询服务")
public Map<String, ?> mmPicUrlLogs(Page page, MmPicUrlLog mmPicUrlLog, Model model, HttpServletRequest request,
HttpServletResponse response) {
long start = System.currentTimeMillis();
SaveRequestLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET,
request, null);
Page<MmPicUrlLog> logPage = null;
try {
resetTime(mmPicUrlLog);
testService.queryConditionCheck(auditLogThread, start, mmPicUrlLog, MmPicUrlLog.class, page);
logPage = new Page<MmPicUrlLog>();
logPage.setPageNo(page.getPageNo());
logPage.setPageSize(page.getPageSize());
String orderBy = "";
if (null != page.getOrderBy() && !page.getOrderBy().equals("")) {
orderBy = Page.getOrderBySql(MmPicUrlLog.class.getSimpleName(), page.getOrderBy());
} else {
orderBy = "found_Time";
}
ResultSet rs = HiveSqlService.getResultSet(page, mmPicUrlLog,
Configurations.getStringProperty(MmPicUrlLog.class.getSimpleName() + "HiveTable", "MM_PIC_URL_LOG"),
getCol2Col(), orderBy, null);
Map<String, List> tableMapping = HiveJDBC.tableMapping(page, null, rs, MmPicUrlLog.class, "foundTime",
"recvTime");
if (tableMapping == null) {
logPage.setList(new ArrayList());
} else {
List list = tableMapping.get("obj");
if (list.size() > 0) {
String jsonString = JsonMapper.toJsonString(list);
List<MmPicUrlLog> List = (java.util.List<MmPicUrlLog>) JsonMapper.fromJsonList(jsonString,
MmPicUrlLog.class);
logPage.setList(List);
logPage.setCount(List.size());
} else {
logPage.setList(new ArrayList());
}
}
} catch (Exception e) {
e.printStackTrace();
auditLogThread.setExceptionInfo(e.getMessage() + " " + e.getCause());
logger.error(e);
if (!(e instanceof RestServiceException)) {
e = new RestServiceException(auditLogThread, System.currentTimeMillis() - start, "图片URL日志检索失败");
}
throw ((RestServiceException) e);
}
return serviceLogResponse(auditLogThread, System.currentTimeMillis() - start, request, "图片URL日志检索成功",
logPage, 0);
}
@RequestMapping(value = "/mmVoipLogs", method = RequestMethod.GET)
@ApiOperation(value = "VOIP日志查询", httpMethod = "GET", notes = "对日志功能“VOIP日志”提供数据基础查询服务")
public Map<String, ?> mmVoipLogs(Page page, MmVoipLog mmVoipLog, Model model, HttpServletRequest request,
HttpServletResponse response) {
long start = System.currentTimeMillis();
SaveRequestLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET,
request, null);
Page<MmVoipLog> logPage = null;
try {
resetTime(mmVoipLog);
testService.queryConditionCheck(auditLogThread, start, mmVoipLog, MmAvIpLog.class, page);
logPage = new Page<MmVoipLog>();
logPage.setPageNo(page.getPageNo());
logPage.setPageSize(page.getPageSize());
String orderBy = "";
if (null != page.getOrderBy() && !page.getOrderBy().equals("")) {
orderBy = Page.getOrderBySql(MmVoipLog.class.getSimpleName(), page.getOrderBy());
} else {
orderBy = "found_Time";
}
ResultSet rs = HiveSqlService.getResultSet(page, mmVoipLog,
Configurations.getStringProperty(MmVoipLog.class.getSimpleName() + "HiveTable", "MM_VOIP_LOG"),
getCol2Col(), orderBy, null);
Map<String, List> tableMapping = HiveJDBC.tableMapping(page, null, rs, MmVoipLog.class, "foundTime",
"recvTime");
if (tableMapping == null) {
logPage.setList(new ArrayList());
} else {
List list = tableMapping.get("obj");
if (list.size() > 0) {
String jsonString = JsonMapper.toJsonString(list);
List<MmVoipLog> List = (java.util.List<MmVoipLog>) JsonMapper.fromJsonList(jsonString,
MmVoipLog.class);
logPage.setList(List);
logPage.setCount(List.size());
} else {
logPage.setList(new ArrayList());
}
}
} catch (Exception e) {
e.printStackTrace();
auditLogThread.setExceptionInfo(e.getMessage() + " " + e.getCause());
logger.error(e);
if (!(e instanceof RestServiceException)) {
e = new RestServiceException(auditLogThread, System.currentTimeMillis() - start, "VOIP日志检索失败");
}
throw ((RestServiceException) e);
}
return serviceLogResponse(auditLogThread, System.currentTimeMillis() - start, request, "VOIP日志检索成功",
logPage, 0);
}
@RequestMapping(value = "/ntcPzReport", method = RequestMethod.GET)
@ApiOperation(value = "配置日志总量统计", httpMethod = "GET", notes = "配置命中日志数量实时统计报表,对外提供多种数据表现形式,具体可应用于界面配置命中总量业务、配置报表业务等")
public Map<String, ?> ntcPzReport(Page page, NtcPzReport ntcPzReport, Model model, HttpServletRequest request,

View File

@@ -373,10 +373,159 @@
<result column="addr_list" jdbcType="VARCHAR" property="addrList" />
<result column="user_region" jdbcType="VARCHAR" property="userRegion" />
<result column="c2s_pkt_num" jdbcType="VARCHAR" property="c2sPktNum" />
<result column="s2c_pkt_num" jdbcType="VARCHAR" property="s2cPktNum" />
<result column="c2s_byte_num" jdbcType="VARCHAR" property="c2sByteNum" />
<result column="s2c_byte_num" jdbcType="VARCHAR" property="s2cByteNum" />
<result column="c2s_send_pkt_num" jdbcType="VARCHAR" property="c2sSendPktNum" />
<result column="s2c_send_pkt_num" jdbcType="VARCHAR" property="s2cSendPktNum" />
<result column="c2s_send_byte_num" jdbcType="VARCHAR" property="c2sSendByteNum" />
<result column="s2c_send_byte_num" jdbcType="VARCHAR" property="s2cSendByteNum" />
<result column="c2s_recv_pkt_num" jdbcType="VARCHAR" property="c2sRecvPktNum" />
<result column="s2c_recv_pkt_num" jdbcType="VARCHAR" property="s2cRecvPktNum" />
<result column="c2s_recv_byte_num" jdbcType="VARCHAR" property="c2sRecvByteNum" />
<result column="s2c_recv_byte_num" jdbcType="VARCHAR" property="s2cRecvByteNum" />
</resultMap>
<resultMap id="MmAvIpLogMap" type="com.nis.domain.restful.MmAvIpLog">
<result column="cfg_id" jdbcType="BIGINT" property="cfgId" />
<result column="found_Time" jdbcType="TIMESTAMP" property="foundTime" />
<result column="recv_Time" jdbcType="TIMESTAMP" property="recvTime" />
<result column="trans_proto" jdbcType="VARCHAR" property="transProto" />
<result column="addr_type" jdbcType="INTEGER" property="addrType" />
<result column="d_ip" jdbcType="VARCHAR" property="dIp" />
<result column="s_ip" jdbcType="VARCHAR" property="sIp" />
<result column="d_port" jdbcType="VARCHAR" property="dPort" />
<result column="s_port" jdbcType="VARCHAR" property="sPort" />
<result column="service" jdbcType="INTEGER" property="service" />
<result column="entrance_id" jdbcType="BIGINT" property="entranceId" />
<result column="device_id" jdbcType="INTEGER" property="deviceId" />
<result column="direction" jdbcType="INTEGER" property="direction" />
<result column="stream_dir" jdbcType="INTEGER" property="streamDir" />
<result column="cap_ip" jdbcType="VARCHAR" property="capIp" />
<result column="addr_list" jdbcType="VARCHAR" property="addrList" />
<result column="user_region" jdbcType="VARCHAR" property="userRegion" />
<result column="pid" jdbcType="VARCHAR" property="pid" />
<result column="url" jdbcType="VARCHAR" property="url" />
<result column="log_uri" jdbcType="VARCHAR" property="logUri" />
<result column="refer" jdbcType="VARCHAR" property="refer" />
<result column="level" jdbcType="INTEGER" property="level" />
<result column="fd_type" jdbcType="INTEGER" property="fdType" />
<result column="protocol" jdbcType="VARCHAR" property="protocol" />
</resultMap>
<resultMap id="MmAvUrlLogMap" type="com.nis.domain.restful.MmAvUrlLog">
<result column="cfg_id" jdbcType="BIGINT" property="cfgId" />
<result column="found_Time" jdbcType="TIMESTAMP" property="foundTime" />
<result column="recv_Time" jdbcType="TIMESTAMP" property="recvTime" />
<result column="trans_proto" jdbcType="VARCHAR" property="transProto" />
<result column="addr_type" jdbcType="INTEGER" property="addrType" />
<result column="d_ip" jdbcType="VARCHAR" property="dIp" />
<result column="s_ip" jdbcType="VARCHAR" property="sIp" />
<result column="d_port" jdbcType="VARCHAR" property="dPort" />
<result column="s_port" jdbcType="VARCHAR" property="sPort" />
<result column="service" jdbcType="INTEGER" property="service" />
<result column="entrance_id" jdbcType="BIGINT" property="entranceId" />
<result column="device_id" jdbcType="INTEGER" property="deviceId" />
<result column="direction" jdbcType="INTEGER" property="direction" />
<result column="stream_dir" jdbcType="INTEGER" property="streamDir" />
<result column="cap_ip" jdbcType="VARCHAR" property="capIp" />
<result column="addr_list" jdbcType="VARCHAR" property="addrList" />
<result column="user_region" jdbcType="VARCHAR" property="userRegion" />
<result column="pid" jdbcType="VARCHAR" property="pid" />
<result column="url" jdbcType="VARCHAR" property="url" />
<result column="log_uri" jdbcType="VARCHAR" property="logUri" />
<result column="refer" jdbcType="VARCHAR" property="refer" />
<result column="level" jdbcType="INTEGER" property="level" />
<result column="fd_type" jdbcType="INTEGER" property="fdType" />
<result column="protocol" jdbcType="VARCHAR" property="protocol" />
</resultMap>
<resultMap id="MmPicIpLogMap" type="com.nis.domain.restful.MmPicIpLog">
<result column="cfg_id" jdbcType="BIGINT" property="cfgId" />
<result column="found_Time" jdbcType="TIMESTAMP" property="foundTime" />
<result column="recv_Time" jdbcType="TIMESTAMP" property="recvTime" />
<result column="trans_proto" jdbcType="VARCHAR" property="transProto" />
<result column="addr_type" jdbcType="INTEGER" property="addrType" />
<result column="d_ip" jdbcType="VARCHAR" property="dIp" />
<result column="s_ip" jdbcType="VARCHAR" property="sIp" />
<result column="d_port" jdbcType="VARCHAR" property="dPort" />
<result column="s_port" jdbcType="VARCHAR" property="sPort" />
<result column="service" jdbcType="INTEGER" property="service" />
<result column="entrance_id" jdbcType="BIGINT" property="entranceId" />
<result column="device_id" jdbcType="INTEGER" property="deviceId" />
<result column="direction" jdbcType="INTEGER" property="direction" />
<result column="stream_dir" jdbcType="INTEGER" property="streamDir" />
<result column="cap_ip" jdbcType="VARCHAR" property="capIp" />
<result column="addr_list" jdbcType="VARCHAR" property="addrList" />
<result column="user_region" jdbcType="VARCHAR" property="userRegion" />
<result column="pid" jdbcType="VARCHAR" property="pid" />
<result column="url" jdbcType="VARCHAR" property="url" />
<result column="log_uri" jdbcType="VARCHAR" property="logUri" />
<result column="refer" jdbcType="VARCHAR" property="refer" />
<result column="level" jdbcType="INTEGER" property="level" />
<result column="fd_type" jdbcType="INTEGER" property="fdType" />
<result column="protocol" jdbcType="VARCHAR" property="protocol" />
</resultMap>
<resultMap id="MmPicUrlLogMap" type="com.nis.domain.restful.MmPicUrlLog">
<result column="cfg_id" jdbcType="BIGINT" property="cfgId" />
<result column="found_Time" jdbcType="TIMESTAMP" property="foundTime" />
<result column="recv_Time" jdbcType="TIMESTAMP" property="recvTime" />
<result column="trans_proto" jdbcType="VARCHAR" property="transProto" />
<result column="addr_type" jdbcType="INTEGER" property="addrType" />
<result column="d_ip" jdbcType="VARCHAR" property="dIp" />
<result column="s_ip" jdbcType="VARCHAR" property="sIp" />
<result column="d_port" jdbcType="VARCHAR" property="dPort" />
<result column="s_port" jdbcType="VARCHAR" property="sPort" />
<result column="service" jdbcType="INTEGER" property="service" />
<result column="entrance_id" jdbcType="BIGINT" property="entranceId" />
<result column="device_id" jdbcType="INTEGER" property="deviceId" />
<result column="direction" jdbcType="INTEGER" property="direction" />
<result column="stream_dir" jdbcType="INTEGER" property="streamDir" />
<result column="cap_ip" jdbcType="VARCHAR" property="capIp" />
<result column="addr_list" jdbcType="VARCHAR" property="addrList" />
<result column="user_region" jdbcType="VARCHAR" property="userRegion" />
<result column="pid" jdbcType="VARCHAR" property="pid" />
<result column="url" jdbcType="VARCHAR" property="url" />
<result column="log_uri" jdbcType="VARCHAR" property="logUri" />
<result column="refer" jdbcType="VARCHAR" property="refer" />
<result column="level" jdbcType="INTEGER" property="level" />
<result column="fd_type" jdbcType="INTEGER" property="fdType" />
<result column="protocol" jdbcType="VARCHAR" property="protocol" />
</resultMap>
<resultMap id="MmVoipLogMap" type="com.nis.domain.restful.MmVoipLog">
<result column="cfg_id" jdbcType="BIGINT" property="cfgId" />
<result column="found_Time" jdbcType="TIMESTAMP" property="foundTime" />
<result column="recv_Time" jdbcType="TIMESTAMP" property="recvTime" />
<result column="trans_proto" jdbcType="VARCHAR" property="transProto" />
<result column="addr_type" jdbcType="INTEGER" property="addrType" />
<result column="d_ip" jdbcType="VARCHAR" property="dIp" />
<result column="s_ip" jdbcType="VARCHAR" property="sIp" />
<result column="d_port" jdbcType="VARCHAR" property="dPort" />
<result column="s_port" jdbcType="VARCHAR" property="sPort" />
<result column="service" jdbcType="INTEGER" property="service" />
<result column="entrance_id" jdbcType="BIGINT" property="entranceId" />
<result column="device_id" jdbcType="INTEGER" property="deviceId" />
<result column="direction" jdbcType="INTEGER" property="direction" />
<result column="stream_dir" jdbcType="INTEGER" property="streamDir" />
<result column="cap_ip" jdbcType="VARCHAR" property="capIp" />
<result column="addr_list" jdbcType="VARCHAR" property="addrList" />
<result column="user_region" jdbcType="VARCHAR" property="userRegion" />
<result column="duation" jdbcType="VARCHAR" property="duation" />
<result column="calling_account" jdbcType="VARCHAR" property="callingAccount" />
<result column="called_account" jdbcType="VARCHAR" property="calledAccount" />
<result column="calling_number" jdbcType="VARCHAR" property="callingNumber" />
<result column="called_number" jdbcType="VARCHAR" property="calledNumber" />
<result column="from_to_store_ip" jdbcType="VARCHAR" property="fromToStoreIp" />
<result column="from_to_store_url" jdbcType="VARCHAR" property="fromToStoreUrl" />
<result column="to_store_from_ip" jdbcType="VARCHAR" property="toFromStoreIp" />
<result column="to_store_from_url" jdbcType="VARCHAR" property="toFromStoreUrl" />
<result column="log_uri" jdbcType="VARCHAR" property="logUri" />
<result column="refer" jdbcType="VARCHAR" property="refer" />
<result column="protocol" jdbcType="VARCHAR" property="protocol" />
<result column="pid" jdbcType="VARCHAR" property="pid" />
<result column="url" jdbcType="VARCHAR" property="url" />
<result column="log_uri" jdbcType="VARCHAR" property="logUri" />
<result column="fd_type" jdbcType="INTEGER" property="fdType" />
</resultMap>

View File

@@ -3033,7 +3033,8 @@ public class ConfigSourcesService extends BaseService {
String maatTableName = ServiceAndRDBIndexReal
.getUnMaatTableName(Integer.valueOf(srcMap.get("service")
.toString().trim()));
dstStr="/home/mesasoft/"+maatTableName.substring(maatTableName.lastIndexOf("_")+1)+"/full/"+dstStr.substring(dstStr.lastIndexOf("/")+1);
String dstPath = Constants.MM_SAMPLE_DST_PATH.replace("{tableType}", maatTableName.substring(maatTableName.lastIndexOf("_")+1));
dstPath=dstPath.replace("{fileName}", dstStr.substring(dstStr.lastIndexOf("/")+1));
}else if ("file_id".equals(commonSourceFieldCfg
.getDstName())) {
dstStr= dstStr.substring(dstStr.indexOf("/group"));
@@ -3253,6 +3254,8 @@ public class ConfigSourcesService extends BaseService {
}
// <service,cfgIdList>
Map<Integer, List<Long>> cfgMap = new HashMap<Integer, List<Long>>();
//所有状态更新的配置isValid的值必须相同
Map<String, String> validIdMap = new HashMap<String, String>();
for (int i = 0; i < jsonObjectList.size(); i++) {
JsonObject jsonObj = (JsonObject) jsonObjectList.get(i);
Map<String, Object> srcMap = JSONObject.fromObject(JSONObject
@@ -3265,6 +3268,7 @@ public class ConfigSourcesService extends BaseService {
msg + sb.toString(),
CompileVal.getBusinessCode());
}
validIdMap.put(srcMap.get("isValid").toString(), srcMap.get("isValid").toString());
Integer service = Integer.valueOf(srcMap.get("service").toString());
Long cfgId = Long.valueOf(srcMap.get("cfgId").toString());
if (cfgMap.containsKey(service)) {
@@ -3276,6 +3280,13 @@ public class ConfigSourcesService extends BaseService {
}
}
if (validIdMap.size()>1) {
thread.setExceptionInfo(RestBusinessCode.IsValidNonUniq.getErrorReason());
throw new RestServiceException(thread,
System.currentTimeMillis() - start,
RestBusinessCode.IsValidNonUniq.getErrorReason(),
RestBusinessCode.IsValidNonUniq.getValue());
}
Map<Integer, Map<Integer, List<Long>>> restMap = new HashMap<Integer, Map<Integer, List<Long>>>();
Iterator serviceIterator = cfgMap.keySet().iterator();
while (serviceIterator.hasNext()) {
@@ -3302,7 +3313,8 @@ public class ConfigSourcesService extends BaseService {
}
}
try {
configRedisService.delUnMaatConfig(restMap);
configRedisService.delUnMaatConfig(restMap,validIdMap.containsKey("0")?true:false);
} catch (Exception e) {
// TODO: handle exception
logger1.error(e.getMessage());
@@ -3343,10 +3355,12 @@ public class ConfigSourcesService extends BaseService {
if (!StringUtil.isNumeric(service)) {
CompileVal.setBusinessCode(RestBusinessCode.IsValidInWrongRange.getValue());
return RestBusinessCode.IsValidInWrongRange.getErrorReason();
} else if (!isValid.equals("0")) {
CompileVal.setBusinessCode(RestBusinessCode.IsValidIsF.getValue());
return RestBusinessCode.IsValidIsF.getErrorReason();
}
//配置取消改为状态更新(停/启用)
// else if (!isValid.equals("0")) {
// CompileVal.setBusinessCode(RestBusinessCode.IsValidIsF.getValue());
// return RestBusinessCode.IsValidIsF.getErrorReason();
// }
}
return "ok";
}

View File

@@ -35,7 +35,7 @@ service=1:128;2:128;16:16;17:16;18:16;19:16;20:16;21:16;22:16;23:16;24:16;26:16;
#0x12 DNS阻断
18=10:NTC_COMPILE;11:NTC_GROUP;12:NTC_UNIVERSAL_IP;13:NTC_UNIVERSAL_PROTO_TYPE;15:NTC_DNS_REGION;18:NTC_IP_RANGE
#0x13 SSL阻断
19=10:NTC_COMPILE;11:NTC_GROUP;12:NTC_UNIVERSAL_IP;13:NTC_UNIVERSAL_PROTO_TYPE;14:NTC_SSL_SNI,NTC_SSL_SAN,NTC_SSL_CA,NTC_SSL_CA;18:NTC_IP_RANGE
19=10:NTC_COMPILE;11:NTC_GROUP;12:NTC_UNIVERSAL_IP;13:NTC_UNIVERSAL_PROTO_TYPE;14:NTC_SSL_SNI,NTC_SSL_SAN,NTC_SSL_CA;18:NTC_IP_RANGE
#0x14 MAIL阻断
20=10:NTC_COMPILE;11:NTC_GROUP;12:NTC_UNIVERSAL_IP;13:NTC_UNIVERSAL_PROTO_TYPE;15:NTC_MAIL_HDR,NTC_MAIL_BODY;16:NTC_FILE_DIGEST;18:NTC_IP_RANGE
#0x15 FTP阻断
@@ -69,7 +69,7 @@ service=1:128;2:128;16:16;17:16;18:16;19:16;20:16;21:16;22:16;23:16;24:16;26:16;
#0x82 DNS监测
130=10:NTC_COMPILE;11:NTC_GROUP;12:NTC_UNIVERSAL_IP;13:NTC_UNIVERSAL_PROTO_TYPE;15:NTC_DNS_REGION;18:NTC_IP_RANGE
#0x83 SSL监测
131=10:NTC_COMPILE;11:NTC_GROUP;12:NTC_UNIVERSAL_IP;13:NTC_UNIVERSAL_PROTO_TYPE;14:NTC_SSL_SNI,NTC_SSL_SAN,NTC_SSL_CN,NTC_SSL_CA;18:NTC_IP_RANGE
131=10:NTC_COMPILE;11:NTC_GROUP;12:NTC_UNIVERSAL_IP;13:NTC_UNIVERSAL_PROTO_TYPE;14:NTC_SSL_SNI,NTC_SSL_SAN,NTC_SSL_CA;18:NTC_IP_RANGE
#0x84 MAIL监测
132=10:NTC_COMPILE;11:NTC_GROUP;12:NTC_UNIVERSAL_IP;13:NTC_UNIVERSAL_PROTO_TYPE;15:NTC_MAIL_HDR,NTC_MAIL_BODY;16:NTC_FILE_DIGEST;18:NTC_IP_RANGE
#0x85 FTP监测

View File

@@ -13,10 +13,11 @@ NtcFtpLogHiveTable=NTC_FTP_LOG
NtcAppLogHiveTable=NTC_APP_LOG
NtcDdosLogHiveTable=NTC_DDOS_LOG
DkBehaviorLogHiveTable=DK_BEHAVIOR_LOG
MmAvIpLogHiveTable=MM_AV_IP_LOG
MmAvUrlLogHiveTable=MM_AV_URL_LOG
MmPicIpLogHiveTable=MM_PIC_IP_LOG
MmPicUrlLogHiveTable=MM_PIC_URL_LOG
MmVoipIpLogHiveTable=MM_VOIP_LOG

View File

@@ -255,3 +255,5 @@ redisStatisticsReal=[COMPILE_ID];\t;[SERVICE];\t;[ACTION];\t;[CONT_TYPE];\t;[ATT
redisStatisticsRealDBIndex=14
#maat测试程序输出日志的文件目录
maatTestLogPath=c:/maat/mmat.log
#样例文件存放目录,{tableType}和{fileName}会替换成具体内容
mmSampleDstPath=/home/mesasoft/{tableType}/full/{fileName}