use of org.yamcs.studio.core.client.URLBuilder in project yamcs-studio by yamcs.
the class ArchiveCatalogue method downloadIndexes.
public CompletableFuture<Void> downloadIndexes(TimeInterval interval, BulkRestDataReceiver receiver) {
String instance = ManagementCatalogue.getCurrentYamcsInstance();
URLBuilder urlb = new URLBuilder("/archive/" + instance + "/indexes");
urlb.setParam("filter", Arrays.asList("tm", "pp", "commands", "completeness"));
if (interval.hasStart())
urlb.setParam("start", interval.getStartUTC());
if (interval.hasStop())
urlb.setParam("stop", interval.getStopUTC());
YamcsClient yamcsClient = YamcsPlugin.getYamcsClient();
return yamcsClient.streamGet(urlb.toString(), null, receiver);
}
use of org.yamcs.studio.core.client.URLBuilder in project yamcs-studio by yamcs.
the class ArchiveCatalogue method downloadCommands.
public CompletableFuture<Void> downloadCommands(TimeInterval interval, BulkRestDataReceiver receiver) {
String instance = ManagementCatalogue.getCurrentYamcsInstance();
URLBuilder urlb = new URLBuilder("/archive/" + instance + "/downloads/commands");
if (interval.hasStart())
urlb.setParam("start", interval.getStartUTC());
if (interval.hasStop())
urlb.setParam("stop", interval.getStopUTC());
YamcsClient yamcsClient = YamcsPlugin.getYamcsClient();
return yamcsClient.streamGet(urlb.toString(), null, receiver);
}
use of org.yamcs.studio.core.client.URLBuilder in project yamcs-studio by yamcs.
the class URLBuilderTest method testURLs.
@Test
public void testURLs() {
URLBuilder urlb = new URLBuilder("resource");
assertEquals("resource", urlb.toString());
urlb.setParam("a", false);
assertEquals("resource?a=false", urlb.toString());
urlb.setParam("b", Arrays.asList("x", "y", "z"));
assertEquals("resource?a=false&b[]=x&b[]=y&b[]=z", urlb.toString());
}
use of org.yamcs.studio.core.client.URLBuilder in project yamcs-studio by yamcs.
the class ArchiveCatalogue method listTags.
public CompletableFuture<byte[]> listTags(TimeInterval interval) {
String instance = ManagementCatalogue.getCurrentYamcsInstance();
URLBuilder urlb = new URLBuilder("/archive/" + instance + "/tags");
if (interval.hasStart())
urlb.setParam("start", interval.getStartUTC());
if (interval.hasStop())
urlb.setParam("stop", interval.getStopUTC());
YamcsClient yamcsClient = YamcsPlugin.getYamcsClient();
return yamcsClient.get(urlb.toString(), null);
}
Aggregations