summaryrefslogtreecommitdiff
path: root/src/com/nis/systeminfo/thread/NewPluginResultMerge.java
blob: 900e26a2c829777e0a40c026b093b8c17e53c821 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
package com.nis.systeminfo.thread;

import java.io.File;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;

import org.apache.commons.lang.ArrayUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.log4j.Logger;

import com.nis.nmsclient.common.Common;
import com.nis.nmsclient.common.Contants;
import com.nis.nmsclient.common.SysConfig;
import com.nis.nmsclient.model.AlarmInfo;
import com.nis.nmsclient.model.SetInfo;
import com.nis.nmsclient.thread.alarm.AlarmUtil;
import com.nis.nmsclient.util.DateUtil;
import com.nis.nmsclient.util.FileWrUtil;

public class NewPluginResultMerge {

	private static final Logger logger = Logger.getLogger(NewPluginResultMerge.class);
	
	private static final File srcRootDir = new File(Contants.localTempDataIncomingPath);
	private static final File tarRootDir = new File(Contants.localDataFilePath);
	
	private static HashMap<Long, Boolean> historyAlarmStateMap = new HashMap<Long, Boolean>();
	private static HashMap<Long, Integer> historyAlarmTimesMap = new HashMap<Long, Integer>();
	
	public void clearTmpFile(SetInfo setInfo) {
		try {
			String subDir = setInfo.getCheckTypeName() + "_" + setInfo.getProcessIden();
			File dir = new File(srcRootDir, subDir);
			
			if(!dir.exists()) {
				dir.mkdirs(); // 临时目录不存在
				return;
			}
			
			File[] results = dir.listFiles();
			for (File file : results) {
				file.delete();
			}
		} catch (Exception e) {
			logger.error(e.getMessage(), e);
		}
	}
	
	public void merge(SetInfo setInfo) {
		try {
			logger.debug("合并临时结果文件开始 ~~~~~~~");
			String subDir = setInfo.getCheckTypeName() + "_" + setInfo.getProcessIden();
			File dir = new File(srcRootDir, subDir);
			File tarDir = new File(tarRootDir, subDir);
			
			/*
			 *  临时目录为空,当前检测未生成结果数据
			 */
			if (!dir.exists() || dir.listFiles().length == 0) {
				AlarmUtil.sendAlarmMsg(setInfo.getId(), setInfo.getCheckTypeName(), setInfo.getProcessIden(),
//						new Date(), new Date(), 1, Contants.DETECTION_STATUS_FAILURE, "监测数据未生成");
						new Date(), new Date(), 1, Contants.DETECTION_STATUS_FAILURE, "i18n_client.NewPluginResultMerge.detecateData_n81i");
				return;
			}
			
			// 监测信息报警相关信息
			System.out.println(Common.detecAlarmInfoMap);
			List<AlarmInfo> alarmInfoList = Common.getDetecAlarmInfo(setInfo.getId());
			
			// 获取临时结果文件
			File srcFile = dir.listFiles()[0];
			// 从文件名获取监测时间毫秒数(YYYYMMDDhhmmss.tmp)
			Calendar cal = Calendar.getInstance();
			cal.set(Calendar.YEAR, Integer.parseInt(srcFile.getName().substring(0, 4)));
			cal.set(Calendar.MONTH, Integer.parseInt(srcFile.getName().substring(4, 6)) - 1);
			cal.set(Calendar.DATE, Integer.parseInt(srcFile.getName().substring(6, 8)));
			cal.set(Calendar.HOUR_OF_DAY, Integer.parseInt(srcFile.getName().substring(8, 10)));
			cal.set(Calendar.MINUTE, Integer.parseInt(srcFile.getName().substring(10, 12)));
			cal.set(Calendar.SECOND, Integer.parseInt(srcFile.getName().substring(12, 14)));

			Long detecTime = cal.getTimeInMillis();
			Date writeDate = new Date(detecTime); // 临时文件写入时间

			//读取临时结果文件
			List<String[]> lines = FileWrUtil.csvFileParser(srcFile, Contants.charset);
			
			/* 临时数据文件新格式形式
			 * line1: 监测时延(秒),尝试次数,状态信息(描述信息),字段1,字段2,···
			 * 
			 *  旧格式转新格式
			 */
			if(lines.size() == 1 && lines.get(0).length > 3) {
				String[] data = lines.get(0);
				lines.clear();
				lines.add((String[]) ArrayUtils.subarray(data, 0, 3));
				lines.add(new String[]{"details","1"});
				lines.add((String[]) ArrayUtils.subarray(data, 3, data.length));
			}
			
			/*
			 * 临时数据文件新格式形式
			 * line1: 监测时延(秒),尝试次数,状态信息(描述信息)
			 * line2: details,具体数据条数
			 * line3: 监测字段1,监测字段2,···
			 * ··· ··· ···
			 *  
			 *  任务执行失败状态判断(临时文件存在时,告警并删除临时文件):
			 *  	1、公共信息不完整;2、无具体数据信息或具体数据信息为空
			 */
			boolean execFail = false;
			if(lines.size() < 1 || lines.get(0).length < 3) { // 公共信息不完整
				logger.info("预设监测 setId: " + setInfo.getId() + " > " + srcFile.getName() + ",公共信息不完整,监测执行错误");
				execFail = true;
			}
			if(lines.size() < 3) { // 无具体数据信息
				logger.info("预设监测 setId: " + setInfo.getId() + " > " + srcFile.getName() + ",无具体数据信息,监测执行错误");
				execFail = true;
			}
			if(lines.size() >= 3) { // 具体数据信息为空字段
				String detailStr = Arrays.toString(lines.get(1));
				String detailReg = "^\\[details,\\s*(\\d+)\\s*\\]$";
				if(detailStr.matches(detailReg)) {
					int endNum = Integer.parseInt(detailStr.replaceAll(detailReg, "$1")); // details格式校验
					if (endNum < 1) {
						logger.info("预设监测 setId: " + setInfo.getId() + " > " + srcFile.getName() + ",具体数据信息格式错误,监测执行错误");
						execFail = true;
					}
					for (int r = 0; r < endNum; r++) {
						String[] sysData = lines.get(r + 2);
						if (Arrays.toString(sysData).matches("^\\[[,|\\s]*\\]$")) { // 空字段
							logger.info("预设监测 setId: " + setInfo.getId() + " > " + srcFile.getName() + ",具体数据信息为空字段,监测执行错误");
							execFail = true;
						}
					}
				} else {
					logger.info("预设监测 setId: " + setInfo.getId() + " > " + srcFile.getName() + ",具体数据信息格式错误,监测执行错误");
					 execFail = true;
				}
			}
			if(execFail) {
				historyAlarmStateMap.put(setInfo.getId(), true); // 数据状态不正常
				srcFile.delete(); // 删除错误临时文件,并告警
				AlarmUtil.sendAlarmMsg(setInfo.getId(), setInfo.getCheckTypeName(), setInfo.getProcessIden(),
//						new Date(detecTime), new Date(detecTime), 1, Contants.DETECTION_STATUS_FAILURE, "监测数据未生成或数据格式错误");
						new Date(detecTime), new Date(detecTime), 1, Contants.DETECTION_STATUS_FAILURE, "i18n_client.NewPluginResultMerge.formatErr_n81i");
				return;
			}
					

			String checkDelayTime = lines.get(0)[0];// 检测时延(秒)
			String checkTimes = lines.get(0)[1]; // 尝试次数
			String detectInfo = lines.get(0)[2]; // 状态信息(描述信息)
			StringBuffer functionSb = new StringBuffer(); // 性能数据
					
			// 执行状态,告警级别
			int totalStatus = Contants.DETECTION_STATUS_ABNORMAL; //监测信息不正常
			int totalAlarmLevel = 99;
			String totalShowNum ="";//告警序列号,取告警级别高的showNum add by jinsj for 紧急告警
			if(lines.size() > 1) {
				String[] detail = lines.get(1);
				if("details".equalsIgnoreCase(detail[0]) && detail[1].trim().matches("\\d+")) {
					 int endNum = StringUtils.isBlank(detail[1])?0:Integer.parseInt(detail[1].trim());

					 if(endNum > 0) { // 详细信息条数大于0,且所有数据不超过告警值时,监测信息正常
						 totalStatus = Contants.DETECTION_STATUS_NORMAL; // 监测信息正常
						 
						for (int r = 0; r < endNum; r++) {
							String[] sysData = lines.get(r + 2);
							String[] warninfos = getAlarmState(alarmInfoList, sysData);
							String[] combine = new String[sysData.length + 3]; // 组合详细信息
							System.arraycopy(warninfos, 0, combine, 0, 3);
							System.arraycopy(sysData, 0, combine, 3, sysData.length);
							lines.set(r + 2, combine);

							if(StringUtils.isNotBlank(warninfos[4])) {
								totalAlarmLevel = Integer.parseInt(warninfos[4]);
							}
							totalShowNum = warninfos[5];
							
							if(StringUtils.isNotBlank(warninfos[0])) {
								totalStatus = Contants.DETECTION_STATUS_ABNORMAL; // 监测信息不正常
								functionSb.append(warninfos[3] + "</br>"); // 组织性能数据
							} else {
								if(StringUtils.isNotBlank(warninfos[3])) {
									functionSb.append(warninfos[3] + "</br>"); // 组织性能数据
								}
							}
						}
					 }
				}
			}
					
			// 主动告警
			String totalAlarmInfo = null;
			if(totalStatus == Contants.DETECTION_STATUS_NORMAL){
				historyAlarmStateMap.put(setInfo.getId(), false);
				historyAlarmTimesMap.put(setInfo.getId(), 0);
				
				// 本次数据正常,看原本的状态:若是告警状态,则发送恢复通知;若是正常状态,则不变
				if(getHistoryAlarmState(setInfo.getId())){
					totalAlarmInfo = "【i18n_client.NewPluginResultMerge.totalAlarmInfo1_n81i】</br>" + functionSb.toString();
				}

			}else if(totalStatus == Contants.DETECTION_STATUS_ABNORMAL){//状态异常
				historyAlarmStateMap.put(setInfo.getId(), true);
				historyAlarmTimesMap.put(setInfo.getId(), getHistoryAlarmTimes(setInfo.getId()) + 1);
				
				// 本次数据不正常,看原本的状态:若是正常状态,则发送告警,此主动告警也只有一次,除非监测恢复正常,之后又异常
				if(getHistoryAlarmTimes(setInfo.getId()) == 1) {//如果是进程监测							
					totalAlarmInfo = "【i18n_client.NewPluginResultMerge.totalAlarmInfo2_n81i】</br>" + functionSb.toString();
				}
				if(getHistoryAlarmTimes(setInfo.getId()) == Contants.overAlarmValTimes) {//若原本的状态是告警状态,则判断是否连续几次达到告警值,次数会一直累积,知道监测恢复正常,所以如果一直异常,则也只告警一次连续4次异常							
					totalAlarmInfo = "【i18n_client.NewPluginResultMerge.totalAlarmInfo3_n81i】</br>" + functionSb.toString();
				}
			}
			if(totalAlarmInfo!=null){
				//2014-5-12 add:根据配置的参数,决定是否启用监测数据超过设定值时的主动告警
				Boolean activeAlarmStart = Contants.ACTIIVE_ALARM_START;
				if(totalStatus == Contants.DETECTION_STATUS_NORMAL || //数据恢复主动告警
						(activeAlarmStart && totalStatus == Contants.DETECTION_STATUS_ABNORMAL)) { //数据异常主动告警
					AlarmUtil.sendAlarmMsg(setInfo.getId(), setInfo.getCheckTypeName(), setInfo.getProcessIden(),
							new Date(), new Date(), totalAlarmLevel, totalStatus, totalAlarmInfo,totalShowNum);
				}
			}

			// 组织监测数据组织
			List<String[]> dataList = new LinkedList<String[]>();
			// 总数据
			String[] totalData = new String[12];
			int index = 0;
			totalData[index++] = Contants.AGENT_HOST_UUID + ""; // UUID
			totalData[index++] = setInfo.getId() + ""; // 监测设置ID
			totalData[index++] = setInfo.getCheckTypeName(); // 监测类别
			totalData[index++] = setInfo.getProcessIden(); // 进程名称
			totalData[index++] = setInfo.getPlanCheckTime() + ""; // 监测服务启动时间
			totalData[index++] = checkDelayTime; // 检测时延(秒)
			totalData[index++] = writeDate.getTime() + ""; // 本次检测时间
			totalData[index++] = checkTimes; // 尝试次数
			totalData[index++] = getNextCheckTime(writeDate, setInfo);// 下次计划监测时间
			totalData[index++] = totalStatus + "";// 执行状态是否成功是否正常
			totalData[index++] = detectInfo; // 状态信息(描述信息)
			totalData[index++] = StringUtils.isBlank(functionSb.toString()) ? detectInfo : functionSb.toString();// 性能数据

			dataList.add(totalData);
			// 详细信息
			dataList.addAll(lines.subList(1, lines.size()));

			// 写入文件
			String fileName = DateUtil.getStingDate(DateUtil.YYYYMMDDHH24MMSS, writeDate) + ".csv";
			File tarFile1 = new File(tarDir, fileName + ".tp");
			FileWrUtil.csvFilePrinter(tarFile1, Contants.charset, dataList);
			File tarFile2 = new File(tarDir, fileName);
			if (tarFile2.exists())
				tarFile2.delete();
			tarFile1.renameTo(tarFile2);
			srcFile.delete();

			logger.info("生成监测结果文件:" + tarFile2.getParentFile().getName() + "/" + tarFile2.getName());

			// 忽略NC停止时间内的监测周期
			// setInfo.setLastMergeDetecTime(detecTime);
			setInfo.setLastMergeDetecTime(Math.max(detecTime, setInfo.getLastMergeDetecTime()));
			
		} catch (Exception e) {
			logger.error(e.getMessage(), e);
		}
	}

	// 下一次检测时间
	private String getNextCheckTime(Date now, SetInfo setInfo) {
		Calendar cal = Calendar.getInstance();
		cal.setTime(now);
		cal.add(Calendar.MINUTE, setInfo.getCheckGap().intValue());
		return cal.getTimeInMillis() + "";
	}

	/**
	 * 获取当前行告警信息
	 * @param sysData
	 * @return
	 */
	private String[] getAlarmState(List<AlarmInfo> alarmInfos, String[] sysData) {
		// strs数组数据依次为:告警序列号、告警级别、告警值、性能数据、本次最高告警级别
		String[] strs = new String[] { "", "", "", "", "", "" };
		if (alarmInfos == null) {
			return strs; 
		}
		int maxAlarmLevel = 99;
		String maxShowNum = "";
		for (AlarmInfo alarm : alarmInfos) {
			if (sysData.length < alarm.getShowNum()) {// 得到的数据个数和告警列数比较
				continue;
			}
			String data = sysData[alarm.getShowNum() - 1];
			boolean alarmFlag = false;

			/**
			 * 2014-5-15 add: 1.指定了特定的标识: (1).当前标识非空:不在指定标识内,则不做告警判断;在,则做告警判断
			 * (2).当前标识为空:空不在指定标识内,不做告警判断 2.未指定特定的标识:所有标识都进行告警判断
			 */
			String marker = alarm.getMarker();
			// Integer markerShowNum = 1;//先默认取第一个
			Integer markerShowNum = alarm.getMarkerFiledShowNum();
			logger.info("告警设置:checkType|" + alarm.getCheckType() + "  setInfoId|" + alarm.getSetInfoId()
					+ "  markerShowNum|" + alarm.getMarkerFiledShowNum() + "   marker|" + alarm.getMarker());
			if (markerShowNum != null && markerShowNum > 0 // 若未指定标识字段,则从DC传递到NC的json字符串中markerShowNum的值为0
					&& StringUtils.isNotBlank(marker)) {
				String markerCurVal = sysData[markerShowNum - 1];// 当前条详细监测数据的标识符
				String sperator = SysConfig.getStringVal("alarm.set.marker.separator", "|");
				if (StringUtils.isNotBlank(markerCurVal)) {
					if (!(sperator + marker.trim() + sperator).toLowerCase().contains(
									(sperator + markerCurVal.trim() + sperator).toLowerCase())) {// 当前标识不在指定的标识里
						continue;
					}
				} else {
					continue;
				}
			}

			if ("equals".equalsIgnoreCase(alarm.getPoliceSysmbols())) {// 相同
				if (data.equals(alarm.getPoliceValue())) {
					alarmFlag = true;
				}
			} else if ("include".equalsIgnoreCase(alarm.getPoliceSysmbols())) {// 包含告警值内容
				if (data.contains(alarm.getPoliceValue())) {
					alarmFlag = true;
				}
			} else if ("exclude".equalsIgnoreCase(alarm.getPoliceSysmbols())) {// 不包含告警值内容
				if (!data.contains(alarm.getPoliceValue())) {
					alarmFlag = true;
				}
			} else {
				double result = Double.parseDouble(data)
						- Double.parseDouble(alarm.getPoliceValue());
				if ((">".equals(alarm.getPoliceSysmbols()) && result > 0)
						|| ("<".equals(alarm.getPoliceSysmbols()) && result < 0)
						|| ("=".equals(alarm.getPoliceSysmbols()) && result == 0)
						|| (">=".equals(alarm.getPoliceSysmbols()) && result >= 0)
						|| ("<=".equals(alarm.getPoliceSysmbols()) && result <= 0)) {
					alarmFlag = true;
				}
			}
			
			String sysmbol = getAlarmSymbol(alarm.getPoliceSysmbols(), alarmFlag);
			if (alarmFlag) {
				strs[0] += alarm.getShowNum() + "|";// 告警序列号
				strs[1] += alarm.getPoliceLevel() + "|"; // 告警级别
				strs[2] += alarm.getPoliceValue() + "|"; // 告警值
				// 性能信息
//				strs[3] += alarm.getFiledCommonts() + ":"
//						+ sysData[alarm.getShowNum() - 1] + "("
//						+ alarm.getPoliceUnit() + ") " + sysmbol + "告警值"
//						+ alarm.getPoliceValue() + "(" + alarm.getPoliceUnit()
//						+ ") " + "不正常;";
				strs[3] += alarm.getFiledCommonts() + ":"
						+ sysData[alarm.getShowNum() - 1] + "("
						+ alarm.getPoliceUnit() + ") " + sysmbol + "i18n_client.NewPluginResultMerge.warningValue_n81i"
						+ alarm.getPoliceValue() + "(" + alarm.getPoliceUnit()
						+ ") " + "i18n_client.NewPluginResultMerge.abnormal_n81i;";
			} else {
				// 性能信息
//				strs[3] += alarm.getFiledCommonts() + ":"
//						+ sysData[alarm.getShowNum() - 1] + "("
//						+ alarm.getPoliceUnit() + ") " + sysmbol + "告警值"
//						+ alarm.getPoliceValue() + "(" + alarm.getPoliceUnit()
//						+ ") " + "正常;";
				strs[3] += alarm.getFiledCommonts() + ":"
						+ sysData[alarm.getShowNum() - 1] + "("
						+ alarm.getPoliceUnit() + ") " + sysmbol + "i18n_client.NewPluginResultMerge.warningValue_n81i"
						+ alarm.getPoliceValue() + "(" + alarm.getPoliceUnit()
						+ ") " + "i18n_client.NewPluginResultMerge.normal_n81i;";
			}

			// 2011-09-29 添加了连续几次达到告警值后主动告警,恢复正常后发送恢复信息
			// 2013-03-26 添加了告警状态控制是否立刻主动告警,如果已经告警则后期不发送告警信息。
			if (maxAlarmLevel > alarm.getPoliceLevel()) {// 保留本次最高告警级别,值越小级别越高
				maxAlarmLevel = alarm.getPoliceLevel();
				maxShowNum = alarm.getShowNum() + "";
			}

		}// for end
		for (int i = 0; i < strs.length - 1; i++) {
			if (strs[i].length() > 0) {
				strs[i] = strs[i].substring(0, strs[i].length() - 1);
			}
		}
		strs[strs.length - 2] = maxAlarmLevel + "";// 本次告警最高级别
		strs[strs.length - 1] = maxShowNum;// 本次告警最高级别对应的序列号showNum
		return strs;
	}

	private String getAlarmSymbol(String oldSymbol, boolean alarmFlag) {
		String symbol = "";
//		if (alarmFlag) {
//			if (">".equals(oldSymbol)) {
//				symbol = "大于";
//			} else if (">=".equals(oldSymbol)) {
//				symbol = "超过";
//			} else if ("<".equals(oldSymbol)) {
//				symbol = "小于";
//			} else if ("<=".equals(oldSymbol)) {
//				symbol = "未超过";
//			} else if ("=".equals(oldSymbol)) {
//				symbol = "等于";
//			} else {
//				symbol = oldSymbol;
//			}
//		} else {
//			if (">".equals(oldSymbol)) {
//				symbol = "未超过";
//			} else if (">=".equals(oldSymbol)) {
//				symbol = "小于";
//			} else if ("<".equals(oldSymbol)) {
//				symbol = "超过";
//			} else if ("<=".equals(oldSymbol)) {
//				symbol = "大于";
//			} else if ("=".equals(oldSymbol)) {
//				symbol = "不等于";
//			} else if ("equals".equalsIgnoreCase(oldSymbol)) {
//				symbol = "not equals";
//			} else if ("include".equalsIgnoreCase(oldSymbol)) {
//				symbol = "exclude";
//			} else if ("exclude".equalsIgnoreCase(oldSymbol)) {
//				symbol = "include";
//			}
//		}
		if (alarmFlag) {
			if (">".equals(oldSymbol)) {
				symbol = "i18n_client.NewPluginResultMerge.gt_n81i";
			} else if (">=".equals(oldSymbol)) {
				symbol = "i18n_client.NewPluginResultMerge.out_n81i";
			} else if ("<".equals(oldSymbol)) {
				symbol = "i18n_client.NewPluginResultMerge.lt_n81i";
			} else if ("<=".equals(oldSymbol)) {
				symbol = "i18n_client.NewPluginResultMerge.in_n81i";
			} else if ("=".equals(oldSymbol)) {
				symbol = "i18n_client.NewPluginResultMerge.eq_n81i";
			} else {
				symbol = oldSymbol;
			}
		} else {
			if (">".equals(oldSymbol)) {
				symbol = "i18n_client.NewPluginResultMerge.in_n81i";
			} else if (">=".equals(oldSymbol)) {
				symbol = "i18n_client.NewPluginResultMerge.lt_n81i";
			} else if ("<".equals(oldSymbol)) {
				symbol = "i18n_client.NewPluginResultMerge.out_n81i";
			} else if ("<=".equals(oldSymbol)) {
				symbol = "i18n_client.NewPluginResultMerge.gt_n81i";
			} else if ("=".equals(oldSymbol)) {
				symbol = "i18n_client.GetInfoRun.notEquels_n81i";
			} else if ("equals".equalsIgnoreCase(oldSymbol)) {
				symbol = "not equals";
			} else if ("include".equalsIgnoreCase(oldSymbol)) {
				symbol = "exclude";
			} else if ("exclude".equalsIgnoreCase(oldSymbol)) {
				symbol = "include";
			}
		}
		return symbol;
	}
	
	private boolean getHistoryAlarmState(Long setInfoId) {
		Boolean alarmState = historyAlarmStateMap.get(setInfoId);
		return (alarmState != null && alarmState == true);
	}
	
	private int getHistoryAlarmTimes(Long setInfoId) {
		Integer alarmTimes = historyAlarmTimesMap.get(setInfoId);
		return (alarmTimes != null ? alarmTimes : 0);
	}
}