update seddion filter

This commit is contained in:
fanfuxiaoran 2014-07-04 11:16:48 +08:00
parent c0c6127e79
commit bbcdc89e27
2 changed files with 3 additions and 143 deletions

View File

@ -15,7 +15,7 @@ public class SessionFilter extends OncePerRequestFilter {
HttpServletResponse response, FilterChain filterChain) HttpServletResponse response, FilterChain filterChain)
throws ServletException, IOException { throws ServletException, IOException {
String[] notFilter = new String[] { "/index", "/css/", "/script/", String[] notFilter = new String[] { "/index", "/css/", "/script/",
"/i18n/", "/images/", "/publiccontrol/", "/img/", "/login", "/adminLogin","/js","/register","/result","/test"}; "/i18n/", "/images/", "/publiccontrol/", "/login","/lib/", "/js", "/register" };
// 请求的uri // 请求的uri
String uri = request.getRequestURI(); String uri = request.getRequestURI();

View File

@ -13,8 +13,8 @@ public class MonitorService {
private Logger logger = Logger.getLogger(MonitorService.class); private Logger logger = Logger.getLogger(MonitorService.class);
public List<ResultModel> extractMonitorResult(List<? extends SampleModel> list, public List<ResultModel> extractMonitorResult(
String fieldName) { List<? extends SampleModel> list, String fieldName) {
if (list == null) if (list == null)
return null; return null;
List<ResultModel> resultModels = new ArrayList<ResultModel>(); List<ResultModel> resultModels = new ArrayList<ResultModel>();
@ -39,144 +39,4 @@ public class MonitorService {
return resultModels; return resultModels;
} }
// public List<ResultModel> extractCpuResultModelList(
// List<ProcessorModel> processorModels, String instance,
// String fieldName) {
// if (processorModels == null) {
// return null;
// }
// List<ResultModel> resultModels = new ArrayList<ResultModel>();
// for (ProcessorModel processorModel : processorModels) {
// if (processorModel != null) {
// ResultModel resultModel;
// try {
// resultModel = extractResultModel(processorModel, instance,
// fieldName);
// if (resultModel != null)
// resultModels.add(resultModel);
// } catch (NoSuchFieldException | IllegalArgumentException e) {
// // TODO Auto-generated catch block
// logger.info(ExceptionLog.getStackTrace(e));
// }
//
// }
//
// }
// return resultModels;
// }
//
// public List<ResultModel> extractCpuResult(
// List<ProcessorModel> processorModels, String fieldName) {
// if (processorModels == null)
// return null;
// List<ResultModel> resultModels = new ArrayList<ResultModel>();
// List<String> fieldNames = new ArrayList<String>();
// fieldNames.add(fieldName);
// for (ProcessorModel processorModel : processorModels) {
// if (processorModel != null) {
// ResultModel resultModel;
// try {
// resultModel = ChangeToResultModel.getResultModel(
// processorModel, fieldNames);
// resultModel.setTime(processorModel.getSamplingTime());
// resultModel.setFinished(processorModel.isFinished());
// resultModels.add(resultModel);
// } catch (NoSuchFieldException e) {
// // TODO Auto-generated catch block
// logger.info(ExceptionLog.getStackTrace(e));
// }
//
// }
// }
// return resultModels;
// }
//
// public List<ResultModel> extractResultModelList(
// List<MemoryModel> memoryModels, String fieldName) {
// if (memoryModels == null)
// return null;
// List<ResultModel> resultModels = new ArrayList<ResultModel>();
// List<String> fieldNames = new ArrayList<String>();
// fieldNames.add(fieldName);
// for (MemoryModel memoryModel : memoryModels) {
// if (memoryModel != null) {
// ResultModel resultModel;
// try {
// resultModel = ChangeToResultModel.getResultModel(
// memoryModel, fieldNames);
// resultModel.setTime(memoryModel.getSamplingTime());
// resultModel.setFinished(memoryModel.isFinished());
// resultModels.add(resultModel);
// } catch (NoSuchFieldException e) {
// // TODO Auto-generated catch block
// logger.info(ExceptionLog.getStackTrace(e));
// }
//
// }
// }
// return resultModels;
// }
//
// private ResultModel extractResultModel(ProcessorModel processorModel,
// String instance, String fieldName) throws NoSuchFieldException,
// IllegalArgumentException {
// List<String> fieldNames = new ArrayList<String>();
// fieldNames.add(fieldName);
// if (processorModel.getProcessorModelList() == null) {
// return null;
// }
// for (ProcessorModelChild processorModelChild : processorModel
// .getProcessorModelList()) {
// if (processorModelChild.getInstance().equalsIgnoreCase(instance)) {
// ResultModel resultModel = ChangeToResultModel.getResultModel(
// processorModelChild, fieldNames);
// resultModel.setFinished(false);
// resultModel.setTime(processorModel.getSamplingTime());
// return resultModel;
// }
// }
// logger.info("no such cpu instance");
// return null;
// }
//
// public List<String> getCpuList(
// @ModelAttribute("accessToken") String accessToken,
// @RequestParam("testPlanId") String testPlanId,
// @RequestParam String ip, String port) {
// try {
// MonitorProcessorResponseModel monitorProcessorResponseModel = getCpus(
// accessToken, testPlanId, ip, port, "0");
//
// ProcessorModel processorModel = null;
// List<ProcessorModel> processorModels = monitorProcessorResponseModel
// .getProcessorModels();
// if (processorModels.size() > 0) {
// processorModel = processorModels.get(0);
// }
//
// else {
// return new ArrayList<String>();
// }
//
// List<String> cpuList = new ArrayList<String>();
// for (ProcessorModelChild processorModelChild : processorModel
// .getProcessorModelList()) {
// cpuList.add(processorModelChild.getInstance());
// }
// return cpuList;
// } catch (NullPointerException e) {
// logger.info(ExceptionLog.getStackTrace(e));
// return new LinkedList<String>();
// }
// }
//
// public MonitorProcessorResponseModel getCpus(
// @ModelAttribute("accessToken") String accessToken,
// String testPlanId, String ip, String port, String startTime) {
// MonitorProcessorResponseModel model = this.getMonitorMessager()
// .porcessor(accessToken, testPlanId, ip, port, startTime);
// return model;
//
// }
} }