|
@@ -6,6 +6,7 @@ import org.java_websocket.client.WebSocketClient;
|
|
|
import org.java_websocket.handshake.ServerHandshake;
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
+import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.persagy.ibms.core.util.LogUtil;
|
|
|
import com.persagy.ibms.data.sdk.util.RWDAlarmUtil;
|
|
@@ -33,10 +34,20 @@ public class AlarmWebSocketClient extends WebSocketClient {
|
|
|
public void run() {
|
|
|
try {
|
|
|
log.warn("onOpen refresh begin");
|
|
|
- int alarm_size = RWDAlarmUtil.refresh();
|
|
|
- log.warn("onOpen refresh finish alarm count: " + alarm_size);
|
|
|
+ JSONObject AlarmJob = new JSONObject();
|
|
|
+ AlarmJob.put("type", "refresh");
|
|
|
+ RepositoryContainer.RepositoryProject.alarmBuffer.offer(AlarmJob, 16384);
|
|
|
+ JSONArray Content;
|
|
|
+ try {
|
|
|
+ Content = RWDAlarmUtil.refresh();
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error(e.getMessage(), e);
|
|
|
+ Content = new JSONArray();
|
|
|
+ }
|
|
|
+ AlarmJob.put("Content", Content);
|
|
|
+ log.warn("onOpen refresh finish alarm count: " + Content.size());
|
|
|
} catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
+ log.error(e.getMessage(), e);
|
|
|
}
|
|
|
}
|
|
|
};
|