fix(all):清除历史无用日志处理类
This commit is contained in:
@@ -1,46 +0,0 @@
|
||||
/**
|
||||
*@Title: DfIpPortUdpService.java
|
||||
*@Package com.nis.web.service.restful
|
||||
*@Description TODO
|
||||
*@author wx
|
||||
*@date 2016年9月7日 下午3:28:44
|
||||
*@version 版本号
|
||||
*/
|
||||
package com.nis.web.service.restful;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.restful.DfIpPortUdp;
|
||||
import com.nis.web.dao.DfIpPortUdpDao;
|
||||
import com.nis.web.service.CrudService;
|
||||
|
||||
/**
|
||||
* @ClassName: DfIpPortUdpService.java
|
||||
* @Description: TODO
|
||||
* @author (wx)
|
||||
* @date 2016年9月7日 下午3:28:44
|
||||
* @version V1.0
|
||||
*/
|
||||
@Service
|
||||
public class DfIpPortUdpService extends CrudService<DfIpPortUdpDao, DfIpPortUdp> {
|
||||
@Autowired
|
||||
public DfIpPortUdpDao dfIpPortUdpDao;
|
||||
public void saveDfIpPortUdpBatch(List<DfIpPortUdp> entity) {
|
||||
// TODO Auto-generated method stub
|
||||
super.saveBatch(entity,DfIpPortUdpDao.class);
|
||||
}
|
||||
public void updateDfIpPortUdpBatch(List<DfIpPortUdp> entity) {
|
||||
// TODO Auto-generated method stub
|
||||
super.updateBatch(entity, DfIpPortUdpDao.class);
|
||||
}
|
||||
public void removeDfIpPortUdp(long id) {
|
||||
dfIpPortUdpDao.delete(id);
|
||||
}
|
||||
public void removeDfIpPortUdpBatch(List<DfIpPortUdp> entity) {
|
||||
super.deleteBatch(entity, DfIpPortUdpDao.class);
|
||||
}
|
||||
}
|
||||
@@ -1,111 +0,0 @@
|
||||
package com.nis.web.service.restful;
|
||||
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.restful.DfKeyConvertUrl;
|
||||
import com.nis.restful.RestBusinessCode;
|
||||
import com.nis.restful.RestServiceException;
|
||||
import com.nis.util.StringUtil;
|
||||
import com.nis.web.dao.DfKeyConvertUrlDao;
|
||||
import com.nis.web.service.BaseLogService;
|
||||
import com.nis.web.service.AuditLogThread;
|
||||
|
||||
/**
|
||||
* @ClassName: DfKeyConvertUrlService
|
||||
* @Description: TODO(这里用一句话描述这个类的作用)
|
||||
* @author (DDM)
|
||||
* @date 2016年9月27日上午10:12:58
|
||||
* @version V1.0
|
||||
*/
|
||||
@Service
|
||||
public class DfKeyConvertUrlService extends BaseLogService {
|
||||
private static SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
protected final Logger logger = Logger.getLogger(this.getClass());
|
||||
/**
|
||||
* 持久层对象
|
||||
*/
|
||||
@Autowired
|
||||
protected DfKeyConvertUrlDao dao;
|
||||
|
||||
/**
|
||||
* 查询分页数据
|
||||
* @param page 分页对象
|
||||
* @param entity
|
||||
* @return
|
||||
*/
|
||||
public Page<DfKeyConvertUrl> findFlowControlStopPage(Page<DfKeyConvertUrl> page,
|
||||
DfKeyConvertUrl entity) {
|
||||
entity.setPage(page);
|
||||
page.setList(dao.findDfKeyConvertUrlPage(entity));
|
||||
return page;
|
||||
}
|
||||
|
||||
/**
|
||||
* 关键字业务转换url查询条件检查
|
||||
* wx
|
||||
* @param entity
|
||||
*/
|
||||
public void queryConditionCheck(AuditLogThread thread, long start, DfKeyConvertUrl entity, Page page) {
|
||||
|
||||
try {
|
||||
if (!StringUtil.isBlank(entity.getSearchId())) {
|
||||
Long.parseLong(entity.getSearchId());
|
||||
}
|
||||
} catch (NumberFormatException e) {
|
||||
thread.setExceptionInfo(e.getMessage()+" "+e.getCause());
|
||||
logger.error(e);
|
||||
throw new RestServiceException(thread, System.currentTimeMillis() - start, "searchId参数格式错误",
|
||||
RestBusinessCode.param_formate_error.getValue());
|
||||
} catch (Exception e) {
|
||||
thread.setExceptionInfo(e.getMessage()+" "+e.getCause());
|
||||
logger.error(e);
|
||||
throw new RestServiceException(thread, System.currentTimeMillis() - start, "searchId参数错误");
|
||||
}
|
||||
|
||||
try {
|
||||
if (!StringUtil.isBlank(entity.getOptStartTime())) {
|
||||
sdf.parse(entity.getOptStartTime());
|
||||
}
|
||||
} catch (ParseException e) {
|
||||
thread.setExceptionInfo(e.getMessage()+" "+e.getCause());
|
||||
logger.error(e);
|
||||
throw new RestServiceException(thread,System.currentTimeMillis()-start,"optStartTime参数格式错误", RestBusinessCode.param_formate_error.getValue());
|
||||
} catch (Exception e) {
|
||||
thread.setExceptionInfo(e.getMessage()+" "+e.getCause());
|
||||
logger.error(e);
|
||||
throw new RestServiceException(thread,System.currentTimeMillis()-start,"optStartTime参数格式错误");
|
||||
}
|
||||
|
||||
try {
|
||||
if (!StringUtil.isBlank(entity.getOptEndTime())) {
|
||||
sdf.parse(entity.getOptEndTime());
|
||||
}
|
||||
} catch (ParseException e) {
|
||||
thread.setExceptionInfo(e.getMessage()+" "+e.getCause());
|
||||
logger.error(e);
|
||||
throw new RestServiceException(thread,System.currentTimeMillis()-start,"optEndTime参数格式错误", RestBusinessCode.param_formate_error.getValue());
|
||||
} catch (Exception e) {
|
||||
thread.setExceptionInfo(e.getMessage()+" "+e.getCause());
|
||||
logger.error(e);
|
||||
throw new RestServiceException(thread,System.currentTimeMillis()-start,"optEndTime参数错误");
|
||||
}
|
||||
|
||||
try {
|
||||
checkCloumnIsExist(thread,start,DfKeyConvertUrl.class, page);
|
||||
} catch (RestServiceException e) {
|
||||
logger.error(e);
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
thread.setExceptionInfo(e.getMessage()+" "+e.getCause());
|
||||
logger.error(e);
|
||||
throw new RestServiceException(thread, System.currentTimeMillis() - start, "请求参数错误");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,107 +0,0 @@
|
||||
package com.nis.web.service.restful;
|
||||
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.restful.DfKeyMailAdd;
|
||||
import com.nis.restful.RestBusinessCode;
|
||||
import com.nis.restful.RestServiceException;
|
||||
import com.nis.util.StringUtil;
|
||||
import com.nis.web.dao.DfKeyMailAddDao;
|
||||
import com.nis.web.service.BaseLogService;
|
||||
import com.nis.web.service.AuditLogThread;
|
||||
|
||||
/**
|
||||
* @ClassName: DfKeyMailAddService
|
||||
* @Description: TODO(这里用一句话描述这个类的作用)
|
||||
* @author (ZBC)
|
||||
* @date 2016年11月09日 下午02:25:00
|
||||
* @version V1.0
|
||||
*/
|
||||
|
||||
@Service
|
||||
@SuppressWarnings({ "rawtypes" })
|
||||
public class DfKeyMailAddService extends BaseLogService {
|
||||
protected final Logger logger = Logger.getLogger(this.getClass());
|
||||
private static SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
|
||||
@Autowired
|
||||
protected DfKeyMailAddDao dao;
|
||||
|
||||
public Page<DfKeyMailAdd> findDfKeyMailAddPage(Page<DfKeyMailAdd> page, DfKeyMailAdd entity) {
|
||||
entity.setPage(page);
|
||||
page.setList(dao.findDfKeyMailAddPage(entity));
|
||||
return page;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询条件检查
|
||||
*/
|
||||
public void queryConditionCheck(AuditLogThread thread, long start, DfKeyMailAdd entity, Page page) {
|
||||
try {
|
||||
if (!StringUtil.isBlank(entity.getSearchId())) {
|
||||
Long.parseLong(entity.getSearchId());
|
||||
}
|
||||
} catch (NumberFormatException e) {
|
||||
thread.setExceptionInfo(e.getMessage()+" "+e.getCause());
|
||||
logger.error(e);
|
||||
throw new RestServiceException(thread, System.currentTimeMillis() - start, "searchId参数格式错误",
|
||||
RestBusinessCode.param_formate_error.getValue());
|
||||
} catch (Exception e) {
|
||||
thread.setExceptionInfo(e.getMessage()+" "+e.getCause());
|
||||
logger.error(e);
|
||||
throw new RestServiceException(thread, System.currentTimeMillis() - start, "searchId参数错误");
|
||||
}
|
||||
|
||||
try {
|
||||
if (!StringUtil.isBlank(entity.getOptStartTime())) {
|
||||
sdf.parse(entity.getOptStartTime());
|
||||
}
|
||||
} catch (ParseException e) {
|
||||
thread.setExceptionInfo(e.getMessage()+" "+e.getCause());
|
||||
logger.error(e);
|
||||
throw new RestServiceException(thread,System.currentTimeMillis()-start,"optStartTime参数格式错误", RestBusinessCode.param_formate_error.getValue());
|
||||
} catch (Exception e) {
|
||||
thread.setExceptionInfo(e.getMessage()+" "+e.getCause());
|
||||
logger.error(e);
|
||||
throw new RestServiceException(thread,System.currentTimeMillis()-start,"optStartTime参数格式错误");
|
||||
}
|
||||
|
||||
try {
|
||||
if (!StringUtil.isBlank(entity.getOptEndTime())) {
|
||||
sdf.parse(entity.getOptEndTime());
|
||||
}
|
||||
} catch (ParseException e) {
|
||||
thread.setExceptionInfo(e.getMessage()+" "+e.getCause());
|
||||
logger.error(e);
|
||||
throw new RestServiceException(thread,System.currentTimeMillis()-start,"optEndTime参数格式错误", RestBusinessCode.param_formate_error.getValue());
|
||||
} catch (Exception e) {
|
||||
thread.setExceptionInfo(e.getMessage()+" "+e.getCause());
|
||||
logger.error(e);
|
||||
throw new RestServiceException(thread,System.currentTimeMillis()-start,"optEndTime参数错误");
|
||||
}
|
||||
|
||||
try {
|
||||
checkCloumnIsExist(thread,start,DfKeyMailAdd.class, page);
|
||||
} catch (RestServiceException e) {
|
||||
logger.error(e);
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
thread.setExceptionInfo(e.getMessage()+" "+e.getCause());
|
||||
logger.error(e);
|
||||
throw new RestServiceException(thread, System.currentTimeMillis() - start, "请求参数错误");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -1,379 +0,0 @@
|
||||
package com.nis.web.service.restful;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.text.ParseException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.http.client.ClientProtocolException;
|
||||
import org.json.JSONException;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.restful.DjDnsLog;
|
||||
import com.nis.domain.restful.DjFtpLog;
|
||||
import com.nis.domain.restful.DjHttpKeywordLog;
|
||||
import com.nis.domain.restful.DjHttpReqLog;
|
||||
import com.nis.domain.restful.DjHttpResLog;
|
||||
import com.nis.domain.restful.DjIpPortLog;
|
||||
import com.nis.domain.restful.DjIpsecLog;
|
||||
import com.nis.domain.restful.DjL2tpLog;
|
||||
import com.nis.domain.restful.DjMailLog;
|
||||
import com.nis.domain.restful.DjOpenvpnLog;
|
||||
import com.nis.domain.restful.DjPptpLog;
|
||||
import com.nis.domain.restful.DjSshLog;
|
||||
import com.nis.domain.restful.DjSslLog;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.web.dao.DjLogSearchDao;
|
||||
import com.nis.web.service.BaseLogService;
|
||||
|
||||
/**
|
||||
* @ClassName: DjLogSearchService
|
||||
* @Description: TODO(这里用一句话描述这个类的作用)
|
||||
* @author (zbc)
|
||||
* @date 2016年9月7日 上午11:15:12
|
||||
* @version V1.0
|
||||
*/
|
||||
@Service
|
||||
public class DjLogSearchService extends BaseLogService {
|
||||
|
||||
/**
|
||||
* 持久层对象
|
||||
*/
|
||||
@Autowired
|
||||
protected DjLogSearchDao dao;
|
||||
|
||||
/**
|
||||
* 查询端口封堵分页数据
|
||||
* @param page 分页对象
|
||||
* @param entity
|
||||
* @return
|
||||
* @throws IOException
|
||||
* @throws JSONException
|
||||
* @throws ParseException
|
||||
* @throws ClientProtocolException
|
||||
* @throws IllegalAccessException
|
||||
* @throws IllegalArgumentException
|
||||
*/
|
||||
public Page<DjIpPortLog> findIpPortPage(Page<DjIpPortLog> page, DjIpPortLog entity,String activeSys) throws IllegalArgumentException, IllegalAccessException, ClientProtocolException, ParseException, JSONException, IOException {
|
||||
entity.setPage(page);
|
||||
if(Constants.IS_USE_ES){
|
||||
List<DjIpPortLog> 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 IOException
|
||||
* @throws JSONException
|
||||
* @throws ParseException
|
||||
* @throws ClientProtocolException
|
||||
* @throws IllegalAccessException
|
||||
* @throws IllegalArgumentException
|
||||
*/
|
||||
public Page<DjHttpResLog> findHttpResPage(Page<DjHttpResLog> page, DjHttpResLog entity,String activeSys) throws IllegalArgumentException, IllegalAccessException, ClientProtocolException, ParseException, JSONException, IOException {
|
||||
entity.setPage(page);
|
||||
if(Constants.IS_USE_ES){
|
||||
List<DjHttpResLog> resultList=new ArrayList<>();
|
||||
elasticsearchSqlDao.findLogs(resultList, entity,activeSys);
|
||||
page.setList(resultList);
|
||||
}else{
|
||||
page.setList(dao.findHttpResLogs(entity));
|
||||
}
|
||||
return page;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询分页数据
|
||||
* @param page 分页对象
|
||||
* @param httpReqLog
|
||||
* @return
|
||||
* @throws IOException
|
||||
* @throws JSONException
|
||||
* @throws ParseException
|
||||
* @throws ClientProtocolException
|
||||
* @throws IllegalAccessException
|
||||
* @throws IllegalArgumentException
|
||||
*/
|
||||
public Page<DjHttpReqLog> findHttpReqPage(Page<DjHttpReqLog> page, DjHttpReqLog httpReqLog,String activeSys) throws IllegalArgumentException, IllegalAccessException, ClientProtocolException, ParseException, JSONException, IOException {
|
||||
httpReqLog.setPage(page);
|
||||
if(Constants.IS_USE_ES){
|
||||
List<DjHttpReqLog> resultList=new ArrayList<>();
|
||||
elasticsearchSqlDao.findLogs(resultList, httpReqLog,activeSys);
|
||||
page.setList(resultList);
|
||||
}else{
|
||||
page.setList(dao.findHttpReqLogs(httpReqLog));
|
||||
}
|
||||
return page;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询分页数据
|
||||
* @param page 分页对象
|
||||
* @param entity
|
||||
* @return
|
||||
* @throws IOException
|
||||
* @throws JSONException
|
||||
* @throws ParseException
|
||||
* @throws ClientProtocolException
|
||||
* @throws IllegalAccessException
|
||||
* @throws IllegalArgumentException
|
||||
*/
|
||||
public Page<DjHttpKeywordLog> findHttpKeywordPage(Page<DjHttpKeywordLog> page, DjHttpKeywordLog entity,String activeSys) throws IllegalArgumentException, IllegalAccessException, ClientProtocolException, ParseException, JSONException, IOException {
|
||||
entity.setPage(page);
|
||||
if(Constants.IS_USE_ES){
|
||||
List<DjHttpKeywordLog> resultList=new ArrayList<>();
|
||||
elasticsearchSqlDao.findLogs(resultList, entity,activeSys);
|
||||
page.setList(resultList);
|
||||
}else{
|
||||
page.setList(dao.findHttpKeywordLogs(entity));
|
||||
}
|
||||
return page;
|
||||
}
|
||||
/**
|
||||
* 查询分页数据
|
||||
* @throws IOException
|
||||
* @throws JSONException
|
||||
* @throws ParseException
|
||||
* @throws ClientProtocolException
|
||||
* @throws IllegalAccessException
|
||||
* @throws IllegalArgumentException
|
||||
*/
|
||||
public Page<DjHttpKeywordLog> findHttpMultiPartPage(Page<DjHttpKeywordLog> page, DjHttpKeywordLog entity,String activeSys) throws IllegalArgumentException, IllegalAccessException, ClientProtocolException, ParseException, JSONException, IOException {
|
||||
entity.setPage(page);
|
||||
if(Constants.IS_USE_ES){
|
||||
List<DjHttpKeywordLog> resultList=new ArrayList<>();
|
||||
elasticsearchSqlDao.findLogs(resultList, entity,activeSys);
|
||||
page.setList(resultList);
|
||||
}else{
|
||||
page.setList(dao.findHttpKeywordLogs(entity));
|
||||
}
|
||||
return page;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询分页数据
|
||||
* @param page 分页对象
|
||||
* @param entity
|
||||
* @return
|
||||
* @throws IOException
|
||||
* @throws JSONException
|
||||
* @throws ParseException
|
||||
* @throws ClientProtocolException
|
||||
* @throws IllegalAccessException
|
||||
* @throws IllegalArgumentException
|
||||
*/
|
||||
public Page<DjMailLog> findMailPage(Page<DjMailLog> page, DjMailLog entity,String activeSys) throws IllegalArgumentException, IllegalAccessException, ClientProtocolException, ParseException, JSONException, IOException {
|
||||
entity.setPage(page);
|
||||
if(Constants.IS_USE_ES){
|
||||
List<DjMailLog> resultList=new ArrayList<>();
|
||||
elasticsearchSqlDao.findLogs(resultList, entity,activeSys);
|
||||
page.setList(resultList);
|
||||
}else{
|
||||
page.setList(dao.findMailLogs(entity));
|
||||
}
|
||||
return page;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询分页数据
|
||||
* @param page 分页对象
|
||||
* @param entity
|
||||
* @return
|
||||
* @throws IOException
|
||||
* @throws JSONException
|
||||
* @throws ParseException
|
||||
* @throws ClientProtocolException
|
||||
* @throws IllegalAccessException
|
||||
* @throws IllegalArgumentException
|
||||
*/
|
||||
public Page<DjDnsLog> findDnsPage(Page<DjDnsLog> page, DjDnsLog entity,String activeSys) throws IllegalArgumentException, IllegalAccessException, ClientProtocolException, ParseException, JSONException, IOException {
|
||||
entity.setPage(page);
|
||||
if(Constants.IS_USE_ES){
|
||||
List<DjDnsLog> resultList=new ArrayList<>();
|
||||
elasticsearchSqlDao.findLogs(resultList, entity,activeSys);
|
||||
page.setList(resultList);
|
||||
}else{
|
||||
page.setList(dao.findDnsLogs(entity));
|
||||
}
|
||||
return page;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询分页数据
|
||||
* @param page 分页对象
|
||||
* @param entity
|
||||
* @return
|
||||
* @throws IOException
|
||||
* @throws JSONException
|
||||
* @throws ParseException
|
||||
* @throws ClientProtocolException
|
||||
* @throws IllegalAccessException
|
||||
* @throws IllegalArgumentException
|
||||
*/
|
||||
public Page<DjFtpLog> findFtpPage(Page<DjFtpLog> page, DjFtpLog entity,String activeSys) throws IllegalArgumentException, IllegalAccessException, ClientProtocolException, ParseException, JSONException, IOException {
|
||||
entity.setPage(page);
|
||||
if(Constants.IS_USE_ES){
|
||||
List<DjFtpLog> resultList=new ArrayList<>();
|
||||
elasticsearchSqlDao.findLogs(resultList, entity,activeSys);
|
||||
page.setList(resultList);
|
||||
}else{
|
||||
page.setList(dao.findFtpLogs(entity));
|
||||
}
|
||||
return page;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询分页数据
|
||||
* @param page 分页对象
|
||||
* @param entity
|
||||
* @return
|
||||
* @throws IOException
|
||||
* @throws JSONException
|
||||
* @throws ParseException
|
||||
* @throws ClientProtocolException
|
||||
* @throws IllegalAccessException
|
||||
* @throws IllegalArgumentException
|
||||
*/
|
||||
public Page<DjPptpLog> findPptpPage(Page<DjPptpLog> page, DjPptpLog entity,String activeSys) throws IllegalArgumentException, IllegalAccessException, ClientProtocolException, ParseException, JSONException, IOException {
|
||||
entity.setPage(page);
|
||||
if(Constants.IS_USE_ES){
|
||||
List<DjPptpLog> resultList=new ArrayList<>();
|
||||
elasticsearchSqlDao.findLogs(resultList, entity,activeSys);
|
||||
page.setList(resultList);
|
||||
}else{
|
||||
page.setList(dao.findPptpLogs(entity));
|
||||
}
|
||||
return page;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询分页数据
|
||||
* @param page 分页对象
|
||||
* @param entity
|
||||
* @return
|
||||
* @throws IOException
|
||||
* @throws JSONException
|
||||
* @throws ParseException
|
||||
* @throws ClientProtocolException
|
||||
* @throws IllegalAccessException
|
||||
* @throws IllegalArgumentException
|
||||
*/
|
||||
public Page<DjL2tpLog> findL2tpPage(Page<DjL2tpLog> page, DjL2tpLog entity,String activeSys) throws IllegalArgumentException, IllegalAccessException, ClientProtocolException, ParseException, JSONException, IOException {
|
||||
entity.setPage(page);
|
||||
if(Constants.IS_USE_ES){
|
||||
List<DjL2tpLog> resultList=new ArrayList<>();
|
||||
elasticsearchSqlDao.findLogs(resultList, entity,activeSys);
|
||||
page.setList(resultList);
|
||||
}else{
|
||||
page.setList(dao.findL2tpLogs(entity));
|
||||
}
|
||||
return page;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询分页数据
|
||||
* @param page 分页对象
|
||||
* @param entity
|
||||
* @return
|
||||
* @throws IOException
|
||||
* @throws JSONException
|
||||
* @throws ParseException
|
||||
* @throws ClientProtocolException
|
||||
* @throws IllegalAccessException
|
||||
* @throws IllegalArgumentException
|
||||
*/
|
||||
public Page<DjIpsecLog> findIpsecPage(Page<DjIpsecLog> page, DjIpsecLog entity,String activeSys) throws IllegalArgumentException, IllegalAccessException, ClientProtocolException, ParseException, JSONException, IOException {
|
||||
entity.setPage(page);
|
||||
if(Constants.IS_USE_ES){
|
||||
List<DjIpsecLog> resultList=new ArrayList<>();
|
||||
elasticsearchSqlDao.findLogs(resultList, entity,activeSys);
|
||||
page.setList(resultList);
|
||||
}else{
|
||||
page.setList(dao.findIpsecLogs(entity));
|
||||
}
|
||||
return page;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询分页数据
|
||||
* @param page 分页对象
|
||||
* @param entity
|
||||
* @return
|
||||
* @throws IOException
|
||||
* @throws JSONException
|
||||
* @throws ParseException
|
||||
* @throws ClientProtocolException
|
||||
* @throws IllegalAccessException
|
||||
* @throws IllegalArgumentException
|
||||
*/
|
||||
public Page<DjOpenvpnLog> findOpenvpnPage(Page<DjOpenvpnLog> page, DjOpenvpnLog entity,String activeSys) throws IllegalArgumentException, IllegalAccessException, ClientProtocolException, ParseException, JSONException, IOException {
|
||||
entity.setPage(page);
|
||||
if(Constants.IS_USE_ES){
|
||||
List<DjOpenvpnLog> resultList=new ArrayList<>();
|
||||
elasticsearchSqlDao.findLogs(resultList, entity,activeSys);
|
||||
page.setList(resultList);
|
||||
}else{
|
||||
page.setList(dao.findOpenvpnLogs(entity));
|
||||
}
|
||||
return page;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询分页数据
|
||||
* @param page 分页对象
|
||||
* @param entity
|
||||
* @return
|
||||
* @throws IOException
|
||||
* @throws JSONException
|
||||
* @throws ParseException
|
||||
* @throws ClientProtocolException
|
||||
* @throws IllegalAccessException
|
||||
* @throws IllegalArgumentException
|
||||
*/
|
||||
public Page<DjSshLog> findSshPage(Page<DjSshLog> page, DjSshLog entity,String activeSys) throws IllegalArgumentException, IllegalAccessException, ClientProtocolException, ParseException, JSONException, IOException {
|
||||
entity.setPage(page);
|
||||
if(Constants.IS_USE_ES){
|
||||
List<DjSshLog> resultList=new ArrayList<>();
|
||||
elasticsearchSqlDao.findLogs(resultList, entity,activeSys);
|
||||
page.setList(resultList);
|
||||
}else{
|
||||
page.setList(dao.findSshLogs(entity));
|
||||
}
|
||||
return page;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询分页数据
|
||||
* @param page 分页对象
|
||||
* @param entity
|
||||
* @return
|
||||
* @throws IOException
|
||||
* @throws JSONException
|
||||
* @throws ParseException
|
||||
* @throws ClientProtocolException
|
||||
* @throws IllegalAccessException
|
||||
* @throws IllegalArgumentException
|
||||
*/
|
||||
public Page<DjSslLog> findSslPage(Page<DjSslLog> page, DjSslLog entity,String activeSys) throws IllegalArgumentException, IllegalAccessException, ClientProtocolException, ParseException, JSONException, IOException {
|
||||
entity.setPage(page);
|
||||
if(Constants.IS_USE_ES){
|
||||
List<DjSslLog> resultList=new ArrayList<>();
|
||||
elasticsearchSqlDao.findLogs(resultList, entity,activeSys);
|
||||
page.setList(resultList);
|
||||
}else{
|
||||
page.setList(dao.findSslLogs(entity));
|
||||
}
|
||||
return page;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,109 +0,0 @@
|
||||
package com.nis.web.service.restful;
|
||||
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
|
||||
import com.nis.web.service.AuditLogThread;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.restful.DjFlowControlStop;
|
||||
import com.nis.restful.RestBusinessCode;
|
||||
import com.nis.restful.RestServiceException;
|
||||
import com.nis.util.StringUtil;
|
||||
import com.nis.web.dao.IntervalTimeSearchDao;
|
||||
import com.nis.web.service.BaseLogService;
|
||||
|
||||
/**
|
||||
* @ClassName: IntervalTimeSearchService
|
||||
* @Description: TODO(这里用一句话描述这个类的作用)
|
||||
* @author (zbc)
|
||||
* @date 2016年9月8日下午8:11:58
|
||||
* @version V1.0
|
||||
*/
|
||||
@Service
|
||||
public class IntervalTimeSearchService extends BaseLogService {
|
||||
private static SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
protected final Logger logger = Logger.getLogger(this.getClass());
|
||||
/**
|
||||
* 持久层对象
|
||||
*/
|
||||
@Autowired
|
||||
protected IntervalTimeSearchDao dao;
|
||||
|
||||
/**
|
||||
* 查询分页数据
|
||||
* @param page 分页对象
|
||||
* @param entity
|
||||
* @return
|
||||
*/
|
||||
public Page<DjFlowControlStop> findFlowControlStopPage(Page<DjFlowControlStop> page,
|
||||
DjFlowControlStop entity) {
|
||||
entity.setPage(page);
|
||||
page.setList(dao.findFlowControlStopPage(entity));
|
||||
return page;
|
||||
}
|
||||
/**
|
||||
* 流控日志查询条件检查
|
||||
* wx
|
||||
* @param entity
|
||||
*/
|
||||
public void queryConditionCheck(AuditLogThread thread, long start, DjFlowControlStop entity, Page page) {
|
||||
/*try {
|
||||
if (!StringUtil.isBlank(entity.getSearchCfgId())) {
|
||||
Long.parseLong(entity.getSearchCfgId());
|
||||
}
|
||||
} catch (NumberFormatException e) {
|
||||
logger.error(e);
|
||||
throw new RestServiceException(thread, System.currentTimeMillis() - start, "searchCfgId参数格式错误",
|
||||
RestBusinessCode.param_formate_error.getValue());
|
||||
} catch (Exception e) {
|
||||
logger.error(e);
|
||||
throw new RestServiceException(thread, System.currentTimeMillis() - start, "searchCfgId参数错误");
|
||||
}*/
|
||||
|
||||
try {
|
||||
if (!StringUtil.isBlank(entity.getOptStartTime())) {
|
||||
sdf.parse(entity.getOptStartTime());
|
||||
}
|
||||
} catch (ParseException e) {
|
||||
thread.setExceptionInfo(e.getMessage()+" "+e.getCause());
|
||||
logger.error(e);
|
||||
throw new RestServiceException(thread,System.currentTimeMillis()-start,"optStartTime参数格式错误", RestBusinessCode.param_formate_error.getValue());
|
||||
} catch (Exception e) {
|
||||
thread.setExceptionInfo(e.getMessage()+" "+e.getCause());
|
||||
logger.error(e);
|
||||
throw new RestServiceException(thread,System.currentTimeMillis()-start,"optStartTime参数格式错误");
|
||||
}
|
||||
|
||||
try {
|
||||
if (!StringUtil.isBlank(entity.getOptEndTime())) {
|
||||
sdf.parse(entity.getOptEndTime());
|
||||
}
|
||||
} catch (ParseException e) {
|
||||
thread.setExceptionInfo(e.getMessage()+" "+e.getCause());
|
||||
logger.error(e);
|
||||
throw new RestServiceException(thread,System.currentTimeMillis()-start,"optEndTime参数格式错误", RestBusinessCode.param_formate_error.getValue());
|
||||
} catch (Exception e) {
|
||||
thread.setExceptionInfo(e.getMessage()+" "+e.getCause());
|
||||
logger.error(e);
|
||||
throw new RestServiceException(thread,System.currentTimeMillis()-start,"optEndTime参数错误");
|
||||
}
|
||||
|
||||
try {
|
||||
checkCloumnIsExist(thread,start,DjFlowControlStop.class, page);
|
||||
} catch (RestServiceException e) {
|
||||
thread.setExceptionInfo(e.getMessage()+" "+e.getCause());
|
||||
logger.error(e);
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
thread.setExceptionInfo(e.getMessage()+" "+e.getCause());
|
||||
logger.error(e);
|
||||
throw new RestServiceException(thread, System.currentTimeMillis() - start, "请求参数错误");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user