Class ReplayService

java.lang.Object
com.bank.trading.data.ReplayService
All Implemented Interfaces:
Runnable

public class ReplayService extends Object implements Runnable
Replay service to catch booted up service or lagging service to the current state of the system. This service is run as a Thread on the Lamport Clock server.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructor to initialize the replay service with the log file.
  • Method Summary

    Modifier and Type
    Method
    Description
    byte[]
    getLog(long startTime, URI subscriber)
    Get the log data starting from a specific time for a given subscriber.
    void
    run()
    This method is responsible for running the Replay service main exection loop.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ReplayService

      public ReplayService(File logFile, InetSocketAddress address)
      Constructor to initialize the replay service with the log file.
      Parameters:
      logFile - The file containing the logged events.
  • Method Details

    • run

      public void run()
      This method is responsible for running the Replay service main exection loop.
      Specified by:
      run in interface Runnable
    • getLog

      public byte[] getLog(long startTime, URI subscriber)
      Get the log data starting from a specific time for a given subscriber.
      Parameters:
      startTime -
      subscriber -
      Returns:
      byte array of the log data in event log format.