org.yamcs.api.MockupEventProducer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of yamcs-api Show documentation
Show all versions of yamcs-api Show documentation
Used by external clients to communicate with Yamcs
package org.yamcs.api;
import java.util.Queue;
import org.yamcs.protobuf.Yamcs.Event;
import org.yamcs.utils.TimeEncoding;
/**
* saves events into a queue (to be used by unit tests)
*
*
* @author nm
*
*/
public class MockupEventProducer extends AbstractEventProducer {
Queue mockupQueue;
public MockupEventProducer(Queue mockupQueue) {
this.mockupQueue=mockupQueue;
}
@Override
public void sendEvent(Event event) {
if(mockupQueue!=null) mockupQueue.add(event);
}
@Override
public void close() {
}
@Override
public long getMissionTime() {
return TimeEncoding.getWallclockTime();
}
}