JAMES-2530 Guice bindings for JMAP filtering

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

Branch: refs/heads/master
Commit: 3c8db042082060b5a0589384f7f4c9606c146467
Parents: 3bc2eec
Author: Benoit Tellier <btell...@linagora.com>
Authored: Tue Aug 28 10:31:35 2018 +0700
Committer: Antoine Duprat <adup...@linagora.com>
Committed: Tue Aug 28 14:11:51 2018 +0200

----------------------------------------------------------------------
 .../apache/james/modules/data/CassandraJmapModule.java    | 10 ++++++++++
 .../apache/james/modules/data/MemoryDataJmapModule.java   |  5 +++++
 .../main/java/org/apache/james/jmap/MethodsModule.java    |  4 ++++
 3 files changed, 19 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/3c8db042/server/container/guice/cassandra-guice/src/main/java/org/apache/james/modules/data/CassandraJmapModule.java
----------------------------------------------------------------------
diff --git 
a/server/container/guice/cassandra-guice/src/main/java/org/apache/james/modules/data/CassandraJmapModule.java
 
b/server/container/guice/cassandra-guice/src/main/java/org/apache/james/modules/data/CassandraJmapModule.java
index 3a88c08..ee5e194 100644
--- 
a/server/container/guice/cassandra-guice/src/main/java/org/apache/james/modules/data/CassandraJmapModule.java
+++ 
b/server/container/guice/cassandra-guice/src/main/java/org/apache/james/modules/data/CassandraJmapModule.java
@@ -20,11 +20,15 @@
 package org.apache.james.modules.data;
 
 import org.apache.james.backends.cassandra.components.CassandraModule;
+import org.apache.james.eventsourcing.eventstore.cassandra.dto.EventDTOModule;
 import org.apache.james.jmap.api.access.AccessTokenRepository;
+import org.apache.james.jmap.api.filtering.FilteringManagement;
+import 
org.apache.james.jmap.api.filtering.impl.EventSourcingFilteringManagement;
 import org.apache.james.jmap.api.vacation.NotificationRegistry;
 import org.apache.james.jmap.api.vacation.VacationRepository;
 import org.apache.james.jmap.cassandra.access.CassandraAccessModule;
 import org.apache.james.jmap.cassandra.access.CassandraAccessTokenRepository;
+import 
org.apache.james.jmap.cassandra.filtering.FilteringRuleSetDefineDTOModules;
 import org.apache.james.jmap.cassandra.vacation.CassandraNotificationRegistry;
 import 
org.apache.james.jmap.cassandra.vacation.CassandraNotificationRegistryModule;
 import org.apache.james.jmap.cassandra.vacation.CassandraVacationModule;
@@ -47,9 +51,15 @@ public class CassandraJmapModule extends AbstractModule {
         bind(CassandraNotificationRegistry.class).in(Scopes.SINGLETON);
         
bind(NotificationRegistry.class).to(CassandraNotificationRegistry.class);
 
+        bind(EventSourcingFilteringManagement.class).in(Scopes.SINGLETON);
+        
bind(FilteringManagement.class).to(EventSourcingFilteringManagement.class);
+
         Multibinder<CassandraModule> cassandraDataDefinitions = 
Multibinder.newSetBinder(binder(), CassandraModule.class);
         
cassandraDataDefinitions.addBinding().toInstance(CassandraAccessModule.MODULE);
         
cassandraDataDefinitions.addBinding().toInstance(CassandraVacationModule.MODULE);
         
cassandraDataDefinitions.addBinding().toInstance(CassandraNotificationRegistryModule.MODULE);
+
+        Multibinder<EventDTOModule> eventDTOModuleBinder = 
Multibinder.newSetBinder(binder(), EventDTOModule.class);
+        
eventDTOModuleBinder.addBinding().toInstance(FilteringRuleSetDefineDTOModules.FILTERING_RULE_SET_DEFINED);
     }
 }

http://git-wip-us.apache.org/repos/asf/james-project/blob/3c8db042/server/container/guice/memory-guice/src/main/java/org/apache/james/modules/data/MemoryDataJmapModule.java
----------------------------------------------------------------------
diff --git 
a/server/container/guice/memory-guice/src/main/java/org/apache/james/modules/data/MemoryDataJmapModule.java
 
b/server/container/guice/memory-guice/src/main/java/org/apache/james/modules/data/MemoryDataJmapModule.java
index 43b50ad..24a9813 100644
--- 
a/server/container/guice/memory-guice/src/main/java/org/apache/james/modules/data/MemoryDataJmapModule.java
+++ 
b/server/container/guice/memory-guice/src/main/java/org/apache/james/modules/data/MemoryDataJmapModule.java
@@ -20,6 +20,8 @@
 package org.apache.james.modules.data;
 
 import org.apache.james.jmap.api.access.AccessTokenRepository;
+import org.apache.james.jmap.api.filtering.FilteringManagement;
+import 
org.apache.james.jmap.api.filtering.impl.EventSourcingFilteringManagement;
 import org.apache.james.jmap.api.vacation.NotificationRegistry;
 import org.apache.james.jmap.api.vacation.VacationRepository;
 import org.apache.james.jmap.memory.access.MemoryAccessTokenRepository;
@@ -45,6 +47,9 @@ public class MemoryDataJmapModule extends AbstractModule {
         bind(MemoryNotificationRegistry.class).in(Scopes.SINGLETON);
         bind(NotificationRegistry.class).to(MemoryNotificationRegistry.class);
 
+        bind(EventSourcingFilteringManagement.class).in(Scopes.SINGLETON);
+        
bind(FilteringManagement.class).to(EventSourcingFilteringManagement.class);
+
         bind(DefaultTextExtractor.class).in(Scopes.SINGLETON);
         bind(TextExtractor.class).to(JsoupTextExtractor.class);
     }

http://git-wip-us.apache.org/repos/asf/james-project/blob/3c8db042/server/container/guice/protocols/jmap/src/main/java/org/apache/james/jmap/MethodsModule.java
----------------------------------------------------------------------
diff --git 
a/server/container/guice/protocols/jmap/src/main/java/org/apache/james/jmap/MethodsModule.java
 
b/server/container/guice/protocols/jmap/src/main/java/org/apache/james/jmap/MethodsModule.java
index 37b2863..13055de 100644
--- 
a/server/container/guice/protocols/jmap/src/main/java/org/apache/james/jmap/MethodsModule.java
+++ 
b/server/container/guice/protocols/jmap/src/main/java/org/apache/james/jmap/MethodsModule.java
@@ -20,6 +20,7 @@
 package org.apache.james.jmap;
 
 import org.apache.james.jmap.json.ObjectMapperFactory;
+import org.apache.james.jmap.methods.GetFilterMethod;
 import org.apache.james.jmap.methods.GetMailboxesMethod;
 import org.apache.james.jmap.methods.GetMessageListMethod;
 import org.apache.james.jmap.methods.GetMessagesMethod;
@@ -30,6 +31,7 @@ import org.apache.james.jmap.methods.JmapResponseWriter;
 import org.apache.james.jmap.methods.JmapResponseWriterImpl;
 import org.apache.james.jmap.methods.Method;
 import org.apache.james.jmap.methods.SendMDNProcessor;
+import org.apache.james.jmap.methods.SetFilterMethod;
 import org.apache.james.jmap.methods.SetMailboxesCreationProcessor;
 import org.apache.james.jmap.methods.SetMailboxesDestructionProcessor;
 import org.apache.james.jmap.methods.SetMailboxesMethod;
@@ -68,6 +70,8 @@ public class MethodsModule extends AbstractModule {
         methods.addBinding().to(SetMailboxesMethod.class);
         methods.addBinding().to(GetVacationResponseMethod.class);
         methods.addBinding().to(SetVacationResponseMethod.class);
+        methods.addBinding().to(GetFilterMethod.class);
+        methods.addBinding().to(SetFilterMethod.class);
 
         Multibinder<SetMailboxesProcessor> setMailboxesProcessor =
             Multibinder.newSetBinder(binder(), SetMailboxesProcessor.class);


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

Reply via email to