|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectno.ntnu.vegare.visualizer.server.db.LogDatabase
public class LogDatabase
A simplified implementation of a SQLite database interface.
Uses SqliteJDBC ( http://www.zentus.com/sqlitejdbc/) to create an in-memory database, and provides an interface to insert or load entries.
The database is cleared when the process dies.
Constructor Summary | |
---|---|
LogDatabase()
Create an in-memory database and a table for log records. |
Method Summary | |
---|---|
void |
addEntry(int severity,
java.lang.String facility,
java.lang.String ip,
java.lang.String msg)
Add a new security incident to the database. |
java.lang.String |
getEntries(int startTime,
int stopTime,
int minSev)
Load all incidents occurring in a time interval, specified by two UNIX timestamps. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LogDatabase()
Method Detail |
---|
public void addEntry(int severity, java.lang.String facility, java.lang.String ip, java.lang.String msg)
Add a new security incident to the database.
Severity is given as one of the following:
severity
- Integer value from 0-7facility
- Textual name of target systemip
- IP addres as a dot-decimal stringmsg
- Textual messagepublic java.lang.String getEntries(int startTime, int stopTime, int minSev)
Load all incidents occurring in a time interval, specified by two UNIX timestamps. In addition, filtering can be performed on severity, avoiding routine messages.
startTime
- Earliest time, as UNIX timestampstopTime
- Latest time, as UNIX timestampminSev
- Minimum severity to load
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |