public interface LogStorage
Interface for log storage.
Persists each new log record, forms on demand new log block for sending it to the Operation server, removes already sent records, cleans up elder records in case if there is some limitation on a size of log storage.
Reference implementation used by default (MemoryLogStorage
).
Modifier and Type | Method and Description |
---|---|
void |
addLogRecord(LogRecord record)
Persists new log record.
|
LogBlock |
getRecordBlock(long blockSize)
Retrieves new log block of specified size or null if there is no logs.
|
void |
notifyUploadFailed(int id)
Notifies if sending of a log block with a specified id was failed.
|
void |
removeOldestRecord(long maximumAllowedVolume)
Removes elder records until occupied size becomes equal or less than
specified in a passed parameter.
|
void |
removeRecordBlock(int id)
Removes already sent log records by its block id.
|
void addLogRecord(LogRecord record)
record
- New record (LogRecord
)LogBlock getRecordBlock(long blockSize)
Retrieves new log block of specified size or null if there is no logs.
The size of retrieved log records should NOT be greater than specified block size.
blockSize
- Maximum size of sending log blockLogBlock
)void removeRecordBlock(int id)
Removes already sent log records by its block id.
Use in case of a successful upload.
id
- Unique id of sent log blockvoid removeOldestRecord(long maximumAllowedVolume)
maximumAllowedVolume
- Maximum size of inner storagevoid notifyUploadFailed(int id)
id
- Unique id of log block.Copyright © 2015. All rights reserved.