james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From btell...@apache.org
Subject [12/13] james-project git commit: JAMES-1717 Expose VacationRepository via Guice
Date Fri, 22 Apr 2016 08:33:20 GMT
JAMES-1717 Expose VacationRepository via Guice


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

Branch: refs/heads/master
Commit: 44e99836c08d490f88e9ff7a4ee55f021facd8b5
Parents: d04d166
Author: Benoit Tellier <btellier@linagora.com>
Authored: Wed Apr 6 17:57:27 2016 +0700
Committer: Benoit Tellier <btellier@linagora.com>
Committed: Fri Apr 22 15:29:29 2016 +0700

----------------------------------------------------------------------
 .../james/modules/data/CassandraJmapModule.java |  8 ++++
 .../org/apache/james/MemoryJamesServerMain.java |  2 +
 .../modules/data/MemoryDataJmapModule.java      | 40 ++++++++++++++++++++
 .../james/modules/data/MemoryDataModule.java    |  5 ---
 4 files changed, 50 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/44e99836/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 7162434..fb6d74e 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
@@ -21,11 +21,15 @@ package org.apache.james.modules.data;
 
 import org.apache.james.backends.cassandra.components.CassandraModule;
 import org.apache.james.jmap.api.access.AccessTokenRepository;
+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.vacation.CassandraVacationModule;
+import org.apache.james.jmap.cassandra.vacation.CassandraVacationRepository;
 
 import com.google.inject.AbstractModule;
 import com.google.inject.Scopes;
+
 import com.google.inject.multibindings.Multibinder;
 
 public class CassandraJmapModule extends AbstractModule {
@@ -35,7 +39,11 @@ public class CassandraJmapModule extends AbstractModule {
         bind(CassandraAccessTokenRepository.class).in(Scopes.SINGLETON);
         bind(AccessTokenRepository.class).to(CassandraAccessTokenRepository.class);
 
+        bind(CassandraVacationRepository.class).in(Scopes.SINGLETON);
+        bind(VacationRepository.class).to(CassandraVacationRepository.class);
+
         Multibinder<CassandraModule> cassandraDataDefinitions = Multibinder.newSetBinder(binder(),
CassandraModule.class);
         cassandraDataDefinitions.addBinding().to(CassandraAccessModule.class);
+        cassandraDataDefinitions.addBinding().to(CassandraVacationModule.class);
     }
 }

http://git-wip-us.apache.org/repos/asf/james-project/blob/44e99836/server/container/guice/memory-guice/src/main/java/org/apache/james/MemoryJamesServerMain.java
----------------------------------------------------------------------
diff --git a/server/container/guice/memory-guice/src/main/java/org/apache/james/MemoryJamesServerMain.java
b/server/container/guice/memory-guice/src/main/java/org/apache/james/MemoryJamesServerMain.java
index 511180a..3d6fc04 100644
--- a/server/container/guice/memory-guice/src/main/java/org/apache/james/MemoryJamesServerMain.java
+++ b/server/container/guice/memory-guice/src/main/java/org/apache/james/MemoryJamesServerMain.java
@@ -20,6 +20,7 @@
 package org.apache.james;
 
 import org.apache.james.mailbox.inmemory.InMemoryId;
+import org.apache.james.modules.data.MemoryDataJmapModule;
 import org.apache.james.modules.data.MemoryDataModule;
 import org.apache.james.modules.mailbox.MemoryMailboxModule;
 import org.apache.james.modules.server.JMXServerModule;
@@ -36,6 +37,7 @@ public class MemoryJamesServerMain {
     
     public static final Module inMemoryServerModule = Modules.combine(
         new MemoryDataModule(),
+        new MemoryDataJmapModule(),
         new MemoryMailboxModule(),
         new QuotaModule(),
         new MemoryMailQueueModule<>(inMemoryId));

http://git-wip-us.apache.org/repos/asf/james-project/blob/44e99836/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
new file mode 100644
index 0000000..449ed88
--- /dev/null
+++ b/server/container/guice/memory-guice/src/main/java/org/apache/james/modules/data/MemoryDataJmapModule.java
@@ -0,0 +1,40 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+
+package org.apache.james.modules.data;
+
+import org.apache.james.jmap.api.access.AccessTokenRepository;
+import org.apache.james.jmap.api.vacation.VacationRepository;
+import org.apache.james.jmap.memory.access.MemoryAccessTokenRepository;
+import org.apache.james.jmap.memory.vacation.MemoryVacationRepository;
+
+import com.google.inject.AbstractModule;
+import com.google.inject.Scopes;
+
+public class MemoryDataJmapModule extends AbstractModule {
+
+    @Override
+    protected void configure() {
+        bind(MemoryAccessTokenRepository.class).in(Scopes.SINGLETON);
+        bind(AccessTokenRepository.class).to(MemoryAccessTokenRepository.class);
+
+        bind(MemoryVacationRepository.class).in(Scopes.SINGLETON);
+        bind(VacationRepository.class).to(MemoryVacationRepository.class);
+    }
+}

http://git-wip-us.apache.org/repos/asf/james-project/blob/44e99836/server/container/guice/memory-guice/src/main/java/org/apache/james/modules/data/MemoryDataModule.java
----------------------------------------------------------------------
diff --git a/server/container/guice/memory-guice/src/main/java/org/apache/james/modules/data/MemoryDataModule.java
b/server/container/guice/memory-guice/src/main/java/org/apache/james/modules/data/MemoryDataModule.java
index 7af0478..9663255 100644
--- a/server/container/guice/memory-guice/src/main/java/org/apache/james/modules/data/MemoryDataModule.java
+++ b/server/container/guice/memory-guice/src/main/java/org/apache/james/modules/data/MemoryDataModule.java
@@ -21,8 +21,6 @@ package org.apache.james.modules.data;
 
 import org.apache.james.domainlist.api.DomainList;
 import org.apache.james.domainlist.memory.MemoryDomainList;
-import org.apache.james.jmap.api.access.AccessTokenRepository;
-import org.apache.james.jmap.memory.access.MemoryAccessTokenRepository;
 import org.apache.james.rrt.api.RecipientRewriteTable;
 import org.apache.james.rrt.memory.MemoryRecipientRewriteTable;
 import org.apache.james.sieverepository.api.SieveRepository;
@@ -58,9 +56,6 @@ public class MemoryDataModule extends AbstractModule {
         bind(SieveFileRepository.class).in(Scopes.SINGLETON);
         bind(SieveRepository.class).to(SieveFileRepository.class);
 
-        bind(MemoryAccessTokenRepository.class).in(Scopes.SINGLETON);
-        bind(AccessTokenRepository.class).to(MemoryAccessTokenRepository.class);
-
         Multibinder.newSetBinder(binder(), ConfigurationPerformer.class).addBinding().to(MemoryDataConfigurationPerformer.class);
     }
 


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