You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by bt...@apache.org on 2016/09/29 10:51:58 UTC

[08/12] james-project git commit: JAMES-1781 Memory implementation of partial updates

JAMES-1781 Memory implementation of partial updates


Project: http://git-wip-us.apache.org/repos/asf/james-project/repo
Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/55116a72
Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/55116a72
Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/55116a72

Branch: refs/heads/master
Commit: 55116a7277d59b814af5124d019c750dcba738ac
Parents: ca8c20d
Author: Benoit Tellier <bt...@linagora.com>
Authored: Mon Jun 27 18:20:33 2016 +0700
Committer: Benoit Tellier <bt...@linagora.com>
Committed: Thu Sep 29 12:48:14 2016 +0200

----------------------------------------------------------------------
 .../jmap/memory/vacation/MemoryVacationRepository.java   | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/55116a72/server/data/data-jmap/src/main/java/org/apache/james/jmap/memory/vacation/MemoryVacationRepository.java
----------------------------------------------------------------------
diff --git a/server/data/data-jmap/src/main/java/org/apache/james/jmap/memory/vacation/MemoryVacationRepository.java b/server/data/data-jmap/src/main/java/org/apache/james/jmap/memory/vacation/MemoryVacationRepository.java
index 3e5337b..73cb212 100644
--- a/server/data/data-jmap/src/main/java/org/apache/james/jmap/memory/vacation/MemoryVacationRepository.java
+++ b/server/data/data-jmap/src/main/java/org/apache/james/jmap/memory/vacation/MemoryVacationRepository.java
@@ -21,11 +21,13 @@ package org.apache.james.jmap.memory.vacation;
 
 import java.util.HashMap;
 import java.util.Map;
+import java.util.Optional;
 import java.util.concurrent.CompletableFuture;
 
 import org.apache.james.jmap.api.vacation.AccountId;
 import org.apache.james.jmap.api.vacation.Vacation;
 import org.apache.james.jmap.api.vacation.VacationRepository;
+import org.apache.james.jmap.api.vacation.VacationPatch;
 
 import com.google.common.base.Preconditions;
 
@@ -44,10 +46,13 @@ public class MemoryVacationRepository implements VacationRepository {
     }
 
     @Override
-    public CompletableFuture<Void> modifyVacation(AccountId accountId, Vacation vacation) {
+    public CompletableFuture<Void> modifyVacation(AccountId accountId, VacationPatch vacationPatch) {
         Preconditions.checkNotNull(accountId);
-        Preconditions.checkNotNull(vacation);
-        vacationMap.put(accountId, vacation);
+        Preconditions.checkNotNull(vacationPatch);
+        Vacation oldVacation = retrieveVacation(accountId).join();
+        vacationMap.put(accountId, vacationPatch.patch(oldVacation));
         return CompletableFuture.completedFuture(null);
     }
+
+
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org