james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From adup...@apache.org
Subject [02/11] james-project git commit: MAILBOX-316 Inject dispatch listener on StoreRightManager
Date Wed, 15 Nov 2017 08:02:00 GMT
MAILBOX-316 Inject dispatch listener on StoreRightManager


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

Branch: refs/heads/master
Commit: 8bd1d0989b8f42f0227642ea54cb98f1be1bdabc
Parents: c0db96a
Author: quynhn <qnguyen@linagora.com>
Authored: Thu Nov 2 17:44:52 2017 +0700
Committer: quynhn <qnguyen@linagora.com>
Committed: Wed Nov 15 09:22:18 2017 +0700

----------------------------------------------------------------------
 .../cassandra/CassandraMailboxManagerProvider.java    |  6 +++---
 .../mailbox/cassandra/CassandraTestSystemFixture.java |  2 +-
 .../mail/CassandraMailboxManagerAttachmentTest.java   |  2 +-
 .../mailbox/hbase/HBaseMailboxManagerStressTest.java  |  6 +++---
 .../james/mailbox/hbase/HBaseMailboxManagerTest.java  |  6 +++---
 .../james/mailbox/jcr/JCRMailboxManagerProvider.java  |  4 ++--
 .../james/mailbox/jpa/JpaMailboxManagerProvider.java  |  2 +-
 .../maildir/MaildirMailboxManagerProvider.java        |  6 +++---
 .../mail/InMemoryMailboxManagerAttachmentTest.java    |  6 +++---
 .../manager/InMemoryIntegrationResources.java         | 13 +++++++------
 .../main/resources/META-INF/spring/spring-mailbox.xml |  1 +
 .../apache/james/mailbox/store/StoreRightManager.java |  6 +++++-
 .../james/mailbox/store/StoreMailboxManagerTest.java  |  5 ++++-
 .../james/mailbox/store/StoreRightManagerTest.java    | 14 +++++++++++---
 .../cassandra/host/CassandraHostSystem.java           |  2 +-
 .../mpt/imapmailbox/hbase/host/HBaseHostSystem.java   |  2 +-
 .../james/mpt/imapmailbox/jcr/host/JCRHostSystem.java |  2 +-
 .../james/mpt/imapmailbox/jpa/host/JPAHostSystem.java |  2 +-
 .../lucenesearch/host/LuceneSearchHostSystem.java     |  4 ++--
 .../imapmailbox/maildir/host/MaildirHostSystem.java   |  2 +-
 20 files changed, 55 insertions(+), 38 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/8bd1d098/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/CassandraMailboxManagerProvider.java
----------------------------------------------------------------------
diff --git a/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/CassandraMailboxManagerProvider.java
b/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/CassandraMailboxManagerProvider.java
index 3fca347..056c899 100644
--- a/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/CassandraMailboxManagerProvider.java
+++ b/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/CassandraMailboxManagerProvider.java
@@ -53,12 +53,12 @@ public class CassandraMailboxManagerProvider {
         MailboxACLResolver aclResolver = new UnionMailboxACLResolver();
         GroupMembershipResolver groupMembershipResolver = new SimpleGroupMembershipResolver();
         MessageParser messageParser = new MessageParser();
-        StoreRightManager storeRightManager = new StoreRightManager(mapperFactory, aclResolver,
groupMembershipResolver);
+        DefaultDelegatingMailboxListener delegatingMailboxListener = new DefaultDelegatingMailboxListener();
+        MailboxEventDispatcher mailboxEventDispatcher = new MailboxEventDispatcher(delegatingMailboxListener);
+        StoreRightManager storeRightManager = new StoreRightManager(mapperFactory, aclResolver,
groupMembershipResolver, mailboxEventDispatcher);
 
         Authenticator noAuthenticator = null;
         Authorizator noAuthorizator = null;
-        DefaultDelegatingMailboxListener delegatingMailboxListener = new DefaultDelegatingMailboxListener();
-        MailboxEventDispatcher mailboxEventDispatcher = new MailboxEventDispatcher(delegatingMailboxListener);
         StoreMailboxAnnotationManager annotationManager = new StoreMailboxAnnotationManager(mapperFactory,
storeRightManager,
             LIMIT_ANNOTATIONS, LIMIT_ANNOTATION_SIZE);
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/8bd1d098/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/CassandraTestSystemFixture.java
----------------------------------------------------------------------
diff --git a/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/CassandraTestSystemFixture.java
b/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/CassandraTestSystemFixture.java
index 8a4d46e..a736f30 100644
--- a/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/CassandraTestSystemFixture.java
+++ b/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/CassandraTestSystemFixture.java
@@ -58,7 +58,7 @@ public class CassandraTestSystemFixture {
     public static CassandraMailboxManager createMailboxManager(CassandraMailboxSessionMapperFactory
mapperFactory) throws Exception{
         DefaultDelegatingMailboxListener delegatingMailboxListener = new DefaultDelegatingMailboxListener();
         MailboxEventDispatcher mailboxEventDispatcher = new MailboxEventDispatcher(delegatingMailboxListener);
-        StoreRightManager storeRightManager = new StoreRightManager(mapperFactory, new UnionMailboxACLResolver(),
new SimpleGroupMembershipResolver());
+        StoreRightManager storeRightManager = new StoreRightManager(mapperFactory, new UnionMailboxACLResolver(),
new SimpleGroupMembershipResolver(), mailboxEventDispatcher);
         StoreMailboxAnnotationManager annotationManager = new StoreMailboxAnnotationManager(mapperFactory,
storeRightManager);
 
         CassandraMailboxManager cassandraMailboxManager = new CassandraMailboxManager(mapperFactory,
mock(Authenticator.class), mock(Authorizator.class),

http://git-wip-us.apache.org/repos/asf/james-project/blob/8bd1d098/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraMailboxManagerAttachmentTest.java
----------------------------------------------------------------------
diff --git a/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraMailboxManagerAttachmentTest.java
b/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraMailboxManagerAttachmentTest.java
index e5d416a..40f7cd2 100644
--- a/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraMailboxManagerAttachmentTest.java
+++ b/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraMailboxManagerAttachmentTest.java
@@ -107,7 +107,7 @@ public class CassandraMailboxManagerAttachmentTest extends AbstractMailboxManage
         Authorizator noAuthorizator = null;
         DefaultDelegatingMailboxListener delegatingMailboxListener = new DefaultDelegatingMailboxListener();
         MailboxEventDispatcher mailboxEventDispatcher = new MailboxEventDispatcher(delegatingMailboxListener);
-        StoreRightManager storeRightManager = new StoreRightManager(mailboxSessionMapperFactory,
new UnionMailboxACLResolver(), new SimpleGroupMembershipResolver());
+        StoreRightManager storeRightManager = new StoreRightManager(mailboxSessionMapperFactory,
new UnionMailboxACLResolver(), new SimpleGroupMembershipResolver(), mailboxEventDispatcher);
         StoreMailboxAnnotationManager annotationManager = new StoreMailboxAnnotationManager(mailboxSessionMapperFactory,
storeRightManager);
 
         mailboxManager = new CassandraMailboxManager(mailboxSessionMapperFactory,

http://git-wip-us.apache.org/repos/asf/james-project/blob/8bd1d098/mailbox/hbase/src/test/java/org/apache/james/mailbox/hbase/HBaseMailboxManagerStressTest.java
----------------------------------------------------------------------
diff --git a/mailbox/hbase/src/test/java/org/apache/james/mailbox/hbase/HBaseMailboxManagerStressTest.java
b/mailbox/hbase/src/test/java/org/apache/james/mailbox/hbase/HBaseMailboxManagerStressTest.java
index 688894d..6ee0777 100644
--- a/mailbox/hbase/src/test/java/org/apache/james/mailbox/hbase/HBaseMailboxManagerStressTest.java
+++ b/mailbox/hbase/src/test/java/org/apache/james/mailbox/hbase/HBaseMailboxManagerStressTest.java
@@ -66,12 +66,12 @@ public class HBaseMailboxManagerStressTest extends MailboxManagerStressTest
{
         MessageId.Factory messageIdFactory = new DefaultMessageId.Factory();
         HBaseMailboxSessionMapperFactory mapperFactory = new HBaseMailboxSessionMapperFactory(CLUSTER.getConf(),
             uidProvider, modSeqProvider, messageIdFactory);
-        StoreRightManager storeRightManager = new StoreRightManager(mapperFactory, new UnionMailboxACLResolver(),
new SimpleGroupMembershipResolver());
+        DefaultDelegatingMailboxListener delegatingListener = new DefaultDelegatingMailboxListener();
+        MailboxEventDispatcher mailboxEventDispatcher = new MailboxEventDispatcher(delegatingListener);
+        StoreRightManager storeRightManager = new StoreRightManager(mapperFactory, new UnionMailboxACLResolver(),
new SimpleGroupMembershipResolver(), mailboxEventDispatcher);
 
         Authenticator noAuthenticator = null;
         Authorizator noAuthorizator = null;
-        DefaultDelegatingMailboxListener delegatingListener = new DefaultDelegatingMailboxListener();
-        MailboxEventDispatcher mailboxEventDispatcher = new MailboxEventDispatcher(delegatingListener);
         StoreMailboxAnnotationManager annotationManager = new StoreMailboxAnnotationManager(mapperFactory,
storeRightManager);
         HBaseMailboxManager manager = new HBaseMailboxManager(mapperFactory,
             noAuthenticator,

http://git-wip-us.apache.org/repos/asf/james-project/blob/8bd1d098/mailbox/hbase/src/test/java/org/apache/james/mailbox/hbase/HBaseMailboxManagerTest.java
----------------------------------------------------------------------
diff --git a/mailbox/hbase/src/test/java/org/apache/james/mailbox/hbase/HBaseMailboxManagerTest.java
b/mailbox/hbase/src/test/java/org/apache/james/mailbox/hbase/HBaseMailboxManagerTest.java
index 5794093..748e50e 100644
--- a/mailbox/hbase/src/test/java/org/apache/james/mailbox/hbase/HBaseMailboxManagerTest.java
+++ b/mailbox/hbase/src/test/java/org/apache/james/mailbox/hbase/HBaseMailboxManagerTest.java
@@ -66,12 +66,12 @@ public class HBaseMailboxManagerTest extends MailboxManagerTest {
         MessageId.Factory messageIdFactory = new DefaultMessageId.Factory();
         HBaseMailboxSessionMapperFactory mapperFactory = new HBaseMailboxSessionMapperFactory(CLUSTER.getConf(),
             uidProvider, modSeqProvider, messageIdFactory);
-        StoreRightManager storeRightManager = new StoreRightManager(mapperFactory, new UnionMailboxACLResolver(),
new SimpleGroupMembershipResolver());
+        DefaultDelegatingMailboxListener delegatingListener = new DefaultDelegatingMailboxListener();
+        MailboxEventDispatcher mailboxEventDispatcher = new MailboxEventDispatcher(delegatingListener);
+        StoreRightManager storeRightManager = new StoreRightManager(mapperFactory, new UnionMailboxACLResolver(),
new SimpleGroupMembershipResolver(), mailboxEventDispatcher);
 
         Authenticator noAuthenticator = null;
         Authorizator noAuthorizator = null;
-        DefaultDelegatingMailboxListener delegatingListener = new DefaultDelegatingMailboxListener();
-        MailboxEventDispatcher mailboxEventDispatcher = new MailboxEventDispatcher(delegatingListener);
         StoreMailboxAnnotationManager annotationManager = new StoreMailboxAnnotationManager(mapperFactory,
storeRightManager);
         HBaseMailboxManager manager = new HBaseMailboxManager(mapperFactory,
             noAuthenticator,

http://git-wip-us.apache.org/repos/asf/james-project/blob/8bd1d098/mailbox/jcr/src/test/java/org/apache/james/mailbox/jcr/JCRMailboxManagerProvider.java
----------------------------------------------------------------------
diff --git a/mailbox/jcr/src/test/java/org/apache/james/mailbox/jcr/JCRMailboxManagerProvider.java
b/mailbox/jcr/src/test/java/org/apache/james/mailbox/jcr/JCRMailboxManagerProvider.java
index 40bc489..ed49335 100644
--- a/mailbox/jcr/src/test/java/org/apache/james/mailbox/jcr/JCRMailboxManagerProvider.java
+++ b/mailbox/jcr/src/test/java/org/apache/james/mailbox/jcr/JCRMailboxManagerProvider.java
@@ -68,10 +68,10 @@ public class JCRMailboxManagerProvider {
 
         Authenticator noAuthenticator = null;
         Authorizator noAuthorizator = null;
-        StoreRightManager storeRightManager = new StoreRightManager(mf, aclResolver, groupMembershipResolver);
-        StoreMailboxAnnotationManager annotationManager = new StoreMailboxAnnotationManager(mf,
storeRightManager);
         DefaultDelegatingMailboxListener delegatingListener = new DefaultDelegatingMailboxListener();
         MailboxEventDispatcher mailboxEventDispatcher = new MailboxEventDispatcher(delegatingListener);
+        StoreRightManager storeRightManager = new StoreRightManager(mf, aclResolver, groupMembershipResolver,
mailboxEventDispatcher);
+        StoreMailboxAnnotationManager annotationManager = new StoreMailboxAnnotationManager(mf,
storeRightManager);
         JCRMailboxManager manager = new JCRMailboxManager(mf, noAuthenticator, noAuthorizator,
locker,
             messageParser, new DefaultMessageId.Factory(), mailboxEventDispatcher, delegatingListener,
             annotationManager, storeRightManager);

http://git-wip-us.apache.org/repos/asf/james-project/blob/8bd1d098/mailbox/jpa/src/test/java/org/apache/james/mailbox/jpa/JpaMailboxManagerProvider.java
----------------------------------------------------------------------
diff --git a/mailbox/jpa/src/test/java/org/apache/james/mailbox/jpa/JpaMailboxManagerProvider.java
b/mailbox/jpa/src/test/java/org/apache/james/mailbox/jpa/JpaMailboxManagerProvider.java
index 8d1439c..d0aba5b 100644
--- a/mailbox/jpa/src/test/java/org/apache/james/mailbox/jpa/JpaMailboxManagerProvider.java
+++ b/mailbox/jpa/src/test/java/org/apache/james/mailbox/jpa/JpaMailboxManagerProvider.java
@@ -58,9 +58,9 @@ public class JpaMailboxManagerProvider {
 
         Authenticator noAuthenticator = null;
         Authorizator noAuthorizator = null;
-        StoreRightManager storeRightManager = new StoreRightManager(mf, aclResolver, groupMembershipResolver);
         DefaultDelegatingMailboxListener delegatingListener = new DefaultDelegatingMailboxListener();
         MailboxEventDispatcher mailboxEventDispatcher = new MailboxEventDispatcher(delegatingListener);
+        StoreRightManager storeRightManager = new StoreRightManager(mf, aclResolver, groupMembershipResolver,
mailboxEventDispatcher);
         StoreMailboxAnnotationManager annotationManager = new StoreMailboxAnnotationManager(mf,
storeRightManager,
             LIMIT_ANNOTATIONS, LIMIT_ANNOTATION_SIZE);
         OpenJPAMailboxManager openJPAMailboxManager = new OpenJPAMailboxManager(mf, noAuthenticator,
noAuthorizator,

http://git-wip-us.apache.org/repos/asf/james-project/blob/8bd1d098/mailbox/maildir/src/test/java/org/apache/james/mailbox/maildir/MaildirMailboxManagerProvider.java
----------------------------------------------------------------------
diff --git a/mailbox/maildir/src/test/java/org/apache/james/mailbox/maildir/MaildirMailboxManagerProvider.java
b/mailbox/maildir/src/test/java/org/apache/james/mailbox/maildir/MaildirMailboxManagerProvider.java
index 4d10a6f..19e446b 100644
--- a/mailbox/maildir/src/test/java/org/apache/james/mailbox/maildir/MaildirMailboxManagerProvider.java
+++ b/mailbox/maildir/src/test/java/org/apache/james/mailbox/maildir/MaildirMailboxManagerProvider.java
@@ -46,13 +46,13 @@ public class MaildirMailboxManagerProvider {
         MailboxACLResolver aclResolver = new UnionMailboxACLResolver();
         GroupMembershipResolver groupMembershipResolver = new SimpleGroupMembershipResolver();
         MessageParser messageParser = new MessageParser();
-        StoreRightManager storeRightManager = new StoreRightManager(mf, aclResolver, groupMembershipResolver);
+        DefaultDelegatingMailboxListener delegatingListener = new DefaultDelegatingMailboxListener();
+        MailboxEventDispatcher mailboxEventDispatcher = new MailboxEventDispatcher(delegatingListener);
+        StoreRightManager storeRightManager = new StoreRightManager(mf, aclResolver, groupMembershipResolver,
mailboxEventDispatcher);
 
         Authenticator noAuthenticator = null;
         Authorizator noAuthorizator = null;
 
-        DefaultDelegatingMailboxListener delegatingListener = new DefaultDelegatingMailboxListener();
-        MailboxEventDispatcher mailboxEventDispatcher = new MailboxEventDispatcher(delegatingListener);
         StoreMailboxAnnotationManager annotationManager = new StoreMailboxAnnotationManager(mf,
storeRightManager);
         StoreMailboxManager manager = new StoreMailboxManager(mf, noAuthenticator, noAuthorizator,
new JVMMailboxPathLocker(),
             messageParser, new DefaultMessageId.Factory(), annotationManager,

http://git-wip-us.apache.org/repos/asf/james-project/blob/8bd1d098/mailbox/memory/src/test/java/org/apache/james/mailbox/inmemory/mail/InMemoryMailboxManagerAttachmentTest.java
----------------------------------------------------------------------
diff --git a/mailbox/memory/src/test/java/org/apache/james/mailbox/inmemory/mail/InMemoryMailboxManagerAttachmentTest.java
b/mailbox/memory/src/test/java/org/apache/james/mailbox/inmemory/mail/InMemoryMailboxManagerAttachmentTest.java
index 0ba5857..eb981ab 100644
--- a/mailbox/memory/src/test/java/org/apache/james/mailbox/inmemory/mail/InMemoryMailboxManagerAttachmentTest.java
+++ b/mailbox/memory/src/test/java/org/apache/james/mailbox/inmemory/mail/InMemoryMailboxManagerAttachmentTest.java
@@ -57,13 +57,13 @@ public class InMemoryMailboxManagerAttachmentTest extends AbstractMailboxManager
         mailboxSessionMapperFactory = new InMemoryMailboxSessionMapperFactory();
         Authenticator noAuthenticator = null;
         Authorizator noAuthorizator = null;
+        DefaultDelegatingMailboxListener delegatingListener = new DefaultDelegatingMailboxListener();
+        MailboxEventDispatcher mailboxEventDispatcher = new MailboxEventDispatcher(delegatingListener);
         MessageId.Factory messageIdFactory = new InMemoryMessageId.Factory();
         GroupMembershipResolver groupMembershipResolver = null;
         UnionMailboxACLResolver aclResolver = new UnionMailboxACLResolver();
-        StoreRightManager storeRightManager = new StoreRightManager(mailboxSessionMapperFactory,
aclResolver, groupMembershipResolver);
+        StoreRightManager storeRightManager = new StoreRightManager(mailboxSessionMapperFactory,
aclResolver, groupMembershipResolver, mailboxEventDispatcher);
 
-        DefaultDelegatingMailboxListener delegatingListener = new DefaultDelegatingMailboxListener();
-        MailboxEventDispatcher mailboxEventDispatcher = new MailboxEventDispatcher(delegatingListener);
         StoreMailboxAnnotationManager annotationManager = new StoreMailboxAnnotationManager(mailboxSessionMapperFactory,
storeRightManager);
         mailboxManager = new InMemoryMailboxManager(mailboxSessionMapperFactory, noAuthenticator,
noAuthorizator, new NoMailboxPathLocker(),
                 new MessageParser(), messageIdFactory, mailboxEventDispatcher, delegatingListener,
annotationManager, storeRightManager);

http://git-wip-us.apache.org/repos/asf/james-project/blob/8bd1d098/mailbox/memory/src/test/java/org/apache/james/mailbox/inmemory/manager/InMemoryIntegrationResources.java
----------------------------------------------------------------------
diff --git a/mailbox/memory/src/test/java/org/apache/james/mailbox/inmemory/manager/InMemoryIntegrationResources.java
b/mailbox/memory/src/test/java/org/apache/james/mailbox/inmemory/manager/InMemoryIntegrationResources.java
index 5c6e4a6..4827f82 100644
--- a/mailbox/memory/src/test/java/org/apache/james/mailbox/inmemory/manager/InMemoryIntegrationResources.java
+++ b/mailbox/memory/src/test/java/org/apache/james/mailbox/inmemory/manager/InMemoryIntegrationResources.java
@@ -85,12 +85,13 @@ public class InMemoryIntegrationResources implements IntegrationResources<StoreM
         fakeAuthenticator.addUser(ManagerTestResources.USER, ManagerTestResources.USER_PASS);
         fakeAuthenticator.addUser(ManagerTestResources.OTHER_USER, ManagerTestResources.OTHER_USER_PASS);
         InMemoryMailboxSessionMapperFactory mailboxSessionMapperFactory = new InMemoryMailboxSessionMapperFactory();
-        StoreRightManager storeRightManager = new StoreRightManager(mailboxSessionMapperFactory,
new UnionMailboxACLResolver(), groupMembershipResolver);
+        DefaultDelegatingMailboxListener delegatingListener = new DefaultDelegatingMailboxListener();
+        MailboxEventDispatcher mailboxEventDispatcher = new MailboxEventDispatcher(delegatingListener);
+        StoreRightManager storeRightManager = new StoreRightManager(mailboxSessionMapperFactory,
new UnionMailboxACLResolver(),
+                                                                    groupMembershipResolver,
mailboxEventDispatcher);
         StoreMailboxAnnotationManager annotationManager = annotationManagerBiFunction
             .apply(storeRightManager, mailboxSessionMapperFactory);
 
-        DefaultDelegatingMailboxListener delegatingListener = new DefaultDelegatingMailboxListener();
-        MailboxEventDispatcher mailboxEventDispatcher = new MailboxEventDispatcher(delegatingListener);
         StoreMailboxManager manager = new InMemoryMailboxManager(
             mailboxSessionMapperFactory,
             fakeAuthenticator,
@@ -109,11 +110,11 @@ public class InMemoryIntegrationResources implements IntegrationResources<StoreM
     public StoreMailboxManager createMailboxManager(GroupMembershipResolver groupMembershipResolver,
                                                     Authenticator authenticator, Authorizator
authorizator) throws MailboxException {
         InMemoryMailboxSessionMapperFactory mailboxSessionMapperFactory = new InMemoryMailboxSessionMapperFactory();
-        StoreRightManager storeRightManager = new StoreRightManager(mailboxSessionMapperFactory,
new UnionMailboxACLResolver(), groupMembershipResolver);
-        StoreMailboxAnnotationManager annotationManager = new StoreMailboxAnnotationManager(mailboxSessionMapperFactory,
storeRightManager);
-
         DefaultDelegatingMailboxListener delegatingListener = new DefaultDelegatingMailboxListener();
         MailboxEventDispatcher mailboxEventDispatcher = new MailboxEventDispatcher(delegatingListener);
+        StoreRightManager storeRightManager = new StoreRightManager(mailboxSessionMapperFactory,
new UnionMailboxACLResolver(), groupMembershipResolver, mailboxEventDispatcher);
+        StoreMailboxAnnotationManager annotationManager = new StoreMailboxAnnotationManager(mailboxSessionMapperFactory,
storeRightManager);
+
         StoreMailboxManager manager = new InMemoryMailboxManager(
             mailboxSessionMapperFactory,
             authenticator,

http://git-wip-us.apache.org/repos/asf/james-project/blob/8bd1d098/mailbox/spring/src/main/resources/META-INF/spring/spring-mailbox.xml
----------------------------------------------------------------------
diff --git a/mailbox/spring/src/main/resources/META-INF/spring/spring-mailbox.xml b/mailbox/spring/src/main/resources/META-INF/spring/spring-mailbox.xml
index 8caa3cb..0b50ccb 100644
--- a/mailbox/spring/src/main/resources/META-INF/spring/spring-mailbox.xml
+++ b/mailbox/spring/src/main/resources/META-INF/spring/spring-mailbox.xml
@@ -69,6 +69,7 @@
         <constructor-arg index="0" ref="messageMapperFactory" />
         <constructor-arg index="1" ref="aclResolver" />
         <constructor-arg index="2" ref="groupMembershipResolver" />
+        <constructor-arg index="3" ref="dispatcher" />
     </bean>
 
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/8bd1d098/mailbox/store/src/main/java/org/apache/james/mailbox/store/StoreRightManager.java
----------------------------------------------------------------------
diff --git a/mailbox/store/src/main/java/org/apache/james/mailbox/store/StoreRightManager.java
b/mailbox/store/src/main/java/org/apache/james/mailbox/store/StoreRightManager.java
index 38076df..51c021f 100644
--- a/mailbox/store/src/main/java/org/apache/james/mailbox/store/StoreRightManager.java
+++ b/mailbox/store/src/main/java/org/apache/james/mailbox/store/StoreRightManager.java
@@ -41,6 +41,7 @@ import org.apache.james.mailbox.model.MailboxACL.Rfc4314Rights;
 import org.apache.james.mailbox.model.MailboxACL.Right;
 import org.apache.james.mailbox.model.MailboxId;
 import org.apache.james.mailbox.model.MailboxPath;
+import org.apache.james.mailbox.store.event.MailboxEventDispatcher;
 import org.apache.james.mailbox.store.mail.MailboxMapper;
 import org.apache.james.mailbox.store.mail.model.Mailbox;
 import org.apache.james.mailbox.store.transaction.Mapper;
@@ -52,6 +53,7 @@ import com.google.common.collect.ImmutableMap;
 public class StoreRightManager implements RightManager {
     public static final boolean GROUP_FOLDER = true;
 
+    private final MailboxEventDispatcher dispatcher;
     private final MailboxSessionMapperFactory mailboxSessionMapperFactory;
     private final MailboxACLResolver aclResolver;
     private final GroupMembershipResolver groupMembershipResolver;
@@ -59,10 +61,12 @@ public class StoreRightManager implements RightManager {
     @Inject
     public StoreRightManager(MailboxSessionMapperFactory mailboxSessionMapperFactory,
                              MailboxACLResolver aclResolver,
-                             GroupMembershipResolver groupMembershipResolver) {
+                             GroupMembershipResolver groupMembershipResolver,
+                             MailboxEventDispatcher dispatcher) {
         this.mailboxSessionMapperFactory = mailboxSessionMapperFactory;
         this.aclResolver = aclResolver;
         this.groupMembershipResolver = groupMembershipResolver;
+        this.dispatcher = dispatcher;
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/james-project/blob/8bd1d098/mailbox/store/src/test/java/org/apache/james/mailbox/store/StoreMailboxManagerTest.java
----------------------------------------------------------------------
diff --git a/mailbox/store/src/test/java/org/apache/james/mailbox/store/StoreMailboxManagerTest.java
b/mailbox/store/src/test/java/org/apache/james/mailbox/store/StoreMailboxManagerTest.java
index 33f9efd..b97d993 100644
--- a/mailbox/store/src/test/java/org/apache/james/mailbox/store/StoreMailboxManagerTest.java
+++ b/mailbox/store/src/test/java/org/apache/james/mailbox/store/StoreMailboxManagerTest.java
@@ -75,10 +75,13 @@ public class StoreMailboxManagerTest {
         FakeAuthenticator authenticator = new FakeAuthenticator();
         authenticator.addUser(CURRENT_USER, CURRENT_USER_PASSWORD);
         authenticator.addUser(ADMIN, ADMIN_PASSWORD);
-        StoreRightManager storeRightManager = new StoreRightManager(mockedMapperFactory,
new UnionMailboxACLResolver(), new SimpleGroupMembershipResolver());
 
         DefaultDelegatingMailboxListener delegatingListener = new DefaultDelegatingMailboxListener();
         MailboxEventDispatcher mailboxEventDispatcher = new MailboxEventDispatcher(delegatingListener);
+
+        StoreRightManager storeRightManager = new StoreRightManager(mockedMapperFactory,
new UnionMailboxACLResolver(),
+                                                                    new SimpleGroupMembershipResolver(),
mailboxEventDispatcher);
+
         StoreMailboxAnnotationManager annotationManager = new StoreMailboxAnnotationManager(mockedMapperFactory,
storeRightManager);
         storeMailboxManager = new StoreMailboxManager(mockedMapperFactory, authenticator,
FakeAuthorizator.forUserAndAdmin(ADMIN, CURRENT_USER),
                 new JVMMailboxPathLocker(), new MessageParser(), messageIdFactory,

http://git-wip-us.apache.org/repos/asf/james-project/blob/8bd1d098/mailbox/store/src/test/java/org/apache/james/mailbox/store/StoreRightManagerTest.java
----------------------------------------------------------------------
diff --git a/mailbox/store/src/test/java/org/apache/james/mailbox/store/StoreRightManagerTest.java
b/mailbox/store/src/test/java/org/apache/james/mailbox/store/StoreRightManagerTest.java
index 78ce9e6..91a481a 100644
--- a/mailbox/store/src/test/java/org/apache/james/mailbox/store/StoreRightManagerTest.java
+++ b/mailbox/store/src/test/java/org/apache/james/mailbox/store/StoreRightManagerTest.java
@@ -30,6 +30,8 @@ import static org.mockito.Mockito.when;
 
 import javax.mail.Flags;
 
+import org.apache.james.mailbox.acl.GroupMembershipResolver;
+import org.apache.james.mailbox.acl.MailboxACLResolver;
 import org.apache.james.mailbox.acl.SimpleGroupMembershipResolver;
 import org.apache.james.mailbox.acl.UnionMailboxACLResolver;
 import org.apache.james.mailbox.exception.DifferentDomainException;
@@ -43,6 +45,7 @@ import org.apache.james.mailbox.model.MailboxACL.ACLCommand;
 import org.apache.james.mailbox.model.MailboxACL.Right;
 import org.apache.james.mailbox.model.MailboxConstants;
 import org.apache.james.mailbox.model.MailboxPath;
+import org.apache.james.mailbox.store.event.MailboxEventDispatcher;
 import org.apache.james.mailbox.store.mail.MailboxMapper;
 import org.apache.james.mailbox.store.mail.model.Mailbox;
 import org.apache.james.mailbox.store.mail.model.impl.SimpleMailbox;
@@ -54,7 +57,8 @@ public class StoreRightManagerTest {
     private static final long UID_VALIDITY = 3421L;
     private StoreRightManager storeRightManager;
     private MockMailboxSession aliceSession;
-
+    private MailboxACLResolver mailboxAclResolver;
+    private GroupMembershipResolver groupMembershipResolver;
     private MailboxMapper mockedMailboxMapper;
 
     @Before
@@ -62,12 +66,16 @@ public class StoreRightManagerTest {
         aliceSession = new MockMailboxSession(MailboxFixture.ALICE);
         MailboxSessionMapperFactory mockedMapperFactory = mock(MailboxSessionMapperFactory.class);
         mockedMailboxMapper = mock(MailboxMapper.class);
+        mailboxAclResolver = new UnionMailboxACLResolver();
+        groupMembershipResolver = new SimpleGroupMembershipResolver();
+        MailboxEventDispatcher dispatcher = mock(MailboxEventDispatcher.class);
         when(mockedMapperFactory.getMailboxMapper(aliceSession))
             .thenReturn(mockedMailboxMapper);
 
         storeRightManager = new StoreRightManager(mockedMapperFactory,
-            new UnionMailboxACLResolver(),
-            new SimpleGroupMembershipResolver());
+                                                  mailboxAclResolver,
+                                                  groupMembershipResolver,
+                                                  dispatcher);
     }
 
     @Test

http://git-wip-us.apache.org/repos/asf/james-project/blob/8bd1d098/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/host/CassandraHostSystem.java
----------------------------------------------------------------------
diff --git a/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/host/CassandraHostSystem.java
b/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/host/CassandraHostSystem.java
index 93fc95e..05ae0c8 100644
--- a/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/host/CassandraHostSystem.java
+++ b/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/host/CassandraHostSystem.java
@@ -115,7 +115,7 @@ public class CassandraHostSystem extends JamesImapHostSystem {
 
         DefaultDelegatingMailboxListener delegatingMailboxListener = new DefaultDelegatingMailboxListener();
         MailboxEventDispatcher mailboxEventDispatcher = new MailboxEventDispatcher(delegatingMailboxListener);
-        StoreRightManager storeRightManager = new StoreRightManager(mapperFactory, new UnionMailboxACLResolver(),
new SimpleGroupMembershipResolver());
+        StoreRightManager storeRightManager = new StoreRightManager(mapperFactory, new UnionMailboxACLResolver(),
new SimpleGroupMembershipResolver(), mailboxEventDispatcher);
 
         StoreMailboxAnnotationManager annotationManager = new StoreMailboxAnnotationManager(mapperFactory,
storeRightManager);
         mailboxManager = new CassandraMailboxManager(mapperFactory, authenticator, authorizator,

http://git-wip-us.apache.org/repos/asf/james-project/blob/8bd1d098/mpt/impl/imap-mailbox/hbase/src/test/java/org/apache/james/mpt/imapmailbox/hbase/host/HBaseHostSystem.java
----------------------------------------------------------------------
diff --git a/mpt/impl/imap-mailbox/hbase/src/test/java/org/apache/james/mpt/imapmailbox/hbase/host/HBaseHostSystem.java
b/mpt/impl/imap-mailbox/hbase/src/test/java/org/apache/james/mpt/imapmailbox/hbase/host/HBaseHostSystem.java
index aa1c82b..939a5f0 100644
--- a/mpt/impl/imap-mailbox/hbase/src/test/java/org/apache/james/mpt/imapmailbox/hbase/host/HBaseHostSystem.java
+++ b/mpt/impl/imap-mailbox/hbase/src/test/java/org/apache/james/mpt/imapmailbox/hbase/host/HBaseHostSystem.java
@@ -109,7 +109,7 @@ public class HBaseHostSystem extends JamesImapHostSystem {
 
         DefaultDelegatingMailboxListener delegatingListener = new DefaultDelegatingMailboxListener();
         MailboxEventDispatcher mailboxEventDispatcher = new MailboxEventDispatcher(delegatingListener);
-        StoreRightManager storeRightManager = new StoreRightManager(mapperFactory, aclResolver,
groupMembershipResolver);
+        StoreRightManager storeRightManager = new StoreRightManager(mapperFactory, aclResolver,
groupMembershipResolver, mailboxEventDispatcher);
         StoreMailboxAnnotationManager annotationManager = new StoreMailboxAnnotationManager(mapperFactory,
storeRightManager);
         mailboxManager = new HBaseMailboxManager(mapperFactory, authenticator, authorizator,
             new JVMMailboxPathLocker(), messageParser,

http://git-wip-us.apache.org/repos/asf/james-project/blob/8bd1d098/mpt/impl/imap-mailbox/jcr/src/test/java/org/apache/james/mpt/imapmailbox/jcr/host/JCRHostSystem.java
----------------------------------------------------------------------
diff --git a/mpt/impl/imap-mailbox/jcr/src/test/java/org/apache/james/mpt/imapmailbox/jcr/host/JCRHostSystem.java
b/mpt/impl/imap-mailbox/jcr/src/test/java/org/apache/james/mpt/imapmailbox/jcr/host/JCRHostSystem.java
index 7702d20..f8eda22 100644
--- a/mpt/impl/imap-mailbox/jcr/src/test/java/org/apache/james/mpt/imapmailbox/jcr/host/JCRHostSystem.java
+++ b/mpt/impl/imap-mailbox/jcr/src/test/java/org/apache/james/mpt/imapmailbox/jcr/host/JCRHostSystem.java
@@ -95,9 +95,9 @@ public class JCRHostSystem extends JamesImapHostSystem {
             GroupMembershipResolver groupMembershipResolver = new SimpleGroupMembershipResolver();
             MessageParser messageParser = new MessageParser();
 
-            StoreRightManager storeRightManager = new StoreRightManager(mf, aclResolver,
groupMembershipResolver);
             DefaultDelegatingMailboxListener delegatingListener = new DefaultDelegatingMailboxListener();
             MailboxEventDispatcher mailboxEventDispatcher = new MailboxEventDispatcher(delegatingListener);
+            StoreRightManager storeRightManager = new StoreRightManager(mf, aclResolver,
groupMembershipResolver, mailboxEventDispatcher);
             StoreMailboxAnnotationManager annotationManager = new StoreMailboxAnnotationManager(mf,
storeRightManager);
             mailboxManager = new JCRMailboxManager(mf, authenticator, authorizator, new JVMMailboxPathLocker(),
messageParser,
                     new DefaultMessageId.Factory(), mailboxEventDispatcher, delegatingListener,

http://git-wip-us.apache.org/repos/asf/james-project/blob/8bd1d098/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/host/JPAHostSystem.java
----------------------------------------------------------------------
diff --git a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/host/JPAHostSystem.java
b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/host/JPAHostSystem.java
index f6468d2..c6d5c32 100644
--- a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/host/JPAHostSystem.java
+++ b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/host/JPAHostSystem.java
@@ -96,9 +96,9 @@ public class JPAHostSystem extends JamesImapHostSystem {
         GroupMembershipResolver groupMembershipResolver = new SimpleGroupMembershipResolver();
         MessageParser messageParser = new MessageParser();
 
-        StoreRightManager storeRightManager = new StoreRightManager(mapperFactory, aclResolver,
groupMembershipResolver);
         DefaultDelegatingMailboxListener delegatingListener = new DefaultDelegatingMailboxListener();
         MailboxEventDispatcher mailboxEventDispatcher = new MailboxEventDispatcher(delegatingListener);
+        StoreRightManager storeRightManager = new StoreRightManager(mapperFactory, aclResolver,
groupMembershipResolver, mailboxEventDispatcher);
         StoreMailboxAnnotationManager annotationManager = new StoreMailboxAnnotationManager(mapperFactory,
storeRightManager);
         mailboxManager = new OpenJPAMailboxManager(mapperFactory, authenticator, authorizator,
             messageParser, new DefaultMessageId.Factory(), delegatingListener,

http://git-wip-us.apache.org/repos/asf/james-project/blob/8bd1d098/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/host/LuceneSearchHostSystem.java
----------------------------------------------------------------------
diff --git a/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/host/LuceneSearchHostSystem.java
b/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/host/LuceneSearchHostSystem.java
index d9a21e2..7455a89 100644
--- a/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/host/LuceneSearchHostSystem.java
+++ b/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/host/LuceneSearchHostSystem.java
@@ -119,10 +119,10 @@ public class LuceneSearchHostSystem extends JamesImapHostSystem {
             GroupMembershipResolver groupMembershipResolver = new SimpleGroupMembershipResolver();
             MessageParser messageParser = new MessageParser();
 
-            StoreRightManager storeRightManager = new StoreRightManager(factory, aclResolver,
groupMembershipResolver);
-
             DefaultDelegatingMailboxListener delegatingListener = new DefaultDelegatingMailboxListener();
             MailboxEventDispatcher mailboxEventDispatcher = new MailboxEventDispatcher(delegatingListener);
+            StoreRightManager storeRightManager = new StoreRightManager(factory, aclResolver,
groupMembershipResolver, mailboxEventDispatcher);
+
             StoreMailboxAnnotationManager annotationManager = new StoreMailboxAnnotationManager(factory,
storeRightManager);
             mailboxManager = new OpenJPAMailboxManager(factory, authenticator, authorizator,
                 messageParser, new DefaultMessageId.Factory(), delegatingListener,

http://git-wip-us.apache.org/repos/asf/james-project/blob/8bd1d098/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/host/MaildirHostSystem.java
----------------------------------------------------------------------
diff --git a/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/host/MaildirHostSystem.java
b/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/host/MaildirHostSystem.java
index 3730ee7..c00d99c 100644
--- a/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/host/MaildirHostSystem.java
+++ b/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/host/MaildirHostSystem.java
@@ -75,7 +75,7 @@ public class MaildirHostSystem extends JamesImapHostSystem {
 
         DefaultDelegatingMailboxListener delegatingListener = new DefaultDelegatingMailboxListener();
         MailboxEventDispatcher mailboxEventDispatcher = new MailboxEventDispatcher(delegatingListener);
-        StoreRightManager storeRightManager = new StoreRightManager(mailboxSessionMapperFactory,
aclResolver, groupMembershipResolver);
+        StoreRightManager storeRightManager = new StoreRightManager(mailboxSessionMapperFactory,
aclResolver, groupMembershipResolver, mailboxEventDispatcher);
         StoreMailboxAnnotationManager annotationManager = new StoreMailboxAnnotationManager(mailboxSessionMapperFactory,
storeRightManager);
         mailboxManager = new StoreMailboxManager(mailboxSessionMapperFactory, authenticator,
authorizator, locker,
             messageParser, new DefaultMessageId.Factory(), annotationManager,


---------------------------------------------------------------------
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