Search in sources :

Example 1 with URLBuilder

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);
}
Also used : YamcsClient(org.yamcs.studio.core.client.YamcsClient) URLBuilder(org.yamcs.studio.core.client.URLBuilder)

Example 2 with URLBuilder

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);
}
Also used : YamcsClient(org.yamcs.studio.core.client.YamcsClient) URLBuilder(org.yamcs.studio.core.client.URLBuilder)

Example 3 with URLBuilder

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());
}
Also used : URLBuilder(org.yamcs.studio.core.client.URLBuilder) Test(org.junit.Test)

Example 4 with URLBuilder

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);
}
Also used : YamcsClient(org.yamcs.studio.core.client.YamcsClient) URLBuilder(org.yamcs.studio.core.client.URLBuilder)

Aggregations

URLBuilder (org.yamcs.studio.core.client.URLBuilder)4 YamcsClient (org.yamcs.studio.core.client.YamcsClient)3 Test (org.junit.Test)1