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 givenchannelId
.java.util.List<Record>
getRecords(java.lang.String channelId, long startTime, long endTime)
Returns a list of all logged data records with timestamps fromstartTime
toendTime
for the channel with the givenchannelId
.void
log(java.util.List<LoggingRecord> containers, long timestamp)
Called by data manager to tell the logger that it should log the given recordsvoid
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 recordsNOTE: Implementation of this method should be non blocking to avoid blocking in the data manager.
- Parameters:
containers
- containers to logtimestamp
- 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 fromstartTime
toendTime
for the channel with the givenchannelId
.- Parameters:
channelId
- the channel ID.startTime
- the starting time in milliseconds since midnight, January 1, 1970 UTC. inclusiveendTime
- the ending time in milliseconds since midnight, January 1, 1970 UTC. inclusive- Returns:
- a list of all logged data records with timestamps from
startTime
toendTime
for the channel with the givenchannelId
. - 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 givenchannelId
. 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
-
-