use of org.yamcs.studio.core.client.YamcsClient in project yamcs-studio by yamcs.
the class CommandingCatalogue method onYamcsConnected.
@Override
public void onYamcsConnected() {
YamcsClient yamcsClient = YamcsPlugin.getYamcsClient();
yamcsClient.subscribe(new WebSocketRequest("cmdhistory", "subscribe"), this);
yamcsClient.subscribe(new WebSocketRequest("cqueues", "subscribe"), this);
initialiseState();
}
use of org.yamcs.studio.core.client.YamcsClient in project yamcs-studio by yamcs.
the class ContainerCatalogue method loadContainers.
private void loadContainers() {
log.fine("Fetching available Containers");
YamcsClient yamcsClient = YamcsPlugin.getYamcsClient();
String instance = ManagementCatalogue.getCurrentYamcsInstance();
yamcsClient.get("/mdb/" + instance + "/containers", null).whenComplete((data, exc) -> {
try {
ListContainerInfoResponse response = ListContainerInfoResponse.parseFrom(data);
processContainers(response.getContainerList());
} catch (InvalidProtocolBufferException e) {
log.log(Level.SEVERE, "Failed to decode server response", e);
}
});
}
use of org.yamcs.studio.core.client.YamcsClient in project yamcs-studio by yamcs.
the class EventCatalogue method onYamcsConnected.
@Override
public void onYamcsConnected() {
YamcsClient yamcsClient = YamcsPlugin.getYamcsClient();
yamcsClient.subscribe(new WebSocketRequest("events", "subscribe"), this);
}
use of org.yamcs.studio.core.client.YamcsClient in project yamcs-studio by yamcs.
the class EventCatalogue method fetchLatestEvents.
public CompletableFuture<byte[]> fetchLatestEvents(String instance) {
String resource = "/archive/" + instance + "/events";
YamcsClient yamcsClient = YamcsPlugin.getYamcsClient();
return yamcsClient.get(resource, null);
}
use of org.yamcs.studio.core.client.YamcsClient in project yamcs-studio by yamcs.
the class EventCatalogue method createEvent.
public CompletableFuture<byte[]> createEvent(String source, int sequenceNumber, String message, long generationTime, long receptionTime, EventSeverity severity) {
String instance = ManagementCatalogue.getCurrentYamcsInstance();
String resource = "/archive/" + instance + "/events/";
Event event = Event.newBuilder().setSource(source).setSeqNumber(sequenceNumber).setMessage(message).setGenerationTime(generationTime).setReceptionTime(receptionTime).setSeverity(severity).build();
YamcsClient yamcsClient = YamcsPlugin.getYamcsClient();
return yamcsClient.post(resource, event);
}
Aggregations