JAMES-2186 Introduce mailboxId API for setRights
Project: http://git-wip-us.apache.org/repos/asf/james-project/repo Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/4227ab8e Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/4227ab8e Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/4227ab8e Branch: refs/heads/master Commit: 4227ab8e8669bd4a1b67ba126e7b5ba003d57342 Parents: 154453a Author: Raphael Ouazana <raphael.ouaz...@linagora.com> Authored: Tue Oct 17 17:24:46 2017 +0200 Committer: Matthieu Baechler <matth...@apache.org> Committed: Fri Oct 20 12:34:51 2017 +0200 ---------------------------------------------------------------------- .../java/org/apache/james/mailbox/MailboxManager.java | 2 ++ .../apache/james/mailbox/store/StoreMailboxManager.java | 11 +++++++++++ .../imap/processor/base/MailboxEventAnalyserTest.java | 5 +++++ .../DefaultMailboxesProvisioningFilterThreadTest.java | 5 +++++ 4 files changed, 23 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/james-project/blob/4227ab8e/mailbox/api/src/main/java/org/apache/james/mailbox/MailboxManager.java ---------------------------------------------------------------------- diff --git a/mailbox/api/src/main/java/org/apache/james/mailbox/MailboxManager.java b/mailbox/api/src/main/java/org/apache/james/mailbox/MailboxManager.java index a2f6cf3..287c790 100644 --- a/mailbox/api/src/main/java/org/apache/james/mailbox/MailboxManager.java +++ b/mailbox/api/src/main/java/org/apache/james/mailbox/MailboxManager.java @@ -406,6 +406,8 @@ public interface MailboxManager extends RequestAware, MailboxListenerSupport { */ void setRights(MailboxPath mailboxPath, MailboxACL mailboxACL, MailboxSession session) throws MailboxException; + void setRights(MailboxId mailboxId, MailboxACL mailboxACL, MailboxSession session) throws MailboxException; + /** * Return a unmodifiable {@link List} of {@link MailboxPath} objects * http://git-wip-us.apache.org/repos/asf/james-project/blob/4227ab8e/mailbox/store/src/main/java/org/apache/james/mailbox/store/StoreMailboxManager.java ---------------------------------------------------------------------- diff --git a/mailbox/store/src/main/java/org/apache/james/mailbox/store/StoreMailboxManager.java b/mailbox/store/src/main/java/org/apache/james/mailbox/store/StoreMailboxManager.java index 35fc9b7..691a56e 100644 --- a/mailbox/store/src/main/java/org/apache/james/mailbox/store/StoreMailboxManager.java +++ b/mailbox/store/src/main/java/org/apache/james/mailbox/store/StoreMailboxManager.java @@ -883,6 +883,17 @@ public class StoreMailboxManager implements MailboxManager { public void setRights(MailboxPath mailboxPath, MailboxACL mailboxACL, MailboxSession session) throws MailboxException { MailboxMapper mapper = mailboxSessionMapperFactory.getMailboxMapper(session); Mailbox mailbox = mapper.findMailboxByPath(mailboxPath); + setRights(mailbox, mailboxACL, mapper); + } + + @Override + public void setRights(MailboxId mailboxId, MailboxACL mailboxACL, MailboxSession session) throws MailboxException { + MailboxMapper mapper = mailboxSessionMapperFactory.getMailboxMapper(session); + Mailbox mailbox = mapper.findMailboxById(mailboxId); + setRights(mailbox, mailboxACL, mapper); + } + + public void setRights(Mailbox mailbox, MailboxACL mailboxACL, MailboxMapper mapper) throws MailboxException { mapper.execute(Mapper.toTransaction(() -> mapper.setACL(mailbox, mailboxACL))); } http://git-wip-us.apache.org/repos/asf/james-project/blob/4227ab8e/protocols/imap/src/test/java/org/apache/james/imap/processor/base/MailboxEventAnalyserTest.java ---------------------------------------------------------------------- diff --git a/protocols/imap/src/test/java/org/apache/james/imap/processor/base/MailboxEventAnalyserTest.java b/protocols/imap/src/test/java/org/apache/james/imap/processor/base/MailboxEventAnalyserTest.java index 819244b..091b5e2 100644 --- a/protocols/imap/src/test/java/org/apache/james/imap/processor/base/MailboxEventAnalyserTest.java +++ b/protocols/imap/src/test/java/org/apache/james/imap/processor/base/MailboxEventAnalyserTest.java @@ -392,6 +392,11 @@ public class MailboxEventAnalyserTest { } @Override + public void setRights(MailboxId mailboxId, MailboxACL mailboxACL, MailboxSession session) throws MailboxException { + throw new NotImplementedException("Not implemented"); + } + + @Override public List<MailboxAnnotation> getAllAnnotations(MailboxPath mailboxPath, MailboxSession session) throws MailboxException { return null; http://git-wip-us.apache.org/repos/asf/james-project/blob/4227ab8e/server/protocols/jmap/src/test/java/org/apache/james/jmap/DefaultMailboxesProvisioningFilterThreadTest.java ---------------------------------------------------------------------- diff --git a/server/protocols/jmap/src/test/java/org/apache/james/jmap/DefaultMailboxesProvisioningFilterThreadTest.java b/server/protocols/jmap/src/test/java/org/apache/james/jmap/DefaultMailboxesProvisioningFilterThreadTest.java index 82e3a07..06e9df3 100644 --- a/server/protocols/jmap/src/test/java/org/apache/james/jmap/DefaultMailboxesProvisioningFilterThreadTest.java +++ b/server/protocols/jmap/src/test/java/org/apache/james/jmap/DefaultMailboxesProvisioningFilterThreadTest.java @@ -215,6 +215,11 @@ public class DefaultMailboxesProvisioningFilterThreadTest { } @Override + public void setRights(MailboxId mailboxId, MailboxACL mailboxACL, MailboxSession session) throws MailboxException { + throw new NotImplementedException(); + } + + @Override public void setRights(MailboxPath mailboxPath, MailboxACL mailboxACL, MailboxSession session) throws MailboxException { throw new NotImplementedException(); } --------------------------------------------------------------------- To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org