All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.yamcs.api.MockupEventProducer Maven / Gradle / Ivy

There is a newer version: 5.10.1
Show newest version
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();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy