Interface Subscription<C extends,S extends>

Type Parameters:
C - The client message
S - The server message
All Superinterfaces:
All Known Implementing Classes:
AbstractSubscription, AlarmSubscription, ClearanceSubscription, CommandSubscription, ContainerSubscription, EventSubscription, GlobalAlarmStatusSubscription, LinkSubscription, PacketSubscription, ParameterSubscription, ProcessorSubscription, QueueEventSubscription, QueueStatisticsSubscription, TimeSubscription

public interface Subscription<C extends,S extends> extends Future<Void>
Top-level interface for any topic subscriptions to Yamcs that make use of the WebSocket API.

Topics are capable of bi-directional communication, where each topic has only a single client and server message type. In practice most topics are one-directional, with the client issuing a single subscription request.

A topic subscription is usually long-running. The server keeps pushing updates until the client cancels the call, or closes the connection. Instances of this class are also futures covering the lifecycle of the call (or any error replies to sent message).

This base class adds general listener support for receiving the unprocessed data messages. Specific implementations of this class sometimes add more customized functionalities, such as polling or processing.

  • Method Details

    • addMessageListener

      void addMessageListener(MessageListener<S> listener)
      Get updated on received server messages.
    • sendMessage

      void sendMessage(C message)
      Sends a message to Yamcs. Note that most topic subscriptions support only a single message to be sent.