james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From matth...@apache.org
Subject [24/27] james-project git commit: MAILBOX-310 Propose a more explicit wording for MailboxMapper::findMailboxes
Date Thu, 05 Oct 2017 18:02:36 GMT
MAILBOX-310 Propose a more explicit wording for MailboxMapper::findMailboxes


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

Branch: refs/heads/master
Commit: b44b9bbee11ba75de24eafddba92a872278bc1e0
Parents: d103058
Author: benwa <btellier@linagora.com>
Authored: Wed Oct 4 16:03:29 2017 +0700
Committer: Matthieu Baechler <matthieu@apache.org>
Committed: Thu Oct 5 20:00:39 2017 +0200

----------------------------------------------------------------------
 .../mailbox/caching/CachingMailboxMapper.java   |  4 ++--
 .../cassandra/mail/CassandraMailboxMapper.java  |  2 +-
 .../mailbox/hbase/mail/HBaseMailboxMapper.java  |  2 +-
 .../mailbox/jcr/mail/JCRMailboxMapper.java      |  2 +-
 .../mailbox/jpa/mail/JPAMailboxMapper.java      |  2 +-
 .../jpa/mail/TransactionalMailboxMapper.java    |  4 ++--
 .../maildir/mail/MaildirMailboxMapper.java      |  2 +-
 .../inmemory/mail/InMemoryMailboxMapper.java    |  2 +-
 .../mailbox/store/StoreMailboxManager.java      |  2 +-
 .../james/mailbox/store/mail/MailboxMapper.java |  2 +-
 .../store/TestMailboxSessionMapperFactory.java  |  2 +-
 .../store/mail/model/MailboxMapperACLTest.java  | 22 ++++++++++----------
 12 files changed, 24 insertions(+), 24 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/b44b9bbe/mailbox/caching/src/main/java/org/apache/james/mailbox/caching/CachingMailboxMapper.java
----------------------------------------------------------------------
diff --git a/mailbox/caching/src/main/java/org/apache/james/mailbox/caching/CachingMailboxMapper.java
b/mailbox/caching/src/main/java/org/apache/james/mailbox/caching/CachingMailboxMapper.java
index fe67704..c368a75 100644
--- a/mailbox/caching/src/main/java/org/apache/james/mailbox/caching/CachingMailboxMapper.java
+++ b/mailbox/caching/src/main/java/org/apache/james/mailbox/caching/CachingMailboxMapper.java
@@ -122,8 +122,8 @@ public class CachingMailboxMapper implements MailboxMapper {
 	}
 
     @Override
-    public List<Mailbox> findMailboxes(String userName, Right right) throws MailboxException
{
-        return underlying.findMailboxes(userName, right);
+    public List<Mailbox> findNonPersonalMailboxes(String userName, Right right) throws
MailboxException {
+        return underlying.findNonPersonalMailboxes(userName, right);
     }
 
 }

http://git-wip-us.apache.org/repos/asf/james-project/blob/b44b9bbe/mailbox/cassandra/src/main/java/org/apache/james/mailbox/cassandra/mail/CassandraMailboxMapper.java
----------------------------------------------------------------------
diff --git a/mailbox/cassandra/src/main/java/org/apache/james/mailbox/cassandra/mail/CassandraMailboxMapper.java
b/mailbox/cassandra/src/main/java/org/apache/james/mailbox/cassandra/mail/CassandraMailboxMapper.java
index 498524b..e8c66fa 100644
--- a/mailbox/cassandra/src/main/java/org/apache/james/mailbox/cassandra/mail/CassandraMailboxMapper.java
+++ b/mailbox/cassandra/src/main/java/org/apache/james/mailbox/cassandra/mail/CassandraMailboxMapper.java
@@ -263,7 +263,7 @@ public class CassandraMailboxMapper implements MailboxMapper {
     }
 
     @Override
-    public List<Mailbox> findMailboxes(String userName, Right right) throws MailboxException
{
+    public List<Mailbox> findNonPersonalMailboxes(String userName, Right right) throws
MailboxException {
         return FluentFutureStream.of(userMailboxRightsDAO.listRightsForUser(userName)
             .thenApply(map -> toAuthorizedMailboxIds(map, right)))
             .thenFlatComposeOnOptional(this::retrieveMailbox)

http://git-wip-us.apache.org/repos/asf/james-project/blob/b44b9bbe/mailbox/hbase/src/main/java/org/apache/james/mailbox/hbase/mail/HBaseMailboxMapper.java
----------------------------------------------------------------------
diff --git a/mailbox/hbase/src/main/java/org/apache/james/mailbox/hbase/mail/HBaseMailboxMapper.java
b/mailbox/hbase/src/main/java/org/apache/james/mailbox/hbase/mail/HBaseMailboxMapper.java
index bbf46b8..ec2e0bc 100644
--- a/mailbox/hbase/src/main/java/org/apache/james/mailbox/hbase/mail/HBaseMailboxMapper.java
+++ b/mailbox/hbase/src/main/java/org/apache/james/mailbox/hbase/mail/HBaseMailboxMapper.java
@@ -427,7 +427,7 @@ public class HBaseMailboxMapper extends HBaseNonTransactionalMapper implements
M
     }
 
     @Override
-    public List<Mailbox> findMailboxes(String userName, Right right) throws MailboxException
{
+    public List<Mailbox> findNonPersonalMailboxes(String userName, Right right) throws
MailboxException {
         return ImmutableList.of();
     }
 }

http://git-wip-us.apache.org/repos/asf/james-project/blob/b44b9bbe/mailbox/jcr/src/main/java/org/apache/james/mailbox/jcr/mail/JCRMailboxMapper.java
----------------------------------------------------------------------
diff --git a/mailbox/jcr/src/main/java/org/apache/james/mailbox/jcr/mail/JCRMailboxMapper.java
b/mailbox/jcr/src/main/java/org/apache/james/mailbox/jcr/mail/JCRMailboxMapper.java
index 8d51e0e..3d0661d 100644
--- a/mailbox/jcr/src/main/java/org/apache/james/mailbox/jcr/mail/JCRMailboxMapper.java
+++ b/mailbox/jcr/src/main/java/org/apache/james/mailbox/jcr/mail/JCRMailboxMapper.java
@@ -264,7 +264,7 @@ public class JCRMailboxMapper extends AbstractJCRScalingMapper implements
Mailbo
     }
 
     @Override
-    public List<Mailbox> findMailboxes(String userName, Right right) throws MailboxException
{
+    public List<Mailbox> findNonPersonalMailboxes(String userName, Right right) throws
MailboxException {
         return ImmutableList.of();
     }
 }

http://git-wip-us.apache.org/repos/asf/james-project/blob/b44b9bbe/mailbox/jpa/src/main/java/org/apache/james/mailbox/jpa/mail/JPAMailboxMapper.java
----------------------------------------------------------------------
diff --git a/mailbox/jpa/src/main/java/org/apache/james/mailbox/jpa/mail/JPAMailboxMapper.java
b/mailbox/jpa/src/main/java/org/apache/james/mailbox/jpa/mail/JPAMailboxMapper.java
index 8cd8761..d928410 100644
--- a/mailbox/jpa/src/main/java/org/apache/james/mailbox/jpa/mail/JPAMailboxMapper.java
+++ b/mailbox/jpa/src/main/java/org/apache/james/mailbox/jpa/mail/JPAMailboxMapper.java
@@ -233,7 +233,7 @@ public class JPAMailboxMapper extends JPATransactionalMapper implements
MailboxM
     }
 
     @Override
-    public List<Mailbox> findMailboxes(String userName, Right right) throws MailboxException
{
+    public List<Mailbox> findNonPersonalMailboxes(String userName, Right right) throws
MailboxException {
         return ImmutableList.of();
     }
 }

http://git-wip-us.apache.org/repos/asf/james-project/blob/b44b9bbe/mailbox/jpa/src/test/java/org/apache/james/mailbox/jpa/mail/TransactionalMailboxMapper.java
----------------------------------------------------------------------
diff --git a/mailbox/jpa/src/test/java/org/apache/james/mailbox/jpa/mail/TransactionalMailboxMapper.java
b/mailbox/jpa/src/test/java/org/apache/james/mailbox/jpa/mail/TransactionalMailboxMapper.java
index f0fdc56..b1f2cca 100644
--- a/mailbox/jpa/src/test/java/org/apache/james/mailbox/jpa/mail/TransactionalMailboxMapper.java
+++ b/mailbox/jpa/src/test/java/org/apache/james/mailbox/jpa/mail/TransactionalMailboxMapper.java
@@ -95,8 +95,8 @@ public class TransactionalMailboxMapper implements MailboxMapper {
     }
 
     @Override
-    public List<Mailbox> findMailboxes(String userName, Right right) throws MailboxException
{
-        return wrapped.findMailboxes(userName, right);
+    public List<Mailbox> findNonPersonalMailboxes(String userName, Right right) throws
MailboxException {
+        return wrapped.findNonPersonalMailboxes(userName, right);
     }
 
 }

http://git-wip-us.apache.org/repos/asf/james-project/blob/b44b9bbe/mailbox/maildir/src/main/java/org/apache/james/mailbox/maildir/mail/MaildirMailboxMapper.java
----------------------------------------------------------------------
diff --git a/mailbox/maildir/src/main/java/org/apache/james/mailbox/maildir/mail/MaildirMailboxMapper.java
b/mailbox/maildir/src/main/java/org/apache/james/mailbox/maildir/mail/MaildirMailboxMapper.java
index c4506e7..7684a1f 100644
--- a/mailbox/maildir/src/main/java/org/apache/james/mailbox/maildir/mail/MaildirMailboxMapper.java
+++ b/mailbox/maildir/src/main/java/org/apache/james/mailbox/maildir/mail/MaildirMailboxMapper.java
@@ -351,7 +351,7 @@ public class MaildirMailboxMapper extends NonTransactionalMapper implements
Mail
     }
 
     @Override
-    public List<Mailbox> findMailboxes(String userName, Right right) throws MailboxException
{
+    public List<Mailbox> findNonPersonalMailboxes(String userName, Right right) throws
MailboxException {
         return ImmutableList.of();
     }
 }

http://git-wip-us.apache.org/repos/asf/james-project/blob/b44b9bbe/mailbox/memory/src/main/java/org/apache/james/mailbox/inmemory/mail/InMemoryMailboxMapper.java
----------------------------------------------------------------------
diff --git a/mailbox/memory/src/main/java/org/apache/james/mailbox/inmemory/mail/InMemoryMailboxMapper.java
b/mailbox/memory/src/main/java/org/apache/james/mailbox/inmemory/mail/InMemoryMailboxMapper.java
index dde0962..5270154 100644
--- a/mailbox/memory/src/main/java/org/apache/james/mailbox/inmemory/mail/InMemoryMailboxMapper.java
+++ b/mailbox/memory/src/main/java/org/apache/james/mailbox/inmemory/mail/InMemoryMailboxMapper.java
@@ -168,7 +168,7 @@ public class InMemoryMailboxMapper implements MailboxMapper {
     }
 
     @Override
-    public List<Mailbox> findMailboxes(String userName, Right right) throws MailboxException
{
+    public List<Mailbox> findNonPersonalMailboxes(String userName, Right right) throws
MailboxException {
         return mailboxesByPath.values()
             .stream()
             .filter(mailbox -> hasRightOn(mailbox, userName, right))

http://git-wip-us.apache.org/repos/asf/james-project/blob/b44b9bbe/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 a125646..5dd1890 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
@@ -713,7 +713,7 @@ public class StoreMailboxManager implements MailboxManager {
         if (mailboxQuery.isPrivateMailboxes(session)) {
             return Stream.of();
         }
-        return mailboxMapper.findMailboxes(session.getUser().getUserName(), Right.Read).stream();
+        return mailboxMapper.findNonPersonalMailboxes(session.getUser().getUserName(), Right.Read).stream();
     }
 
     private boolean isReadable(MailboxSession session, Mailbox mailbox) throws MailboxException
{

http://git-wip-us.apache.org/repos/asf/james-project/blob/b44b9bbe/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/MailboxMapper.java
----------------------------------------------------------------------
diff --git a/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/MailboxMapper.java
b/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/MailboxMapper.java
index efeb42b..0409f88 100644
--- a/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/MailboxMapper.java
+++ b/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/MailboxMapper.java
@@ -82,7 +82,7 @@ public interface MailboxMapper extends Mapper {
      * @return right
      * @throws MailboxException
      */
-    List<Mailbox> findMailboxes(String userName, Right right) throws MailboxException;
+    List<Mailbox> findNonPersonalMailboxes(String userName, Right right) throws MailboxException;
 
     /**
      * Return a List of {@link Mailbox} which name is like the given name

http://git-wip-us.apache.org/repos/asf/james-project/blob/b44b9bbe/mailbox/store/src/test/java/org/apache/james/mailbox/store/TestMailboxSessionMapperFactory.java
----------------------------------------------------------------------
diff --git a/mailbox/store/src/test/java/org/apache/james/mailbox/store/TestMailboxSessionMapperFactory.java
b/mailbox/store/src/test/java/org/apache/james/mailbox/store/TestMailboxSessionMapperFactory.java
index cf47c1d..7a16348 100644
--- a/mailbox/store/src/test/java/org/apache/james/mailbox/store/TestMailboxSessionMapperFactory.java
+++ b/mailbox/store/src/test/java/org/apache/james/mailbox/store/TestMailboxSessionMapperFactory.java
@@ -165,7 +165,7 @@ public class TestMailboxSessionMapperFactory extends MailboxSessionMapperFactory
             }
 
             @Override
-            public List<Mailbox> findMailboxes(String userName, Right right) throws
MailboxException {
+            public List<Mailbox> findNonPersonalMailboxes(String userName, Right right)
throws MailboxException {
                 throw new NotImplementedException();
             }
         };

http://git-wip-us.apache.org/repos/asf/james-project/blob/b44b9bbe/mailbox/store/src/test/java/org/apache/james/mailbox/store/mail/model/MailboxMapperACLTest.java
----------------------------------------------------------------------
diff --git a/mailbox/store/src/test/java/org/apache/james/mailbox/store/mail/model/MailboxMapperACLTest.java
b/mailbox/store/src/test/java/org/apache/james/mailbox/store/mail/model/MailboxMapperACLTest.java
index 836db5d..9d759fc 100644
--- a/mailbox/store/src/test/java/org/apache/james/mailbox/store/mail/model/MailboxMapperACLTest.java
+++ b/mailbox/store/src/test/java/org/apache/james/mailbox/store/mail/model/MailboxMapperACLTest.java
@@ -244,7 +244,7 @@ public abstract class MailboxMapperACLTest {
 
     @Test
     public void findMailboxesShouldReturnEmptyWhenNone() throws MailboxException {
-        assertThat(mailboxMapper.findMailboxes("user", Right.Administer)).isEmpty();
+        assertThat(mailboxMapper.findNonPersonalMailboxes("user", Right.Administer)).isEmpty();
     }
 
     @Test
@@ -257,7 +257,7 @@ public abstract class MailboxMapperACLTest {
                 .rights(rights)
                 .asReplacement());
 
-        assertThat(mailboxMapper.findMailboxes("user", Right.Read)).isEmpty();
+        assertThat(mailboxMapper.findNonPersonalMailboxes("user", Right.Read)).isEmpty();
     }
 
     @Test
@@ -269,7 +269,7 @@ public abstract class MailboxMapperACLTest {
                 .rights(rights)
                 .asAddition());
 
-        assertThat(mailboxMapper.findMailboxes("user", Right.Administer))
+        assertThat(mailboxMapper.findNonPersonalMailboxes("user", Right.Administer))
             .containsOnly(benwaInboxMailbox);
     }
 
@@ -289,7 +289,7 @@ public abstract class MailboxMapperACLTest {
                 .rights(newRights)
                 .asReplacement());
 
-        assertThat(mailboxMapper.findMailboxes("user", Right.Read))
+        assertThat(mailboxMapper.findNonPersonalMailboxes("user", Right.Read))
             .containsOnly(benwaInboxMailbox);
     }
 
@@ -310,7 +310,7 @@ public abstract class MailboxMapperACLTest {
                 .rights(new Rfc4314Rights())
                 .build());
 
-        assertThat(mailboxMapper.findMailboxes("user", Right.Administer))
+        assertThat(mailboxMapper.findNonPersonalMailboxes("user", Right.Administer))
             .isEmpty();
     }
 
@@ -329,7 +329,7 @@ public abstract class MailboxMapperACLTest {
                 .rights(initialRights)
                 .asRemoval());
 
-        assertThat(mailboxMapper.findMailboxes("user", Right.Administer))
+        assertThat(mailboxMapper.findNonPersonalMailboxes("user", Right.Administer))
             .isEmpty();
     }
 
@@ -344,7 +344,7 @@ public abstract class MailboxMapperACLTest {
                 .asReplacement());
         mailboxMapper.delete(benwaInboxMailbox);
 
-        assertThat(mailboxMapper.findMailboxes("user", Right.Administer))
+        assertThat(mailboxMapper.findNonPersonalMailboxes("user", Right.Administer))
             .isEmpty();
     }
 
@@ -357,9 +357,9 @@ public abstract class MailboxMapperACLTest {
             new MailboxACL.Entry(user1, new Rfc4314Rights(Right.Administer)),
             new MailboxACL.Entry(user2, new Rfc4314Rights(Right.Read))));
 
-        assertThat(mailboxMapper.findMailboxes("user1", Right.Administer))
+        assertThat(mailboxMapper.findNonPersonalMailboxes("user1", Right.Administer))
             .containsOnly(benwaInboxMailbox);
-        assertThat(mailboxMapper.findMailboxes("user2", Right.Read))
+        assertThat(mailboxMapper.findNonPersonalMailboxes("user2", Right.Read))
             .containsOnly(benwaInboxMailbox);
     }
 
@@ -375,7 +375,7 @@ public abstract class MailboxMapperACLTest {
         mailboxMapper.setACL(benwaInboxMailbox, new MailboxACL(
             new MailboxACL.Entry(user2, new Rfc4314Rights(Right.Read))));
 
-        assertThat(mailboxMapper.findMailboxes("user1", Right.Administer))
+        assertThat(mailboxMapper.findNonPersonalMailboxes("user1", Right.Administer))
             .isEmpty();
     }
 
@@ -391,7 +391,7 @@ public abstract class MailboxMapperACLTest {
         mailboxMapper.setACL(benwaInboxMailbox, new MailboxACL(
             new MailboxACL.Entry(user2, new Rfc4314Rights(Right.Write))));
 
-        assertThat(mailboxMapper.findMailboxes("user2", Right.Write))
+        assertThat(mailboxMapper.findNonPersonalMailboxes("user2", Right.Write))
             .containsOnly(benwaInboxMailbox);
     }
 


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


Mime
View raw message