james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From btell...@apache.org
Subject [17/21] james-project git commit: JAMES-1902 define supported protocols in the server
Date Tue, 14 Mar 2017 11:14:58 GMT
JAMES-1902 define supported protocols in the server


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

Branch: refs/heads/master
Commit: ddda1d72fe15667437692e5e5a3473fc40cda9ee
Parents: 6cc8ed0
Author: Matthieu Baechler <matthieu.baechler@gmail.com>
Authored: Tue Dec 27 15:21:47 2016 +0100
Committer: benwa <btellier@linagora.com>
Committed: Tue Mar 14 18:13:55 2017 +0700

----------------------------------------------------------------------
 .../smtp/host/CassandraJamesSmtpHostSystem.java |  4 +-
 .../apache/james/CassandraJamesServerMain.java  | 18 +++++++-
 .../org/apache/james/CassandraJmapTestRule.java |  2 +-
 .../james/JamesCapabilitiesServerTest.java      |  2 +-
 .../james/CassandraLdapJamesServerMain.java     |  2 +-
 .../org/apache/james/GuiceJamesServerImpl.java  |  2 -
 .../apache/james/modules/ProtocolsModule.java   | 46 --------------------
 .../org/apache/james/JPAJamesServerMain.java    | 18 +++++++-
 .../cassandra/cucumber/CassandraStepdefs.java   |  2 +-
 9 files changed, 41 insertions(+), 55 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/ddda1d72/mpt/impl/smtp/cassandra/src/test/java/org/apache/james/mpt/smtp/host/CassandraJamesSmtpHostSystem.java
----------------------------------------------------------------------
diff --git a/mpt/impl/smtp/cassandra/src/test/java/org/apache/james/mpt/smtp/host/CassandraJamesSmtpHostSystem.java
b/mpt/impl/smtp/cassandra/src/test/java/org/apache/james/mpt/smtp/host/CassandraJamesSmtpHostSystem.java
index c7320f3..d59a9ef 100644
--- a/mpt/impl/smtp/cassandra/src/test/java/org/apache/james/mpt/smtp/host/CassandraJamesSmtpHostSystem.java
+++ b/mpt/impl/smtp/cassandra/src/test/java/org/apache/james/mpt/smtp/host/CassandraJamesSmtpHostSystem.java
@@ -28,6 +28,8 @@ import org.apache.james.backends.es.EmbeddedElasticSearch;
 import org.apache.james.dnsservice.api.DNSService;
 import org.apache.james.mailbox.elasticsearch.MailboxElasticsearchConstants;
 import org.apache.james.modules.CassandraJmapServerModule;
+import org.apache.james.modules.protocols.ProtocolHandlerModule;
+import org.apache.james.modules.protocols.SMTPServerModule;
 import org.apache.james.mpt.monitor.SystemLoggingMonitor;
 import org.apache.james.mpt.session.ExternalSessionFactory;
 import org.apache.james.mpt.smtp.SmtpHostSystem;
@@ -107,7 +109,7 @@ public class CassandraJamesSmtpHostSystem extends ExternalSessionFactory
impleme
 
     protected GuiceJamesServerImpl createJamesServer() {
         return new GuiceJamesServerImpl()
-            .combineWith(CassandraJamesServerMain.cassandraServerModule)
+            .combineWith(CassandraJamesServerMain.cassandraServerModule, new SMTPServerModule(),
new ProtocolHandlerModule())
             .overrideWith(new CassandraJmapServerModule(folder::getRoot, embeddedElasticSearch,
embeddedCassandra),
                 (binder) -> binder.bind(DNSService.class).toInstance(inMemoryDNSService));
     }

http://git-wip-us.apache.org/repos/asf/james-project/blob/ddda1d72/server/container/guice/cassandra-guice/src/main/java/org/apache/james/CassandraJamesServerMain.java
----------------------------------------------------------------------
diff --git a/server/container/guice/cassandra-guice/src/main/java/org/apache/james/CassandraJamesServerMain.java
b/server/container/guice/cassandra-guice/src/main/java/org/apache/james/CassandraJamesServerMain.java
index 431ea6b..24705a7 100644
--- a/server/container/guice/cassandra-guice/src/main/java/org/apache/james/CassandraJamesServerMain.java
+++ b/server/container/guice/cassandra-guice/src/main/java/org/apache/james/CassandraJamesServerMain.java
@@ -27,17 +27,33 @@ import org.apache.james.modules.data.CassandraUsersRepositoryModule;
 import org.apache.james.modules.mailbox.CassandraMailboxModule;
 import org.apache.james.modules.mailbox.CassandraSessionModule;
 import org.apache.james.modules.mailbox.ElasticSearchMailboxModule;
+import org.apache.james.modules.protocols.IMAPServerModule;
 import org.apache.james.modules.protocols.JMAPServerModule;
+import org.apache.james.modules.protocols.LMTPServerModule;
+import org.apache.james.modules.protocols.ManageSieveServerModule;
+import org.apache.james.modules.protocols.POP3ServerModule;
+import org.apache.james.modules.protocols.ProtocolHandlerModule;
+import org.apache.james.modules.protocols.SMTPServerModule;
 import org.apache.james.modules.server.ActiveMQQueueModule;
 import org.apache.james.modules.server.ESMetricReporterModule;
 import org.apache.james.modules.server.JMXServerModule;
 import org.apache.james.modules.server.QuotaModule;
+import org.apache.james.modules.server.WebAdminServerModule;
 
 import com.google.inject.Module;
 import com.google.inject.util.Modules;
 
 public class CassandraJamesServerMain {
 
+    public static final Module protocols = Modules.combine(
+            new IMAPServerModule(),
+            new ProtocolHandlerModule(),
+            new POP3ServerModule(),
+            new SMTPServerModule(),
+            new LMTPServerModule(),
+            new ManageSieveServerModule(),
+            new WebAdminServerModule());
+    
     public static final Module cassandraServerModule = Modules.combine(
         new JMAPServerModule(),
         new CassandraUsersRepositoryModule(),
@@ -55,7 +71,7 @@ public class CassandraJamesServerMain {
 
     public static void main(String[] args) throws Exception {
         GuiceJamesServerImpl server = new GuiceJamesServerImpl()
-                    .combineWith(cassandraServerModule, new JMXServerModule());
+                    .combineWith(cassandraServerModule, protocols, new JMXServerModule());
         server.start();
     }
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/ddda1d72/server/container/guice/cassandra-guice/src/test/java/org/apache/james/CassandraJmapTestRule.java
----------------------------------------------------------------------
diff --git a/server/container/guice/cassandra-guice/src/test/java/org/apache/james/CassandraJmapTestRule.java
b/server/container/guice/cassandra-guice/src/test/java/org/apache/james/CassandraJmapTestRule.java
index 68d3371..d3588eb 100644
--- a/server/container/guice/cassandra-guice/src/test/java/org/apache/james/CassandraJmapTestRule.java
+++ b/server/container/guice/cassandra-guice/src/test/java/org/apache/james/CassandraJmapTestRule.java
@@ -47,7 +47,7 @@ public class CassandraJmapTestRule implements TestRule {
 
     public JmapJamesServer jmapServer(Module... additionals) {
         return new JmapJamesServer()
-            .combineWith(CassandraJamesServerMain.cassandraServerModule)
+            .combineWith(CassandraJamesServerMain.cassandraServerModule, CassandraJamesServerMain.protocols)
             .overrideWith(new TestJMAPServerModule(LIMIT_TO_3_MESSAGES))
             .overrideWith(new TestESMetricReporterModule())
             .overrideWith(guiceModuleTestRule.getModule())

http://git-wip-us.apache.org/repos/asf/james-project/blob/ddda1d72/server/container/guice/cassandra-guice/src/test/java/org/apache/james/JamesCapabilitiesServerTest.java
----------------------------------------------------------------------
diff --git a/server/container/guice/cassandra-guice/src/test/java/org/apache/james/JamesCapabilitiesServerTest.java
b/server/container/guice/cassandra-guice/src/test/java/org/apache/james/JamesCapabilitiesServerTest.java
index 4fc103f..69c20f3 100644
--- a/server/container/guice/cassandra-guice/src/test/java/org/apache/james/JamesCapabilitiesServerTest.java
+++ b/server/container/guice/cassandra-guice/src/test/java/org/apache/james/JamesCapabilitiesServerTest.java
@@ -65,7 +65,7 @@ public class JamesCapabilitiesServerTest {
         Module mockMailboxManager = (binder) -> binder.bind(MailboxManager.class).toInstance(mailboxManager);
         
         return new GuiceJamesServerImpl()
-            .combineWith(CassandraJamesServerMain.cassandraServerModule)
+            .combineWith(CassandraJamesServerMain.cassandraServerModule, CassandraJamesServerMain.protocols)
             .overrideWith((binder) -> binder.bind(PersistenceAdapter.class).to(MemoryPersistenceAdapter.class))
             .overrideWith(new TestElasticSearchModule(embeddedElasticSearch),
                 new TestFilesystemModule(temporaryFolder),

http://git-wip-us.apache.org/repos/asf/james-project/blob/ddda1d72/server/container/guice/cassandra-ldap-guice/src/main/java/org/apache/james/CassandraLdapJamesServerMain.java
----------------------------------------------------------------------
diff --git a/server/container/guice/cassandra-ldap-guice/src/main/java/org/apache/james/CassandraLdapJamesServerMain.java
b/server/container/guice/cassandra-ldap-guice/src/main/java/org/apache/james/CassandraLdapJamesServerMain.java
index 90e2c0d..f2fe651 100644
--- a/server/container/guice/cassandra-ldap-guice/src/main/java/org/apache/james/CassandraLdapJamesServerMain.java
+++ b/server/container/guice/cassandra-ldap-guice/src/main/java/org/apache/james/CassandraLdapJamesServerMain.java
@@ -27,7 +27,7 @@ import com.google.inject.util.Modules;
 
 public class CassandraLdapJamesServerMain {
 
-    public static final Module cassandraLdapServerModule = Modules.override(CassandraJamesServerMain.cassandraServerModule)
+    public static final Module cassandraLdapServerModule = Modules.override(CassandraJamesServerMain.cassandraServerModule,
CassandraJamesServerMain.protocols)
         .with(new LdapUsersRepositoryModule());
 
     public static void main(String[] args) throws Exception {

http://git-wip-us.apache.org/repos/asf/james-project/blob/ddda1d72/server/container/guice/guice-common/src/main/java/org/apache/james/GuiceJamesServerImpl.java
----------------------------------------------------------------------
diff --git a/server/container/guice/guice-common/src/main/java/org/apache/james/GuiceJamesServerImpl.java
b/server/container/guice/guice-common/src/main/java/org/apache/james/GuiceJamesServerImpl.java
index e33c72c..63d184d 100644
--- a/server/container/guice/guice-common/src/main/java/org/apache/james/GuiceJamesServerImpl.java
+++ b/server/container/guice/guice-common/src/main/java/org/apache/james/GuiceJamesServerImpl.java
@@ -24,7 +24,6 @@ import javax.annotation.PreDestroy;
 
 import org.apache.james.modules.CommonServicesModule;
 import org.apache.james.modules.MailetProcessingModule;
-import org.apache.james.modules.ProtocolsModule;
 import org.apache.james.onami.lifecycle.Stager;
 import org.apache.james.utils.ConfigurationsPerformer;
 import org.apache.james.utils.GuiceProbeProvider;
@@ -46,7 +45,6 @@ public class GuiceJamesServerImpl implements GuiceJamesServer {
     public GuiceJamesServerImpl() {
         this(Modules.combine(
                         new CommonServicesModule(),
-                        new ProtocolsModule(),
                         new MailetProcessingModule()));
     }
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/ddda1d72/server/container/guice/guice-common/src/main/java/org/apache/james/modules/ProtocolsModule.java
----------------------------------------------------------------------
diff --git a/server/container/guice/guice-common/src/main/java/org/apache/james/modules/ProtocolsModule.java
b/server/container/guice/guice-common/src/main/java/org/apache/james/modules/ProtocolsModule.java
deleted file mode 100644
index 2600d44..0000000
--- a/server/container/guice/guice-common/src/main/java/org/apache/james/modules/ProtocolsModule.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/****************************************************************
- * 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;
-
-import org.apache.james.modules.protocols.IMAPServerModule;
-import org.apache.james.modules.protocols.JSPFModule;
-import org.apache.james.modules.protocols.LMTPServerModule;
-import org.apache.james.modules.protocols.ManageSieveServerModule;
-import org.apache.james.modules.protocols.POP3ServerModule;
-import org.apache.james.modules.protocols.ProtocolHandlerModule;
-import org.apache.james.modules.protocols.SMTPServerModule;
-import org.apache.james.modules.server.WebAdminServerModule;
-
-import com.google.inject.AbstractModule;
-
-public class ProtocolsModule extends AbstractModule {
-
-    @Override
-    protected void configure() {
-        install(new JSPFModule());
-        install(new IMAPServerModule());
-        install(new ProtocolHandlerModule());
-        install(new POP3ServerModule());
-        install(new SMTPServerModule());
-        install(new LMTPServerModule());
-        install(new ManageSieveServerModule());
-        install(new WebAdminServerModule());
-    }
-    
-}

http://git-wip-us.apache.org/repos/asf/james-project/blob/ddda1d72/server/container/guice/jpa-guice/src/main/java/org/apache/james/JPAJamesServerMain.java
----------------------------------------------------------------------
diff --git a/server/container/guice/jpa-guice/src/main/java/org/apache/james/JPAJamesServerMain.java
b/server/container/guice/jpa-guice/src/main/java/org/apache/james/JPAJamesServerMain.java
index 19968a4..ac99765 100644
--- a/server/container/guice/jpa-guice/src/main/java/org/apache/james/JPAJamesServerMain.java
+++ b/server/container/guice/jpa-guice/src/main/java/org/apache/james/JPAJamesServerMain.java
@@ -23,16 +23,32 @@ import org.apache.james.modules.data.JPADataModule;
 import org.apache.james.modules.data.SieveFileRepositoryModule;
 import org.apache.james.modules.mailbox.JPAMailboxModule;
 import org.apache.james.modules.mailbox.LuceneSearchMailboxModule;
+import org.apache.james.modules.protocols.IMAPServerModule;
+import org.apache.james.modules.protocols.LMTPServerModule;
+import org.apache.james.modules.protocols.ManageSieveServerModule;
+import org.apache.james.modules.protocols.POP3ServerModule;
+import org.apache.james.modules.protocols.ProtocolHandlerModule;
+import org.apache.james.modules.protocols.SMTPServerModule;
 import org.apache.james.modules.server.ActiveMQQueueModule;
 import org.apache.james.modules.server.JMXServerModule;
 import org.apache.james.modules.server.QuotaModule;
 import org.apache.james.modules.server.RawPostDequeueDecoratorModule;
+import org.apache.james.modules.server.WebAdminServerModule;
 
 import com.google.inject.Module;
 import com.google.inject.util.Modules;
 
 public class JPAJamesServerMain {
 
+    private static final Module protocols = Modules.combine(
+            new IMAPServerModule(),
+            new ProtocolHandlerModule(),
+            new POP3ServerModule(),
+            new SMTPServerModule(),
+            new LMTPServerModule(),
+            new ManageSieveServerModule(),
+            new WebAdminServerModule());
+    
     public static final Module jpaServerModule = Modules.combine(
         new JPAMailboxModule(),
         new JPADataModule(),
@@ -43,7 +59,7 @@ public class JPAJamesServerMain {
 
     public static void main(String[] args) throws Exception {
         GuiceJamesServerImpl server = new GuiceJamesServerImpl()
-                    .combineWith(jpaServerModule, 
+                    .combineWith(jpaServerModule, protocols, 
                             new JMXServerModule(), 
                             new LuceneSearchMailboxModule());
         server.start();

http://git-wip-us.apache.org/repos/asf/james-project/blob/ddda1d72/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/cucumber/CassandraStepdefs.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/cucumber/CassandraStepdefs.java
b/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/cucumber/CassandraStepdefs.java
index 915f40c..abae9bd 100644
--- a/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/cucumber/CassandraStepdefs.java
+++ b/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/cucumber/CassandraStepdefs.java
@@ -60,7 +60,7 @@ public class CassandraStepdefs {
         embeddedElasticSearch.before();
         mainStepdefs.messageIdFactory = new CassandraMessageId.Factory();
         mainStepdefs.jmapServer = new JmapJamesServer()
-                .combineWith(CassandraJamesServerMain.cassandraServerModule)
+                .combineWith(CassandraJamesServerMain.cassandraServerModule, CassandraJamesServerMain.protocols)
                 .overrideWith(new CassandraJmapServerModule(temporaryFolder, embeddedElasticSearch,
cassandra))
                 .overrideWith((binder) -> binder.bind(PersistenceAdapter.class).to(MemoryPersistenceAdapter.class));
         mainStepdefs.awaitMethod = () -> embeddedElasticSearch.awaitForElasticSearch();


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