public class SQLiteSerialization
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected java.util.LinkedHashMap<java.lang.Integer,java.sql.PreparedStatement> |
messageInserts |
| Modifier and Type | Method and Description |
|---|---|
protected void |
commit()
Commit any uncommited transactions to the database
|
static SQLiteSerialization |
connect()
Creates a new SQLite DB and connects to it
|
static SQLiteSerialization |
connect(java.lang.String filename)
Connect to an existing DB
|
static java.lang.Object |
extractValue(java.lang.String imcType,
java.lang.String column,
java.sql.ResultSet rs) |
java.sql.Connection |
getConn() |
static SQLiteSerialization |
getDb() |
java.lang.String |
getFilename() |
pt.lsts.imc.IMCMessage |
getLastMessageOfType(int messageType)
Fetch the last message of some type
|
pt.lsts.imc.IMCMessage |
getLastMessageOfType(java.lang.String messageAbbrev)
Fetch the last message of some type
|
pt.lsts.imc.IMCMessage |
getLatestMessageOfType(int messageType)
Fetch the last message of some type
|
protected java.sql.PreparedStatement |
getMessageInsertStatement(int msgType) |
static void |
main(java.lang.String[] args) |
long |
store(pt.lsts.imc.IMCMessage msg)
Stores the given message in the Database
|
protected long |
storeHeader(pt.lsts.imc.IMCMessage header) |
protected java.util.LinkedHashMap<java.lang.Integer,java.sql.PreparedStatement> messageInserts
public static SQLiteSerialization getDb()
public static SQLiteSerialization connect()
public static SQLiteSerialization connect(java.lang.String filename)
filename - The filename of the SQLite database data. If this file does not exist, a new DB is created in that file.public pt.lsts.imc.IMCMessage getLatestMessageOfType(int messageType)
throws java.sql.SQLException
messageType - The IMC type of the message to be returnedjava.sql.SQLExceptionpublic pt.lsts.imc.IMCMessage getLastMessageOfType(java.lang.String messageAbbrev)
throws java.sql.SQLException
messageType - The abbreviated name of the message to be returnedjava.sql.SQLExceptionpublic pt.lsts.imc.IMCMessage getLastMessageOfType(int messageType)
throws java.sql.SQLException
messageType - The IMC type of the message to be returnedjava.sql.SQLExceptionpublic long store(pt.lsts.imc.IMCMessage msg)
throws java.sql.SQLException
msg - The message to be serialized onto the DBjava.sql.SQLExceptionprotected void commit()
throws java.sql.SQLException
java.sql.SQLExceptionprotected java.sql.PreparedStatement getMessageInsertStatement(int msgType)
throws java.sql.SQLException
java.sql.SQLExceptionpublic static java.lang.Object extractValue(java.lang.String imcType,
java.lang.String column,
java.sql.ResultSet rs)
throws java.sql.SQLException
java.sql.SQLExceptionprotected long storeHeader(pt.lsts.imc.IMCMessage header)
throws java.sql.SQLException
java.sql.SQLExceptionpublic java.sql.Connection getConn()
public java.lang.String getFilename()
public static void main(java.lang.String[] args)
throws java.sql.SQLException
java.sql.SQLExceptionCopyright © 2004-2014 FEUP-LSTS and Neptus developers. All Rights Reserved.