public boolean apply(Void arg) { for (IterableWithMarker<AlarmHistoryItem> page : api().listHistory()) { for (AlarmHistoryItem alarmHistoryItem : page) { if (alarmHistoryItem.getAlarmName().equals(alarmName)) { JsonObject historyData = new JsonParser().parse(alarmHistoryItem.getHistoryData()) .getAsJsonObject(); if (historyData.has("newState") && historyData.getAsJsonObject("newState").has("stateReason") && historyData.getAsJsonObject("newState").get("stateReason").getAsString() .equals("Updating the state.")) { return true; } } } } return false; } }, 5, 1, MINUTES).apply(null);
public boolean apply(ListAlarmHistoryOptions options) { for (IterableWithMarker<AlarmHistoryItem> page : api().listHistory(options)) { for (AlarmHistoryItem alarmHistoryItem : page) { if (alarmHistoryItem.getAlarmName().equals(alarmName)) { JsonObject historyData = new JsonParser().parse(alarmHistoryItem.getHistoryData()) .getAsJsonObject(); if (historyData.has("newState") && historyData.getAsJsonObject("newState").has("stateReason") && historyData.getAsJsonObject("newState").get("stateReason").getAsString() .equals("Updating the state.")) { return true; } } } } return false; } }, 5, 1, MINUTES).apply(daho);
public boolean apply(ListAlarmHistoryOptions options) { for (IterableWithMarker<AlarmHistoryItem> page : api().listHistory(options)) { for (AlarmHistoryItem alarmHistoryItem : page) { if (alarmHistoryItem.getAlarmName().equals(alarmName)) { JsonObject historyData = new JsonParser().parse(alarmHistoryItem.getHistoryData()) .getAsJsonObject(); if (historyData.has("newState") && historyData.getAsJsonObject("newState").has("stateReason") && historyData.getAsJsonObject("newState").get("stateReason").getAsString() .equals("Updating the state.")) { return true; } } } } return false; } }, 5, 1, MINUTES).apply(daho);
public boolean apply(Void arg) { for (IterableWithMarker<AlarmHistoryItem> page : api().listHistory()) { for (AlarmHistoryItem alarmHistoryItem : page) { if (alarmHistoryItem.getAlarmName().equals(alarmName)) { JsonObject historyData = new JsonParser().parse(alarmHistoryItem.getHistoryData()) .getAsJsonObject(); if (historyData.has("newState") && historyData.getAsJsonObject("newState").has("stateReason") && historyData.getAsJsonObject("newState").get("stateReason").getAsString() .equals("Updating the state.")) { return true; } } } } return false; } }, 5, 1, MINUTES).apply(null);