-
- All Implemented Interfaces:
-
backtraceio.library.interfaces.DatabaseContext
public class BacktraceDatabaseContext implements DatabaseContext
-
-
Constructor Summary
Constructors Constructor Description BacktraceDatabaseContext(Context context, BacktraceDatabaseSettings settings)
Initialize new instance of Backtrace Database Context
-
Method Summary
Modifier and Type Method Description BacktraceDatabaseRecord
add(BacktraceData backtraceData)
Add new record to database BacktraceDatabaseRecord
add(BacktraceDatabaseRecord backtraceDatabaseRecord)
Add existing record to database BacktraceDatabaseRecord
first()
Get first existing database record. BacktraceDatabaseRecord
last()
Get last existing database record. Iterable<BacktraceDatabaseRecord>
get()
Get all database records boolean
delete(BacktraceDatabaseRecord record)
Delete existing record from database boolean
contains(BacktraceDatabaseRecord record)
Check if the record passed as parameter exists boolean
isEmpty()
Check if database is empty int
count()
Get total number of records in database void
clear()
Delete all records from database void
incrementBatchRetry()
Increment retry time for current record long
getDatabaseSize()
Get database size boolean
removeOldestRecord()
Delete the oldest file -
-
Constructor Detail
-
BacktraceDatabaseContext
BacktraceDatabaseContext(Context context, BacktraceDatabaseSettings settings)
Initialize new instance of Backtrace Database Context- Parameters:
settings
- database settings
-
-
Method Detail
-
add
BacktraceDatabaseRecord add(BacktraceData backtraceData)
Add new record to database
- Parameters:
backtraceData
- diagnostic data that should be stored in database
-
add
BacktraceDatabaseRecord add(BacktraceDatabaseRecord backtraceDatabaseRecord)
Add existing record to database
- Parameters:
backtraceDatabaseRecord
- database record
-
first
BacktraceDatabaseRecord first()
Get first existing database record. Method returns record based on order in database
-
last
BacktraceDatabaseRecord last()
Get last existing database record. Method returns record based on order in database
-
get
Iterable<BacktraceDatabaseRecord> get()
Get all database records
-
delete
boolean delete(BacktraceDatabaseRecord record)
Delete existing record from database
- Parameters:
record
- Database record to delete
-
contains
boolean contains(BacktraceDatabaseRecord record)
Check if the record passed as parameter exists
- Parameters:
record
- database record
-
isEmpty
boolean isEmpty()
Check if database is empty
-
count
int count()
Get total number of records in database
-
clear
void clear()
Delete all records from database
-
incrementBatchRetry
void incrementBatchRetry()
Increment retry time for current record
-
getDatabaseSize
long getDatabaseSize()
Get database size
-
removeOldestRecord
boolean removeOldestRecord()
Delete the oldest file
-
-
-
-