Package org.yamcs
Class ParameterCaptor
- java.lang.Object
-
- org.yamcs.ParameterCaptor
-
public class ParameterCaptor extends Object
Utility class for queueing parameter deliveries as they are received from a subscription to Yamcs. This is intended for use in unit tests only.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidassertSilence()voidclear()List<org.yamcs.protobuf.Pvalue.ParameterValue>expectTimely()Returns the next delivery.org.yamcs.protobuf.Yamcs.NamedObjectIdexpectTimelyInvalidIdentifier()intgetPendingCount()Returns the number of unprocessed value deliveries.booleanisEmpty()Returns true if there are not currently any unprocessed deliveries.static ParameterCaptorof(ParameterSubscription subscription)List<org.yamcs.protobuf.Pvalue.ParameterValue>poll()Returns the next delivery.List<org.yamcs.protobuf.Pvalue.ParameterValue>poll(long timeout)Returns the next delivery.
-
-
-
Method Detail
-
poll
public List<org.yamcs.protobuf.Pvalue.ParameterValue> poll()
Returns the next delivery. Or null, if nothing was received yet.
-
poll
public List<org.yamcs.protobuf.Pvalue.ParameterValue> poll(long timeout) throws InterruptedException
Returns the next delivery. Or null, if nothing was received yet.- Throws:
InterruptedException
-
expectTimely
public List<org.yamcs.protobuf.Pvalue.ParameterValue> expectTimely() throws InterruptedException, TimeoutException
Returns the next delivery. If there is nothing available yet, this will block for the specified time awaiting delivery.- Throws:
InterruptedExceptionTimeoutException
-
assertSilence
public void assertSilence() throws InterruptedException- Throws:
InterruptedException
-
clear
public void clear()
-
isEmpty
public boolean isEmpty()
Returns true if there are not currently any unprocessed deliveries.
-
getPendingCount
public int getPendingCount()
Returns the number of unprocessed value deliveries.
-
expectTimelyInvalidIdentifier
public org.yamcs.protobuf.Yamcs.NamedObjectId expectTimelyInvalidIdentifier() throws InterruptedException, TimeoutException- Throws:
InterruptedExceptionTimeoutException
-
of
public static ParameterCaptor of(ParameterSubscription subscription)
-
-