Merge remote-tracking branch 'remotes/origin/orgin/develop' into develop
This commit is contained in:
@@ -219,7 +219,7 @@ public abstract class BaseLogService {
|
||||
/**
|
||||
* wx 报表查询条件检查
|
||||
*
|
||||
* @param className
|
||||
* @param clazz
|
||||
* 需要检验的实体名称[需要保证resultMap的id命名方式为[className]Map]
|
||||
* @param page
|
||||
* 需要校验的page对象
|
||||
|
||||
@@ -19,8 +19,9 @@ import org.apache.log4j.Logger;
|
||||
import com.nis.datasource.CustomerContextHolder;
|
||||
|
||||
/**
|
||||
* 审计日志工作线程
|
||||
* @ClassName: SaveLogThread.java
|
||||
* @Description: TODO
|
||||
* @Description: 用于记录业务操作日志,后期用于审计及相关联调验证工作
|
||||
* @author (dell)
|
||||
* @date 2016年10月14日 下午6:26:41
|
||||
* @version V1.0
|
||||
@@ -66,7 +67,6 @@ public class SaveRequestLogThread implements Runnable {
|
||||
* 创建一个新的实例 SaveRequestLogThread.
|
||||
*
|
||||
* @param service
|
||||
* @param requestAddr
|
||||
* @param requestURI
|
||||
* @param queryString
|
||||
* @param contextPath
|
||||
|
||||
@@ -67,9 +67,6 @@ public class ServicesRequestLogService {
|
||||
* request中的参数
|
||||
* @param contextPath
|
||||
* request中的参数
|
||||
* @param request
|
||||
* 请求
|
||||
* @param response
|
||||
* 响应
|
||||
* @param operator
|
||||
* 操作人
|
||||
|
||||
@@ -25,10 +25,6 @@ import com.nis.domain.LogEntity;
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.restful.DfDnsLog;
|
||||
import com.nis.domain.restful.DfFtpLog;
|
||||
import com.nis.domain.restful.DfHttpKeywordLog;
|
||||
import com.nis.domain.restful.DfHttpReqLog;
|
||||
import com.nis.domain.restful.DfHttpResLog;
|
||||
import com.nis.domain.restful.DfIpPortLog;
|
||||
import com.nis.domain.restful.DfIpsecLog;
|
||||
import com.nis.domain.restful.DfL2tpLog;
|
||||
import com.nis.domain.restful.DfMailLog;
|
||||
@@ -87,109 +83,8 @@ public class DfLogSearchService extends BaseLogService{
|
||||
public List<LogEntity> findList(LogEntity entity) {
|
||||
return dao.findList(entity);
|
||||
}
|
||||
/**
|
||||
* 查询端口封堵分页数据
|
||||
* @param page 分页对象
|
||||
* @param entity
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public Page<DfIpPortLog> findIpPortPage(Page<DfIpPortLog> page, DfIpPortLog entity,String activeSys) throws Exception{
|
||||
entity.setPage(page);
|
||||
if(Constants.IS_USE_ES){
|
||||
List<DfIpPortLog> resultList=new ArrayList<>();
|
||||
elasticsearchSqlDao.findLogs(resultList, entity,activeSys);
|
||||
page.setList(resultList);
|
||||
}else{
|
||||
page.setList(dao.findIpPortLogs(entity));
|
||||
}
|
||||
|
||||
return page;
|
||||
}
|
||||
/**
|
||||
* 查询分页数据
|
||||
* @param page 分页对象
|
||||
* @param entity
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public Page<DfHttpReqLog> findHttpReqPage(Page<DfHttpReqLog> page, DfHttpReqLog entity,String activeSys) throws Exception {
|
||||
entity.setPage(page);
|
||||
if(Constants.IS_USE_ES){
|
||||
List<DfHttpReqLog> resultList=new ArrayList<>();
|
||||
elasticsearchSqlDao.findLogs(resultList, entity,activeSys);
|
||||
page.setList(resultList);
|
||||
}else{
|
||||
page.setList(dao.findHttpReqLogs(entity));
|
||||
}
|
||||
/*if(type.equals("jdbc")){
|
||||
logger.info("**********oralce JDBC数据查询开始时间"+System.currentTimeMillis());
|
||||
page.setList(MysqlJDBC.queryByCondition(page, entity));
|
||||
logger.info("**********oralce JDBC数据查询结束时间"+System.currentTimeMillis());
|
||||
}else if(type.equals("es")){
|
||||
logger.info("**********es数据查询开始时间"+System.currentTimeMillis());
|
||||
List<DfHttpReqLog> dfHttpReqLogs=new ArrayList<DfHttpReqLog>();
|
||||
elasticsearchSqlDao.findLogs(dfHttpReqLogs, entity);
|
||||
page.setList(dfHttpReqLogs);
|
||||
logger.info("**********es数据查询开始时间"+System.currentTimeMillis());
|
||||
}else{
|
||||
logger.info("**********oralce Mybatis数据查询开始时间"+System.currentTimeMillis());
|
||||
page.setList(dao.findHttpReqLogs(entity));
|
||||
logger.info("**********oralce Mybatis数据查询开始结束"+System.currentTimeMillis());
|
||||
}*/
|
||||
return page;
|
||||
}
|
||||
/**
|
||||
* 查询分页数据
|
||||
* @param page 分页对象
|
||||
* @param entity
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public Page<DfHttpResLog> findHttpResPage(Page<DfHttpResLog> page, DfHttpResLog entity,String activeSys) throws Exception{
|
||||
entity.setPage(page);
|
||||
if(Constants.IS_USE_ES){
|
||||
List<DfHttpResLog> resultList=new ArrayList<>();
|
||||
elasticsearchSqlDao.findLogs(resultList, entity,activeSys);
|
||||
page.setList(resultList);
|
||||
}else{
|
||||
page.setList(dao.findHttpResLogs(entity));
|
||||
}
|
||||
return page;
|
||||
}
|
||||
/**
|
||||
* 查询分页数据
|
||||
* @param page 分页对象
|
||||
* @param entity
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public Page<DfHttpKeywordLog> findHttpKeywordPage(Page<DfHttpKeywordLog> page, DfHttpKeywordLog entity,String activeSys) throws Exception {
|
||||
entity.setPage(page);
|
||||
if(Constants.IS_USE_ES){
|
||||
List<DfHttpKeywordLog> resultList=new ArrayList<>();
|
||||
elasticsearchSqlDao.findLogs(resultList, entity,activeSys);
|
||||
page.setList(resultList);
|
||||
}else{
|
||||
page.setList(dao.findHttpKeywordLogs(entity));
|
||||
}
|
||||
return page;
|
||||
}
|
||||
/**
|
||||
* 查询分页数据
|
||||
* @throws Exception
|
||||
*/
|
||||
public Page<DfHttpKeywordLog> findHttpMultiPartPage(Page<DfHttpKeywordLog> page, DfHttpKeywordLog entity,String activeSys) throws Exception {
|
||||
entity.setPage(page);
|
||||
if(Constants.IS_USE_ES){
|
||||
List<DfHttpKeywordLog> resultList=new ArrayList<>();
|
||||
elasticsearchSqlDao.findLogs(resultList, entity,activeSys);
|
||||
page.setList(resultList);
|
||||
}else{
|
||||
page.setList(dao.findHttpKeywordLogs(entity));
|
||||
}
|
||||
return page;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询分页数据
|
||||
* @param page 分页对象
|
||||
@@ -373,64 +268,7 @@ public class DfLogSearchService extends BaseLogService{
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询端口封堵分页数据
|
||||
* @param page 分页对象
|
||||
* @param entity
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public Page<DfIpPortLog> findIpPortPageCluster(Page<DfIpPortLog> page, DfIpPortLog entity,String activeSys) throws Exception{
|
||||
entity.setPage(page);
|
||||
page.setList(daoCluster.findIpPortLogsCluster(entity));
|
||||
|
||||
return page;
|
||||
}
|
||||
/**
|
||||
* 查询分页数据
|
||||
* @param page 分页对象
|
||||
* @param entity
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public Page<DfHttpReqLog> findHttpReqPageCluster(Page<DfHttpReqLog> page, DfHttpReqLog entity,String activeSys) throws Exception {
|
||||
entity.setPage(page);
|
||||
page.setList(daoCluster.findHttpReqLogsCluster(entity));
|
||||
return page;
|
||||
}
|
||||
/**
|
||||
* 查询分页数据
|
||||
* @param page 分页对象
|
||||
* @param entity
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public Page<DfHttpResLog> findHttpResPageCluster(Page<DfHttpResLog> page, DfHttpResLog entity,String activeSys) throws Exception{
|
||||
entity.setPage(page);
|
||||
page.setList(daoCluster.findHttpResLogsCluster(entity));
|
||||
return page;
|
||||
}
|
||||
/**
|
||||
* 查询分页数据
|
||||
* @param page 分页对象
|
||||
* @param entity
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public Page<DfHttpKeywordLog> findHttpKeywordPageCluster(Page<DfHttpKeywordLog> page, DfHttpKeywordLog entity,String activeSys) throws Exception {
|
||||
entity.setPage(page);
|
||||
page.setList(daoCluster.findHttpKeywordLogsCluster(entity));
|
||||
return page;
|
||||
}
|
||||
/**
|
||||
* 查询分页数据
|
||||
* @throws Exception
|
||||
*/
|
||||
public Page<DfHttpKeywordLog> findHttpMultiPartPageCluster(Page<DfHttpKeywordLog> page, DfHttpKeywordLog entity,String activeSys) throws Exception {
|
||||
entity.setPage(page);
|
||||
page.setList(daoCluster.findHttpKeywordLogsCluster(entity));
|
||||
return page;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询分页数据
|
||||
* @param page 分页对象
|
||||
|
||||
596
src/main/java/com/nis/web/service/restful/LogTestService.java
Normal file
596
src/main/java/com/nis/web/service/restful/LogTestService.java
Normal file
@@ -0,0 +1,596 @@
|
||||
package com.nis.web.service.restful;
|
||||
|
||||
import com.beust.jcommander.internal.Lists;
|
||||
import com.nis.domain.LogEntity;
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.restful.*;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.web.service.BaseLogService;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.twill.api.logging.LogEntry;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by darnell on 2018/6/10.
|
||||
* 日志测试业务类,用于接口或临时验证测试使用
|
||||
*/
|
||||
@Service
|
||||
public class LogTestService extends BaseLogService {
|
||||
|
||||
protected final Logger logger = Logger.getLogger(this.getClass());
|
||||
|
||||
|
||||
/**
|
||||
* IP地址日志检索测试业务方法
|
||||
* @param page
|
||||
* @param entity
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public Page<NtcIpLog> findNtcIpLogPage(Page<NtcIpLog> page, NtcIpLog entity) throws Exception{
|
||||
List<NtcIpLog> ntcIpLogs = Lists.newArrayList();
|
||||
NtcIpLog ntcIpLog = new NtcIpLog();
|
||||
ntcIpLog.setId(35L);
|
||||
ntcIpLog.setCfgId(531L);
|
||||
ntcIpLog.setServiceType(16);
|
||||
ntcIpLog.setFoundTime(new Date());
|
||||
ntcIpLog.setRecvTime(new Date());
|
||||
ntcIpLog.setAddrType(4);
|
||||
ntcIpLog.setProtocol("IPv4_TCP");
|
||||
ntcIpLog.setClientIp("192.168.10.106");
|
||||
ntcIpLog.setClientPort(80);
|
||||
ntcIpLog.setServerIp("202.106.0.20");
|
||||
ntcIpLog.setServerPort(8443);
|
||||
ntcIpLog.setCljIp("10.0.6.240");
|
||||
ntcIpLog.setDeviceId(1356981);
|
||||
ntcIpLog.setDirection(0);
|
||||
ntcIpLog.setStreamType(0);
|
||||
ntcIpLog.setEntranceId(21L);
|
||||
ntcIpLog.setUserRegion("531");
|
||||
ntcIpLog.setClientLocate("本地地址");
|
||||
ntcIpLog.setServerLocate("中国 北京 电信宽带光纤");
|
||||
ntcIpLogs.add(ntcIpLog);
|
||||
|
||||
ntcIpLog = new NtcIpLog();
|
||||
ntcIpLog.setId(36L);
|
||||
ntcIpLog.setCfgId(532L);
|
||||
ntcIpLog.setServiceType(128);
|
||||
ntcIpLog.setFoundTime(new Date());
|
||||
ntcIpLog.setRecvTime(new Date());
|
||||
ntcIpLog.setAddrType(4);
|
||||
ntcIpLog.setProtocol("IPv4_TCP");
|
||||
ntcIpLog.setClientIp("192.168.10.106");
|
||||
ntcIpLog.setClientPort(80);
|
||||
ntcIpLog.setServerIp("202.106.0.20");
|
||||
ntcIpLog.setServerPort(8443);
|
||||
ntcIpLog.setCljIp("10.0.6.240");
|
||||
ntcIpLog.setDeviceId(1356981);
|
||||
ntcIpLog.setDirection(0);
|
||||
ntcIpLog.setStreamType(0);
|
||||
ntcIpLog.setEntranceId(21L);
|
||||
ntcIpLog.setUserRegion("531");
|
||||
ntcIpLog.setClientLocate("本地地址");
|
||||
ntcIpLog.setServerLocate("中国 北京 电信宽带光纤");
|
||||
ntcIpLogs.add(ntcIpLog);
|
||||
page.setCount(ntcIpLogs.size());
|
||||
|
||||
page.setList(ntcIpLogs);
|
||||
|
||||
|
||||
return page;
|
||||
}
|
||||
|
||||
/**
|
||||
* http 日志检索测试业务方法
|
||||
* @param page
|
||||
* @param entity
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public Page<NtcHttpLog> findNtcHttpLogPage(Page<NtcHttpLog> page, NtcHttpLog entity) throws Exception {
|
||||
|
||||
List<NtcHttpLog> ntcHttpLogs = Lists.newArrayList();
|
||||
|
||||
NtcHttpLog ntcHttpLog = new NtcHttpLog();
|
||||
ntcHttpLog = (NtcHttpLog) createTestData(ntcHttpLog);
|
||||
ntcHttpLog.setId(35L);
|
||||
ntcHttpLog.setCfgId(1532L);
|
||||
ntcHttpLog.setServiceType(17);
|
||||
ntcHttpLog.setUserRegion("1532");
|
||||
ntcHttpLog.setC2sIsn(19034211L);
|
||||
ntcHttpLog.setHttpProxyFlag(211L);
|
||||
ntcHttpLog.setHttpSeq(1L);
|
||||
ntcHttpLog.setUrl("http://jd.com/get/api/json");
|
||||
ntcHttpLog.setReqLine("Get jd.com");
|
||||
ntcHttpLog.setResLine("response line content");
|
||||
ntcHttpLogs.add(ntcHttpLog);
|
||||
|
||||
|
||||
ntcHttpLog = new NtcHttpLog();
|
||||
ntcHttpLog = (NtcHttpLog) createTestData(ntcHttpLog);
|
||||
ntcHttpLog.setId(36L);
|
||||
ntcHttpLog.setCfgId(1533L);
|
||||
ntcHttpLog.setServiceType(129);
|
||||
ntcHttpLog.setUserRegion("1533");
|
||||
ntcHttpLog.setC2sIsn(19034211L);
|
||||
ntcHttpLog.setHttpProxyFlag(211L);
|
||||
ntcHttpLog.setC2sIsn(190342112L);
|
||||
ntcHttpLog.setHttpProxyFlag(212L);
|
||||
ntcHttpLog.setHttpSeq(2L);
|
||||
ntcHttpLog.setUrl("http://jd.com/get/api/json/abc");
|
||||
ntcHttpLog.setReqLine("Get jd.com");
|
||||
ntcHttpLog.setResLine("response line content");
|
||||
ntcHttpLogs.add(ntcHttpLog);
|
||||
|
||||
|
||||
page.setCount(ntcHttpLogs.size());
|
||||
page.setList(ntcHttpLogs);
|
||||
|
||||
return page;
|
||||
}
|
||||
|
||||
/**
|
||||
* dns 日志检索测试方法
|
||||
* @param page
|
||||
* @param entity
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public Page<NtcDnsLog> findNtcDnsLogPage(Page<NtcDnsLog> page, NtcDnsLog entity) throws Exception {
|
||||
|
||||
List<NtcDnsLog> ntcDnsLogs = Lists.newArrayList();
|
||||
|
||||
NtcDnsLog ntcDnsLog = new NtcDnsLog();
|
||||
ntcDnsLog = (NtcDnsLog) createTestData(ntcDnsLog);
|
||||
ntcDnsLog.setId(37L);
|
||||
ntcDnsLog.setCfgId(2532L);
|
||||
ntcDnsLog.setServiceType(18);
|
||||
ntcDnsLog.setUserRegion("2532");
|
||||
ntcDnsLog.setQr(0);
|
||||
ntcDnsLog.setRd(1);
|
||||
ntcDnsLog.setRa(0);
|
||||
ntcDnsLog.setRr("query");
|
||||
ntcDnsLog.setqType(0);
|
||||
ntcDnsLog.setQclass(0);
|
||||
ntcDnsLog.setOpcode(0);
|
||||
ntcDnsLog.setQname("www.sina.com.cn");
|
||||
ntcDnsLog.setCname("sina");
|
||||
ntcDnsLog.setDnsSub(1);
|
||||
|
||||
ntcDnsLogs.add(ntcDnsLog);
|
||||
|
||||
|
||||
ntcDnsLog = new NtcDnsLog();
|
||||
ntcDnsLog = (NtcDnsLog) createTestData(ntcDnsLog);
|
||||
ntcDnsLog.setId(38L);
|
||||
ntcDnsLog.setCfgId(2533L);
|
||||
ntcDnsLog.setServiceType(130);
|
||||
ntcDnsLog.setUserRegion("2533");
|
||||
ntcDnsLog.setQr(1);
|
||||
ntcDnsLog.setRd(1);
|
||||
ntcDnsLog.setRa(0);
|
||||
ntcDnsLog.setRr("query");
|
||||
ntcDnsLog.setqType(1);
|
||||
ntcDnsLog.setQclass(1);
|
||||
ntcDnsLog.setOpcode(1);
|
||||
ntcDnsLog.setQname("www.sina.com.cn");
|
||||
ntcDnsLog.setCname("sina");
|
||||
ntcDnsLog.setDnsSub(2);
|
||||
|
||||
ntcDnsLogs.add(ntcDnsLog);
|
||||
|
||||
|
||||
page.setCount(ntcDnsLogs.size());
|
||||
page.setList(ntcDnsLogs);
|
||||
|
||||
return page;
|
||||
}
|
||||
|
||||
/**
|
||||
* SSL 日志检索测试方法
|
||||
* @param page
|
||||
* @param entity
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public Page<NtcSslLog> findNtcSslLogPage(Page<NtcSslLog> page, NtcSslLog entity) throws Exception {
|
||||
|
||||
List<NtcSslLog> ntcSslLogs = Lists.newArrayList();
|
||||
|
||||
NtcSslLog ntcSslLog = new NtcSslLog();
|
||||
ntcSslLog = (NtcSslLog) createTestData(ntcSslLog);
|
||||
ntcSslLog.setId(39L);
|
||||
ntcSslLog.setCfgId(4532L);
|
||||
ntcSslLog.setServiceType(19);
|
||||
ntcSslLog.setUserRegion("4532");
|
||||
ntcSslLog.setVersion("版本 3");
|
||||
ntcSslLog.setSni("*.cnblogs.cn");
|
||||
ntcSslLog.setCa("DigCert Inc");
|
||||
ntcSslLog.setSan("*.cnblogs.cn");
|
||||
|
||||
|
||||
ntcSslLogs.add(ntcSslLog);
|
||||
|
||||
|
||||
ntcSslLog = new NtcSslLog();
|
||||
ntcSslLog = (NtcSslLog) createTestData(ntcSslLog);
|
||||
ntcSslLog.setId(40L);
|
||||
ntcSslLog.setCfgId(4533L);
|
||||
ntcSslLog.setServiceType(131);
|
||||
ntcSslLog.setUserRegion("4533");
|
||||
ntcSslLog.setVersion("版本 3");
|
||||
ntcSslLog.setSni("*.cnblogs.cn");
|
||||
ntcSslLog.setCa("DigCert Inc");
|
||||
ntcSslLog.setSan("*.cnblogs.cn");
|
||||
|
||||
|
||||
ntcSslLogs.add(ntcSslLog);
|
||||
|
||||
|
||||
page.setCount(ntcSslLogs.size());
|
||||
page.setList(ntcSslLogs);
|
||||
|
||||
return page;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Mail日志检索测试方法
|
||||
* @param page
|
||||
* @param entity
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public Page<NtcMailLog> findNtcMailLogPage(Page<NtcMailLog> page, NtcMailLog entity) throws Exception {
|
||||
|
||||
List<NtcMailLog> ntcMailLogs = Lists.newArrayList();
|
||||
|
||||
NtcMailLog ntcMailLog = new NtcMailLog();
|
||||
ntcMailLog = (NtcMailLog) createTestData(ntcMailLog);
|
||||
ntcMailLog.setId(38L);
|
||||
ntcMailLog.setCfgId(3532L);
|
||||
ntcMailLog.setServiceType(20);
|
||||
ntcMailLog.setUserRegion("3532");
|
||||
ntcMailLog.setMailProto("SMTP");
|
||||
ntcMailLog.setMailFrom("darnell@163.com");
|
||||
ntcMailLog.setMailTo("iamfree@163.com");
|
||||
ntcMailLog.setSubject("领导工资问题,涨涨");
|
||||
ntcMailLog.setEmlFile("http://127.0.0.1/abc.eml");
|
||||
ntcMailLogs.add(ntcMailLog);
|
||||
|
||||
|
||||
ntcMailLog = new NtcMailLog();
|
||||
ntcMailLog = (NtcMailLog) createTestData(ntcMailLog);
|
||||
ntcMailLog.setId(39L);
|
||||
ntcMailLog.setCfgId(3533L);
|
||||
ntcMailLog.setServiceType(132);
|
||||
ntcMailLog.setUserRegion("3533");
|
||||
ntcMailLog.setMailProto("smtp");
|
||||
ntcMailLog.setMailFrom("iamfree@163.com");
|
||||
ntcMailLog.setMailTo("darnell@163.com");
|
||||
ntcMailLog.setSubject("滚");
|
||||
ntcMailLog.setEmlFile("http://127.0.0.1/abc.eml");
|
||||
|
||||
ntcMailLogs.add(ntcMailLog);
|
||||
|
||||
|
||||
page.setCount(ntcMailLogs.size());
|
||||
page.setList(ntcMailLogs);
|
||||
|
||||
return page;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* PPTP 日志检索测试方法
|
||||
* @param page
|
||||
* @param entity
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public Page<NtcPptpLog> findNtcPptpLogPage(Page<NtcPptpLog> page, NtcPptpLog entity) throws Exception {
|
||||
|
||||
List<NtcPptpLog> ntcPptpLogs = Lists.newArrayList();
|
||||
|
||||
NtcPptpLog ntcPptpLog = new NtcPptpLog();
|
||||
ntcPptpLog = (NtcPptpLog) createTestData(ntcPptpLog);
|
||||
ntcPptpLog.setId(41L);
|
||||
ntcPptpLog.setCfgId(5532L);
|
||||
ntcPptpLog.setServiceType(22);
|
||||
ntcPptpLog.setUserRegion("5532");
|
||||
ntcPptpLog.setTunnelType(1);
|
||||
ntcPptpLog.setEncryptMode(1);
|
||||
|
||||
|
||||
|
||||
ntcPptpLogs.add(ntcPptpLog);
|
||||
|
||||
|
||||
ntcPptpLog = new NtcPptpLog();
|
||||
ntcPptpLog = (NtcPptpLog) createTestData(ntcPptpLog);
|
||||
ntcPptpLog.setId(42L);
|
||||
ntcPptpLog.setCfgId(4533L);
|
||||
ntcPptpLog.setServiceType(134);
|
||||
ntcPptpLog.setUserRegion("5533");
|
||||
ntcPptpLog.setTunnelType(2);
|
||||
ntcPptpLog.setEncryptMode(6);
|
||||
|
||||
|
||||
|
||||
ntcPptpLogs.add(ntcPptpLog);
|
||||
|
||||
|
||||
page.setCount(ntcPptpLogs.size());
|
||||
page.setList(ntcPptpLogs);
|
||||
|
||||
return page;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* L2TP 日志检索测试方法
|
||||
* @param page
|
||||
* @param entity
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public Page<NtcL2tpLog> findNtcL2tpLogPage(Page<NtcL2tpLog> page, NtcL2tpLog entity) throws Exception {
|
||||
|
||||
List<NtcL2tpLog> ntcL2tpLogs = Lists.newArrayList();
|
||||
|
||||
NtcL2tpLog ntcL2tpLog = new NtcL2tpLog();
|
||||
ntcL2tpLog = (NtcL2tpLog) createTestData(ntcL2tpLog);
|
||||
ntcL2tpLog.setId(43L);
|
||||
ntcL2tpLog.setCfgId(6532L);
|
||||
ntcL2tpLog.setServiceType(23);
|
||||
ntcL2tpLog.setUserRegion("6532");
|
||||
ntcL2tpLog.setTunnelType(1);
|
||||
ntcL2tpLog.setEncryptMode(1);
|
||||
|
||||
|
||||
|
||||
ntcL2tpLogs.add(ntcL2tpLog);
|
||||
ntcL2tpLog = new NtcL2tpLog();
|
||||
ntcL2tpLog = (NtcL2tpLog) createTestData(ntcL2tpLog);
|
||||
ntcL2tpLog.setId(44L);
|
||||
ntcL2tpLog.setCfgId(6533L);
|
||||
ntcL2tpLog.setServiceType(135);
|
||||
ntcL2tpLog.setUserRegion("6533");
|
||||
ntcL2tpLog.setTunnelType(2);
|
||||
ntcL2tpLog.setEncryptMode(2);
|
||||
|
||||
|
||||
|
||||
ntcL2tpLogs.add(ntcL2tpLog);
|
||||
|
||||
|
||||
page.setCount(ntcL2tpLogs.size());
|
||||
page.setList(ntcL2tpLogs);
|
||||
|
||||
return page;
|
||||
}
|
||||
|
||||
/**
|
||||
*OPENVPN 日志检索测试方法
|
||||
* @param page
|
||||
* @param entity
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public Page<NtcOpenvpnLog> findNtcOpenvpnLogPage(Page<NtcOpenvpnLog> page, NtcOpenvpnLog entity) throws Exception {
|
||||
|
||||
List<NtcOpenvpnLog> ntcOpenvpnLogs = Lists.newArrayList();
|
||||
|
||||
NtcOpenvpnLog ntcOpenvpnLog = new NtcOpenvpnLog();
|
||||
ntcOpenvpnLog = (NtcOpenvpnLog) createTestData(ntcOpenvpnLog);
|
||||
ntcOpenvpnLog.setId(45L);
|
||||
ntcOpenvpnLog.setCfgId(6532L);
|
||||
ntcOpenvpnLog.setServiceType(24);
|
||||
ntcOpenvpnLog.setUserRegion("6532");
|
||||
ntcOpenvpnLog.setVersion("版本1");
|
||||
ntcOpenvpnLog.setEncryptMode("AES");
|
||||
ntcOpenvpnLog.setHmac(1);
|
||||
ntcOpenvpnLog.setTunnelType(1);
|
||||
|
||||
|
||||
|
||||
ntcOpenvpnLogs.add(ntcOpenvpnLog);
|
||||
|
||||
|
||||
ntcOpenvpnLog = new NtcOpenvpnLog();
|
||||
ntcOpenvpnLog = (NtcOpenvpnLog) createTestData(ntcOpenvpnLog);
|
||||
ntcOpenvpnLog.setId(46L);
|
||||
ntcOpenvpnLog.setCfgId(4533L);
|
||||
ntcOpenvpnLog.setServiceType(136);
|
||||
ntcOpenvpnLog.setUserRegion("6533");
|
||||
ntcOpenvpnLog.setVersion("版本1");
|
||||
ntcOpenvpnLog.setEncryptMode("MD5");
|
||||
ntcOpenvpnLog.setHmac(1);
|
||||
ntcOpenvpnLog.setTunnelType(2);
|
||||
|
||||
|
||||
|
||||
ntcOpenvpnLogs.add(ntcOpenvpnLog);
|
||||
|
||||
|
||||
page.setCount(ntcOpenvpnLogs.size());
|
||||
page.setList(ntcOpenvpnLogs);
|
||||
|
||||
return page;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* IPSEC 日志检索测试方法
|
||||
* @param page
|
||||
* @param entity
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public Page<NtcIpsecLog> findNtcIpsecLogPage(Page<NtcIpsecLog> page, NtcIpsecLog entity) throws Exception {
|
||||
|
||||
List<NtcIpsecLog> ntcIpsecLogs = Lists.newArrayList();
|
||||
|
||||
NtcIpsecLog ntcIpsecLog = new NtcIpsecLog();
|
||||
ntcIpsecLog = (NtcIpsecLog) createTestData(ntcIpsecLog);
|
||||
ntcIpsecLog.setId(47L);
|
||||
ntcIpsecLog.setCfgId(7532L);
|
||||
ntcIpsecLog.setServiceType(137);
|
||||
ntcIpsecLog.setUserRegion("7532");
|
||||
ntcIpsecLog.setExProtocol(1);
|
||||
ntcIpsecLog.setIsakmpMode(1);
|
||||
|
||||
ntcIpsecLogs.add(ntcIpsecLog);
|
||||
|
||||
|
||||
ntcIpsecLog = new NtcIpsecLog();
|
||||
ntcIpsecLog = (NtcIpsecLog) createTestData(ntcIpsecLog);
|
||||
|
||||
ntcIpsecLog.setId(48L);
|
||||
ntcIpsecLog.setCfgId(7533L);
|
||||
ntcIpsecLog.setServiceType(137);
|
||||
ntcIpsecLog.setUserRegion("7533");
|
||||
ntcIpsecLog.setExProtocol(2);
|
||||
ntcIpsecLog.setIsakmpMode(2);
|
||||
|
||||
|
||||
|
||||
|
||||
ntcIpsecLogs.add(ntcIpsecLog);
|
||||
|
||||
|
||||
page.setCount(ntcIpsecLogs.size());
|
||||
page.setList(ntcIpsecLogs);
|
||||
|
||||
return page;
|
||||
}
|
||||
|
||||
/**
|
||||
* SSH 日志检索测试方法
|
||||
* @param page
|
||||
* @param entity
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public Page<NtcSshLog> findNtcSshLogPage(Page<NtcSshLog> page, NtcSshLog entity) throws Exception {
|
||||
|
||||
List<NtcSshLog> ntcSshLogs = Lists.newArrayList();
|
||||
|
||||
NtcSshLog ntcSshLog = new NtcSshLog();
|
||||
ntcSshLog = (NtcSshLog) createTestData(ntcSshLog);
|
||||
ntcSshLog.setId(49L);
|
||||
ntcSshLog.setCfgId(8532L);
|
||||
ntcSshLog.setServiceType(26);
|
||||
ntcSshLog.setUserRegion("8532");
|
||||
ntcSshLog.setVersion("版本2");
|
||||
ntcSshLog.setHostKey("*&SDAEAS");
|
||||
ntcSshLog.setHostCookie("87we8wewe888888");
|
||||
ntcSshLog.setEncryptMode("SHA-1");
|
||||
ntcSshLog.setMac("CRC");
|
||||
ntcSshLog.setTunnelType(1);
|
||||
|
||||
|
||||
ntcSshLogs.add(ntcSshLog);
|
||||
|
||||
|
||||
ntcSshLog = new NtcSshLog();
|
||||
ntcSshLog = (NtcSshLog) createTestData(ntcSshLog);
|
||||
ntcSshLog.setId(50L);
|
||||
ntcSshLog.setCfgId(8533L);
|
||||
ntcSshLog.setServiceType(138);
|
||||
ntcSshLog.setUserRegion("8533");
|
||||
ntcSshLog.setVersion("版本2");
|
||||
ntcSshLog.setHostKey("*&SDAEAS111");
|
||||
ntcSshLog.setHostCookie("87we8wewe88228888");
|
||||
ntcSshLog.setEncryptMode("SHA-1");
|
||||
ntcSshLog.setMac("CRC");
|
||||
ntcSshLog.setTunnelType(2);
|
||||
|
||||
|
||||
ntcSshLogs.add(ntcSshLog);
|
||||
|
||||
page.setCount(ntcSshLogs.size());
|
||||
page.setList(ntcSshLogs);
|
||||
|
||||
return page;
|
||||
}
|
||||
|
||||
/**
|
||||
* FTP 日志检索测试方法
|
||||
* @param page
|
||||
* @param entity
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public Page<NtcFtpLog> findNtcFtpLogPage(Page<NtcFtpLog> page, NtcFtpLog entity) throws Exception {
|
||||
|
||||
List<NtcFtpLog> ntcFtpLogs = Lists.newArrayList();
|
||||
|
||||
NtcFtpLog ntcFtpLog = new NtcFtpLog();
|
||||
ntcFtpLog = (NtcFtpLog) createTestData(ntcFtpLog);
|
||||
ntcFtpLog.setId(51L);
|
||||
ntcFtpLog.setCfgId(9532L);
|
||||
ntcFtpLog.setServiceType(21);
|
||||
ntcFtpLog.setUserRegion(" 9532");
|
||||
ntcFtpLog.setFtpUrl("ftp://127.0.0.1/a/b/c.txt");
|
||||
ntcFtpLog.setFtpContent("我能解附件内容");
|
||||
|
||||
|
||||
|
||||
ntcFtpLogs.add(ntcFtpLog);
|
||||
|
||||
|
||||
ntcFtpLog = new NtcFtpLog();
|
||||
ntcFtpLog = (NtcFtpLog) createTestData(ntcFtpLog);
|
||||
ntcFtpLog.setId(52L);
|
||||
ntcFtpLog.setCfgId(9533L);
|
||||
ntcFtpLog.setServiceType(133);
|
||||
ntcFtpLog.setUserRegion("9533");
|
||||
ntcFtpLog.setFtpUrl("ftp://127.0.0.1/a/b/d.txt");
|
||||
ntcFtpLog.setFtpContent("我能解附件内容");
|
||||
|
||||
ntcFtpLogs.add(ntcFtpLog);
|
||||
|
||||
page.setCount(ntcFtpLogs.size());
|
||||
page.setList(ntcFtpLogs);
|
||||
|
||||
return page;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private Object createTestData(LogEntity logEntity) {
|
||||
logEntity.setProtocol("IPv4_TCP");
|
||||
logEntity.setFoundTime(new Date());
|
||||
logEntity.setRecvTime(new Date());
|
||||
logEntity.setAddrType(4);
|
||||
logEntity.setClientIp("192.168.10.106");
|
||||
logEntity.setClientPort(80);
|
||||
logEntity.setServerIp("202.106.0.20");
|
||||
logEntity.setServerPort(8443);
|
||||
logEntity.setCljIp("10.0.6.240");
|
||||
logEntity.setDeviceId(1356981);
|
||||
logEntity.setDirection(0);
|
||||
logEntity.setStreamType(0);
|
||||
logEntity.setEntranceId(21L);
|
||||
logEntity.setClientLocate("本地地址");
|
||||
logEntity.setServerLocate("中国 北京 电信宽带光纤");
|
||||
|
||||
return logEntity;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user