|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.unikassel.android.sdcframework.persistence.DatabaseManagerImpl
public final class DatabaseManagerImpl
Implementation of a central database manager.
Field Summary | |
---|---|
private DatabaseAdapterImpl |
dbAdapter
The internal database adapter |
Constructor Summary | |
---|---|
DatabaseManagerImpl(Context applicationContext,
long maxDBSize,
String dbName)
Constructor |
|
DatabaseManagerImpl(Context applicationContext,
String dbName)
Constructor |
Method Summary | ||
---|---|---|
long |
doDeleteOldestSamplesInDatabase(long count,
boolean lowestPriorityFirst)
Method to delete the oldest "count" samples in the database This method is used to delete samples for deletion in case of database size maximum reached. |
|
|
doExecuteCommand(DatabaseCommand<T> command)
Does execute a database command |
|
DatabaseAdapterImpl |
getDbAdapter()
Getter for the dbAdapter |
|
long |
getMaximumDatabaseSize()
Getter for the maximum database size in kilobytes |
|
long |
getRecordCountInDatabase()
Getter for the current sample record count stored in database |
|
long |
setMaximumDatabaseSize(long size)
Setter for the maximum database size in kilobytes |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final DatabaseAdapterImpl dbAdapter
Constructor Detail |
---|
public DatabaseManagerImpl(Context applicationContext, String dbName)
applicationContext
- the application contextdbName
- the database namepublic DatabaseManagerImpl(Context applicationContext, long maxDBSize, String dbName)
applicationContext
- the application contextmaxDBSize
- the maximum database sizedbName
- the database nameMethod Detail |
---|
public final DatabaseAdapterImpl getDbAdapter()
public long getRecordCountInDatabase()
DatabaseManager
getRecordCountInDatabase
in interface DatabaseManager
public long setMaximumDatabaseSize(long size)
DatabaseManager
setMaximumDatabaseSize
in interface DatabaseManager
size
- the maximum database size
public long getMaximumDatabaseSize()
DatabaseManager
getMaximumDatabaseSize
in interface DatabaseManager
public long doDeleteOldestSamplesInDatabase(long count, boolean lowestPriorityFirst)
DatabaseManager
doDeleteOldestSamplesInDatabase
in interface DatabaseManager
count
- the sample count to delete in databaselowestPriorityFirst
- if true the samples will be selected ordered by priority and time
stamp, otherwise just by time stamp
public <T> T doExecuteCommand(DatabaseCommand<T> command) throws SQLiteFullException
DatabaseManager
doExecuteCommand
in interface DatabaseManager
T
- the result type of the commandcommand
- the command to execute
SQLiteFullException
- if command execution fails due to database is full
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |