package cn.amq.videotask;

import java.util.ArrayList;
import java.util.List;

import cn.amq.peas.SafetyHatAlarmPeas;
import cn.amq.peas.VideoTaskAlarmPeas;

/**
 * 巡检任务告警缓存并推送至前端
 * @author Lenovo
 *
 */
public class VideoTaskAlarmDateService {

	Object mutex = new Object();
	
	private List<VideoTaskAlarmPeas> videoTaskAlarmDateList = new ArrayList<VideoTaskAlarmPeas>();

	public List<VideoTaskAlarmPeas> getVideoTaskAlarmDataList() {
		synchronized (mutex) {
			List<VideoTaskAlarmPeas> tempList = new ArrayList<VideoTaskAlarmPeas>();
			tempList = videoTaskAlarmDateList;
			videoTaskAlarmDateList = new ArrayList<VideoTaskAlarmPeas>();
			return tempList;
		}
	}

	public void setVideoTaskAlarmDataList(List<VideoTaskAlarmPeas> ls) {
		synchronized (mutex) {
			if (videoTaskAlarmDateList != null) {
				videoTaskAlarmDateList.addAll(ls);
			}
		}
	}
}
