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

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

There is a newer version: 5.10.9
Show newest version
package org.yamcs.events;

import java.util.Queue;

import org.yamcs.yarch.protobuf.Db.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