| author | Da Risk <da_risk@geekorum.com> |
| Sat, 11 May 2019 19:53:20 -0700 | |
| changeset 149 | 1e4bb9b9b86c |
| parent 137 | 5464f07a306c |
| child 150 | c6077ce0d399 |
| permissions | -rw-r--r-- |
|
137
5464f07a306c
Update copyright headers for 2019
Da Risk <da_risk@geekorum.com>
parents:
0
diff
changeset
|
1 |
/* |
| 0 | 2 |
* Geekttrss is a RSS feed reader application on the Android Platform. |
3 |
* |
|
|
137
5464f07a306c
Update copyright headers for 2019
Da Risk <da_risk@geekorum.com>
parents:
0
diff
changeset
|
4 |
* Copyright (C) 2017-2019 by Frederic-Charles Barthelery. |
| 0 | 5 |
* |
6 |
* This file is part of Geekttrss. |
|
7 |
* |
|
8 |
* Geekttrss is free software: you can redistribute it and/or modify |
|
9 |
* it under the terms of the GNU General Public License as published by |
|
10 |
* the Free Software Foundation, either version 3 of the License, or |
|
11 |
* (at your option) any later version. |
|
12 |
* |
|
13 |
* Geekttrss is distributed in the hope that it will be useful, |
|
14 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
15 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
16 |
* GNU General Public License for more details. |
|
17 |
* |
|
18 |
* You should have received a copy of the GNU General Public License |
|
19 |
* along with Geekttrss. If not, see <http://www.gnu.org/licenses/>. |
|
20 |
*/ |
|
21 |
package com.geekorum.ttrss.sync |
|
22 |
||
23 |
import com.geekorum.ttrss.data.Article |
|
24 |
import com.geekorum.ttrss.data.Category |
|
25 |
import com.geekorum.ttrss.data.Feed |
|
26 |
import com.geekorum.ttrss.data.Transaction |
|
27 |
||
28 |
/** |
|
29 |
* Database access interface for the synchronization process. |
|
30 |
*/ |
|
31 |
interface DatabaseService {
|
|
32 |
fun beginTransaction() |
|
33 |
fun endTransaction() |
|
34 |
fun setTransactionSuccessful() |
|
|
149
1e4bb9b9b86c
Synchronization: convert DAO to kotlin and use suspendable functions
Da Risk <da_risk@geekorum.com>
parents:
137
diff
changeset
|
35 |
suspend fun <R> runInTransaction(block: suspend () -> R) |
| 0 | 36 |
|
|
149
1e4bb9b9b86c
Synchronization: convert DAO to kotlin and use suspendable functions
Da Risk <da_risk@geekorum.com>
parents:
137
diff
changeset
|
37 |
suspend fun insertFeeds(feeds: List<Feed>) |
|
1e4bb9b9b86c
Synchronization: convert DAO to kotlin and use suspendable functions
Da Risk <da_risk@geekorum.com>
parents:
137
diff
changeset
|
38 |
suspend fun deleteFeedsAndArticles(feeds: List<Feed>) |
|
1e4bb9b9b86c
Synchronization: convert DAO to kotlin and use suspendable functions
Da Risk <da_risk@geekorum.com>
parents:
137
diff
changeset
|
39 |
suspend fun getFeeds(): List<Feed> |
| 0 | 40 |
|
|
149
1e4bb9b9b86c
Synchronization: convert DAO to kotlin and use suspendable functions
Da Risk <da_risk@geekorum.com>
parents:
137
diff
changeset
|
41 |
suspend fun insertCategories(categories: List<Category>) |
|
1e4bb9b9b86c
Synchronization: convert DAO to kotlin and use suspendable functions
Da Risk <da_risk@geekorum.com>
parents:
137
diff
changeset
|
42 |
suspend fun deleteCategories(categories: List<Category>) |
|
1e4bb9b9b86c
Synchronization: convert DAO to kotlin and use suspendable functions
Da Risk <da_risk@geekorum.com>
parents:
137
diff
changeset
|
43 |
suspend fun getCategories(): List<Category> |
| 0 | 44 |
|
|
149
1e4bb9b9b86c
Synchronization: convert DAO to kotlin and use suspendable functions
Da Risk <da_risk@geekorum.com>
parents:
137
diff
changeset
|
45 |
suspend fun getTransactions(): List<Transaction> |
|
1e4bb9b9b86c
Synchronization: convert DAO to kotlin and use suspendable functions
Da Risk <da_risk@geekorum.com>
parents:
137
diff
changeset
|
46 |
suspend fun deleteTransaction(transaction: Transaction) |
| 0 | 47 |
|
|
149
1e4bb9b9b86c
Synchronization: convert DAO to kotlin and use suspendable functions
Da Risk <da_risk@geekorum.com>
parents:
137
diff
changeset
|
48 |
suspend fun getArticle(id: Long): Article? |
|
1e4bb9b9b86c
Synchronization: convert DAO to kotlin and use suspendable functions
Da Risk <da_risk@geekorum.com>
parents:
137
diff
changeset
|
49 |
suspend fun insertArticles(articles: List<Article>) |
|
1e4bb9b9b86c
Synchronization: convert DAO to kotlin and use suspendable functions
Da Risk <da_risk@geekorum.com>
parents:
137
diff
changeset
|
50 |
suspend fun updateArticle(article: Article) |
|
1e4bb9b9b86c
Synchronization: convert DAO to kotlin and use suspendable functions
Da Risk <da_risk@geekorum.com>
parents:
137
diff
changeset
|
51 |
suspend fun getLatestArticleId(): Long? |
| 0 | 52 |
|
|
149
1e4bb9b9b86c
Synchronization: convert DAO to kotlin and use suspendable functions
Da Risk <da_risk@geekorum.com>
parents:
137
diff
changeset
|
53 |
suspend fun updateArticleMetadata( |
| 0 | 54 |
id: Long, unread: Boolean, transientUnread: Boolean, starred: Boolean, |
55 |
published: Boolean, lastTimeUpdated: Long, isUpdated: Boolean) |
|
|
137
5464f07a306c
Update copyright headers for 2019
Da Risk <da_risk@geekorum.com>
parents:
0
diff
changeset
|
56 |
} |