Interface DataLoggerService


  • public interface DataLoggerService
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.lang.String getId()  
      Record getLatestLogRecord​(java.lang.String channelId)
      Returns the Record with the highest timestamp available in all logged data for the channel with the given channelId.
      java.util.List<Record> getRecords​(java.lang.String channelId, long startTime, long endTime)
      Returns a list of all logged data records with timestamps from startTime to endTime for the channel with the given channelId.
      void log​(java.util.List<LoggingRecord> containers, long timestamp)
      Called by data manager to tell the logger that it should log the given records
      void logEvent​(java.util.List<LoggingRecord> containers, long timestamp)  
      boolean logSettingsRequired()  
      void setChannelsToLog​(java.util.List<LogChannel> channels)  
    • Method Detail

      • getId

        java.lang.String getId()
      • setChannelsToLog

        void setChannelsToLog​(java.util.List<LogChannel> channels)
      • log

        void log​(java.util.List<LoggingRecord> containers,
                 long timestamp)
        Called by data manager to tell the logger that it should log the given records

        NOTE: Implementation of this method should be non blocking to avoid blocking in the data manager.

        Parameters:
        containers - containers to log
        timestamp - logging timestamp
      • logEvent

        void logEvent​(java.util.List<LoggingRecord> containers,
                      long timestamp)
      • logSettingsRequired

        boolean logSettingsRequired()
      • getRecords

        java.util.List<Record> getRecords​(java.lang.String channelId,
                                          long startTime,
                                          long endTime)
                                   throws java.io.IOException
        Returns a list of all logged data records with timestamps from startTime to endTime for the channel with the given channelId.
        Parameters:
        channelId - the channel ID.
        startTime - the starting time in milliseconds since midnight, January 1, 1970 UTC. inclusive
        endTime - the ending time in milliseconds since midnight, January 1, 1970 UTC. inclusive
        Returns:
        a list of all logged data records with timestamps from startTime to endTime for the channel with the given channelId.
        Throws:
        java.io.IOException - if any kind of error occurs accessing the logged data.
      • getLatestLogRecord

        Record getLatestLogRecord​(java.lang.String channelId)
                           throws java.io.IOException
        Returns the Record with the highest timestamp available in all logged data for the channel with the given channelId. If there are multiple Records with the same timestamp, results may not be consistent. Null if no Record was found.
        Parameters:
        channelId - the channel ID.
        Returns:
        the Record with the highest timestamp available in all logged data for the channel with the given channelId
        Throws:
        java.io.IOException