Class 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.
    • Constructor Detail

      • 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

      • run

        public void run()
        Specified by:
        run in interface Runnable
        Specified by:
        run in class com.google.common.util.concurrent.AbstractExecutionThreadService
      • 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 interface Link
      • triggerShutdown

        public void triggerShutdown()
        Overrides:
        triggerShutdown in class com.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
        Specified by:
        disable in interface Link
      • enable

        public void enable()
        Description copied from interface: Link
        Reenable the data transit if disabled by the disable() method.
        Specified by:
        enable in interface Link
      • isDisabled

        public boolean isDisabled()
        Specified by:
        isDisabled in interface Link
      • getDetailedStatus

        public String getDetailedStatus()
        Specified by:
        getDetailedStatus in interface Link
        Returns:
        more detailed status information
      • getDataInCount

        public long getDataInCount()
        Specified by:
        getDataInCount in interface Link
      • getDataOutCount

        public long getDataOutCount()
        Specified by:
        getDataOutCount in interface Link
      • resetCounters

        public void resetCounters()
        Specified by:
        resetCounters in interface Link
      • getConfig

        public YConfiguration getConfig()
        Specified by:
        getConfig in interface Link
        Returns:
        the config (args) used when creating the link
      • getName

        public String getName()
        Description copied from interface: Link
        Return the name of the link
        Specified by:
        getName in interface Link