|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.gcube.datatransfer.scheduler.db.DBManager
public abstract class DBManager
Nested Class Summary | |
---|---|
static interface |
DBManager.BaseConsumer
|
Field Summary | |
---|---|
protected static File |
backupFolder
|
protected static int |
backupIntervalMS
|
protected String |
dbFileBaseFolder
dbFileName is used to open or create files that hold the state of the db. |
protected String |
dbFileName
|
protected String |
dbName
|
protected javax.jdo.PersistenceManagerFactory |
persistenceFactory
|
Constructor Summary | |
---|---|
DBManager()
Constructor for SQLDBManager |
Method Summary | |
---|---|
void |
backup()
checkpoint the db and create a backup |
void |
close()
Shutdown the db and close the connection to the db. |
String |
queryJSON(String expression)
Executes SQL command SELECT and invokes the given consumer, giging back JSON formatetted output. |
protected static String |
quote(String string)
Produce a string in double quotes with backslash sequences in all the right places. |
static String |
toJSon(ResultSet resultSet)
|
protected void |
zipFolder(File[] files)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected javax.jdo.PersistenceManagerFactory persistenceFactory
protected static File backupFolder
protected String dbFileBaseFolder
protected String dbFileName
protected String dbName
protected static int backupIntervalMS
Constructor Detail |
---|
public DBManager()
Method Detail |
---|
public void close() throws Exception
Exception
public void backup() throws SQLException, Exception
SQLException
- if the CHECKPOINT query fails
Exception
public String queryJSON(String expression) throws SQLException, Exception
expression
- the SQL expression to evaluate
SQLException
- if the query fails
Exception
- if the given resultset consumer failspublic static String toJSon(ResultSet resultSet) throws SQLException
resultSet
-
SQLException
protected static String quote(String string)
string
- A String
protected void zipFolder(File[] files) throws Exception
Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |