Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/stefan-niedermann/nextcloud-deck.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordesperateCoder <echotodevnull@gmail.com>2019-03-23 17:13:27 +0300
committerdesperateCoder <echotodevnull@gmail.com>2019-03-23 17:13:27 +0300
commit79cfd21e5f789c0b5634fabbe6e83317bf90b7ed (patch)
tree9fe24e36283b0648291368648a2c18bc0e08203e /app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/ServerAdapter.java
parent4595babf7383ce0e932e3ec05f9ef56a90abc48e (diff)
implemented methods for future use
Diffstat (limited to 'app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/ServerAdapter.java')
-rw-r--r--app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/ServerAdapter.java43
1 files changed, 32 insertions, 11 deletions
diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/ServerAdapter.java b/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/ServerAdapter.java
index 5cbfdcbec..595cf6589 100644
--- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/ServerAdapter.java
+++ b/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/ServerAdapter.java
@@ -24,6 +24,7 @@ import it.niedermann.nextcloud.deck.api.RequestHelper;
import it.niedermann.nextcloud.deck.exceptions.OfflineException;
import it.niedermann.nextcloud.deck.model.Board;
import it.niedermann.nextcloud.deck.model.Card;
+import it.niedermann.nextcloud.deck.model.Label;
import it.niedermann.nextcloud.deck.model.Stack;
import it.niedermann.nextcloud.deck.model.full.FullBoard;
import it.niedermann.nextcloud.deck.model.full.FullCard;
@@ -106,17 +107,19 @@ public class ServerAdapter {
RequestHelper.request(sourceActivity, provider, () -> provider.getAPI().createBoard(board), responseCallback);
}
- public void deleteBoard(Board board) {
+ public void deleteBoard(Board board, IResponseCallback<Void> responseCallback) {
ensureInternetConnection();
-
+ RequestHelper.request(sourceActivity, provider, () -> provider.getAPI().deleteBoard(board.getId()), responseCallback);
}
- public void updateBoard(Board board) {
+ public void updateBoard(Board board, IResponseCallback<FullBoard> responseCallback) {
ensureInternetConnection();
+ RequestHelper.request(sourceActivity, provider, () -> provider.getAPI().updateBoard(board.getId(), board), responseCallback);
}
public void getStacks(long boardId, IResponseCallback<List<FullStack>> responseCallback) {
+ ensureInternetConnection();
RequestHelper.request(sourceActivity, provider, () -> provider.getAPI().getStacks(boardId, getLastSyncDateFormatted()), responseCallback);
}
@@ -129,33 +132,36 @@ public class ServerAdapter {
RequestHelper.request(sourceActivity, provider, () -> provider.getAPI().createStack(stack.getBoardId(), stack), responseCallback);
}
- public void deleteStack(Stack stack) {
+ public void deleteStack(Stack stack, IResponseCallback<Void> responseCallback) {
ensureInternetConnection();
+ RequestHelper.request(sourceActivity, provider, () -> provider.getAPI().deleteStack(stack.getBoardId(), stack.getId()), responseCallback);
}
- public void updateStack(Stack stack) {
+ public void updateStack(Stack stack, IResponseCallback<FullStack> responseCallback) {
ensureInternetConnection();
+ RequestHelper.request(sourceActivity, provider, () -> provider.getAPI().updateStack(stack.getBoardId(), stack.getId(), stack), responseCallback);
}
public void getCard(long boardId, long stackId, long cardId, IResponseCallback<FullCard> responseCallback) {
+ ensureInternetConnection();
RequestHelper.request(sourceActivity, provider, () -> provider.getAPI().getCard(boardId, stackId, cardId, getLastSyncDateFormatted()), responseCallback);
}
- public void createCard(Card card) {
+ public void createCard(long boardId, long stackId, Card card, IResponseCallback<FullCard> responseCallback) {
ensureInternetConnection();
-
+ RequestHelper.request(sourceActivity, provider, () -> provider.getAPI().createCard(boardId, stackId, card), responseCallback);
}
- public void deleteCard(Card card) {
+ public void deleteCard(long boardId, long stackId, Card card, IResponseCallback<Void> responseCallback) {
ensureInternetConnection();
-
+ RequestHelper.request(sourceActivity, provider, () -> provider.getAPI().deleteCard(boardId, stackId, card.getId()), responseCallback);
}
- public void updateCard(Card card) {
+ public void updateCard(long boardId, long stackId, Card card, IResponseCallback<FullCard> responseCallback) {
ensureInternetConnection();
-
+ RequestHelper.request(sourceActivity, provider, () -> provider.getAPI().updateCard(boardId, stackId, card.getId(), card), responseCallback);
}
public void assignUserToCard(long boardId, long stackId, long cardId, String userUID, IResponseCallback<Void> responseCallback){
@@ -177,4 +183,19 @@ public class ServerAdapter {
ensureInternetConnection();
RequestHelper.request(sourceActivity, provider, () -> provider.getAPI().unassignLabelFromCard(boardId, stackId, cardId, labelId), responseCallback);
}
+
+
+ // ## LABELS
+ public void createLabel(long boardId, Label label, IResponseCallback<Label> responseCallback){
+ ensureInternetConnection();
+ RequestHelper.request(sourceActivity, provider, () -> provider.getAPI().createLabel(boardId, label), responseCallback);
+ }
+ public void deleteLabel(long boardId, Label label, IResponseCallback<Void> responseCallback){
+ ensureInternetConnection();
+ RequestHelper.request(sourceActivity, provider, () -> provider.getAPI().deleteLabel(boardId, label.getId()), responseCallback);
+ }
+ public void updateLabel(long boardId, Label label, IResponseCallback<Label> responseCallback){
+ ensureInternetConnection();
+ RequestHelper.request(sourceActivity, provider, () -> provider.getAPI().updateLabel(boardId, label.getId(), label), responseCallback);
+ }
}