|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface Log
A Log collects and performs computations on LogRecords. This is an interface because we may implement logs differently, e.g. as a local array, as a Collection, as a remote server or database, etc.
| Method Summary | |
|---|---|
void |
add(LogRecord record)
Stores a LogRecord in the Log. |
java.util.List<LogRecord> |
flush()
Returns all LogRecords kept in the log, emptying the log. |
java.util.List<LogRecord> |
getAll(long windowMS)
Returns all LogRecords whose timestamps are within a window of time. |
void |
register(Listener<LogRecord> listener)
Registers a listener that whose notify() method will be called whenever a record is added to this log; the first argument of notify() is the log itself, and the second is the LogRecord that was added. |
void |
unregister(Listener<LogRecord> listener)
Removes a previously-registered listener. |
| Method Detail |
|---|
void add(LogRecord record)
java.util.List<LogRecord> getAll(long windowMS)
windowMS - return all records from the last [windowMS]
milliseconds.java.util.List<LogRecord> flush()
void register(Listener<LogRecord> listener)
listener - The listener to register.void unregister(Listener<LogRecord> listener)
listener - The listener to remove. If this listener is
not present, then unregister behaves as a no-op.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||