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 void
disable()
Disable any data I/O through this link.void
enable()
Reenable the data transit if disabled by the disable() method.YConfiguration
getConfig()
long
getDataInCount()
long
getDataOutCount()
long
getDelayBetweenPackets()
String
getDetailedStatus()
Link.Status
getLinkStatus()
Returns the current link status.String
getName()
Return the name of the linkboolean
isDisabled()
void
resetCounters()
void
run()
void
setDelayBetweenPackets(int delayBetweenPackets)
void
setTmSink(TmSink tmProcessor)
sets the tm processor that should get all the tm packetsvoid
triggerShutdown()
-
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:TmPacketDataLink
sets the tm processor that should get all the tm packets- Specified by:
setTmSink
in 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:Link
Returns the current link status.- Specified by:
getLinkStatus
in interfaceLink
-
triggerShutdown
public void triggerShutdown()
- Overrides:
triggerShutdown
in classcom.google.common.util.concurrent.AbstractExecutionThreadService
-
disable
public void disable()
Description copied from interface:Link
Disable 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:Link
Reenable the data transit if disabled by the disable() method.
-
isDisabled
public boolean isDisabled()
- Specified by:
isDisabled
in interfaceLink
-
getDetailedStatus
public String getDetailedStatus()
- Specified by:
getDetailedStatus
in interfaceLink
- Returns:
- more detailed status information
-
getDataInCount
public long getDataInCount()
- Specified by:
getDataInCount
in interfaceLink
-
getDataOutCount
public long getDataOutCount()
- Specified by:
getDataOutCount
in interfaceLink
-
resetCounters
public void resetCounters()
- Specified by:
resetCounters
in interfaceLink
-
getConfig
public YConfiguration getConfig()
-
-