-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathDatabase.java
More file actions
143 lines (124 loc) · 3.91 KB
/
Database.java
File metadata and controls
143 lines (124 loc) · 3.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
package backtraceio.library.interfaces;
import backtraceio.library.BacktraceCredentials;
import backtraceio.library.base.BacktraceBase;
import backtraceio.library.enums.UnwindingMode;
import backtraceio.library.models.database.BacktraceDatabaseRecord;
import backtraceio.library.models.database.BacktraceDatabaseSettings;
import backtraceio.library.models.json.BacktraceReport;
import java.util.Map;
public interface Database {
/**
* Start all database tasks - data storage, timers, file loading
*/
void start();
/**
* Send all reports stored in BacktraceDatabase and clean database
*/
void flush();
/**
* @param backtraceApi
*/
void setApi(Api backtraceApi);
/**
* Remove all existing reports in BacktraceDatabase
*/
void clear();
/**
* Check all database consistency requirements
*
* @return is database has valid consistency requirements
*/
boolean validConsistency();
/**
* Add new report to Database
*
* @param backtraceReport
* @param attributes
* @return
*/
BacktraceDatabaseRecord add(BacktraceReport backtraceReport, Map<String, Object> attributes);
/**
* Add new report to Database
*
* @param backtraceReport
* @param attributes
* @param isProguardEnabled
* @return
*/
BacktraceDatabaseRecord add(
BacktraceReport backtraceReport, Map<String, Object> attributes, boolean isProguardEnabled);
/**
* @return
*/
Iterable<BacktraceDatabaseRecord> get();
/**
* @param record
*/
void delete(BacktraceDatabaseRecord record);
/**
* Get database settings
*
* @return
*/
BacktraceDatabaseSettings getSettings();
/**
* Get database size
*
* @return
*/
long getDatabaseSize();
/**
* Setup database NDK integration
*
* @param client Backtrace client
* @param credentials Backtrace credentials
*/
Boolean setupNativeIntegration(BacktraceBase client, BacktraceCredentials credentials);
/**
* Setup native crash handler
*
* @param client Backtrace client
* @param credentials Backtrace credentials
* @param enableClientSideUnwinding Enable client side unwinding
*/
Boolean setupNativeIntegration(
BacktraceBase client, BacktraceCredentials credentials, boolean enableClientSideUnwinding);
/**
* Setup native crash handler
*
* @param client Backtrace client
* @param credentials Backtrace credentials
* @param enableClientSideUnwinding Enable client side unwinding
* @param unwindingMode Unwinding mode to use for client side unwinding
*/
Boolean setupNativeIntegration(
BacktraceBase client,
BacktraceCredentials credentials,
boolean enableClientSideUnwinding,
UnwindingMode unwindingMode);
/**
* Disable native crash handler
*/
void disableNativeIntegration();
/**
* Get the breadcrumbs implementation
*
* @return the breadcrumbs implementation for this Database, if any
*/
Breadcrumbs getBreadcrumbs();
/**
* If the native integration is enabled and a value is a primitive type,
* adds a new attribute to the native integration.
* @param key attribute key
* @param value attribute value
* @return true, if attribute was added to the native report. Otherwise false.
*/
Boolean addNativeAttribute(String key, Object value);
/**
* If the native integration is enabled then adds a file attachment to be included
* with native crash reports.
* @param attachmentPath the file path to attach to native reports.
* @return whether the attachment was added to the native report or not.
*/
Boolean addNativeAttachment(String attachmentPath);
}