/** * Add a new record to the data history. * This method returns a double value equal to the state. This may be used for comparison by the caller. * * @param time the time of the record * @param state the state at this time */ public void addData(Long time, State state) { HistoryDataBean newVal = new HistoryDataBean(); newVal.time = time; newVal.state = state.toString(); data.add(newVal); }
/** * Gets a list of persistence services currently configured in the system * * @return list of persistence services as {@link ServiceBean} */ private List<PersistenceServiceDTO> getPersistenceServiceList(Locale locale) { List<PersistenceServiceDTO> dtoList = new ArrayList<PersistenceServiceDTO>(); for (PersistenceService service : persistenceServiceRegistry.getAll()) { PersistenceServiceDTO serviceDTO = new PersistenceServiceDTO(); serviceDTO.id = service.getId(); serviceDTO.label = service.getLabel(locale); if (service instanceof ModifiablePersistenceService) { serviceDTO.type = MODIFYABLE; } else if (service instanceof QueryablePersistenceService) { serviceDTO.type = QUERYABLE; } else { serviceDTO.type = STANDARD; } dtoList.add(serviceDTO); } return dtoList; }
ItemHistoryDTO dto = new ItemHistoryDTO(); dto.name = itemName; result = qService.query(filter); if (result != null && result.iterator().hasNext()) { dto.addData(dateTimeBegin.toInstant().toEpochMilli(), result.iterator().next().getState()); quantity++; dto.addData(historicItem.getTimestamp().getTime(), lastItem.getState()); quantity++; dto.addData(historicItem.getTimestamp().getTime(), state); quantity++; lastItem = historicItem; result = qService.query(filter); if (result != null && result.iterator().hasNext()) { dto.addData(dateTimeEnd.toInstant().toEpochMilli(), result.iterator().next().getState()); quantity++;
/** * Add a new record to the data history. * This method returns a double value equal to the state. This may be used for comparison by the caller. * * @param time the time of the record * @param state the state at this time */ public void addData(Long time, State state) { HistoryDataBean newVal = new HistoryDataBean(); newVal.time = time; newVal.state = state.toString(); data.add(newVal); }