public class LogArchiveImpl extends Object implements LogArchive, LogEventSink
Constructor and Description |
---|
LogArchiveImpl(String archive,
int maxHistory)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addEvent(LogLevel level,
String line)
Add an event to this archive.
|
void |
addListener(LogListener l,
LogLevel level,
long last,
int history)
Add a listener.
|
String |
getArchive()
Get the archive name.
|
long |
getLastMessageNumber()
Get the last message number in this archive.
|
int |
getMaxHistory()
Get the naximum number archive history lines supported.
|
boolean |
removeListener(LogListener l)
Remove a listener.
|
LogEvent[] |
retrieveEvents(long from,
int max)
Retrieve events from the archive.
|
public LogArchiveImpl(String archive, int maxHistory)
maxHistory
- The maximum history lines.public long getLastMessageNumber()
getLastMessageNumber
in interface LogArchive
public void addEvent(LogLevel level, String line)
addEvent
in interface LogEventSink
level
- The level.line
- The message.public LogEvent[] retrieveEvents(long from, int max)
retrieveEvents
in interface LogArchive
from
- From message numbermax
- The maximum number to retreive.public void addListener(LogListener l, LogLevel level, long last, int history)
addListener
in interface LogArchive
l
- The listener.level
- The level.last
- The last message number this listener requires.history
- The maximum lines this listener requires.public boolean removeListener(LogListener l)
removeListener
in interface LogArchive
l
- The listener.public String getArchive()
getArchive
in interface LogArchive
public int getMaxHistory()
getMaxHistory
in interface LogArchive