de.unikassel.android.sdcframework.persistence.facade
Interface DatabaseManager

Package class diagram package DatabaseManager
All Known Subinterfaces:
PersistentStorageManager
All Known Implementing Classes:
DatabaseManagerImpl, PersistentStorageManagerImpl

public interface DatabaseManager

Interface for the central database management component.


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.
<T> T
doExecuteCommand(DatabaseCommand<T> command)
          Does execute a database command
 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
 

Method Detail

doExecuteCommand

<T> T doExecuteCommand(DatabaseCommand<T> command)
                   throws SQLiteFullException
Does execute a database command

Type Parameters:
T - the result type of the command
Parameters:
command - the command to execute
Returns:
true if successful, false if a database full exception occurred
Throws:
SQLiteFullException - if command execution fails due to database is full

getRecordCountInDatabase

long getRecordCountInDatabase()
Getter for the current sample record count stored in database

Returns:
the current sample record count in the database

setMaximumDatabaseSize

long setMaximumDatabaseSize(long size)
Setter for the maximum database size in kilobytes

Parameters:
size - the maximum database size
Returns:
the new maximum database size

getMaximumDatabaseSize

long getMaximumDatabaseSize()
Getter for the maximum database size in kilobytes

Returns:
the new maximum database size

doDeleteOldestSamplesInDatabase

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.
Depending on the flag lowestPriorityFirst the oldest samples will be selected priority independent or not.

Parameters:
count - the sample count to delete in database
lowestPriorityFirst - if true the samples will be selected ordered by priority and time stamp, otherwise just by time stamp
Returns:
the count of samples deleted in database