public byte[][] getReportingData(User user, GraphPinRequest[] requestedPins) throws NoDataException { byte[][] values = new byte[requestedPins.length][]; for (int i = 0; i < requestedPins.length; i++) { GraphPinRequest graphPinRequest = requestedPins[i]; log.debug("Getting data for graph pin : {}.", graphPinRequest); if (graphPinRequest.isValid()) { ByteBuffer byteBuffer = graphPinRequest.isLiveData() //live graph data is not on disk but in memory ? rawDataCacheForGraphProcessor.getLiveGraphData(user, graphPinRequest) : getByteBufferFromDisk(user, graphPinRequest); values[i] = byteBuffer == null ? EMPTY_BYTES : byteBuffer.array(); } else { values[i] = EMPTY_BYTES; } } if (!hasData(values)) { throw new NoDataException(); } return values; }
requestedPins[i] = new GraphPinRequest(dashId, -1, graphDataStream.dataStream, graphPeriod, skipCount, graphDataStream.functionType); } else { if (target.isTag()) { requestedPins[i] = new GraphPinRequest(dashId, target.getDeviceIds(), graphDataStream.dataStream, graphPeriod, skipCount, graphDataStream.functionType); } else { requestedPins[i] = new GraphPinRequest(dashId, target.getDeviceId(), graphDataStream.dataStream, graphPeriod, skipCount, graphDataStream.functionType);