Package org.yamcs.tctm
Class FileTmPacketProvider
- java.lang.Object
-
- com.google.common.util.concurrent.AbstractExecutionThreadService
-
- org.yamcs.tctm.FileTmPacketProvider
-
- All Implemented Interfaces:
com.google.common.util.concurrent.Service,Runnable,Link,TmPacketDataLink
public class FileTmPacketProvider extends com.google.common.util.concurrent.AbstractExecutionThreadService implements Runnable, TmPacketDataLink
Plays files in pacts format, hrdp format or containing raw ccsds packets.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.yamcs.tctm.Link
Link.Status
-
-
Constructor Summary
Constructors Constructor Description FileTmPacketProvider(String fileName, String endActionStr, long delayBetweenPackets)Constructs a packet provider that sends packets from a file at the indicated speed.FileTmPacketProvider(String instance, String name, String fileName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddisable()Disable any data I/O through this link.voidenable()Reenable the data transit if disabled by the disable() method.YConfigurationgetConfig()longgetDataInCount()longgetDataOutCount()longgetDelayBetweenPackets()StringgetDetailedStatus()Link.StatusgetLinkStatus()Returns the current link status.StringgetName()Return the name of the linkbooleanisDisabled()voidresetCounters()voidrun()voidsetDelayBetweenPackets(int delayBetweenPackets)voidsetTmSink(TmSink tmProcessor)sets the tm processor that should get all the tm packetsvoidtriggerShutdown()-
Methods inherited from class com.google.common.util.concurrent.AbstractExecutionThreadService
addListener, awaitRunning, awaitRunning, awaitTerminated, awaitTerminated, executor, failureCause, isRunning, serviceName, shutDown, startAsync, startUp, state, stopAsync, toString
-
-
-
-
Constructor Detail
-
FileTmPacketProvider
public FileTmPacketProvider(String instance, String name, String fileName) throws IOException
- Throws:
IOException
-
FileTmPacketProvider
public FileTmPacketProvider(String fileName, String endActionStr, long delayBetweenPackets) throws IOException
Constructs a packet provider that sends packets from a file at the indicated speed. If the parameter loop is set to true, then jump back at the beginning of the file once the end has been reached.- Parameters:
fileName-delayBetweenPackets-- Throws:
IOException
-
-
Method Detail
-
setTmSink
public void setTmSink(TmSink tmProcessor)
Description copied from interface:TmPacketDataLinksets the tm processor that should get all the tm packets- Specified by:
setTmSinkin interfaceTmPacketDataLink
-
run
public void run()
-
getDelayBetweenPackets
public long getDelayBetweenPackets()
- Returns:
- the delayBetweenPakets
-
setDelayBetweenPackets
public void setDelayBetweenPackets(int delayBetweenPackets)
- Parameters:
delayBetweenPackets- the delayBetweenPakets to set
-
getLinkStatus
public Link.Status getLinkStatus()
Description copied from interface:LinkReturns the current link status.- Specified by:
getLinkStatusin interfaceLink
-
triggerShutdown
public void triggerShutdown()
- Overrides:
triggerShutdownin classcom.google.common.util.concurrent.AbstractExecutionThreadService
-
disable
public void disable()
Description copied from interface:LinkDisable any data I/O through this link. Any connection to a server is closed. Can be reenabled using the enable method. Note that this method can be called before starting the service if it's configured as such in the configuration file
-
enable
public void enable()
Description copied from interface:LinkReenable the data transit if disabled by the disable() method.
-
isDisabled
public boolean isDisabled()
- Specified by:
isDisabledin interfaceLink
-
getDetailedStatus
public String getDetailedStatus()
- Specified by:
getDetailedStatusin interfaceLink- Returns:
- more detailed status information
-
getDataInCount
public long getDataInCount()
- Specified by:
getDataInCountin interfaceLink
-
getDataOutCount
public long getDataOutCount()
- Specified by:
getDataOutCountin interfaceLink
-
resetCounters
public void resetCounters()
- Specified by:
resetCountersin interfaceLink
-
getConfig
public YConfiguration getConfig()
-
-