public abstract class AbstractSubscription<C extends com.google.protobuf.Message,S extends com.google.protobuf.Message> extends Object implements Subscription<C,S>
Subscription.
This is designed such that most subclasses need only to provide type information. More advanced subscription subclasses may want to add custom functionality such as call-specific message processing.
| Modifier and Type | Field and Description |
|---|---|
protected Observer<C> |
clientObserver |
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractSubscription(MethodHandler methodHandler,
String topic,
Class<S> responseClass) |
| Modifier and Type | Method and Description |
|---|---|
void |
addMessageListener(MessageListener<S> listener)
Get updated on received server messages.
|
boolean |
cancel(boolean mayInterruptIfRunning)
Cancel this subscription.
|
Void |
get() |
Void |
get(long timeout,
TimeUnit unit) |
boolean |
isCancelled() |
boolean |
isDone() |
void |
sendMessage(C message)
Send a message (typically a subscription request) to Yamcs
|
protected AbstractSubscription(MethodHandler methodHandler, String topic, Class<S> responseClass)
public void sendMessage(C message)
sendMessage in interface Subscription<C extends com.google.protobuf.Message,S extends com.google.protobuf.Message>public void addMessageListener(MessageListener<S> listener)
addMessageListener in interface Subscription<C extends com.google.protobuf.Message,S extends com.google.protobuf.Message>public boolean cancel(boolean mayInterruptIfRunning)
public boolean isCancelled()
isCancelled in interface Future<Void>public Void get() throws InterruptedException, ExecutionException
get in interface Future<Void>InterruptedExceptionExecutionExceptionpublic Void get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException
get in interface Future<Void>InterruptedExceptionExecutionExceptionTimeoutExceptionCopyright © 2020 Space Applications Services. All rights reserved.