use of org.yamcs.protobuf.Yamcs.IndexResult in project yamcs-studio by yamcs.
the class ArchiveIndexReceiver method getIndex.
public void getIndex(TimeInterval interval) {
if (receiving) {
log.info("already receiving data");
return;
}
ArchiveCatalogue catalogue = ArchiveCatalogue.getInstance();
catalogue.downloadIndexes(interval, data -> {
try {
IndexResult response = IndexResult.parseFrom(data);
log.fine(String.format("Received %d archive records", response.getRecordsCount()));
archiveView.receiveArchiveRecords(response);
} catch (InvalidProtocolBufferException e) {
throw new YamcsApiException("Failed to decode server message", e);
}
}).whenComplete((data, exc) -> {
if (exc == null) {
log.info("Done receiving archive records.");
archiveView.receiveArchiveRecordsFinished();
receiving = false;
} else {
archiveView.receiveArchiveRecordsError(exc.toString());
}
});
}
Aggregations