You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by ad...@apache.org on 2016/11/18 09:53:54 UTC

[01/29] james-project git commit: JAMES-1842 Remove MailetProcessingWithoutCamelModule

Repository: james-project
Updated Branches:
  refs/heads/master 73a7c4682 -> 56acfd067


JAMES-1842 Remove MailetProcessingWithoutCamelModule


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

Branch: refs/heads/master
Commit: df98b6e38d1e8dd3d61427382e96b60c4bee4793
Parents: f824e27
Author: Quynh Nguyen <qn...@linagora.com>
Authored: Thu Nov 10 14:48:25 2016 +0700
Committer: Quynh Nguyen <qn...@linagora.com>
Committed: Fri Nov 18 09:25:34 2016 +0700

----------------------------------------------------------------------
 .../MailetProcessingWithoutCamelModule.java     | 34 --------------------
 1 file changed, 34 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/df98b6e3/server/container/guice/guice-common/src/main/java/org/apache/james/modules/MailetProcessingWithoutCamelModule.java
----------------------------------------------------------------------
diff --git a/server/container/guice/guice-common/src/main/java/org/apache/james/modules/MailetProcessingWithoutCamelModule.java b/server/container/guice/guice-common/src/main/java/org/apache/james/modules/MailetProcessingWithoutCamelModule.java
deleted file mode 100644
index 78fbc98..0000000
--- a/server/container/guice/guice-common/src/main/java/org/apache/james/modules/MailetProcessingWithoutCamelModule.java
+++ /dev/null
@@ -1,34 +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.server.MailStoreRepositoryModule;
-import org.apache.james.modules.server.SieveModule;
-
-import com.google.inject.AbstractModule;
-
-public class MailetProcessingWithoutCamelModule extends AbstractModule {
-
-    @Override
-    protected void configure() {
-        install(new SieveModule());
-        install(new MailStoreRepositoryModule());
-    }
-    
-}


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


[23/29] james-project git commit: JAMES-1842: remove eclipse warnings

Posted by ad...@apache.org.
JAMES-1842: remove eclipse warnings


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

Branch: refs/heads/master
Commit: 95e11203398f889cdf5089b24e5459f9936fad28
Parents: 0aafb2d
Author: Quynh Nguyen <qn...@linagora.com>
Authored: Wed Nov 16 09:44:50 2016 +0700
Committer: Quynh Nguyen <qn...@linagora.com>
Committed: Fri Nov 18 09:33:08 2016 +0700

----------------------------------------------------------------------
 .../filesystem/api/AbstractFileSystemTest.java  |  1 -
 .../apache/james/utils/GuiceProbeProvider.java  |  2 +
 .../org/apache/james/utils/JmapGuiceProbe.java  |  8 +---
 .../james/AbstractJmapJamesServerTest.java      |  1 -
 .../james/utils/GuiceProbeProviderTest.java     |  3 +-
 .../mailbox/LuceneSearchMailboxModule.java      |  4 --
 .../james/modules/data/MemoryDataModule.java    |  2 -
 .../james/mailets/TemporaryJamesServer.java     |  1 -
 .../CassandraVacationIntegrationTest.java       |  1 -
 .../cassandra/cucumber/CassandraStepdefs.java   |  4 +-
 .../james/jmap/JMAPAuthenticationTest.java      |  1 -
 .../integration/GetMailboxesMethodTest.java     | 39 ++++++++++----------
 .../integration/GetMessageListMethodTest.java   |  1 -
 .../integration/SetMailboxesMethodTest.java     |  1 -
 .../integration/SetMessagesMethodTest.java      |  1 -
 .../integration/cucumber/DownloadStepdefs.java  | 11 ++++--
 .../cucumber/GetMessagesMethodStepdefs.java     | 11 ++++--
 .../integration/cucumber/MainStepdefs.java      |  2 +-
 .../cucumber/SetMailboxesMethodStepdefs.java    | 11 ++++--
 .../integration/cucumber/UploadStepdefs.java    | 15 +++++---
 .../integration/cucumber/UserStepdefs.java      |  9 +++--
 .../jmap/memory/cucumber/MemoryStepdefs.java    |  4 +-
 22 files changed, 66 insertions(+), 67 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/95e11203/server/container/filesystem-api/src/test/java/org/apache/james/filesystem/api/AbstractFileSystemTest.java
----------------------------------------------------------------------
diff --git a/server/container/filesystem-api/src/test/java/org/apache/james/filesystem/api/AbstractFileSystemTest.java b/server/container/filesystem-api/src/test/java/org/apache/james/filesystem/api/AbstractFileSystemTest.java
index df43491..c0f58bf 100644
--- a/server/container/filesystem-api/src/test/java/org/apache/james/filesystem/api/AbstractFileSystemTest.java
+++ b/server/container/filesystem-api/src/test/java/org/apache/james/filesystem/api/AbstractFileSystemTest.java
@@ -44,7 +44,6 @@ import com.sun.net.httpserver.HttpServer;
 import junitparams.JUnitParamsRunner;
 import junitparams.Parameters;
 
-@SuppressWarnings("restriction")
 @RunWith(JUnitParamsRunner.class)
 public abstract class AbstractFileSystemTest {
     private static final String FAKE_DIRECTORY = "b7b73e3a-5234-11e5-87f2-9b171f273b49/";

http://git-wip-us.apache.org/repos/asf/james-project/blob/95e11203/server/container/guice/guice-common/src/main/java/org/apache/james/utils/GuiceProbeProvider.java
----------------------------------------------------------------------
diff --git a/server/container/guice/guice-common/src/main/java/org/apache/james/utils/GuiceProbeProvider.java b/server/container/guice/guice-common/src/main/java/org/apache/james/utils/GuiceProbeProvider.java
index 7b98b6f..237c537 100644
--- a/server/container/guice/guice-common/src/main/java/org/apache/james/utils/GuiceProbeProvider.java
+++ b/server/container/guice/guice-common/src/main/java/org/apache/james/utils/GuiceProbeProvider.java
@@ -30,12 +30,14 @@ import java.util.Set;
 public class GuiceProbeProvider {
     private final Map<Class<GuiceProbe>, GuiceProbe> registry;
 
+    @SuppressWarnings("unchecked")
     @Inject
     public GuiceProbeProvider(Set<GuiceProbe> guiceProbes) {
         this.registry = guiceProbes.stream()
             .collect(Guavate.toImmutableMap(guiceProbe -> (Class<GuiceProbe>) guiceProbe.getClass()));
     }
 
+    @SuppressWarnings("unchecked")
     public <T extends GuiceProbe> T getProbe(Class<T> clazz) {
         Preconditions.checkNotNull(clazz);
         return Optional.ofNullable(registry.get(clazz))

http://git-wip-us.apache.org/repos/asf/james-project/blob/95e11203/server/container/guice/guice-common/src/main/java/org/apache/james/utils/JmapGuiceProbe.java
----------------------------------------------------------------------
diff --git a/server/container/guice/guice-common/src/main/java/org/apache/james/utils/JmapGuiceProbe.java b/server/container/guice/guice-common/src/main/java/org/apache/james/utils/JmapGuiceProbe.java
index 9d881e0..cfbbbb6 100644
--- a/server/container/guice/guice-common/src/main/java/org/apache/james/utils/JmapGuiceProbe.java
+++ b/server/container/guice/guice-common/src/main/java/org/apache/james/utils/JmapGuiceProbe.java
@@ -19,20 +19,16 @@
 
 package org.apache.james.utils;
 
+import javax.inject.Inject;
+
 import org.apache.james.jmap.JMAPServer;
 import org.apache.james.jmap.api.vacation.AccountId;
 import org.apache.james.jmap.api.vacation.Vacation;
 import org.apache.james.jmap.api.vacation.VacationPatch;
 import org.apache.james.jmap.api.vacation.VacationRepository;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.inject.Inject;
 
 public class JmapGuiceProbe implements GuiceProbe {
 
-    private static final Logger LOGGER = LoggerFactory.getLogger(JmapGuiceProbe.class);
-
     private final VacationRepository vacationRepository;
     private final JMAPServer jmapServer;
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/95e11203/server/container/guice/guice-common/src/test/java/org/apache/james/AbstractJmapJamesServerTest.java
----------------------------------------------------------------------
diff --git a/server/container/guice/guice-common/src/test/java/org/apache/james/AbstractJmapJamesServerTest.java b/server/container/guice/guice-common/src/test/java/org/apache/james/AbstractJmapJamesServerTest.java
index 4de3ba6..c67eac8 100644
--- a/server/container/guice/guice-common/src/test/java/org/apache/james/AbstractJmapJamesServerTest.java
+++ b/server/container/guice/guice-common/src/test/java/org/apache/james/AbstractJmapJamesServerTest.java
@@ -30,7 +30,6 @@ import java.nio.ByteBuffer;
 import java.nio.channels.SocketChannel;
 import java.nio.charset.Charset;
 
-import org.apache.james.utils.JmapGuiceProbe;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;

http://git-wip-us.apache.org/repos/asf/james-project/blob/95e11203/server/container/guice/guice-common/src/test/java/org/apache/james/utils/GuiceProbeProviderTest.java
----------------------------------------------------------------------
diff --git a/server/container/guice/guice-common/src/test/java/org/apache/james/utils/GuiceProbeProviderTest.java b/server/container/guice/guice-common/src/test/java/org/apache/james/utils/GuiceProbeProviderTest.java
index f4f73ec..6a54a53 100644
--- a/server/container/guice/guice-common/src/test/java/org/apache/james/utils/GuiceProbeProviderTest.java
+++ b/server/container/guice/guice-common/src/test/java/org/apache/james/utils/GuiceProbeProviderTest.java
@@ -19,13 +19,12 @@
 package org.apache.james.utils;
 import static  org.assertj.core.api.Assertions.assertThat;
 
-import com.google.common.collect.ImmutableSet;
 import org.junit.Before;
 import org.junit.Rule;
 import org.junit.Test;
 import org.junit.rules.ExpectedException;
 
-import static org.junit.Assert.*;
+import com.google.common.collect.ImmutableSet;
 
 public class GuiceProbeProviderTest {
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/95e11203/server/container/guice/jpa-guice/src/main/java/org/apache/james/modules/mailbox/LuceneSearchMailboxModule.java
----------------------------------------------------------------------
diff --git a/server/container/guice/jpa-guice/src/main/java/org/apache/james/modules/mailbox/LuceneSearchMailboxModule.java b/server/container/guice/jpa-guice/src/main/java/org/apache/james/modules/mailbox/LuceneSearchMailboxModule.java
index 53cbc01..55996fd 100644
--- a/server/container/guice/jpa-guice/src/main/java/org/apache/james/modules/mailbox/LuceneSearchMailboxModule.java
+++ b/server/container/guice/jpa-guice/src/main/java/org/apache/james/modules/mailbox/LuceneSearchMailboxModule.java
@@ -19,13 +19,9 @@
 
 package org.apache.james.modules.mailbox;
 
-import java.io.File;
 import java.io.IOException;
 
-import org.apache.james.core.JamesServerResourceLoader;
-import org.apache.james.core.filesystem.FileSystemImpl;
 import org.apache.james.filesystem.api.FileSystem;
-import org.apache.james.filesystem.api.JamesDirectoriesProvider;
 import org.apache.james.mailbox.lucene.search.LuceneMessageSearchIndex;
 import org.apache.james.mailbox.store.search.ListeningMessageSearchIndex;
 import org.apache.james.mailbox.store.search.MessageSearchIndex;

http://git-wip-us.apache.org/repos/asf/james-project/blob/95e11203/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 b809df8..e7799e5 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
@@ -27,8 +27,6 @@ import org.apache.james.domainlist.memory.MemoryDomainList;
 import org.apache.james.lifecycle.api.Configurable;
 import org.apache.james.rrt.api.RecipientRewriteTable;
 import org.apache.james.rrt.memory.MemoryRecipientRewriteTable;
-import org.apache.james.sieverepository.api.SieveRepository;
-import org.apache.james.sieverepository.file.SieveFileRepository;
 import org.apache.james.user.api.UsersRepository;
 import org.apache.james.user.memory.MemoryUsersRepository;
 import org.apache.james.utils.ConfigurationPerformer;

http://git-wip-us.apache.org/repos/asf/james-project/blob/95e11203/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/TemporaryJamesServer.java
----------------------------------------------------------------------
diff --git a/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/TemporaryJamesServer.java b/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/TemporaryJamesServer.java
index a23d552..4b9ba55 100644
--- a/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/TemporaryJamesServer.java
+++ b/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/TemporaryJamesServer.java
@@ -28,7 +28,6 @@ import java.util.Arrays;
 
 import org.apache.commons.configuration.ConfigurationException;
 import org.apache.commons.io.IOUtils;
-import org.apache.james.GuiceJamesServer;
 import org.apache.james.MemoryJamesServer;
 import org.apache.james.MemoryJamesServerMain;
 import org.apache.james.mailets.configuration.MailetContainer;

http://git-wip-us.apache.org/repos/asf/james-project/blob/95e11203/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraVacationIntegrationTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraVacationIntegrationTest.java b/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraVacationIntegrationTest.java
index 5792447..cec5976 100644
--- a/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraVacationIntegrationTest.java
+++ b/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraVacationIntegrationTest.java
@@ -21,7 +21,6 @@ package org.apache.james.jmap.cassandra;
 
 import org.apache.james.CassandraJamesServer;
 import org.apache.james.CassandraJamesServerMain;
-import org.apache.james.GuiceJamesServer;
 import org.apache.james.backends.cassandra.EmbeddedCassandra;
 import org.apache.james.jmap.VacationIntegrationTest;
 import org.apache.james.mailbox.elasticsearch.EmbeddedElasticSearch;

http://git-wip-us.apache.org/repos/asf/james-project/blob/95e11203/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 39f4b65..2e3ea82 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
@@ -40,13 +40,13 @@ import cucumber.runtime.java.guice.ScenarioScoped;
 @ScenarioScoped
 public class CassandraStepdefs {
 
-    private final MainStepdefs mainStepdefs;
+    private final MainStepdefs<CassandraJamesServer> mainStepdefs;
     private TemporaryFolder temporaryFolder = new TemporaryFolder();
     private EmbeddedElasticSearch embeddedElasticSearch = new EmbeddedElasticSearch(temporaryFolder);
     private EmbeddedCassandra cassandra = EmbeddedCassandra.createStartServer();
 
     @Inject
-    private CassandraStepdefs(MainStepdefs mainStepdefs) {
+    private CassandraStepdefs(MainStepdefs<CassandraJamesServer> mainStepdefs) {
         this.mainStepdefs = mainStepdefs;
     }
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/95e11203/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/JMAPAuthenticationTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/JMAPAuthenticationTest.java b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/JMAPAuthenticationTest.java
index 1fa5c87..428a20f 100644
--- a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/JMAPAuthenticationTest.java
+++ b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/JMAPAuthenticationTest.java
@@ -36,7 +36,6 @@ import org.apache.james.GuiceJamesServer;
 import org.apache.james.JmapServer;
 import org.apache.james.WebAdminServer;
 import org.apache.james.jmap.model.ContinuationToken;
-import org.apache.james.utils.JmapGuiceProbe;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;

http://git-wip-us.apache.org/repos/asf/james-project/blob/95e11203/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetMailboxesMethodTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetMailboxesMethodTest.java b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetMailboxesMethodTest.java
index e1f7622..3d99136 100644
--- a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetMailboxesMethodTest.java
+++ b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetMailboxesMethodTest.java
@@ -19,10 +19,22 @@
 
 package org.apache.james.jmap.methods.integration;
 
-import com.google.common.base.Charsets;
-import com.jayway.restassured.RestAssured;
-import com.jayway.restassured.builder.RequestSpecBuilder;
-import com.jayway.restassured.http.ContentType;
+import static com.jayway.restassured.RestAssured.given;
+import static com.jayway.restassured.config.EncoderConfig.encoderConfig;
+import static com.jayway.restassured.config.RestAssuredConfig.newConfig;
+import static org.hamcrest.Matchers.empty;
+import static org.hamcrest.Matchers.equalTo;
+import static org.hamcrest.Matchers.hasItems;
+import static org.hamcrest.Matchers.hasSize;
+import static org.hamcrest.Matchers.isEmptyOrNullString;
+import static org.hamcrest.Matchers.not;
+import static org.hamcrest.Matchers.nullValue;
+
+import java.io.ByteArrayInputStream;
+import java.util.Date;
+
+import javax.mail.Flags;
+
 import org.apache.james.GuiceJamesServer;
 import org.apache.james.JmapServer;
 import org.apache.james.WebAdminServer;
@@ -31,25 +43,14 @@ import org.apache.james.jmap.api.access.AccessToken;
 import org.apache.james.mailbox.model.MailboxConstants;
 import org.apache.james.mailbox.model.MailboxPath;
 import org.apache.james.mailbox.store.mail.model.Mailbox;
-import org.apache.james.utils.JmapGuiceProbe;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 
-import javax.mail.Flags;
-import java.io.ByteArrayInputStream;
-import java.util.Date;
-
-import static com.jayway.restassured.RestAssured.given;
-import static com.jayway.restassured.config.EncoderConfig.encoderConfig;
-import static com.jayway.restassured.config.RestAssuredConfig.newConfig;
-import static org.hamcrest.Matchers.empty;
-import static org.hamcrest.Matchers.equalTo;
-import static org.hamcrest.Matchers.hasItems;
-import static org.hamcrest.Matchers.hasSize;
-import static org.hamcrest.Matchers.isEmptyOrNullString;
-import static org.hamcrest.Matchers.not;
-import static org.hamcrest.Matchers.nullValue;
+import com.google.common.base.Charsets;
+import com.jayway.restassured.RestAssured;
+import com.jayway.restassured.builder.RequestSpecBuilder;
+import com.jayway.restassured.http.ContentType;
 
 public abstract class GetMailboxesMethodTest<T extends GuiceJamesServer & JmapServer & WebAdminServer> {
     private static final String NAME = "[0][0]";

http://git-wip-us.apache.org/repos/asf/james-project/blob/95e11203/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetMessageListMethodTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetMessageListMethodTest.java b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetMessageListMethodTest.java
index cbb6df7..5d08da4 100644
--- a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetMessageListMethodTest.java
+++ b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetMessageListMethodTest.java
@@ -44,7 +44,6 @@ import org.apache.james.jmap.api.access.AccessToken;
 import org.apache.james.mailbox.model.MailboxConstants;
 import org.apache.james.mailbox.model.MailboxId;
 import org.apache.james.mailbox.model.MailboxPath;
-import org.apache.james.utils.JmapGuiceProbe;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Ignore;

http://git-wip-us.apache.org/repos/asf/james-project/blob/95e11203/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/SetMailboxesMethodTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/SetMailboxesMethodTest.java b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/SetMailboxesMethodTest.java
index 8b69679..8087bd5 100644
--- a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/SetMailboxesMethodTest.java
+++ b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/SetMailboxesMethodTest.java
@@ -44,7 +44,6 @@ import org.apache.james.jmap.api.access.AccessToken;
 import org.apache.james.mailbox.model.MailboxConstants;
 import org.apache.james.mailbox.model.MailboxId;
 import org.apache.james.mailbox.store.mail.model.Mailbox;
-import org.apache.james.utils.JmapGuiceProbe;
 import org.hamcrest.Matchers;
 import org.junit.After;
 import org.junit.Before;

http://git-wip-us.apache.org/repos/asf/james-project/blob/95e11203/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/SetMessagesMethodTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/SetMessagesMethodTest.java b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/SetMessagesMethodTest.java
index c45a35b..dd5b580 100644
--- a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/SetMessagesMethodTest.java
+++ b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/SetMessagesMethodTest.java
@@ -61,7 +61,6 @@ import org.apache.james.mailbox.model.MailboxConstants;
 import org.apache.james.mailbox.model.MailboxPath;
 import org.apache.james.mailbox.store.mail.model.Mailbox;
 import org.apache.james.util.ZeroedInputStream;
-import org.apache.james.utils.JmapGuiceProbe;
 import org.hamcrest.Matcher;
 import org.hamcrest.Matchers;
 import org.junit.After;

http://git-wip-us.apache.org/repos/asf/james-project/blob/95e11203/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/DownloadStepdefs.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/DownloadStepdefs.java b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/DownloadStepdefs.java
index d000bb3..03537ce 100644
--- a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/DownloadStepdefs.java
+++ b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/DownloadStepdefs.java
@@ -37,6 +37,9 @@ import org.apache.http.HttpResponse;
 import org.apache.http.client.fluent.Request;
 import org.apache.http.client.fluent.Response;
 import org.apache.http.client.utils.URIBuilder;
+import org.apache.james.GuiceJamesServer;
+import org.apache.james.JmapServer;
+import org.apache.james.WebAdminServer;
 import org.apache.james.jmap.api.access.AccessToken;
 import org.apache.james.jmap.model.AttachmentAccessToken;
 import org.apache.james.mailbox.model.MailboxConstants;
@@ -56,7 +59,7 @@ import cucumber.api.java.en.When;
 import cucumber.runtime.java.guice.ScenarioScoped;
 
 @ScenarioScoped
-public class DownloadStepdefs {
+public class DownloadStepdefs <T extends GuiceJamesServer & JmapServer & WebAdminServer> {
 
     private static final String ONE_ATTACHMENT_EML_ATTACHEMENT_BLOB_ID = "4000c5145f633410b80be368c44e1c394bff9437";
     private static final String EXPIRED_ATTACHMENT_TOKEN = "usera@domain.tld_"
@@ -67,15 +70,15 @@ public class DownloadStepdefs {
             + "DiZa0O14MjLWrAA8P6MG35Gt5CBp7mt5U1EH/M++rIoZK7nlGJ4dPW0dvZD7h4m3o5b/Yd8DXU5x2x4+s0HOOKzD7X0RMlsU7JHJMNLvTvRGWF/C+MUyC8Zce7DtnRVPEQX2uAZhL2PBABV07Vpa8kH+NxoS9CL955Bc1Obr4G+KN2JorADlocFQA6ElXryF5YS/HPZSvq1MTC6aJIP0ku8WRpRnbwgwJnn26YpcHXcJjbkCBtd9/BhlMV6xNd2hTBkfZmYdoNo+UKBaXWzLxAlbLuxjpxwvDNJfOEyWFPgHDoRvzP+G7KzhVWjanHAHrhF0GilEa/MKpOI1qHBSwA==";
     private static final String UTF8_CONTENT_DIPOSITION_START = "Content-Disposition: attachment; filename*=\"";
 
-    private final UserStepdefs userStepdefs;
-    private final MainStepdefs mainStepdefs;
+    private final UserStepdefs<T> userStepdefs;
+    private final MainStepdefs<T> mainStepdefs;
     private HttpResponse response;
     private Multimap<String, String> attachmentsByMessageId;
     private Map<String, String> blobIdByAttachmentId;
     private Map<AttachmentAccessTokenKey, AttachmentAccessToken> attachmentAccessTokens;
 
     @Inject
-    private DownloadStepdefs(MainStepdefs mainStepdefs, UserStepdefs userStepdefs) {
+    private DownloadStepdefs(MainStepdefs<T> mainStepdefs, UserStepdefs<T> userStepdefs) {
         this.mainStepdefs = mainStepdefs;
         this.userStepdefs = userStepdefs;
         this.attachmentsByMessageId = ArrayListMultimap.create();

http://git-wip-us.apache.org/repos/asf/james-project/blob/95e11203/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/GetMessagesMethodStepdefs.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/GetMessagesMethodStepdefs.java b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/GetMessagesMethodStepdefs.java
index 5bbc254..78aec0c 100644
--- a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/GetMessagesMethodStepdefs.java
+++ b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/GetMessagesMethodStepdefs.java
@@ -38,6 +38,9 @@ import javax.mail.Flags;
 import org.apache.commons.lang3.StringEscapeUtils;
 import org.apache.http.HttpResponse;
 import org.apache.http.client.fluent.Request;
+import org.apache.james.GuiceJamesServer;
+import org.apache.james.JmapServer;
+import org.apache.james.WebAdminServer;
 import org.apache.james.jmap.methods.integration.cucumber.util.TableRow;
 import org.apache.james.mailbox.model.MailboxConstants;
 import org.apache.james.mailbox.model.MailboxPath;
@@ -57,7 +60,7 @@ import cucumber.api.java.en.When;
 import cucumber.runtime.java.guice.ScenarioScoped;
 
 @ScenarioScoped
-public class GetMessagesMethodStepdefs {
+public class GetMessagesMethodStepdefs <T extends GuiceJamesServer & JmapServer & WebAdminServer> {
 
     private static final Optional<Map<String, String>> NO_HEADERS = Optional.empty();
     private static final String NAME = "[0][0]";
@@ -68,14 +71,14 @@ public class GetMessagesMethodStepdefs {
     private static final String SECOND_ATTACHMENT = ATTACHMENTS + "[1]";
 
 
-    private final MainStepdefs mainStepdefs;
-    private final UserStepdefs userStepdefs;
+    private final MainStepdefs<T> mainStepdefs;
+    private final UserStepdefs<T> userStepdefs;
 
     private HttpResponse response;
     private DocumentContext jsonPath;
 
     @Inject
-    private GetMessagesMethodStepdefs(MainStepdefs mainStepdefs, UserStepdefs userStepdefs) {
+    private GetMessagesMethodStepdefs(MainStepdefs<T> mainStepdefs, UserStepdefs<T> userStepdefs) {
         this.mainStepdefs = mainStepdefs;
         this.userStepdefs = userStepdefs;
     }

http://git-wip-us.apache.org/repos/asf/james-project/blob/95e11203/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/MainStepdefs.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/MainStepdefs.java b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/MainStepdefs.java
index 525b563..e8f48f4 100644
--- a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/MainStepdefs.java
+++ b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/MainStepdefs.java
@@ -23,9 +23,9 @@ import org.apache.http.client.utils.URIBuilder;
 import org.apache.james.GuiceJamesServer;
 import org.apache.james.JmapServer;
 import org.apache.james.WebAdminServer;
-import org.apache.james.utils.JmapGuiceProbe;
 
 import com.google.common.base.Charsets;
+
 import cucumber.runtime.java.guice.ScenarioScoped;
 
 @ScenarioScoped

http://git-wip-us.apache.org/repos/asf/james-project/blob/95e11203/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/SetMailboxesMethodStepdefs.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/SetMailboxesMethodStepdefs.java b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/SetMailboxesMethodStepdefs.java
index b2fed83..69b79eb 100644
--- a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/SetMailboxesMethodStepdefs.java
+++ b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/SetMailboxesMethodStepdefs.java
@@ -32,6 +32,9 @@ import javax.mail.Flags;
 import org.apache.http.HttpResponse;
 import org.apache.http.client.fluent.Request;
 import org.apache.http.entity.ContentType;
+import org.apache.james.GuiceJamesServer;
+import org.apache.james.JmapServer;
+import org.apache.james.WebAdminServer;
 import org.apache.james.mailbox.exception.MailboxException;
 import org.apache.james.mailbox.model.MailboxConstants;
 import org.apache.james.mailbox.model.MailboxPath;
@@ -47,16 +50,16 @@ import cucumber.api.java.en.When;
 import cucumber.runtime.java.guice.ScenarioScoped;
 
 @ScenarioScoped
-public class SetMailboxesMethodStepdefs {
+public class SetMailboxesMethodStepdefs <T extends GuiceJamesServer & JmapServer & WebAdminServer> {
 
     private static final String NAME = "[0][0]";
     private static final String ARGUMENTS = "[0][1]";
 
-    private final MainStepdefs mainStepdefs;
-    private final UserStepdefs userStepdefs;
+    private final MainStepdefs<T> mainStepdefs;
+    private final UserStepdefs<T> userStepdefs;
 
     @Inject
-    private SetMailboxesMethodStepdefs(MainStepdefs mainStepdefs, UserStepdefs userStepdefs) {
+    private SetMailboxesMethodStepdefs(MainStepdefs<T> mainStepdefs, UserStepdefs<T> userStepdefs) {
         this.mainStepdefs = mainStepdefs;
         this.userStepdefs = userStepdefs;
     }

http://git-wip-us.apache.org/repos/asf/james-project/blob/95e11203/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/UploadStepdefs.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/UploadStepdefs.java b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/UploadStepdefs.java
index d05e90d..0337e6d 100644
--- a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/UploadStepdefs.java
+++ b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/UploadStepdefs.java
@@ -19,6 +19,8 @@
 
 package org.apache.james.jmap.methods.integration.cucumber;
 
+import static org.assertj.core.api.Assertions.assertThat;
+
 import java.io.BufferedInputStream;
 import java.net.URI;
 import java.net.URISyntaxException;
@@ -30,6 +32,9 @@ import org.apache.http.HttpResponse;
 import org.apache.http.client.fluent.Executor;
 import org.apache.http.client.fluent.Request;
 import org.apache.http.impl.client.HttpClientBuilder;
+import org.apache.james.GuiceJamesServer;
+import org.apache.james.JmapServer;
+import org.apache.james.WebAdminServer;
 import org.apache.james.jmap.api.access.AccessToken;
 import org.apache.james.util.ZeroedInputStream;
 
@@ -37,25 +42,23 @@ import com.google.common.base.Charsets;
 import com.jayway.jsonpath.DocumentContext;
 import com.jayway.jsonpath.JsonPath;
 
-import static org.assertj.core.api.Assertions.assertThat;
-
 import cucumber.api.java.en.Then;
 import cucumber.api.java.en.When;
 import cucumber.runtime.java.guice.ScenarioScoped;
 
 @ScenarioScoped
-public class UploadStepdefs {
+public class UploadStepdefs <T extends GuiceJamesServer & JmapServer & WebAdminServer> {
     private static final String _1M_ZEROED_FILE_BLOB_ID = "3b71f43ff30f4b15b5cd85dd9e95ebc7e84eb5a3";
     private static final int _1M = 1024 * 1024;
     private static final int _10M = 10 * _1M;
 
-    private final UserStepdefs userStepdefs;
-    private final MainStepdefs mainStepdefs;
+    private final UserStepdefs<T> userStepdefs;
+    private final MainStepdefs<T> mainStepdefs;
     private final URI uploadUri;
     private HttpResponse response;
 
     @Inject
-    private UploadStepdefs(UserStepdefs userStepdefs, MainStepdefs mainStepdefs) throws URISyntaxException {
+    private UploadStepdefs(UserStepdefs<T> userStepdefs, MainStepdefs<T> mainStepdefs) throws URISyntaxException {
         this.userStepdefs = userStepdefs;
         this.mainStepdefs = mainStepdefs;
         uploadUri = mainStepdefs.baseUri().setPath("/upload").build();

http://git-wip-us.apache.org/repos/asf/james-project/blob/95e11203/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/UserStepdefs.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/UserStepdefs.java b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/UserStepdefs.java
index c805105..011f4a5 100644
--- a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/UserStepdefs.java
+++ b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/UserStepdefs.java
@@ -27,6 +27,9 @@ import java.util.Set;
 
 import javax.inject.Inject;
 
+import org.apache.james.GuiceJamesServer;
+import org.apache.james.JmapServer;
+import org.apache.james.WebAdminServer;
 import org.apache.james.jmap.HttpJmapAuthentication;
 import org.apache.james.jmap.api.access.AccessToken;
 import org.apache.james.mailbox.model.MailboxConstants;
@@ -41,9 +44,9 @@ import cucumber.api.java.en.Given;
 import cucumber.runtime.java.guice.ScenarioScoped;
 
 @ScenarioScoped
-public class UserStepdefs {
+public class UserStepdefs <T extends GuiceJamesServer & JmapServer & WebAdminServer>{
 
-    private final MainStepdefs mainStepdefs;
+    private final MainStepdefs<T> mainStepdefs;
     
     protected Map<String, String> passwordByUser;
     protected Set<String> domains;
@@ -51,7 +54,7 @@ public class UserStepdefs {
     protected String lastConnectedUser;
     
     @Inject
-    private UserStepdefs(MainStepdefs mainStepdefs) {
+    private UserStepdefs(MainStepdefs<T> mainStepdefs) {
         this.mainStepdefs = mainStepdefs;
         this.domains = new HashSet<>();
         this.passwordByUser = new HashMap<>();

http://git-wip-us.apache.org/repos/asf/james-project/blob/95e11203/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/cucumber/MemoryStepdefs.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/cucumber/MemoryStepdefs.java b/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/cucumber/MemoryStepdefs.java
index fc36fc7..da4c95e 100644
--- a/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/cucumber/MemoryStepdefs.java
+++ b/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/cucumber/MemoryStepdefs.java
@@ -34,11 +34,11 @@ import cucumber.runtime.java.guice.ScenarioScoped;
 @ScenarioScoped
 public class MemoryStepdefs {
 
-    private final MainStepdefs mainStepdefs;
+    private final MainStepdefs<MemoryJamesServer> mainStepdefs;
     private final TemporaryFolder temporaryFolder;
 
     @Inject
-    private MemoryStepdefs(MainStepdefs mainStepdefs) {
+    private MemoryStepdefs(MainStepdefs<MemoryJamesServer> mainStepdefs) {
         this.mainStepdefs = mainStepdefs;
         this.temporaryFolder = new TemporaryFolder();
     }


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


[25/29] james-project git commit: JAMES-1842: Rename GuiceJamesServer to GuiceJamesServerImpl

Posted by ad...@apache.org.
JAMES-1842: Rename GuiceJamesServer to GuiceJamesServerImpl


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

Branch: refs/heads/master
Commit: 932f16c3a70f81b887fb26022084c8eddaee0815
Parents: 95e1120
Author: Antoine Duprat <ad...@apache.org>
Authored: Wed Nov 16 09:58:02 2016 +0100
Committer: Quynh Nguyen <qn...@linagora.com>
Committed: Fri Nov 18 09:33:20 2016 +0700

----------------------------------------------------------------------
 .../smtp/host/CassandraJamesSmtpHostSystem.java |  8 +-
 .../org/apache/james/CassandraJamesServer.java  |  2 +-
 .../apache/james/CassandraJamesServerMain.java  |  2 +-
 .../james/JamesCapabilitiesServerTest.java      |  6 +-
 .../java/org/apache/james/GuiceJamesServer.java | 85 --------------------
 .../org/apache/james/GuiceJamesServerImpl.java  | 85 ++++++++++++++++++++
 .../apache/james/AbstractJamesServerTest.java   |  4 +-
 .../james/AbstractJmapJamesServerTest.java      |  2 +-
 .../org/apache/james/MemoryJamesServer.java     |  2 +-
 .../james/jmap/JMAPAuthenticationTest.java      |  4 +-
 .../james/jmap/VacationIntegrationTest.java     |  4 +-
 .../integration/GetMailboxesMethodTest.java     |  4 +-
 .../integration/GetMessageListMethodTest.java   |  4 +-
 .../integration/GetVacationResponseTest.java    |  4 +-
 .../integration/SetMailboxesMethodTest.java     |  4 +-
 .../integration/SetMessagesMethodTest.java      |  4 +-
 .../integration/SetVacationResponseTest.java    |  4 +-
 .../integration/cucumber/DownloadStepdefs.java  |  4 +-
 .../cucumber/GetMessagesMethodStepdefs.java     |  4 +-
 .../integration/cucumber/MainStepdefs.java      |  4 +-
 .../cucumber/SetMailboxesMethodStepdefs.java    |  4 +-
 .../integration/cucumber/UploadStepdefs.java    |  4 +-
 .../integration/cucumber/UserStepdefs.java      |  4 +-
 23 files changed, 126 insertions(+), 126 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/932f16c3/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 4949765..bc8f678 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
@@ -22,7 +22,7 @@ package org.apache.james.mpt.smtp.host;
 import java.util.Iterator;
 
 import org.apache.james.CassandraJamesServerMain;
-import org.apache.james.GuiceJamesServer;
+import org.apache.james.GuiceJamesServerImpl;
 import org.apache.james.backends.cassandra.EmbeddedCassandra;
 import org.apache.james.dnsservice.api.DNSService;
 import org.apache.james.mailbox.elasticsearch.EmbeddedElasticSearch;
@@ -42,7 +42,7 @@ public class CassandraJamesSmtpHostSystem extends ExternalSessionFactory impleme
     private EmbeddedCassandra embeddedCassandra;
     private EmbeddedElasticSearch embeddedElasticSearch;
 
-    private GuiceJamesServer jamesServer;
+    private GuiceJamesServerImpl jamesServer;
     private InMemoryDNSService inMemoryDNSService;
 
 
@@ -104,8 +104,8 @@ public class CassandraJamesSmtpHostSystem extends ExternalSessionFactory impleme
         return inMemoryDNSService;
     }
 
-    protected GuiceJamesServer createJamesServer() {
-        return new GuiceJamesServer()
+    protected GuiceJamesServerImpl createJamesServer() {
+        return new GuiceJamesServerImpl()
             .combineWith(CassandraJamesServerMain.cassandraServerModule)
             .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/932f16c3/server/container/guice/cassandra-guice/src/main/java/org/apache/james/CassandraJamesServer.java
----------------------------------------------------------------------
diff --git a/server/container/guice/cassandra-guice/src/main/java/org/apache/james/CassandraJamesServer.java b/server/container/guice/cassandra-guice/src/main/java/org/apache/james/CassandraJamesServer.java
index f1ef305..e4375d4 100644
--- a/server/container/guice/cassandra-guice/src/main/java/org/apache/james/CassandraJamesServer.java
+++ b/server/container/guice/cassandra-guice/src/main/java/org/apache/james/CassandraJamesServer.java
@@ -27,7 +27,7 @@ import com.google.common.collect.Iterables;
 import com.google.inject.Module;
 import com.google.inject.util.Modules;
 
-public class CassandraJamesServer extends GuiceJamesServer implements JmapServer, WebAdminServer {
+public class CassandraJamesServer extends GuiceJamesServerImpl implements JmapServer, WebAdminServer {
 
     public CassandraJamesServer() {
         super();

http://git-wip-us.apache.org/repos/asf/james-project/blob/932f16c3/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 87f4a07..c269263 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
@@ -52,7 +52,7 @@ public class CassandraJamesServerMain {
 
 
     public static void main(String[] args) throws Exception {
-        GuiceJamesServer server = new GuiceJamesServer()
+        GuiceJamesServerImpl server = new GuiceJamesServerImpl()
                     .combineWith(cassandraServerModule, new JMXServerModule());
         server.start();
     }

http://git-wip-us.apache.org/repos/asf/james-project/blob/932f16c3/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 e866369..0aef8ad 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
@@ -46,7 +46,7 @@ import com.google.inject.Singleton;
 
 public class JamesCapabilitiesServerTest {
 
-    private GuiceJamesServer server;
+    private GuiceJamesServerImpl server;
     private TemporaryFolder temporaryFolder = new TemporaryFolder();
     private EmbeddedElasticSearch embeddedElasticSearch = new EmbeddedElasticSearch(temporaryFolder);
 
@@ -58,10 +58,10 @@ public class JamesCapabilitiesServerTest {
         server.stop();
     }
     
-    private GuiceJamesServer createCassandraJamesServer(final MailboxManager mailboxManager) {
+    private GuiceJamesServerImpl createCassandraJamesServer(final MailboxManager mailboxManager) {
         Module mockMailboxManager = (binder) -> binder.bind(MailboxManager.class).toInstance(mailboxManager);
         
-        return new GuiceJamesServer()
+        return new GuiceJamesServerImpl()
             .combineWith(CassandraJamesServerMain.cassandraServerModule)
             .overrideWith(new TestElasticSearchModule(embeddedElasticSearch),
                 new TestFilesystemModule(temporaryFolder),

http://git-wip-us.apache.org/repos/asf/james-project/blob/932f16c3/server/container/guice/guice-common/src/main/java/org/apache/james/GuiceJamesServer.java
----------------------------------------------------------------------
diff --git a/server/container/guice/guice-common/src/main/java/org/apache/james/GuiceJamesServer.java b/server/container/guice/guice-common/src/main/java/org/apache/james/GuiceJamesServer.java
deleted file mode 100644
index 9fa2efc..0000000
--- a/server/container/guice/guice-common/src/main/java/org/apache/james/GuiceJamesServer.java
+++ /dev/null
@@ -1,85 +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;
-
-import java.util.Arrays;
-
-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;
-import org.apache.james.utils.GuiceServerProbe;
-
-import com.google.common.collect.Iterables;
-import com.google.inject.Guice;
-import com.google.inject.Injector;
-import com.google.inject.Key;
-import com.google.inject.Module;
-import com.google.inject.TypeLiteral;
-import com.google.inject.util.Modules;
-
-public class GuiceJamesServer {
-    protected final Module module;
-    private Stager<PreDestroy> preDestroy;
-    private GuiceProbeProvider guiceProbeProvider;
-
-    public GuiceJamesServer() {
-        this(Modules.combine(
-                        new CommonServicesModule(),
-                        new ProtocolsModule(),
-                        new MailetProcessingModule()));
-    }
-
-    protected GuiceJamesServer(Module module) {
-        this.module = module;
-    }
-    
-    public GuiceJamesServer combineWith(Module... modules) {
-        return new GuiceJamesServer(Modules.combine(Iterables.concat(Arrays.asList(module), Arrays.asList(modules))));
-    }
-
-    public GuiceJamesServer overrideWith(Module... overrides) {
-        return new GuiceJamesServer(Modules.override(module).with(overrides));
-    }
-
-    public void start() throws Exception {
-        Injector injector = Guice.createInjector(module);
-        preDestroy = injector.getInstance(Key.get(new TypeLiteral<Stager<PreDestroy>>() {}));
-        injector.getInstance(ConfigurationsPerformer.class).initModules();
-        guiceProbeProvider = injector.getInstance(GuiceProbeProvider.class);
-    }
-
-    public void stop() {
-        if (preDestroy != null) {
-            preDestroy.stage();
-        }
-    }
-
-    public GuiceServerProbe serverProbe() {
-        return guiceProbeProvider.getProbe(GuiceServerProbe.class);
-    }
-
-    protected GuiceProbeProvider getGuiceProbeProvider() {
-        return guiceProbeProvider;
-    }
-}

http://git-wip-us.apache.org/repos/asf/james-project/blob/932f16c3/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
new file mode 100644
index 0000000..0ebd7c6
--- /dev/null
+++ b/server/container/guice/guice-common/src/main/java/org/apache/james/GuiceJamesServerImpl.java
@@ -0,0 +1,85 @@
+/****************************************************************
+ * 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;
+
+import java.util.Arrays;
+
+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;
+import org.apache.james.utils.GuiceServerProbe;
+
+import com.google.common.collect.Iterables;
+import com.google.inject.Guice;
+import com.google.inject.Injector;
+import com.google.inject.Key;
+import com.google.inject.Module;
+import com.google.inject.TypeLiteral;
+import com.google.inject.util.Modules;
+
+public class GuiceJamesServerImpl {
+    protected final Module module;
+    private Stager<PreDestroy> preDestroy;
+    private GuiceProbeProvider guiceProbeProvider;
+
+    public GuiceJamesServerImpl() {
+        this(Modules.combine(
+                        new CommonServicesModule(),
+                        new ProtocolsModule(),
+                        new MailetProcessingModule()));
+    }
+
+    protected GuiceJamesServerImpl(Module module) {
+        this.module = module;
+    }
+    
+    public GuiceJamesServerImpl combineWith(Module... modules) {
+        return new GuiceJamesServerImpl(Modules.combine(Iterables.concat(Arrays.asList(module), Arrays.asList(modules))));
+    }
+
+    public GuiceJamesServerImpl overrideWith(Module... overrides) {
+        return new GuiceJamesServerImpl(Modules.override(module).with(overrides));
+    }
+
+    public void start() throws Exception {
+        Injector injector = Guice.createInjector(module);
+        preDestroy = injector.getInstance(Key.get(new TypeLiteral<Stager<PreDestroy>>() {}));
+        injector.getInstance(ConfigurationsPerformer.class).initModules();
+        guiceProbeProvider = injector.getInstance(GuiceProbeProvider.class);
+    }
+
+    public void stop() {
+        if (preDestroy != null) {
+            preDestroy.stage();
+        }
+    }
+
+    public GuiceServerProbe serverProbe() {
+        return guiceProbeProvider.getProbe(GuiceServerProbe.class);
+    }
+
+    protected GuiceProbeProvider getGuiceProbeProvider() {
+        return guiceProbeProvider;
+    }
+}

http://git-wip-us.apache.org/repos/asf/james-project/blob/932f16c3/server/container/guice/guice-common/src/test/java/org/apache/james/AbstractJamesServerTest.java
----------------------------------------------------------------------
diff --git a/server/container/guice/guice-common/src/test/java/org/apache/james/AbstractJamesServerTest.java b/server/container/guice/guice-common/src/test/java/org/apache/james/AbstractJamesServerTest.java
index fa85594..58039ea 100644
--- a/server/container/guice/guice-common/src/test/java/org/apache/james/AbstractJamesServerTest.java
+++ b/server/container/guice/guice-common/src/test/java/org/apache/james/AbstractJamesServerTest.java
@@ -39,7 +39,7 @@ public abstract class AbstractJamesServerTest {
     private static final int SMTP_PORT = 1025;
     private static final int LMTP_PORT = 1024;
 
-    private GuiceJamesServer server;
+    private GuiceJamesServerImpl server;
     private SocketChannel socketChannel;
 
     @Before
@@ -49,7 +49,7 @@ public abstract class AbstractJamesServerTest {
         server.start();
     }
 
-    protected abstract GuiceJamesServer createJamesServer();
+    protected abstract GuiceJamesServerImpl createJamesServer();
 
     protected abstract void clean();
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/932f16c3/server/container/guice/guice-common/src/test/java/org/apache/james/AbstractJmapJamesServerTest.java
----------------------------------------------------------------------
diff --git a/server/container/guice/guice-common/src/test/java/org/apache/james/AbstractJmapJamesServerTest.java b/server/container/guice/guice-common/src/test/java/org/apache/james/AbstractJmapJamesServerTest.java
index c67eac8..cdfd301 100644
--- a/server/container/guice/guice-common/src/test/java/org/apache/james/AbstractJmapJamesServerTest.java
+++ b/server/container/guice/guice-common/src/test/java/org/apache/james/AbstractJmapJamesServerTest.java
@@ -39,7 +39,7 @@ import com.jayway.restassured.RestAssured;
 import com.jayway.restassured.builder.RequestSpecBuilder;
 import com.jayway.restassured.http.ContentType;
 
-public abstract class AbstractJmapJamesServerTest<T extends GuiceJamesServer & JmapServer & WebAdminServer> {
+public abstract class AbstractJmapJamesServerTest<T extends GuiceJamesServerImpl & JmapServer & WebAdminServer> {
 
     private static final int IMAP_PORT = 1143; // You need to be root (superuser) to bind to ports under 1024.
     private static final int IMAP_PORT_SSL = 1993;

http://git-wip-us.apache.org/repos/asf/james-project/blob/932f16c3/server/container/guice/memory-guice/src/main/java/org/apache/james/MemoryJamesServer.java
----------------------------------------------------------------------
diff --git a/server/container/guice/memory-guice/src/main/java/org/apache/james/MemoryJamesServer.java b/server/container/guice/memory-guice/src/main/java/org/apache/james/MemoryJamesServer.java
index 7a5e52f..d65aaa0 100644
--- a/server/container/guice/memory-guice/src/main/java/org/apache/james/MemoryJamesServer.java
+++ b/server/container/guice/memory-guice/src/main/java/org/apache/james/MemoryJamesServer.java
@@ -27,7 +27,7 @@ import com.google.common.collect.Iterables;
 import com.google.inject.Module;
 import com.google.inject.util.Modules;
 
-public class MemoryJamesServer extends GuiceJamesServer implements JmapServer, WebAdminServer {
+public class MemoryJamesServer extends GuiceJamesServerImpl implements JmapServer, WebAdminServer {
     public MemoryJamesServer() {
         super();
     }

http://git-wip-us.apache.org/repos/asf/james-project/blob/932f16c3/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/JMAPAuthenticationTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/JMAPAuthenticationTest.java b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/JMAPAuthenticationTest.java
index 428a20f..8e34206 100644
--- a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/JMAPAuthenticationTest.java
+++ b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/JMAPAuthenticationTest.java
@@ -32,7 +32,7 @@ import java.time.ZonedDateTime;
 import java.time.format.DateTimeFormatter;
 import java.util.UUID;
 
-import org.apache.james.GuiceJamesServer;
+import org.apache.james.GuiceJamesServerImpl;
 import org.apache.james.JmapServer;
 import org.apache.james.WebAdminServer;
 import org.apache.james.jmap.model.ContinuationToken;
@@ -45,7 +45,7 @@ import com.jayway.restassured.RestAssured;
 import com.jayway.restassured.builder.RequestSpecBuilder;
 import com.jayway.restassured.http.ContentType;
 
-public abstract class JMAPAuthenticationTest<T extends GuiceJamesServer & JmapServer & WebAdminServer> {
+public abstract class JMAPAuthenticationTest<T extends GuiceJamesServerImpl & JmapServer & WebAdminServer> {
 
     private static final ZonedDateTime oldDate = ZonedDateTime.parse("2011-12-03T10:15:30+01:00", DateTimeFormatter.ISO_OFFSET_DATE_TIME);
     private static final ZonedDateTime newDate = ZonedDateTime.parse("2011-12-03T10:16:30+01:00", DateTimeFormatter.ISO_OFFSET_DATE_TIME);

http://git-wip-us.apache.org/repos/asf/james-project/blob/932f16c3/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/VacationIntegrationTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/VacationIntegrationTest.java b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/VacationIntegrationTest.java
index 7c6ee22..b039913 100644
--- a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/VacationIntegrationTest.java
+++ b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/VacationIntegrationTest.java
@@ -31,7 +31,7 @@ import java.util.List;
 import java.util.Map;
 import java.util.concurrent.TimeUnit;
 
-import org.apache.james.GuiceJamesServer;
+import org.apache.james.GuiceJamesServerImpl;
 import org.apache.james.JmapServer;
 import org.apache.james.WebAdminServer;
 import org.apache.james.jmap.api.access.AccessToken;
@@ -51,7 +51,7 @@ import com.jayway.restassured.RestAssured;
 import com.jayway.restassured.builder.RequestSpecBuilder;
 import com.jayway.restassured.http.ContentType;
 
-public abstract class VacationIntegrationTest<T extends GuiceJamesServer & JmapServer & WebAdminServer> {
+public abstract class VacationIntegrationTest<T extends GuiceJamesServerImpl & JmapServer & WebAdminServer> {
 
     private static final String ARGUMENTS = "[0][1]";
     private static final String SECOND_NAME = "[1][0]";

http://git-wip-us.apache.org/repos/asf/james-project/blob/932f16c3/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetMailboxesMethodTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetMailboxesMethodTest.java b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetMailboxesMethodTest.java
index 3d99136..011752c 100644
--- a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetMailboxesMethodTest.java
+++ b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetMailboxesMethodTest.java
@@ -35,7 +35,7 @@ import java.util.Date;
 
 import javax.mail.Flags;
 
-import org.apache.james.GuiceJamesServer;
+import org.apache.james.GuiceJamesServerImpl;
 import org.apache.james.JmapServer;
 import org.apache.james.WebAdminServer;
 import org.apache.james.jmap.JmapAuthentication;
@@ -52,7 +52,7 @@ import com.jayway.restassured.RestAssured;
 import com.jayway.restassured.builder.RequestSpecBuilder;
 import com.jayway.restassured.http.ContentType;
 
-public abstract class GetMailboxesMethodTest<T extends GuiceJamesServer & JmapServer & WebAdminServer> {
+public abstract class GetMailboxesMethodTest<T extends GuiceJamesServerImpl & JmapServer & WebAdminServer> {
     private static final String NAME = "[0][0]";
     private static final String ARGUMENTS = "[0][1]";
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/932f16c3/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetMessageListMethodTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetMessageListMethodTest.java b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetMessageListMethodTest.java
index 5d08da4..a9b7a22 100644
--- a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetMessageListMethodTest.java
+++ b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetMessageListMethodTest.java
@@ -36,7 +36,7 @@ import java.util.List;
 
 import javax.mail.Flags;
 
-import org.apache.james.GuiceJamesServer;
+import org.apache.james.GuiceJamesServerImpl;
 import org.apache.james.JmapServer;
 import org.apache.james.WebAdminServer;
 import org.apache.james.jmap.JmapAuthentication;
@@ -54,7 +54,7 @@ import com.jayway.restassured.RestAssured;
 import com.jayway.restassured.builder.RequestSpecBuilder;
 import com.jayway.restassured.http.ContentType;
 
-public abstract class GetMessageListMethodTest<T extends GuiceJamesServer & JmapServer & WebAdminServer> {
+public abstract class GetMessageListMethodTest<T extends GuiceJamesServerImpl & JmapServer & WebAdminServer> {
     private static final String NAME = "[0][0]";
     private static final String ARGUMENTS = "[0][1]";
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/932f16c3/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetVacationResponseTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetVacationResponseTest.java b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetVacationResponseTest.java
index ec6e5cc..16e2403 100644
--- a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetVacationResponseTest.java
+++ b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetVacationResponseTest.java
@@ -28,7 +28,7 @@ import static org.hamcrest.core.IsNull.nullValue;
 
 import java.time.ZonedDateTime;
 
-import org.apache.james.GuiceJamesServer;
+import org.apache.james.GuiceJamesServerImpl;
 import org.apache.james.JmapServer;
 import org.apache.james.WebAdminServer;
 import org.apache.james.jmap.FixedDateZonedDateTimeProvider;
@@ -47,7 +47,7 @@ import com.jayway.restassured.RestAssured;
 import com.jayway.restassured.builder.RequestSpecBuilder;
 import com.jayway.restassured.http.ContentType;
 
-public abstract class GetVacationResponseTest<T extends GuiceJamesServer & JmapServer & WebAdminServer> {
+public abstract class GetVacationResponseTest<T extends GuiceJamesServerImpl & JmapServer & WebAdminServer> {
 
     private static final String NAME = "[0][0]";
     private static final String ARGUMENTS = "[0][1]";

http://git-wip-us.apache.org/repos/asf/james-project/blob/932f16c3/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/SetMailboxesMethodTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/SetMailboxesMethodTest.java b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/SetMailboxesMethodTest.java
index 8087bd5..4f3b19b 100644
--- a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/SetMailboxesMethodTest.java
+++ b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/SetMailboxesMethodTest.java
@@ -36,7 +36,7 @@ import static org.hamcrest.Matchers.not;
 import static org.hamcrest.Matchers.nullValue;
 import static org.hamcrest.collection.IsMapWithSize.aMapWithSize;
 
-import org.apache.james.GuiceJamesServer;
+import org.apache.james.GuiceJamesServerImpl;
 import org.apache.james.JmapServer;
 import org.apache.james.WebAdminServer;
 import org.apache.james.jmap.JmapAuthentication;
@@ -54,7 +54,7 @@ import com.jayway.restassured.RestAssured;
 import com.jayway.restassured.builder.RequestSpecBuilder;
 import com.jayway.restassured.http.ContentType;
 
-public abstract class SetMailboxesMethodTest<T extends GuiceJamesServer & JmapServer & WebAdminServer> {
+public abstract class SetMailboxesMethodTest<T extends GuiceJamesServerImpl & JmapServer & WebAdminServer> {
 
     private static final String NAME = "[0][0]";
     private static final String ARGUMENTS = "[0][1]";

http://git-wip-us.apache.org/repos/asf/james-project/blob/932f16c3/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/SetMessagesMethodTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/SetMessagesMethodTest.java b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/SetMessagesMethodTest.java
index dd5b580..0045e32 100644
--- a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/SetMessagesMethodTest.java
+++ b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/SetMessagesMethodTest.java
@@ -49,7 +49,7 @@ import java.util.stream.Collectors;
 import javax.mail.Flags;
 
 import org.apache.commons.io.IOUtils;
-import org.apache.james.GuiceJamesServer;
+import org.apache.james.GuiceJamesServerImpl;
 import org.apache.james.JmapServer;
 import org.apache.james.WebAdminServer;
 import org.apache.james.jmap.JmapAuthentication;
@@ -80,7 +80,7 @@ import com.jayway.restassured.builder.ResponseSpecBuilder;
 import com.jayway.restassured.http.ContentType;
 import com.jayway.restassured.specification.ResponseSpecification;
 
-public abstract class SetMessagesMethodTest<T extends GuiceJamesServer & JmapServer & WebAdminServer> {
+public abstract class SetMessagesMethodTest<T extends GuiceJamesServerImpl & JmapServer & WebAdminServer> {
 
     private static final int _1MB = 1024*1024;
     private static final String NAME = "[0][0]";

http://git-wip-us.apache.org/repos/asf/james-project/blob/932f16c3/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/SetVacationResponseTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/SetVacationResponseTest.java b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/SetVacationResponseTest.java
index 07a49a5..ab2d265 100644
--- a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/SetVacationResponseTest.java
+++ b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/SetVacationResponseTest.java
@@ -28,7 +28,7 @@ import static org.hamcrest.Matchers.equalTo;
 import java.time.ZonedDateTime;
 import java.util.Optional;
 
-import org.apache.james.GuiceJamesServer;
+import org.apache.james.GuiceJamesServerImpl;
 import org.apache.james.JmapServer;
 import org.apache.james.WebAdminServer;
 import org.apache.james.jmap.JmapAuthentication;
@@ -47,7 +47,7 @@ import com.jayway.restassured.RestAssured;
 import com.jayway.restassured.builder.RequestSpecBuilder;
 import com.jayway.restassured.http.ContentType;
 
-public abstract class SetVacationResponseTest<T extends GuiceJamesServer & JmapServer & WebAdminServer> {
+public abstract class SetVacationResponseTest<T extends GuiceJamesServerImpl & JmapServer & WebAdminServer> {
 
     private static final String NAME = "[0][0]";
     private static final String ARGUMENTS = "[0][1]";

http://git-wip-us.apache.org/repos/asf/james-project/blob/932f16c3/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/DownloadStepdefs.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/DownloadStepdefs.java b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/DownloadStepdefs.java
index 03537ce..50fbe6a 100644
--- a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/DownloadStepdefs.java
+++ b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/DownloadStepdefs.java
@@ -37,7 +37,7 @@ import org.apache.http.HttpResponse;
 import org.apache.http.client.fluent.Request;
 import org.apache.http.client.fluent.Response;
 import org.apache.http.client.utils.URIBuilder;
-import org.apache.james.GuiceJamesServer;
+import org.apache.james.GuiceJamesServerImpl;
 import org.apache.james.JmapServer;
 import org.apache.james.WebAdminServer;
 import org.apache.james.jmap.api.access.AccessToken;
@@ -59,7 +59,7 @@ import cucumber.api.java.en.When;
 import cucumber.runtime.java.guice.ScenarioScoped;
 
 @ScenarioScoped
-public class DownloadStepdefs <T extends GuiceJamesServer & JmapServer & WebAdminServer> {
+public class DownloadStepdefs <T extends GuiceJamesServerImpl & JmapServer & WebAdminServer> {
 
     private static final String ONE_ATTACHMENT_EML_ATTACHEMENT_BLOB_ID = "4000c5145f633410b80be368c44e1c394bff9437";
     private static final String EXPIRED_ATTACHMENT_TOKEN = "usera@domain.tld_"

http://git-wip-us.apache.org/repos/asf/james-project/blob/932f16c3/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/GetMessagesMethodStepdefs.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/GetMessagesMethodStepdefs.java b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/GetMessagesMethodStepdefs.java
index 78aec0c..07e28ff 100644
--- a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/GetMessagesMethodStepdefs.java
+++ b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/GetMessagesMethodStepdefs.java
@@ -38,7 +38,7 @@ import javax.mail.Flags;
 import org.apache.commons.lang3.StringEscapeUtils;
 import org.apache.http.HttpResponse;
 import org.apache.http.client.fluent.Request;
-import org.apache.james.GuiceJamesServer;
+import org.apache.james.GuiceJamesServerImpl;
 import org.apache.james.JmapServer;
 import org.apache.james.WebAdminServer;
 import org.apache.james.jmap.methods.integration.cucumber.util.TableRow;
@@ -60,7 +60,7 @@ import cucumber.api.java.en.When;
 import cucumber.runtime.java.guice.ScenarioScoped;
 
 @ScenarioScoped
-public class GetMessagesMethodStepdefs <T extends GuiceJamesServer & JmapServer & WebAdminServer> {
+public class GetMessagesMethodStepdefs <T extends GuiceJamesServerImpl & JmapServer & WebAdminServer> {
 
     private static final Optional<Map<String, String>> NO_HEADERS = Optional.empty();
     private static final String NAME = "[0][0]";

http://git-wip-us.apache.org/repos/asf/james-project/blob/932f16c3/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/MainStepdefs.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/MainStepdefs.java b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/MainStepdefs.java
index e8f48f4..e4e4959 100644
--- a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/MainStepdefs.java
+++ b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/MainStepdefs.java
@@ -20,7 +20,7 @@
 package org.apache.james.jmap.methods.integration.cucumber;
 
 import org.apache.http.client.utils.URIBuilder;
-import org.apache.james.GuiceJamesServer;
+import org.apache.james.GuiceJamesServerImpl;
 import org.apache.james.JmapServer;
 import org.apache.james.WebAdminServer;
 
@@ -29,7 +29,7 @@ import com.google.common.base.Charsets;
 import cucumber.runtime.java.guice.ScenarioScoped;
 
 @ScenarioScoped
-public class MainStepdefs<T extends GuiceJamesServer & JmapServer & WebAdminServer> {
+public class MainStepdefs<T extends GuiceJamesServerImpl & JmapServer & WebAdminServer> {
 
     public T jmapServer;
     public Runnable awaitMethod = () -> {};

http://git-wip-us.apache.org/repos/asf/james-project/blob/932f16c3/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/SetMailboxesMethodStepdefs.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/SetMailboxesMethodStepdefs.java b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/SetMailboxesMethodStepdefs.java
index 69b79eb..a8dc46e 100644
--- a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/SetMailboxesMethodStepdefs.java
+++ b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/SetMailboxesMethodStepdefs.java
@@ -32,7 +32,7 @@ import javax.mail.Flags;
 import org.apache.http.HttpResponse;
 import org.apache.http.client.fluent.Request;
 import org.apache.http.entity.ContentType;
-import org.apache.james.GuiceJamesServer;
+import org.apache.james.GuiceJamesServerImpl;
 import org.apache.james.JmapServer;
 import org.apache.james.WebAdminServer;
 import org.apache.james.mailbox.exception.MailboxException;
@@ -50,7 +50,7 @@ import cucumber.api.java.en.When;
 import cucumber.runtime.java.guice.ScenarioScoped;
 
 @ScenarioScoped
-public class SetMailboxesMethodStepdefs <T extends GuiceJamesServer & JmapServer & WebAdminServer> {
+public class SetMailboxesMethodStepdefs <T extends GuiceJamesServerImpl & JmapServer & WebAdminServer> {
 
     private static final String NAME = "[0][0]";
     private static final String ARGUMENTS = "[0][1]";

http://git-wip-us.apache.org/repos/asf/james-project/blob/932f16c3/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/UploadStepdefs.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/UploadStepdefs.java b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/UploadStepdefs.java
index 0337e6d..d1e26bd 100644
--- a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/UploadStepdefs.java
+++ b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/UploadStepdefs.java
@@ -32,7 +32,7 @@ import org.apache.http.HttpResponse;
 import org.apache.http.client.fluent.Executor;
 import org.apache.http.client.fluent.Request;
 import org.apache.http.impl.client.HttpClientBuilder;
-import org.apache.james.GuiceJamesServer;
+import org.apache.james.GuiceJamesServerImpl;
 import org.apache.james.JmapServer;
 import org.apache.james.WebAdminServer;
 import org.apache.james.jmap.api.access.AccessToken;
@@ -47,7 +47,7 @@ import cucumber.api.java.en.When;
 import cucumber.runtime.java.guice.ScenarioScoped;
 
 @ScenarioScoped
-public class UploadStepdefs <T extends GuiceJamesServer & JmapServer & WebAdminServer> {
+public class UploadStepdefs <T extends GuiceJamesServerImpl & JmapServer & WebAdminServer>{
     private static final String _1M_ZEROED_FILE_BLOB_ID = "3b71f43ff30f4b15b5cd85dd9e95ebc7e84eb5a3";
     private static final int _1M = 1024 * 1024;
     private static final int _10M = 10 * _1M;

http://git-wip-us.apache.org/repos/asf/james-project/blob/932f16c3/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/UserStepdefs.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/UserStepdefs.java b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/UserStepdefs.java
index 011f4a5..7fae1db 100644
--- a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/UserStepdefs.java
+++ b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/UserStepdefs.java
@@ -27,7 +27,7 @@ import java.util.Set;
 
 import javax.inject.Inject;
 
-import org.apache.james.GuiceJamesServer;
+import org.apache.james.GuiceJamesServerImpl;
 import org.apache.james.JmapServer;
 import org.apache.james.WebAdminServer;
 import org.apache.james.jmap.HttpJmapAuthentication;
@@ -44,7 +44,7 @@ import cucumber.api.java.en.Given;
 import cucumber.runtime.java.guice.ScenarioScoped;
 
 @ScenarioScoped
-public class UserStepdefs <T extends GuiceJamesServer & JmapServer & WebAdminServer>{
+public class UserStepdefs <T extends GuiceJamesServerImpl & JmapServer & WebAdminServer>{
 
     private final MainStepdefs<T> mainStepdefs;
     


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


[05/29] james-project git commit: JAMES-1842: Remove sample-configuration on common and move them to specified module

Posted by ad...@apache.org.
JAMES-1842: Remove sample-configuration on common and move them to specified module


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

Branch: refs/heads/master
Commit: b45667b6cbb0c6fcf3e22fcc849345415a87c849
Parents: c659fcb
Author: Quynh Nguyen <qn...@linagora.com>
Authored: Thu Nov 3 17:08:27 2016 +0700
Committer: Quynh Nguyen <qn...@linagora.com>
Committed: Fri Nov 18 09:25:34 2016 +0700

----------------------------------------------------------------------
 .../sample-configuration/cassandra.properties   |   6 +
 .../sample-configuration/dnsservice.xml         |  29 ++++
 .../sample-configuration/domainlist.xml         |  28 ++++
 .../elasticsearch.properties                    |  26 ++++
 .../sample-configuration/imapserver.xml         |  54 ++++++++
 .../sample-configuration/jmap.properties        |  11 ++
 .../sample-configuration/jmx.properties         |  28 ++++
 .../sample-configuration/lmtpserver.xml         |  41 ++++++
 .../sample-configuration/mailetcontainer.xml    | 138 +++++++++++++++++++
 .../mailrepositorystore.xml                     |  34 +++++
 .../sample-configuration/pop3server.xml         |  42 ++++++
 .../recipientrewritetable.xml                   |  27 ++++
 .../sample-configuration/smtpserver.xml         | 105 ++++++++++++++
 .../sample-configuration/usersrepository.xml    |  27 ++++
 .../sample-configuration/cassandra.properties   |   6 -
 .../sample-configuration/dnsservice.xml         |  29 ----
 .../sample-configuration/domainlist.xml         |  28 ----
 .../elasticsearch.properties                    |  26 ----
 .../sample-configuration/imapserver.xml         |  54 --------
 .../james-database.properties                   |  40 ------
 .../sample-configuration/jcr-repository.xml     |  72 ----------
 .../sample-configuration/jmap.properties        |  11 --
 .../sample-configuration/jmx.properties         |  28 ----
 .../sample-configuration/lmtpserver.xml         |  41 ------
 .../sample-configuration/mailetcontainer.xml    | 137 ------------------
 .../mailrepositorystore.xml                     |  34 -----
 .../sample-configuration/pop3server.xml         |  42 ------
 .../recipientrewritetable.xml                   |  27 ----
 .../sample-configuration/smtpserver.xml         | 105 --------------
 .../sample-configuration/usersrepository.xml    |  27 ----
 .../sample-configuration/dnsservice.xml         |  29 ++++
 .../sample-configuration/domainlist.xml         |  28 ++++
 .../sample-configuration/imapserver.xml         |  54 ++++++++
 .../james-database.properties                   |  40 ++++++
 .../sample-configuration/jmx.properties         |  28 ++++
 .../sample-configuration/lmtpserver.xml         |  41 ++++++
 .../sample-configuration/mailetcontainer.xml    | 137 ++++++++++++++++++
 .../mailrepositorystore.xml                     |  34 +++++
 .../sample-configuration/pop3server.xml         |  42 ++++++
 .../recipientrewritetable.xml                   |  27 ++++
 .../sample-configuration/smtpserver.xml         | 105 ++++++++++++++
 .../sample-configuration/usersrepository.xml    |  27 ++++
 .../sample-configuration/dnsservice.xml         |  29 ++++
 .../sample-configuration/domainlist.xml         |  28 ++++
 .../sample-configuration/imapserver.xml         |  54 ++++++++
 .../sample-configuration/jmap.properties        |  11 ++
 .../sample-configuration/jmx.properties         |  28 ++++
 .../sample-configuration/lmtpserver.xml         |  41 ++++++
 .../sample-configuration/mailetcontainer.xml    | 137 ++++++++++++++++++
 .../mailrepositorystore.xml                     |  34 +++++
 .../sample-configuration/pop3server.xml         |  42 ++++++
 .../recipientrewritetable.xml                   |  27 ++++
 .../sample-configuration/smtpserver.xml         | 105 ++++++++++++++
 .../sample-configuration/usersrepository.xml    |  27 ++++
 54 files changed, 1751 insertions(+), 707 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/b45667b6/server/container/guice/cassandra-guice/sample-configuration/cassandra.properties
----------------------------------------------------------------------
diff --git a/server/container/guice/cassandra-guice/sample-configuration/cassandra.properties b/server/container/guice/cassandra-guice/sample-configuration/cassandra.properties
new file mode 100644
index 0000000..1358332
--- /dev/null
+++ b/server/container/guice/cassandra-guice/sample-configuration/cassandra.properties
@@ -0,0 +1,6 @@
+# Configuration file for cassandra mailbox
+
+cassandra.ip=172.17.0.2
+cassandra.port=9042
+cassandra.keyspace=apache_james
+cassandra.replication.factor=1
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/james-project/blob/b45667b6/server/container/guice/cassandra-guice/sample-configuration/dnsservice.xml
----------------------------------------------------------------------
diff --git a/server/container/guice/cassandra-guice/sample-configuration/dnsservice.xml b/server/container/guice/cassandra-guice/sample-configuration/dnsservice.xml
new file mode 100644
index 0000000..0978a00
--- /dev/null
+++ b/server/container/guice/cassandra-guice/sample-configuration/dnsservice.xml
@@ -0,0 +1,29 @@
+<?xml version="1.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.                                           
+ -->
+
+<dnsservice>
+  <servers>
+    <server>8.8.8.8</server>
+    <server>62.210.16.6</server>
+  </servers>
+  <autodiscover>false</autodiscover>
+  <authoritative>false</authoritative>
+  <maxcachesize>50000</maxcachesize>
+</dnsservice>

http://git-wip-us.apache.org/repos/asf/james-project/blob/b45667b6/server/container/guice/cassandra-guice/sample-configuration/domainlist.xml
----------------------------------------------------------------------
diff --git a/server/container/guice/cassandra-guice/sample-configuration/domainlist.xml b/server/container/guice/cassandra-guice/sample-configuration/domainlist.xml
new file mode 100644
index 0000000..8d00118
--- /dev/null
+++ b/server/container/guice/cassandra-guice/sample-configuration/domainlist.xml
@@ -0,0 +1,28 @@
+<?xml version="1.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.                                           
+ -->
+
+<domainlist class="org.apache.james.domainlist.jpa.JPADomainList">
+    <domainnames>
+        <domainname>james.apache.org</domainname>
+    </domainnames>
+    <autodetect>true</autodetect>
+    <autodetectIP>true</autodetectIP>
+    <defaultDomain>localhost</defaultDomain>
+</domainlist>

http://git-wip-us.apache.org/repos/asf/james-project/blob/b45667b6/server/container/guice/cassandra-guice/sample-configuration/elasticsearch.properties
----------------------------------------------------------------------
diff --git a/server/container/guice/cassandra-guice/sample-configuration/elasticsearch.properties b/server/container/guice/cassandra-guice/sample-configuration/elasticsearch.properties
new file mode 100644
index 0000000..924404c
--- /dev/null
+++ b/server/container/guice/cassandra-guice/sample-configuration/elasticsearch.properties
@@ -0,0 +1,26 @@
+#  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.
+
+#  This template file can be used as example for James Server configuration
+#  DO NOT USE IT AS SUCH AND ADAPT IT TO YOUR NEEDS
+
+# Configuration file for ElasticSearch
+
+elasticsearch.masterHost=172.17.0.1
+elasticsearch.port=9300
+elasticsearch.nb.shards=1
+elasticsearch.nb.replica=0
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/james-project/blob/b45667b6/server/container/guice/cassandra-guice/sample-configuration/imapserver.xml
----------------------------------------------------------------------
diff --git a/server/container/guice/cassandra-guice/sample-configuration/imapserver.xml b/server/container/guice/cassandra-guice/sample-configuration/imapserver.xml
new file mode 100644
index 0000000..c03b978
--- /dev/null
+++ b/server/container/guice/cassandra-guice/sample-configuration/imapserver.xml
@@ -0,0 +1,54 @@
+<?xml version="1.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.
+-->
+
+
+<imapservers>
+	<imapserver enabled="true">
+		<jmxName>imapserver</jmxName>
+		<bind>0.0.0.0:1143</bind>
+		<connectionBacklog>200</connectionBacklog>
+		<tls socketTLS="false" startTLS="true">
+			<!-- To create a new keystore execute:
+            keytool -genkey -alias james -keyalg RSA -keystore /path/to/james/conf/keystore
+              -->
+			<keystore>file://conf/keystore</keystore>
+			<secret>james72laBalle</secret>
+			<provider>org.bouncycastle.jce.provider.BouncyCastleProvider</provider>
+		</tls>
+		<connectionLimit>0</connectionLimit>
+		<connectionLimitPerIP>0</connectionLimitPerIP>
+	</imapserver>
+	<imapserver enabled="true">
+		<jmxName>imapserver-ssl</jmxName>
+		<bind>0.0.0.0:1993</bind>
+		<connectionBacklog>200</connectionBacklog>
+		<tls socketTLS="true" startTLS="false">
+			<!-- To create a new keystore execute:
+              keytool -genkey -alias james -keyalg RSA -keystore /path/to/james/conf/keystore
+             -->
+			<keystore>file://conf/keystore</keystore>
+			<secret>james72laBalle</secret>
+			<provider>org.bouncycastle.jce.provider.BouncyCastleProvider</provider>
+		</tls>
+		<connectionLimit>0</connectionLimit>
+		<connectionLimitPerIP>0</connectionLimitPerIP>
+	</imapserver>
+</imapservers>

http://git-wip-us.apache.org/repos/asf/james-project/blob/b45667b6/server/container/guice/cassandra-guice/sample-configuration/jmap.properties
----------------------------------------------------------------------
diff --git a/server/container/guice/cassandra-guice/sample-configuration/jmap.properties b/server/container/guice/cassandra-guice/sample-configuration/jmap.properties
new file mode 100644
index 0000000..d785ccd
--- /dev/null
+++ b/server/container/guice/cassandra-guice/sample-configuration/jmap.properties
@@ -0,0 +1,11 @@
+# Configuration file for JMAP
+
+tls.keystoreURL=file://conf/keystore
+tls.secret=james72laBalle
+
+#
+# If you wish to use OAuth authentication, you should provide a valid JWT public key.
+# The following entry specify the link to the URL of the public key file,
+# which should be a PEM format file.
+#
+jwt.publickeypem.url=
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/james-project/blob/b45667b6/server/container/guice/cassandra-guice/sample-configuration/jmx.properties
----------------------------------------------------------------------
diff --git a/server/container/guice/cassandra-guice/sample-configuration/jmx.properties b/server/container/guice/cassandra-guice/sample-configuration/jmx.properties
new file mode 100644
index 0000000..a1dbdf8
--- /dev/null
+++ b/server/container/guice/cassandra-guice/sample-configuration/jmx.properties
@@ -0,0 +1,28 @@
+#  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.
+#
+
+#  This template file can be used as example for James Server configuration
+#  DO NOT USE IT AS SUCH AND ADAPT IT TO YOUR NEEDS
+
+#  This template file can be used as example for James Server configuration
+#  DO NOT USE IT AS SUCH AND ADAPT IT TO YOUR NEEDS
+
+# See http://james.apache.org/server/3/config.html for usage
+
+jmx.address=127.0.0.1
+jmx.port=9999

http://git-wip-us.apache.org/repos/asf/james-project/blob/b45667b6/server/container/guice/cassandra-guice/sample-configuration/lmtpserver.xml
----------------------------------------------------------------------
diff --git a/server/container/guice/cassandra-guice/sample-configuration/lmtpserver.xml b/server/container/guice/cassandra-guice/sample-configuration/lmtpserver.xml
new file mode 100644
index 0000000..87a0caa
--- /dev/null
+++ b/server/container/guice/cassandra-guice/sample-configuration/lmtpserver.xml
@@ -0,0 +1,41 @@
+<?xml version="1.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.                                           
+ -->
+
+<lmtpservers>
+
+    <lmtpserver enabled="false">
+        <jmxName>lmtpserver</jmxName>
+        <!-- LMTP should not be reachable from outside your network so bind it to loopback-->
+        <bind>127.0.0.1:1024</bind>
+        <connectionBacklog>200</connectionBacklog>
+        <connectiontimeout>1200</connectiontimeout>
+        <!-- Set the maximum simultaneous incoming connections for this service -->
+        <connectionLimit>0</connectionLimit>
+        <!-- Set the maximum simultaneous incoming connections per IP for this service -->
+        <connectionLimitPerIP>0</connectionLimitPerIP>
+        <!--  This sets the maximum allowed message size (in kilobytes) for this -->
+        <!--  LMTP service. If unspecified, the value defaults to 0, which means no limit. -->
+        <maxmessagesize>0</maxmessagesize>
+        <handlerchain>
+            <handler class="org.apache.james.lmtpserver.CoreCmdHandlerLoader"/>
+        </handlerchain>
+    </lmtpserver>
+
+</lmtpservers>

http://git-wip-us.apache.org/repos/asf/james-project/blob/b45667b6/server/container/guice/cassandra-guice/sample-configuration/mailetcontainer.xml
----------------------------------------------------------------------
diff --git a/server/container/guice/cassandra-guice/sample-configuration/mailetcontainer.xml b/server/container/guice/cassandra-guice/sample-configuration/mailetcontainer.xml
new file mode 100644
index 0000000..bad37f5
--- /dev/null
+++ b/server/container/guice/cassandra-guice/sample-configuration/mailetcontainer.xml
@@ -0,0 +1,138 @@
+<?xml version="1.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.
+ -->
+
+<mailetcontainer enableJmx="true">
+
+    <context>
+        <postmaster>postmaster@james.minet.net</postmaster>
+    </context>
+
+    <spooler>
+        <threads>20</threads>
+    </spooler>
+
+    <processors>
+        <processor state="root" enableJmx="true">
+            <mailet match="All" class="PostmasterAlias"/>
+            <mailet match="RelayLimit=30" class="Null"/>
+            <!-- Hook on sievemanager@james.linagora.com
+                 Mail send to this address will get interpreted with SIEVE Manage -->
+            <mailet match="RecipientIs=sievemanager@james.linagora.com" class="ToProcessor">
+                <processor>sieve-manager-check</processor>
+            </mailet>
+            <mailet match="HasMailAttribute=spamChecked" class="ToProcessor">
+                <processor>transport</processor>
+            </mailet>
+            <mailet match="All" class="SetMailAttribute">
+                <spamChecked>true</spamChecked>
+            </mailet>
+            <mailet match="SMTPAuthSuccessful" class="ToProcessor">
+                <processor>transport</processor>
+            </mailet>
+            <mailet match="InSpammerBlacklist=query.bondedsender.org." class="ToProcessor">
+                <processor>transport</processor>
+            </mailet>
+            <!-- Check for delivery from a known spam server -->
+            <!-- This set of matchers/mailets redirect all emails from known -->
+            <!-- black holes, open relays, and spam servers to the spam processor -->
+            <!-- For this set to function properly, the spam processor must be configured. -->
+            <mailet match="InSpammerBlacklist=dnsbl.njabl.org." class="ToProcessor">
+                <processor>spam</processor>
+                <notice>550 Requested action not taken: rejected - see http://njabl.org/</notice>
+            </mailet>
+            <mailet match="All" class="ToProcessor">
+                <processor>transport</processor>
+            </mailet>
+        </processor>
+
+        <processor state="error" enableJmx="true">
+            <mailet match="All" class="Bounce"/>
+            <mailet match="All" class="ToRepository">
+                <repositoryPath>file://var/mail/error/</repositoryPath>
+            </mailet>
+        </processor>
+
+
+        <processor state="transport" enableJmx="true">
+            <mailet match="SMTPAuthSuccessful" class="SetMimeHeader">
+                <name>X-UserIsAuth</name>
+                <value>true</value>
+            </mailet>
+            <mailet match="HasMailAttribute=org.apache.james.SMIMECheckSignature" class="SetMimeHeader">
+                <name>X-WasSigned</name>
+                <value>true</value>
+            </mailet>
+            <mailet match="All" class="RecipientRewriteTable" />
+            <mailet match="RecipientIsLocal" class="org.apache.james.jmap.mailet.VacationMailet"/>
+            <mailet match="RecipientIsLocal" class="LocalDelivery"/>
+            <mailet match="HostIsLocal" class="ToProcessor">
+                <processor>local-address-error</processor>
+                <notice>550 - Requested action not taken: no such user here</notice>
+            </mailet>
+            <mailet match="SMTPAuthSuccessful" class="RemoteDelivery">
+                <outgoingQueue>outgoing</outgoingQueue>
+                <delayTime>5000, 100000, 500000</delayTime>
+                <maxRetries>25</maxRetries>
+                <maxDnsProblemRetries>0</maxDnsProblemRetries>
+                <deliveryThreads>10</deliveryThreads>
+                <sendpartial>true</sendpartial>
+                <bounceProcessor>bounces</bounceProcessor>
+            </mailet>
+            <mailet match="All" class="ToProcessor">
+                <processor>relay-denied</processor>
+            </mailet>
+        </processor>
+
+        <processor state="spam" enableJmx="true">
+            <mailet match="All" class="ToRepository">
+                <repositoryPath>file://var/mail/spam/</repositoryPath>
+            </mailet>
+        </processor>
+
+        <processor state="local-address-error" enableJmx="true">
+            <mailet match="All" class="Bounce">
+                <attachment>none</attachment>
+            </mailet>
+            <mailet match="All" class="ToRepository">
+                <repositoryPath>file://var/mail/address-error/</repositoryPath>
+            </mailet>
+        </processor>
+
+        <processor state="relay-denied" enableJmx="true">
+            <mailet match="All" class="Bounce">
+                <attachment>none</attachment>
+            </mailet>
+            <mailet match="All" class="ToRepository">
+                <repositoryPath>file://var/mail/relay-denied/</repositoryPath>
+                <notice>Warning: You are sending an e-mail to a remote server. You must be authentified to perform such an operation</notice>
+            </mailet>
+        </processor>
+
+        <processor state="bounces" enableJmx="true">
+            <mailet match="All" class="DSNBounce">
+                <passThrough>false</passThrough>
+            </mailet>
+        </processor>
+    </processors>
+
+</mailetcontainer>
+
+

http://git-wip-us.apache.org/repos/asf/james-project/blob/b45667b6/server/container/guice/cassandra-guice/sample-configuration/mailrepositorystore.xml
----------------------------------------------------------------------
diff --git a/server/container/guice/cassandra-guice/sample-configuration/mailrepositorystore.xml b/server/container/guice/cassandra-guice/sample-configuration/mailrepositorystore.xml
new file mode 100644
index 0000000..acca810
--- /dev/null
+++ b/server/container/guice/cassandra-guice/sample-configuration/mailrepositorystore.xml
@@ -0,0 +1,34 @@
+<?xml version="1.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.
+ -->
+
+<mailrepositorystore>
+    <mailrepositories>
+        <!-- File based repositories.  These repositories store all message data -->
+        <!-- in the file system. -->
+        <mailrepository class="org.apache.james.mailrepository.file.FileMailRepository">
+            <protocols>
+                <protocol>file</protocol>
+            </protocols>
+            <!-- Set if the messages should be listed sorted. False by default -->
+            <config FIFO="false" CACHEKEYS="true"/>
+        </mailrepository>
+    </mailrepositories>
+</mailrepositorystore>

http://git-wip-us.apache.org/repos/asf/james-project/blob/b45667b6/server/container/guice/cassandra-guice/sample-configuration/pop3server.xml
----------------------------------------------------------------------
diff --git a/server/container/guice/cassandra-guice/sample-configuration/pop3server.xml b/server/container/guice/cassandra-guice/sample-configuration/pop3server.xml
new file mode 100644
index 0000000..c57c832
--- /dev/null
+++ b/server/container/guice/cassandra-guice/sample-configuration/pop3server.xml
@@ -0,0 +1,42 @@
+<?xml version="1.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.                                           
+ -->
+
+
+<pop3servers>
+    <pop3server enabled="false">
+        <jmxName>pop3server</jmxName>
+        <bind>0.0.0.0:1110</bind>
+        <connectionBacklog>200</connectionBacklog>
+        <tls socketTLS="false" startTLS="false">
+            <!-- To create a new keystore execute:
+                  keytool -genkey -alias james -keyalg RSA -keystore /path/to/james/conf/keystore
+             -->
+            <keystore>file://conf/keystore</keystore>
+            <secret>james72laBalle</secret>
+            <provider>org.bouncycastle.jce.provider.BouncyCastleProvider</provider>
+        </tls>
+        <connectiontimeout>1200</connectiontimeout>
+        <connectionLimit>0</connectionLimit>
+        <connectionLimitPerIP>0</connectionLimitPerIP>
+        <handlerchain>
+            <handler class="org.apache.james.pop3server.core.CoreCmdHandlerLoader"/>
+        </handlerchain>
+    </pop3server>
+</pop3servers>

http://git-wip-us.apache.org/repos/asf/james-project/blob/b45667b6/server/container/guice/cassandra-guice/sample-configuration/recipientrewritetable.xml
----------------------------------------------------------------------
diff --git a/server/container/guice/cassandra-guice/sample-configuration/recipientrewritetable.xml b/server/container/guice/cassandra-guice/sample-configuration/recipientrewritetable.xml
new file mode 100644
index 0000000..7e7f586
--- /dev/null
+++ b/server/container/guice/cassandra-guice/sample-configuration/recipientrewritetable.xml
@@ -0,0 +1,27 @@
+<?xml version="1.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.                                           
+ -->
+
+<!-- The default table for storing James' RecipientRewriteTable mappings. -->
+<recipientrewritetable class="org.apache.james.rrt.jpa.JPARecipientRewriteTable">
+  <recursiveMapping>true</recursiveMapping>
+  <mappingLimit>10</mappingLimit>
+  <mapping>some@domain=some</mapping>
+</recipientrewritetable>
+

http://git-wip-us.apache.org/repos/asf/james-project/blob/b45667b6/server/container/guice/cassandra-guice/sample-configuration/smtpserver.xml
----------------------------------------------------------------------
diff --git a/server/container/guice/cassandra-guice/sample-configuration/smtpserver.xml b/server/container/guice/cassandra-guice/sample-configuration/smtpserver.xml
new file mode 100644
index 0000000..c34fcd1
--- /dev/null
+++ b/server/container/guice/cassandra-guice/sample-configuration/smtpserver.xml
@@ -0,0 +1,105 @@
+<?xml version="1.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.
+ -->
+
+<smtpservers>
+    <smtpserver enabled="true">
+        <jmxName>smtpserver-global</jmxName>
+        <bind>0.0.0.0:1025</bind>
+        <connectionBacklog>200</connectionBacklog>
+        <tls socketTLS="false" startTLS="false">
+            <keystore>file://conf/keystore</keystore>
+            <secret>james72laBalle</secret>
+            <provider>org.bouncycastle.jce.provider.BouncyCastleProvider</provider>
+            <algorithm>SunX509</algorithm>
+        </tls>
+        <connectiontimeout>360</connectiontimeout>
+        <connectionLimit>0</connectionLimit>
+        <connectionLimitPerIP>0</connectionLimitPerIP>
+        <authRequired>false</authRequired>
+        <authorizedAddresses>0.0.0.0/0</authorizedAddresses>
+        <verifyIdentity>true</verifyIdentity>
+        <maxmessagesize>0</maxmessagesize>
+        <addressBracketsEnforcement>true</addressBracketsEnforcement>
+        <smtpGreeting>JAMES Linagora's SMTP awesome Server</smtpGreeting>
+        <handlerchain>
+            <handler class="org.apache.james.smtpserver.fastfail.ValidRcptHandler"/>
+            <handler class="org.apache.james.smtpserver.CoreCmdHandlerLoader"/>
+        </handlerchain>
+    </smtpserver>
+    <smtpserver enabled="true">
+        <jmxName>smtpserver-TLS</jmxName>
+        <bind>0.0.0.0:1465</bind>
+        <connectionBacklog>200</connectionBacklog>
+        <tls socketTLS="true" startTLS="false">
+            <keystore>file://conf/keystore</keystore>
+            <secret>james72laBalle</secret>
+            <provider>org.bouncycastle.jce.provider.BouncyCastleProvider</provider>
+            <algorithm>SunX509</algorithm>
+        </tls>
+        <connectiontimeout>360</connectiontimeout>
+        <connectionLimit>0</connectionLimit>
+        <connectionLimitPerIP>0</connectionLimitPerIP>
+        <!--
+           Authorize only local users
+        -->
+        <authRequired>true</authRequired>
+        <authorizedAddresses>0.0.0.0/0</authorizedAddresses>
+        <!-- Trust authenticated users -->
+        <verifyIdentity>false</verifyIdentity>
+        <maxmessagesize>0</maxmessagesize>
+        <addressBracketsEnforcement>true</addressBracketsEnforcement>
+        <smtpGreeting>JAMES Linagora's SMTP awesome Server</smtpGreeting>
+        <handlerchain>
+            <handler class="org.apache.james.smtpserver.fastfail.ValidRcptHandler"/>
+            <handler class="org.apache.james.smtpserver.CoreCmdHandlerLoader"/>
+        </handlerchain>
+    </smtpserver>
+    <smtpserver enabled="true">
+        <jmxName>smtpserver-authenticated</jmxName>
+        <bind>0.0.0.0:1587</bind>
+        <connectionBacklog>200</connectionBacklog>
+        <tls socketTLS="false" startTLS="true">
+            <keystore>file://conf/keystore</keystore>
+            <secret>james72laBalle</secret>
+            <provider>org.bouncycastle.jce.provider.BouncyCastleProvider</provider>
+            <algorithm>SunX509</algorithm>
+        </tls>
+        <connectiontimeout>360</connectiontimeout>
+        <connectionLimit>0</connectionLimit>
+        <connectionLimitPerIP>0</connectionLimitPerIP>
+        <!--
+           Authorize only local users
+        -->
+        <authRequired>true</authRequired>
+        <authorizedAddresses>0.0.0.0/0</authorizedAddresses>
+        <!-- Trust authenticated users -->
+        <verifyIdentity>false</verifyIdentity>
+        <maxmessagesize>0</maxmessagesize>
+        <addressBracketsEnforcement>true</addressBracketsEnforcement>
+        <smtpGreeting>JAMES Linagora's SMTP awesome Server</smtpGreeting>
+        <handlerchain>
+            <handler class="org.apache.james.smtpserver.fastfail.ValidRcptHandler"/>
+            <handler class="org.apache.james.smtpserver.CoreCmdHandlerLoader"/>
+        </handlerchain>
+    </smtpserver>
+</smtpservers>
+
+

http://git-wip-us.apache.org/repos/asf/james-project/blob/b45667b6/server/container/guice/cassandra-guice/sample-configuration/usersrepository.xml
----------------------------------------------------------------------
diff --git a/server/container/guice/cassandra-guice/sample-configuration/usersrepository.xml b/server/container/guice/cassandra-guice/sample-configuration/usersrepository.xml
new file mode 100644
index 0000000..fc76107
--- /dev/null
+++ b/server/container/guice/cassandra-guice/sample-configuration/usersrepository.xml
@@ -0,0 +1,27 @@
+<?xml version="1.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.                                           
+ -->
+
+<usersrepository name="LocalUsers" class="org.apache.james.user.jpa.JPAUsersRepository">
+    <destination URL="file://users/"/>
+    <algorithm>MD5</algorithm>
+    <enableVirtualHosting>true</enableVirtualHosting>
+    <enableForwarding>true</enableForwarding>
+</usersrepository>
+

http://git-wip-us.apache.org/repos/asf/james-project/blob/b45667b6/server/container/guice/guice-common/sample-configuration/cassandra.properties
----------------------------------------------------------------------
diff --git a/server/container/guice/guice-common/sample-configuration/cassandra.properties b/server/container/guice/guice-common/sample-configuration/cassandra.properties
deleted file mode 100644
index 1358332..0000000
--- a/server/container/guice/guice-common/sample-configuration/cassandra.properties
+++ /dev/null
@@ -1,6 +0,0 @@
-# Configuration file for cassandra mailbox
-
-cassandra.ip=172.17.0.2
-cassandra.port=9042
-cassandra.keyspace=apache_james
-cassandra.replication.factor=1
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/james-project/blob/b45667b6/server/container/guice/guice-common/sample-configuration/dnsservice.xml
----------------------------------------------------------------------
diff --git a/server/container/guice/guice-common/sample-configuration/dnsservice.xml b/server/container/guice/guice-common/sample-configuration/dnsservice.xml
deleted file mode 100644
index 0978a00..0000000
--- a/server/container/guice/guice-common/sample-configuration/dnsservice.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.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.                                           
- -->
-
-<dnsservice>
-  <servers>
-    <server>8.8.8.8</server>
-    <server>62.210.16.6</server>
-  </servers>
-  <autodiscover>false</autodiscover>
-  <authoritative>false</authoritative>
-  <maxcachesize>50000</maxcachesize>
-</dnsservice>

http://git-wip-us.apache.org/repos/asf/james-project/blob/b45667b6/server/container/guice/guice-common/sample-configuration/domainlist.xml
----------------------------------------------------------------------
diff --git a/server/container/guice/guice-common/sample-configuration/domainlist.xml b/server/container/guice/guice-common/sample-configuration/domainlist.xml
deleted file mode 100644
index 8d00118..0000000
--- a/server/container/guice/guice-common/sample-configuration/domainlist.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.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.                                           
- -->
-
-<domainlist class="org.apache.james.domainlist.jpa.JPADomainList">
-    <domainnames>
-        <domainname>james.apache.org</domainname>
-    </domainnames>
-    <autodetect>true</autodetect>
-    <autodetectIP>true</autodetectIP>
-    <defaultDomain>localhost</defaultDomain>
-</domainlist>

http://git-wip-us.apache.org/repos/asf/james-project/blob/b45667b6/server/container/guice/guice-common/sample-configuration/elasticsearch.properties
----------------------------------------------------------------------
diff --git a/server/container/guice/guice-common/sample-configuration/elasticsearch.properties b/server/container/guice/guice-common/sample-configuration/elasticsearch.properties
deleted file mode 100644
index 924404c..0000000
--- a/server/container/guice/guice-common/sample-configuration/elasticsearch.properties
+++ /dev/null
@@ -1,26 +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.
-
-#  This template file can be used as example for James Server configuration
-#  DO NOT USE IT AS SUCH AND ADAPT IT TO YOUR NEEDS
-
-# Configuration file for ElasticSearch
-
-elasticsearch.masterHost=172.17.0.1
-elasticsearch.port=9300
-elasticsearch.nb.shards=1
-elasticsearch.nb.replica=0
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/james-project/blob/b45667b6/server/container/guice/guice-common/sample-configuration/imapserver.xml
----------------------------------------------------------------------
diff --git a/server/container/guice/guice-common/sample-configuration/imapserver.xml b/server/container/guice/guice-common/sample-configuration/imapserver.xml
deleted file mode 100644
index c03b978..0000000
--- a/server/container/guice/guice-common/sample-configuration/imapserver.xml
+++ /dev/null
@@ -1,54 +0,0 @@
-<?xml version="1.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.
--->
-
-
-<imapservers>
-	<imapserver enabled="true">
-		<jmxName>imapserver</jmxName>
-		<bind>0.0.0.0:1143</bind>
-		<connectionBacklog>200</connectionBacklog>
-		<tls socketTLS="false" startTLS="true">
-			<!-- To create a new keystore execute:
-            keytool -genkey -alias james -keyalg RSA -keystore /path/to/james/conf/keystore
-              -->
-			<keystore>file://conf/keystore</keystore>
-			<secret>james72laBalle</secret>
-			<provider>org.bouncycastle.jce.provider.BouncyCastleProvider</provider>
-		</tls>
-		<connectionLimit>0</connectionLimit>
-		<connectionLimitPerIP>0</connectionLimitPerIP>
-	</imapserver>
-	<imapserver enabled="true">
-		<jmxName>imapserver-ssl</jmxName>
-		<bind>0.0.0.0:1993</bind>
-		<connectionBacklog>200</connectionBacklog>
-		<tls socketTLS="true" startTLS="false">
-			<!-- To create a new keystore execute:
-              keytool -genkey -alias james -keyalg RSA -keystore /path/to/james/conf/keystore
-             -->
-			<keystore>file://conf/keystore</keystore>
-			<secret>james72laBalle</secret>
-			<provider>org.bouncycastle.jce.provider.BouncyCastleProvider</provider>
-		</tls>
-		<connectionLimit>0</connectionLimit>
-		<connectionLimitPerIP>0</connectionLimitPerIP>
-	</imapserver>
-</imapservers>

http://git-wip-us.apache.org/repos/asf/james-project/blob/b45667b6/server/container/guice/guice-common/sample-configuration/james-database.properties
----------------------------------------------------------------------
diff --git a/server/container/guice/guice-common/sample-configuration/james-database.properties b/server/container/guice/guice-common/sample-configuration/james-database.properties
deleted file mode 100644
index b3ac7eb..0000000
--- a/server/container/guice/guice-common/sample-configuration/james-database.properties
+++ /dev/null
@@ -1,40 +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.
-
-#  This template file can be used as example for James Server configuration
-#  DO NOT USE IT AS SUCH AND ADAPT IT TO YOUR NEEDS
-
-# See http://james.apache.org/server/3/config.html for usage
-
-# Use derby as default
-database.driverClassName=org.apache.derby.jdbc.EmbeddedDriver
-database.url=jdbc:derby:../var/store/derby;create=true
-database.username=app
-database.password=app
-
-# Supported adapters are:
-# DB2, DERBY, H2, HSQL, INFORMIX, MYSQL, ORACLE, POSTGRESQL, SQL_SERVER, SYBASE 
-vendorAdapter.database=DERBY
-
-# Use streaming for Blobs
-# This is only supported on a limited set of databases atm. You should check if its supported by your DB before enable
-# it. 
-# 
-# See:
-# http://openjpa.apache.org/builds/latest/docs/manual/ref_guide_mapping_jpa.html  #7.11.  LOB Streaming 
-# 
-openjpa.streaming=false
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/james-project/blob/b45667b6/server/container/guice/guice-common/sample-configuration/jcr-repository.xml
----------------------------------------------------------------------
diff --git a/server/container/guice/guice-common/sample-configuration/jcr-repository.xml b/server/container/guice/guice-common/sample-configuration/jcr-repository.xml
deleted file mode 100644
index c1b998a..0000000
--- a/server/container/guice/guice-common/sample-configuration/jcr-repository.xml
+++ /dev/null
@@ -1,72 +0,0 @@
-<?xml version="1.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.
--->
-
-<!--
-   This template file can be used as example for James Server configuration
-   DO NOT USE IT AS SUCH AND ADAPT IT TO YOUR NEEDS
--->
-
-<!-- See http://james.apache.org/server/3/config.html for usage -->
-
-<!DOCTYPE Repository
-        PUBLIC "-//The Apache Software Foundation//DTD Jackrabbit 2.0//EN"
-        "http://jackrabbit.apache.org/dtd/repository-2.0.dtd">
-
-<Repository>
-    <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
-        <param name="path" value="${rep.home}/repository"/>
-    </FileSystem>
-    <DataStore class="org.apache.jackrabbit.core.data.FileDataStore"/>
-    <Security appName="Jackrabbit">
-        <SecurityManager class="org.apache.jackrabbit.core.security.simple.SimpleSecurityManager" workspaceName="security">
-        </SecurityManager>
-        <AccessManager class="org.apache.jackrabbit.core.security.simple.SimpleAccessManager">
-        </AccessManager>
-        <LoginModule class="org.apache.jackrabbit.core.security.simple.SimpleLoginModule">
-            <param name="anonymousId" value="anonymous"/>
-            <param name="adminId" value="admin"/>
-        </LoginModule>
-    </Security>
-    <Workspaces rootPath="${rep.home}/workspaces" defaultWorkspace="james"/>
-    <Workspace name="${wsp.name}">
-        <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
-            <param name="path" value="${wsp.home}"/>
-        </FileSystem>
-        <PersistenceManager class="org.apache.jackrabbit.core.persistence.pool.DerbyPersistenceManager">
-            <param name="url" value="jdbc:derby:${wsp.home}/db;create=true"/>
-            <param name="schemaObjectPrefix" value="${wsp.name}_"/>
-        </PersistenceManager>
-        <SearchIndex class="org.apache.jackrabbit.core.query.lucene.SearchIndex">
-            <param name="path" value="${wsp.home}/index"/>
-            <param name="supportHighlighting" value="true"/>
-        </SearchIndex>
-    </Workspace>
-    <Versioning rootPath="${rep.home}/version">
-        <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
-            <param name="path" value="${rep.home}/version" />
-        </FileSystem>
-        <PersistenceManager class="org.apache.jackrabbit.core.persistence.pool.DerbyPersistenceManager">
-            <param name="url" value="jdbc:derby:${rep.home}/version/db;create=true"/>
-            <param name="schemaObjectPrefix" value="version_"/>
-        </PersistenceManager>
-    </Versioning>
-    <SearchIndex class="org.apache.jackrabbit.core.query.lucene.SearchIndex">
-        <param name="path" value="${rep.home}/repository/index"/>
-        <param name="supportHighlighting" value="true"/>
-    </SearchIndex>
-</Repository>

http://git-wip-us.apache.org/repos/asf/james-project/blob/b45667b6/server/container/guice/guice-common/sample-configuration/jmap.properties
----------------------------------------------------------------------
diff --git a/server/container/guice/guice-common/sample-configuration/jmap.properties b/server/container/guice/guice-common/sample-configuration/jmap.properties
deleted file mode 100644
index d785ccd..0000000
--- a/server/container/guice/guice-common/sample-configuration/jmap.properties
+++ /dev/null
@@ -1,11 +0,0 @@
-# Configuration file for JMAP
-
-tls.keystoreURL=file://conf/keystore
-tls.secret=james72laBalle
-
-#
-# If you wish to use OAuth authentication, you should provide a valid JWT public key.
-# The following entry specify the link to the URL of the public key file,
-# which should be a PEM format file.
-#
-jwt.publickeypem.url=
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/james-project/blob/b45667b6/server/container/guice/guice-common/sample-configuration/jmx.properties
----------------------------------------------------------------------
diff --git a/server/container/guice/guice-common/sample-configuration/jmx.properties b/server/container/guice/guice-common/sample-configuration/jmx.properties
deleted file mode 100644
index a1dbdf8..0000000
--- a/server/container/guice/guice-common/sample-configuration/jmx.properties
+++ /dev/null
@@ -1,28 +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.
-#
-
-#  This template file can be used as example for James Server configuration
-#  DO NOT USE IT AS SUCH AND ADAPT IT TO YOUR NEEDS
-
-#  This template file can be used as example for James Server configuration
-#  DO NOT USE IT AS SUCH AND ADAPT IT TO YOUR NEEDS
-
-# See http://james.apache.org/server/3/config.html for usage
-
-jmx.address=127.0.0.1
-jmx.port=9999

http://git-wip-us.apache.org/repos/asf/james-project/blob/b45667b6/server/container/guice/guice-common/sample-configuration/lmtpserver.xml
----------------------------------------------------------------------
diff --git a/server/container/guice/guice-common/sample-configuration/lmtpserver.xml b/server/container/guice/guice-common/sample-configuration/lmtpserver.xml
deleted file mode 100644
index 87a0caa..0000000
--- a/server/container/guice/guice-common/sample-configuration/lmtpserver.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-<?xml version="1.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.                                           
- -->
-
-<lmtpservers>
-
-    <lmtpserver enabled="false">
-        <jmxName>lmtpserver</jmxName>
-        <!-- LMTP should not be reachable from outside your network so bind it to loopback-->
-        <bind>127.0.0.1:1024</bind>
-        <connectionBacklog>200</connectionBacklog>
-        <connectiontimeout>1200</connectiontimeout>
-        <!-- Set the maximum simultaneous incoming connections for this service -->
-        <connectionLimit>0</connectionLimit>
-        <!-- Set the maximum simultaneous incoming connections per IP for this service -->
-        <connectionLimitPerIP>0</connectionLimitPerIP>
-        <!--  This sets the maximum allowed message size (in kilobytes) for this -->
-        <!--  LMTP service. If unspecified, the value defaults to 0, which means no limit. -->
-        <maxmessagesize>0</maxmessagesize>
-        <handlerchain>
-            <handler class="org.apache.james.lmtpserver.CoreCmdHandlerLoader"/>
-        </handlerchain>
-    </lmtpserver>
-
-</lmtpservers>

http://git-wip-us.apache.org/repos/asf/james-project/blob/b45667b6/server/container/guice/guice-common/sample-configuration/mailetcontainer.xml
----------------------------------------------------------------------
diff --git a/server/container/guice/guice-common/sample-configuration/mailetcontainer.xml b/server/container/guice/guice-common/sample-configuration/mailetcontainer.xml
deleted file mode 100644
index 968b59c..0000000
--- a/server/container/guice/guice-common/sample-configuration/mailetcontainer.xml
+++ /dev/null
@@ -1,137 +0,0 @@
-<?xml version="1.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.
- -->
-
-<mailetcontainer enableJmx="true">
-
-    <context>
-        <postmaster>postmaster@james.minet.net</postmaster>
-    </context>
-
-    <spooler>
-        <threads>20</threads>
-    </spooler>
-
-    <processors>
-        <processor state="root" enableJmx="true">
-            <mailet match="All" class="PostmasterAlias"/>
-            <mailet match="RelayLimit=30" class="Null"/>
-            <!-- Hook on sievemanager@james.linagora.com
-                 Mail send to this address will get interpreted with SIEVE Manage -->
-            <mailet match="RecipientIs=sievemanager@james.linagora.com" class="ToProcessor">
-                <processor>sieve-manager-check</processor>
-            </mailet>
-            <mailet match="HasMailAttribute=spamChecked" class="ToProcessor">
-                <processor>transport</processor>
-            </mailet>
-            <mailet match="All" class="SetMailAttribute">
-                <spamChecked>true</spamChecked>
-            </mailet>
-            <mailet match="SMTPAuthSuccessful" class="ToProcessor">
-                <processor>transport</processor>
-            </mailet>
-            <mailet match="InSpammerBlacklist=query.bondedsender.org." class="ToProcessor">
-                <processor>transport</processor>
-            </mailet>
-            <!-- Check for delivery from a known spam server -->
-            <!-- This set of matchers/mailets redirect all emails from known -->
-            <!-- black holes, open relays, and spam servers to the spam processor -->
-            <!-- For this set to function properly, the spam processor must be configured. -->
-            <mailet match="InSpammerBlacklist=dnsbl.njabl.org." class="ToProcessor">
-                <processor>spam</processor>
-                <notice>550 Requested action not taken: rejected - see http://njabl.org/</notice>
-            </mailet>
-            <mailet match="All" class="ToProcessor">
-                <processor>transport</processor>
-            </mailet>
-        </processor>
-
-        <processor state="error" enableJmx="true">
-            <mailet match="All" class="Bounce"/>
-            <mailet match="All" class="ToRepository">
-                <repositoryPath>file://var/mail/error/</repositoryPath>
-            </mailet>
-        </processor>
-
-
-        <processor state="transport" enableJmx="true">
-            <mailet match="SMTPAuthSuccessful" class="SetMimeHeader">
-                <name>X-UserIsAuth</name>
-                <value>true</value>
-            </mailet>
-            <mailet match="HasMailAttribute=org.apache.james.SMIMECheckSignature" class="SetMimeHeader">
-                <name>X-WasSigned</name>
-                <value>true</value>
-            </mailet>
-            <mailet match="All" class="RecipientRewriteTable" />
-            <mailet match="RecipientIsLocal" class="LocalDelivery"/>
-            <mailet match="HostIsLocal" class="ToProcessor">
-                <processor>local-address-error</processor>
-                <notice>550 - Requested action not taken: no such user here</notice>
-            </mailet>
-            <mailet match="SMTPAuthSuccessful" class="RemoteDelivery">
-                <outgoingQueue>outgoing</outgoingQueue>
-                <delayTime>5000, 100000, 500000</delayTime>
-                <maxRetries>25</maxRetries>
-                <maxDnsProblemRetries>0</maxDnsProblemRetries>
-                <deliveryThreads>10</deliveryThreads>
-                <sendpartial>true</sendpartial>
-                <bounceProcessor>bounces</bounceProcessor>
-            </mailet>
-            <mailet match="All" class="ToProcessor">
-                <processor>relay-denied</processor>
-            </mailet>
-        </processor>
-
-        <processor state="spam" enableJmx="true">
-            <mailet match="All" class="ToRepository">
-                <repositoryPath>file://var/mail/spam/</repositoryPath>
-            </mailet>
-        </processor>
-
-        <processor state="local-address-error" enableJmx="true">
-            <mailet match="All" class="Bounce">
-                <attachment>none</attachment>
-            </mailet>
-            <mailet match="All" class="ToRepository">
-                <repositoryPath>file://var/mail/address-error/</repositoryPath>
-            </mailet>
-        </processor>
-
-        <processor state="relay-denied" enableJmx="true">
-            <mailet match="All" class="Bounce">
-                <attachment>none</attachment>
-            </mailet>
-            <mailet match="All" class="ToRepository">
-                <repositoryPath>file://var/mail/relay-denied/</repositoryPath>
-                <notice>Warning: You are sending an e-mail to a remote server. You must be authentified to perform such an operation</notice>
-            </mailet>
-        </processor>
-
-        <processor state="bounces" enableJmx="true">
-            <mailet match="All" class="DSNBounce">
-                <passThrough>false</passThrough>
-            </mailet>
-        </processor>
-    </processors>
-
-</mailetcontainer>
-
-

http://git-wip-us.apache.org/repos/asf/james-project/blob/b45667b6/server/container/guice/guice-common/sample-configuration/mailrepositorystore.xml
----------------------------------------------------------------------
diff --git a/server/container/guice/guice-common/sample-configuration/mailrepositorystore.xml b/server/container/guice/guice-common/sample-configuration/mailrepositorystore.xml
deleted file mode 100644
index acca810..0000000
--- a/server/container/guice/guice-common/sample-configuration/mailrepositorystore.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.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.
- -->
-
-<mailrepositorystore>
-    <mailrepositories>
-        <!-- File based repositories.  These repositories store all message data -->
-        <!-- in the file system. -->
-        <mailrepository class="org.apache.james.mailrepository.file.FileMailRepository">
-            <protocols>
-                <protocol>file</protocol>
-            </protocols>
-            <!-- Set if the messages should be listed sorted. False by default -->
-            <config FIFO="false" CACHEKEYS="true"/>
-        </mailrepository>
-    </mailrepositories>
-</mailrepositorystore>

http://git-wip-us.apache.org/repos/asf/james-project/blob/b45667b6/server/container/guice/guice-common/sample-configuration/pop3server.xml
----------------------------------------------------------------------
diff --git a/server/container/guice/guice-common/sample-configuration/pop3server.xml b/server/container/guice/guice-common/sample-configuration/pop3server.xml
deleted file mode 100644
index c57c832..0000000
--- a/server/container/guice/guice-common/sample-configuration/pop3server.xml
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.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.                                           
- -->
-
-
-<pop3servers>
-    <pop3server enabled="false">
-        <jmxName>pop3server</jmxName>
-        <bind>0.0.0.0:1110</bind>
-        <connectionBacklog>200</connectionBacklog>
-        <tls socketTLS="false" startTLS="false">
-            <!-- To create a new keystore execute:
-                  keytool -genkey -alias james -keyalg RSA -keystore /path/to/james/conf/keystore
-             -->
-            <keystore>file://conf/keystore</keystore>
-            <secret>james72laBalle</secret>
-            <provider>org.bouncycastle.jce.provider.BouncyCastleProvider</provider>
-        </tls>
-        <connectiontimeout>1200</connectiontimeout>
-        <connectionLimit>0</connectionLimit>
-        <connectionLimitPerIP>0</connectionLimitPerIP>
-        <handlerchain>
-            <handler class="org.apache.james.pop3server.core.CoreCmdHandlerLoader"/>
-        </handlerchain>
-    </pop3server>
-</pop3servers>

http://git-wip-us.apache.org/repos/asf/james-project/blob/b45667b6/server/container/guice/guice-common/sample-configuration/recipientrewritetable.xml
----------------------------------------------------------------------
diff --git a/server/container/guice/guice-common/sample-configuration/recipientrewritetable.xml b/server/container/guice/guice-common/sample-configuration/recipientrewritetable.xml
deleted file mode 100644
index 7e7f586..0000000
--- a/server/container/guice/guice-common/sample-configuration/recipientrewritetable.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.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.                                           
- -->
-
-<!-- The default table for storing James' RecipientRewriteTable mappings. -->
-<recipientrewritetable class="org.apache.james.rrt.jpa.JPARecipientRewriteTable">
-  <recursiveMapping>true</recursiveMapping>
-  <mappingLimit>10</mappingLimit>
-  <mapping>some@domain=some</mapping>
-</recipientrewritetable>
-

http://git-wip-us.apache.org/repos/asf/james-project/blob/b45667b6/server/container/guice/guice-common/sample-configuration/smtpserver.xml
----------------------------------------------------------------------
diff --git a/server/container/guice/guice-common/sample-configuration/smtpserver.xml b/server/container/guice/guice-common/sample-configuration/smtpserver.xml
deleted file mode 100644
index c34fcd1..0000000
--- a/server/container/guice/guice-common/sample-configuration/smtpserver.xml
+++ /dev/null
@@ -1,105 +0,0 @@
-<?xml version="1.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.
- -->
-
-<smtpservers>
-    <smtpserver enabled="true">
-        <jmxName>smtpserver-global</jmxName>
-        <bind>0.0.0.0:1025</bind>
-        <connectionBacklog>200</connectionBacklog>
-        <tls socketTLS="false" startTLS="false">
-            <keystore>file://conf/keystore</keystore>
-            <secret>james72laBalle</secret>
-            <provider>org.bouncycastle.jce.provider.BouncyCastleProvider</provider>
-            <algorithm>SunX509</algorithm>
-        </tls>
-        <connectiontimeout>360</connectiontimeout>
-        <connectionLimit>0</connectionLimit>
-        <connectionLimitPerIP>0</connectionLimitPerIP>
-        <authRequired>false</authRequired>
-        <authorizedAddresses>0.0.0.0/0</authorizedAddresses>
-        <verifyIdentity>true</verifyIdentity>
-        <maxmessagesize>0</maxmessagesize>
-        <addressBracketsEnforcement>true</addressBracketsEnforcement>
-        <smtpGreeting>JAMES Linagora's SMTP awesome Server</smtpGreeting>
-        <handlerchain>
-            <handler class="org.apache.james.smtpserver.fastfail.ValidRcptHandler"/>
-            <handler class="org.apache.james.smtpserver.CoreCmdHandlerLoader"/>
-        </handlerchain>
-    </smtpserver>
-    <smtpserver enabled="true">
-        <jmxName>smtpserver-TLS</jmxName>
-        <bind>0.0.0.0:1465</bind>
-        <connectionBacklog>200</connectionBacklog>
-        <tls socketTLS="true" startTLS="false">
-            <keystore>file://conf/keystore</keystore>
-            <secret>james72laBalle</secret>
-            <provider>org.bouncycastle.jce.provider.BouncyCastleProvider</provider>
-            <algorithm>SunX509</algorithm>
-        </tls>
-        <connectiontimeout>360</connectiontimeout>
-        <connectionLimit>0</connectionLimit>
-        <connectionLimitPerIP>0</connectionLimitPerIP>
-        <!--
-           Authorize only local users
-        -->
-        <authRequired>true</authRequired>
-        <authorizedAddresses>0.0.0.0/0</authorizedAddresses>
-        <!-- Trust authenticated users -->
-        <verifyIdentity>false</verifyIdentity>
-        <maxmessagesize>0</maxmessagesize>
-        <addressBracketsEnforcement>true</addressBracketsEnforcement>
-        <smtpGreeting>JAMES Linagora's SMTP awesome Server</smtpGreeting>
-        <handlerchain>
-            <handler class="org.apache.james.smtpserver.fastfail.ValidRcptHandler"/>
-            <handler class="org.apache.james.smtpserver.CoreCmdHandlerLoader"/>
-        </handlerchain>
-    </smtpserver>
-    <smtpserver enabled="true">
-        <jmxName>smtpserver-authenticated</jmxName>
-        <bind>0.0.0.0:1587</bind>
-        <connectionBacklog>200</connectionBacklog>
-        <tls socketTLS="false" startTLS="true">
-            <keystore>file://conf/keystore</keystore>
-            <secret>james72laBalle</secret>
-            <provider>org.bouncycastle.jce.provider.BouncyCastleProvider</provider>
-            <algorithm>SunX509</algorithm>
-        </tls>
-        <connectiontimeout>360</connectiontimeout>
-        <connectionLimit>0</connectionLimit>
-        <connectionLimitPerIP>0</connectionLimitPerIP>
-        <!--
-           Authorize only local users
-        -->
-        <authRequired>true</authRequired>
-        <authorizedAddresses>0.0.0.0/0</authorizedAddresses>
-        <!-- Trust authenticated users -->
-        <verifyIdentity>false</verifyIdentity>
-        <maxmessagesize>0</maxmessagesize>
-        <addressBracketsEnforcement>true</addressBracketsEnforcement>
-        <smtpGreeting>JAMES Linagora's SMTP awesome Server</smtpGreeting>
-        <handlerchain>
-            <handler class="org.apache.james.smtpserver.fastfail.ValidRcptHandler"/>
-            <handler class="org.apache.james.smtpserver.CoreCmdHandlerLoader"/>
-        </handlerchain>
-    </smtpserver>
-</smtpservers>
-
-

http://git-wip-us.apache.org/repos/asf/james-project/blob/b45667b6/server/container/guice/guice-common/sample-configuration/usersrepository.xml
----------------------------------------------------------------------
diff --git a/server/container/guice/guice-common/sample-configuration/usersrepository.xml b/server/container/guice/guice-common/sample-configuration/usersrepository.xml
deleted file mode 100644
index fc76107..0000000
--- a/server/container/guice/guice-common/sample-configuration/usersrepository.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.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.                                           
- -->
-
-<usersrepository name="LocalUsers" class="org.apache.james.user.jpa.JPAUsersRepository">
-    <destination URL="file://users/"/>
-    <algorithm>MD5</algorithm>
-    <enableVirtualHosting>true</enableVirtualHosting>
-    <enableForwarding>true</enableForwarding>
-</usersrepository>
-

http://git-wip-us.apache.org/repos/asf/james-project/blob/b45667b6/server/container/guice/jpa-guice/sample-configuration/dnsservice.xml
----------------------------------------------------------------------
diff --git a/server/container/guice/jpa-guice/sample-configuration/dnsservice.xml b/server/container/guice/jpa-guice/sample-configuration/dnsservice.xml
new file mode 100644
index 0000000..0978a00
--- /dev/null
+++ b/server/container/guice/jpa-guice/sample-configuration/dnsservice.xml
@@ -0,0 +1,29 @@
+<?xml version="1.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.                                           
+ -->
+
+<dnsservice>
+  <servers>
+    <server>8.8.8.8</server>
+    <server>62.210.16.6</server>
+  </servers>
+  <autodiscover>false</autodiscover>
+  <authoritative>false</authoritative>
+  <maxcachesize>50000</maxcachesize>
+</dnsservice>

http://git-wip-us.apache.org/repos/asf/james-project/blob/b45667b6/server/container/guice/jpa-guice/sample-configuration/domainlist.xml
----------------------------------------------------------------------
diff --git a/server/container/guice/jpa-guice/sample-configuration/domainlist.xml b/server/container/guice/jpa-guice/sample-configuration/domainlist.xml
new file mode 100644
index 0000000..8d00118
--- /dev/null
+++ b/server/container/guice/jpa-guice/sample-configuration/domainlist.xml
@@ -0,0 +1,28 @@
+<?xml version="1.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.                                           
+ -->
+
+<domainlist class="org.apache.james.domainlist.jpa.JPADomainList">
+    <domainnames>
+        <domainname>james.apache.org</domainname>
+    </domainnames>
+    <autodetect>true</autodetect>
+    <autodetectIP>true</autodetectIP>
+    <defaultDomain>localhost</defaultDomain>
+</domainlist>

http://git-wip-us.apache.org/repos/asf/james-project/blob/b45667b6/server/container/guice/jpa-guice/sample-configuration/imapserver.xml
----------------------------------------------------------------------
diff --git a/server/container/guice/jpa-guice/sample-configuration/imapserver.xml b/server/container/guice/jpa-guice/sample-configuration/imapserver.xml
new file mode 100644
index 0000000..c03b978
--- /dev/null
+++ b/server/container/guice/jpa-guice/sample-configuration/imapserver.xml
@@ -0,0 +1,54 @@
+<?xml version="1.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.
+-->
+
+
+<imapservers>
+	<imapserver enabled="true">
+		<jmxName>imapserver</jmxName>
+		<bind>0.0.0.0:1143</bind>
+		<connectionBacklog>200</connectionBacklog>
+		<tls socketTLS="false" startTLS="true">
+			<!-- To create a new keystore execute:
+            keytool -genkey -alias james -keyalg RSA -keystore /path/to/james/conf/keystore
+              -->
+			<keystore>file://conf/keystore</keystore>
+			<secret>james72laBalle</secret>
+			<provider>org.bouncycastle.jce.provider.BouncyCastleProvider</provider>
+		</tls>
+		<connectionLimit>0</connectionLimit>
+		<connectionLimitPerIP>0</connectionLimitPerIP>
+	</imapserver>
+	<imapserver enabled="true">
+		<jmxName>imapserver-ssl</jmxName>
+		<bind>0.0.0.0:1993</bind>
+		<connectionBacklog>200</connectionBacklog>
+		<tls socketTLS="true" startTLS="false">
+			<!-- To create a new keystore execute:
+              keytool -genkey -alias james -keyalg RSA -keystore /path/to/james/conf/keystore
+             -->
+			<keystore>file://conf/keystore</keystore>
+			<secret>james72laBalle</secret>
+			<provider>org.bouncycastle.jce.provider.BouncyCastleProvider</provider>
+		</tls>
+		<connectionLimit>0</connectionLimit>
+		<connectionLimitPerIP>0</connectionLimitPerIP>
+	</imapserver>
+</imapservers>

http://git-wip-us.apache.org/repos/asf/james-project/blob/b45667b6/server/container/guice/jpa-guice/sample-configuration/james-database.properties
----------------------------------------------------------------------
diff --git a/server/container/guice/jpa-guice/sample-configuration/james-database.properties b/server/container/guice/jpa-guice/sample-configuration/james-database.properties
new file mode 100644
index 0000000..b3ac7eb
--- /dev/null
+++ b/server/container/guice/jpa-guice/sample-configuration/james-database.properties
@@ -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.
+
+#  This template file can be used as example for James Server configuration
+#  DO NOT USE IT AS SUCH AND ADAPT IT TO YOUR NEEDS
+
+# See http://james.apache.org/server/3/config.html for usage
+
+# Use derby as default
+database.driverClassName=org.apache.derby.jdbc.EmbeddedDriver
+database.url=jdbc:derby:../var/store/derby;create=true
+database.username=app
+database.password=app
+
+# Supported adapters are:
+# DB2, DERBY, H2, HSQL, INFORMIX, MYSQL, ORACLE, POSTGRESQL, SQL_SERVER, SYBASE 
+vendorAdapter.database=DERBY
+
+# Use streaming for Blobs
+# This is only supported on a limited set of databases atm. You should check if its supported by your DB before enable
+# it. 
+# 
+# See:
+# http://openjpa.apache.org/builds/latest/docs/manual/ref_guide_mapping_jpa.html  #7.11.  LOB Streaming 
+# 
+openjpa.streaming=false
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/james-project/blob/b45667b6/server/container/guice/jpa-guice/sample-configuration/jmx.properties
----------------------------------------------------------------------
diff --git a/server/container/guice/jpa-guice/sample-configuration/jmx.properties b/server/container/guice/jpa-guice/sample-configuration/jmx.properties
new file mode 100644
index 0000000..a1dbdf8
--- /dev/null
+++ b/server/container/guice/jpa-guice/sample-configuration/jmx.properties
@@ -0,0 +1,28 @@
+#  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.
+#
+
+#  This template file can be used as example for James Server configuration
+#  DO NOT USE IT AS SUCH AND ADAPT IT TO YOUR NEEDS
+
+#  This template file can be used as example for James Server configuration
+#  DO NOT USE IT AS SUCH AND ADAPT IT TO YOUR NEEDS
+
+# See http://james.apache.org/server/3/config.html for usage
+
+jmx.address=127.0.0.1
+jmx.port=9999


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


[16/29] james-project git commit: JAMES-1842: Add more binding for MessageId

Posted by ad...@apache.org.
JAMES-1842: Add more binding for MessageId


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

Branch: refs/heads/master
Commit: 270a97f7d99150eae6fb65491082485ed8f98037
Parents: d65e484
Author: Quynh Nguyen <qn...@linagora.com>
Authored: Fri Oct 28 12:50:20 2016 +0700
Committer: Quynh Nguyen <qn...@linagora.com>
Committed: Fri Nov 18 09:25:34 2016 +0700

----------------------------------------------------------------------
 .../resources/META-INF/spring/mailbox-cassandra.xml     |  4 +---
 .../src/main/resources/META-INF/spring/mailbox-jpa.xml  | 12 ++++--------
 .../main/resources/META-INF/spring/mailbox-maildir.xml  |  4 +---
 .../main/resources/META-INF/spring/mailbox-memory.xml   |  4 +---
 .../main/resources/META-INF/spring/spring-mailbox.xml   |  3 ++-
 .../apache/james/modules/mailbox/JPAMailboxModule.java  |  4 ++++
 6 files changed, 13 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/270a97f7/mailbox/cassandra/src/main/resources/META-INF/spring/mailbox-cassandra.xml
----------------------------------------------------------------------
diff --git a/mailbox/cassandra/src/main/resources/META-INF/spring/mailbox-cassandra.xml b/mailbox/cassandra/src/main/resources/META-INF/spring/mailbox-cassandra.xml
index 3d40aad..5078a18 100644
--- a/mailbox/cassandra/src/main/resources/META-INF/spring/mailbox-cassandra.xml
+++ b/mailbox/cassandra/src/main/resources/META-INF/spring/mailbox-cassandra.xml
@@ -34,7 +34,7 @@
         <constructor-arg index="0" ref="cassandra-sessionMapperFactory"/>
         <constructor-arg index="1" ref="authenticator"/>
         <constructor-arg index="2" ref="cassandra-locker"/>
-        <constructor-arg index="3" ref="cassandra-messageIdFactory" />
+        <constructor-arg index="3" ref="messageIdFactory" />
         <property name="messageSearchIndex" ref="elasticsearch-listener"/>
         <property name="quotaManager" ref="quotaManager"/>
         <property name="quotaRootResolver" ref="quotaRootResolver"/>
@@ -42,8 +42,6 @@
         <property name="delegatingMailboxListener" ref="delegating-listener"/>
     </bean>
 
-    <bean id="cassandra-messageIdFactory" class="org.apache.james.mailbox.store.mail.model.DefaultMessageId.Factory" />
-
     <bean id ="cassandra-subscriptionManager"
           class="org.apache.james.mailbox.cassandra.CassandraSubscriptionManager"
           lazy-init="true">

http://git-wip-us.apache.org/repos/asf/james-project/blob/270a97f7/mailbox/jpa/src/main/resources/META-INF/spring/mailbox-jpa.xml
----------------------------------------------------------------------
diff --git a/mailbox/jpa/src/main/resources/META-INF/spring/mailbox-jpa.xml b/mailbox/jpa/src/main/resources/META-INF/spring/mailbox-jpa.xml
index 223187c..a4fa05d 100644
--- a/mailbox/jpa/src/main/resources/META-INF/spring/mailbox-jpa.xml
+++ b/mailbox/jpa/src/main/resources/META-INF/spring/mailbox-jpa.xml
@@ -34,20 +34,16 @@
     <bean id="jpa-mailboxmanager" class="org.apache.james.mailbox.jpa.openjpa.OpenJPAMailboxManager" init-method="init">
         <constructor-arg index="0" ref="jpa-sessionMapperFactory"/>
         <constructor-arg index="1" ref="authenticator"/>
-        <constructor-arg index="2" ref="jpa-locker"/>
-        <constructor-arg index="3" type="boolean" value="false"/>
-        <constructor-arg index="4" ref="aclResolver"/>
-        <constructor-arg index="5" ref="groupMembershipResolver"/>
-        <constructor-arg index="6" ref="messageParser"/>
-        <constructor-arg index="7" ref="jpa-messageIdFactory" />
+        <constructor-arg index="2" ref="aclResolver"/>
+        <constructor-arg index="3" ref="groupMembershipResolver"/>
+        <constructor-arg index="4" ref="messageParser"/>
+        <constructor-arg index="5" ref="messageIdFactory"/>
         <property name="quotaManager" ref="quotaManager"/>
         <property name="quotaRootResolver" ref="quotaRootResolver"/>
         <property name="quotaUpdater" ref="quotaUpdater"/>
         <property name="delegatingMailboxListener" ref="delegating-listener"/>
     </bean>
     
-    <bean id="jpa-messageIdFactory" class="org.apache.james.mailbox.store.mail.model.DefaultMessageId.Factory" />
-    
     <bean id ="jpa-subscriptionManager" class="org.apache.james.mailbox.jpa.JPASubscriptionManager">
         <constructor-arg index="0" ref="jpa-sessionMapperFactory"/>
     </bean>

http://git-wip-us.apache.org/repos/asf/james-project/blob/270a97f7/mailbox/maildir/src/main/resources/META-INF/spring/mailbox-maildir.xml
----------------------------------------------------------------------
diff --git a/mailbox/maildir/src/main/resources/META-INF/spring/mailbox-maildir.xml b/mailbox/maildir/src/main/resources/META-INF/spring/mailbox-maildir.xml
index aaa1062..4e9ef7a 100644
--- a/mailbox/maildir/src/main/resources/META-INF/spring/mailbox-maildir.xml
+++ b/mailbox/maildir/src/main/resources/META-INF/spring/mailbox-maildir.xml
@@ -40,7 +40,7 @@
         <constructor-arg index="3" ref="aclResolver"/>
         <constructor-arg index="4" ref="groupMembershipResolver"/>
         <constructor-arg index="5" ref="messageParser"/>
-        <constructor-arg index="6" ref="maildir-messageIdFactory" />
+        <constructor-arg index="6" ref="messageIdFactory" />
 <!--         <property name="messageSearchIndex" ref="lazyIndex"/> -->
         <property name="quotaManager" ref="quotaManager"/>
         <property name="quotaRootResolver" ref="quotaRootResolver"/>
@@ -48,8 +48,6 @@
         <property name="delegatingMailboxListener" ref="delegating-listener"/>
     </bean>
     
-    <bean id="maildir-messageIdFactory" class="org.apache.james.mailbox.store.mail.model.DefaultMessageId.Factory" />
-    
     <bean id ="maildir-subscriptionManager" class="org.apache.james.mailbox.store.StoreSubscriptionManager">
         <constructor-arg index="0" ref="maildir-sessionMapperFactory"/>
     </bean>

http://git-wip-us.apache.org/repos/asf/james-project/blob/270a97f7/mailbox/memory/src/main/resources/META-INF/spring/mailbox-memory.xml
----------------------------------------------------------------------
diff --git a/mailbox/memory/src/main/resources/META-INF/spring/mailbox-memory.xml b/mailbox/memory/src/main/resources/META-INF/spring/mailbox-memory.xml
index 1beac65..92b2824 100644
--- a/mailbox/memory/src/main/resources/META-INF/spring/mailbox-memory.xml
+++ b/mailbox/memory/src/main/resources/META-INF/spring/mailbox-memory.xml
@@ -38,15 +38,13 @@
         <constructor-arg index="3" ref="aclResolver"/>
         <constructor-arg index="4" ref="groupMembershipResolver"/>
         <constructor-arg index="5" ref="messageParser"/>
-        <constructor-arg index="6" ref="memory-messageIdFactory" />
+        <constructor-arg index="6" ref="messageIdFactory" />
 <!--         <property name="messageSearchIndex" ref="lazyIndex"/> -->
         <property name="quotaManager" ref="quotaManager"/>
         <property name="quotaRootResolver" ref="quotaRootResolver"/>
         <property name="quotaUpdater" ref="quotaUpdater"/>
     </bean>
 
-    <bean id="memory-messageIdFactory" class="org.apache.james.mailbox.store.mail.model.DefaultMessageId.Factory" />
-
     <bean id ="memory-subscriptionManager" class="org.apache.james.mailbox.store.StoreSubscriptionManager">
         <constructor-arg index="0" ref="memory-sessionMapperFactory"/>
     </bean>

http://git-wip-us.apache.org/repos/asf/james-project/blob/270a97f7/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 182d1c1..153e1a2 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
@@ -22,7 +22,8 @@
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
 
-    <!-- 
+    <bean id="messageIdFactory" class="org.apache.james.mailbox.store.mail.model.DefaultMessageId.Factory" />
+    <!--
       Mailbox Managers
      -->
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/270a97f7/server/container/guice/jpa-guice/src/main/java/org/apache/james/modules/mailbox/JPAMailboxModule.java
----------------------------------------------------------------------
diff --git a/server/container/guice/jpa-guice/src/main/java/org/apache/james/modules/mailbox/JPAMailboxModule.java b/server/container/guice/jpa-guice/src/main/java/org/apache/james/modules/mailbox/JPAMailboxModule.java
index 7f5f6eb..52c4237 100644
--- a/server/container/guice/jpa-guice/src/main/java/org/apache/james/modules/mailbox/JPAMailboxModule.java
+++ b/server/container/guice/jpa-guice/src/main/java/org/apache/james/modules/mailbox/JPAMailboxModule.java
@@ -44,6 +44,7 @@ import org.apache.james.mailbox.jpa.mail.JPAModSeqProvider;
 import org.apache.james.mailbox.jpa.mail.JPAUidProvider;
 import org.apache.james.mailbox.jpa.openjpa.OpenJPAMailboxManager;
 import org.apache.james.mailbox.model.MailboxId;
+import org.apache.james.mailbox.model.MessageId;
 import org.apache.james.mailbox.store.Authenticator;
 import org.apache.james.mailbox.store.MailboxSessionMapperFactory;
 import org.apache.james.mailbox.store.NoMailboxPathLocker;
@@ -52,6 +53,7 @@ import org.apache.james.mailbox.store.mail.MailboxMapperFactory;
 import org.apache.james.mailbox.store.mail.MessageMapperFactory;
 import org.apache.james.mailbox.store.mail.ModSeqProvider;
 import org.apache.james.mailbox.store.mail.UidProvider;
+import org.apache.james.mailbox.store.mail.model.DefaultMessageId;
 import org.apache.james.modules.Names;
 import org.apache.james.utils.MailboxManagerDefinition;
 import org.apache.james.utils.PropertiesProvider;
@@ -77,11 +79,13 @@ public class JPAMailboxModule extends AbstractModule {
         bind(JPAId.Factory.class).in(Scopes.SINGLETON);
         bind(SimpleGroupMembershipResolver.class).in(Scopes.SINGLETON);
         bind(UnionMailboxACLResolver.class).in(Scopes.SINGLETON);
+        bind(DefaultMessageId.Factory.class).in(Scopes.SINGLETON);
 
         bind(MessageMapperFactory.class).to(JPAMailboxSessionMapperFactory.class);
         bind(MailboxMapperFactory.class).to(JPAMailboxSessionMapperFactory.class);
         bind(AttachmentMapperFactory.class).to(JPAMailboxSessionMapperFactory.class);
         bind(MailboxSessionMapperFactory.class).to(JPAMailboxSessionMapperFactory.class);
+        bind(MessageId.Factory.class).to(DefaultMessageId.Factory.class);
 
         bind(ModSeqProvider.class).to(JPAModSeqProvider.class);
         bind(UidProvider.class).to(JPAUidProvider.class);


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


[10/29] james-project git commit: JAMES-1842: Add jpa-guice module

Posted by ad...@apache.org.
http://git-wip-us.apache.org/repos/asf/james-project/blob/d65e484a/server/container/guice/jpa-guice/src/test/resources/pop3server.xml
----------------------------------------------------------------------
diff --git a/server/container/guice/jpa-guice/src/test/resources/pop3server.xml b/server/container/guice/jpa-guice/src/test/resources/pop3server.xml
new file mode 100644
index 0000000..e4187da
--- /dev/null
+++ b/server/container/guice/jpa-guice/src/test/resources/pop3server.xml
@@ -0,0 +1,42 @@
+<?xml version="1.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.                                           
+ -->
+
+
+<pop3servers>
+    <pop3server enabled="true">
+        <jmxName>pop3server</jmxName>
+        <bind>0.0.0.0:1110</bind>
+        <connectionBacklog>200</connectionBacklog>
+        <tls socketTLS="false" startTLS="false">
+            <!-- To create a new keystore execute:
+                  keytool -genkey -alias james -keyalg RSA -keystore /path/to/james/conf/keystore
+             -->
+            <keystore>file://conf/keystore</keystore>
+            <secret>james72laBalle</secret>
+            <provider>org.bouncycastle.jce.provider.BouncyCastleProvider</provider>
+        </tls>
+        <connectiontimeout>1200</connectiontimeout>
+        <connectionLimit>0</connectionLimit>
+        <connectionLimitPerIP>0</connectionLimitPerIP>
+        <handlerchain>
+            <handler class="org.apache.james.pop3server.core.CoreCmdHandlerLoader"/>
+        </handlerchain>
+    </pop3server>
+</pop3servers>

http://git-wip-us.apache.org/repos/asf/james-project/blob/d65e484a/server/container/guice/jpa-guice/src/test/resources/smtpserver.xml
----------------------------------------------------------------------
diff --git a/server/container/guice/jpa-guice/src/test/resources/smtpserver.xml b/server/container/guice/jpa-guice/src/test/resources/smtpserver.xml
new file mode 100644
index 0000000..a3d4b8f
--- /dev/null
+++ b/server/container/guice/jpa-guice/src/test/resources/smtpserver.xml
@@ -0,0 +1,105 @@
+<?xml version="1.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.
+ -->
+
+<smtpservers>
+    <smtpserver enabled="true">
+        <jmxName>smtpserver-global</jmxName>
+        <bind>0.0.0.0:1025</bind>
+        <connectionBacklog>200</connectionBacklog>
+        <tls socketTLS="false" startTLS="false">
+            <keystore>file://conf/keystore</keystore>
+            <secret>james72laBalle</secret>
+            <provider>org.bouncycastle.jce.provider.BouncyCastleProvider</provider>
+            <algorithm>SunX509</algorithm>
+        </tls>
+        <connectiontimeout>360</connectiontimeout>
+        <connectionLimit>0</connectionLimit>
+        <connectionLimitPerIP>0</connectionLimitPerIP>
+        <authRequired>false</authRequired>
+        <authorizedAddresses>0.0.0.0/0</authorizedAddresses>
+        <verifyIdentity>true</verifyIdentity>
+        <maxmessagesize>0</maxmessagesize>
+        <addressBracketsEnforcement>true</addressBracketsEnforcement>
+        <smtpGreeting>JAMES Linagora's SMTP awesome Server</smtpGreeting>
+        <handlerchain>
+            <handler class="org.apache.james.smtpserver.fastfail.ValidRcptHandler"/>
+            <handler class="org.apache.james.smtpserver.CoreCmdHandlerLoader"/>
+        </handlerchain>
+    </smtpserver>
+    <smtpserver enabled="true">
+        <jmxName>smtpserver-TLS</jmxName>
+        <bind>0.0.0.0:10465</bind>
+        <connectionBacklog>200</connectionBacklog>
+        <tls socketTLS="false" startTLS="false">
+            <keystore>file://conf/keystore</keystore>
+            <secret>james72laBalle</secret>
+            <provider>org.bouncycastle.jce.provider.BouncyCastleProvider</provider>
+            <algorithm>SunX509</algorithm>
+        </tls>
+        <connectiontimeout>360</connectiontimeout>
+        <connectionLimit>0</connectionLimit>
+        <connectionLimitPerIP>0</connectionLimitPerIP>
+        <!--
+           Authorize only local users
+        -->
+        <authRequired>true</authRequired>
+        <authorizedAddresses>0.0.0.0/0</authorizedAddresses>
+        <!-- Trust authenticated users -->
+        <verifyIdentity>false</verifyIdentity>
+        <maxmessagesize>0</maxmessagesize>
+        <addressBracketsEnforcement>true</addressBracketsEnforcement>
+        <smtpGreeting>JAMES Linagora's SMTP awesome Server</smtpGreeting>
+        <handlerchain>
+            <handler class="org.apache.james.smtpserver.fastfail.ValidRcptHandler"/>
+            <handler class="org.apache.james.smtpserver.CoreCmdHandlerLoader"/>
+        </handlerchain>
+    </smtpserver>
+    <smtpserver enabled="true">
+        <jmxName>smtpserver-authenticated</jmxName>
+        <bind>0.0.0.0:1587</bind>
+        <connectionBacklog>200</connectionBacklog>
+        <tls socketTLS="false" startTLS="false">
+            <keystore>file://conf/keystore</keystore>
+            <secret>james72laBalle</secret>
+            <provider>org.bouncycastle.jce.provider.BouncyCastleProvider</provider>
+            <algorithm>SunX509</algorithm>
+        </tls>
+        <connectiontimeout>360</connectiontimeout>
+        <connectionLimit>0</connectionLimit>
+        <connectionLimitPerIP>0</connectionLimitPerIP>
+        <!--
+           Authorize only local users
+        -->
+        <authRequired>true</authRequired>
+        <authorizedAddresses>0.0.0.0/0</authorizedAddresses>
+        <!-- Trust authenticated users -->
+        <verifyIdentity>false</verifyIdentity>
+        <maxmessagesize>0</maxmessagesize>
+        <addressBracketsEnforcement>true</addressBracketsEnforcement>
+        <smtpGreeting>JAMES Linagora's SMTP awesome Server</smtpGreeting>
+        <handlerchain>
+            <handler class="org.apache.james.smtpserver.fastfail.ValidRcptHandler"/>
+            <handler class="org.apache.james.smtpserver.CoreCmdHandlerLoader"/>
+        </handlerchain>
+    </smtpserver>
+</smtpservers>
+
+

http://git-wip-us.apache.org/repos/asf/james-project/blob/d65e484a/server/container/guice/pom.xml
----------------------------------------------------------------------
diff --git a/server/container/guice/pom.xml b/server/container/guice/pom.xml
index 16d39b0..92a62bb 100644
--- a/server/container/guice/pom.xml
+++ b/server/container/guice/pom.xml
@@ -36,6 +36,7 @@
         <module>guice-common</module>
         <module>cassandra-guice</module>
         <module>memory-guice</module>
+        <module>jpa-guice</module>
         <module>onami</module>
     </modules>
 </project>


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


[08/29] james-project git commit: JAMES-1842: Inversion of control on GuiceProbe

Posted by ad...@apache.org.
JAMES-1842: Inversion of control on GuiceProbe


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

Branch: refs/heads/master
Commit: ebbf1e6fe6f41f568396f409a28381912d0aeebd
Parents: 2ae5e1a
Author: Quynh Nguyen <qn...@linagora.com>
Authored: Thu Nov 10 12:04:27 2016 +0700
Committer: Quynh Nguyen <qn...@linagora.com>
Committed: Fri Nov 18 09:25:34 2016 +0700

----------------------------------------------------------------------
 .../smtp/host/CassandraJamesSmtpHostSystem.java |   8 +-
 .../org/apache/james/CassandraJamesServer.java  |  58 +++
 .../apache/james/CassandraJamesServerMain.java  |   4 +-
 .../apache/james/CassandraJamesServerTest.java  |   6 +-
 .../james/JamesCapabilitiesServerTest.java      |   6 +-
 .../java/org/apache/james/GuiceJamesServer.java |  40 +-
 .../org/apache/james/GuiceJmapJamesServer.java  | 114 ------
 .../main/java/org/apache/james/JmapServer.java  |  26 ++
 .../java/org/apache/james/WebAdminServer.java   |  25 ++
 .../james/modules/CommonServicesModule.java     |   4 +
 .../apache/james/modules/ProtocolsModule.java   |   6 -
 .../modules/ProtocolsModuleWithoutJMAP.java     |  30 --
 .../modules/protocols/JMAPServerModule.java     |   3 +
 .../modules/server/WebAdminServerModule.java    |   3 +
 .../james/utils/ExtendedJmapServerProbe.java    |  31 --
 .../java/org/apache/james/utils/GuiceProbe.java |  22 ++
 .../apache/james/utils/GuiceProbeProvider.java  |  45 +++
 .../apache/james/utils/GuiceServerProbe.java    |   4 +-
 .../org/apache/james/utils/JmapGuiceProbe.java  |  56 +++
 .../james/utils/JmapGuiceServerProbe.java       | 368 -------------------
 .../apache/james/utils/WebAdminGuiceProbe.java  |  37 ++
 .../james/AbstractJmapJamesServerTest.java      |  11 +-
 .../james/utils/GuiceProbeProviderTest.java     |  68 ++++
 .../modules/data/JPASieveRepositoryModule.java  |  18 +
 .../mailbox/LuceneSearchMailboxModule.java      |   8 +-
 .../org/apache/james/MemoryJamesServer.java     |  56 +++
 .../org/apache/james/MemoryJamesServerMain.java |   4 +-
 .../org/apache/james/MemoryJamesServerTest.java |   6 +-
 .../james/mailets/TemporaryJamesServer.java     |  11 +-
 .../CassandraGetMailboxesMethodTest.java        |   8 +-
 .../CassandraGetMessageListMethodTest.java      |   8 +-
 .../CassandraGetVacationResponseTest.java       |   8 +-
 .../CassandraJmapAuthenticationTest.java        |   8 +-
 .../CassandraSetMailboxesMethodTest.java        |   8 +-
 .../CassandraSetMessagesMethodTest.java         |   8 +-
 .../CassandraSetVacationResponseTest.java       |   8 +-
 .../CassandraVacationIntegrationTest.java       |   9 +-
 .../cassandra/cucumber/CassandraStepdefs.java   |   4 +-
 .../james/jmap/JMAPAuthenticationTest.java      |  15 +-
 .../james/jmap/VacationIntegrationTest.java     |  19 +-
 .../integration/GetMailboxesMethodTest.java     |  51 +--
 .../integration/GetMessageListMethodTest.java   |  15 +-
 .../integration/GetVacationResponseTest.java    |  26 +-
 .../integration/SetMailboxesMethodTest.java     |  15 +-
 .../integration/SetMessagesMethodTest.java      |  17 +-
 .../integration/SetVacationResponseTest.java    |  33 +-
 .../integration/cucumber/MainStepdefs.java      |  14 +-
 .../memory/MemoryGetMailboxesMethodTest.java    |   8 +-
 .../memory/MemoryGetMessageListMethodTest.java  |   8 +-
 .../MemoryGetVacationResponseMethodTest.java    |   8 +-
 .../memory/MemoryJmapAuthenticationTest.java    |   8 +-
 .../memory/MemorySetMailboxesMethodTest.java    |   8 +-
 .../memory/MemorySetMessagesMethodTest.java     |   8 +-
 .../MemorySetVacationResponseMethodTest.java    |   8 +-
 .../memory/MemoryVacationIntegrationTest.java   |   8 +-
 .../jmap/memory/cucumber/MemoryStepdefs.java    |   4 +-
 .../WebAdminServerIntegrationTest.java          |  11 +-
 57 files changed, 663 insertions(+), 768 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/ebbf1e6f/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 836e4e5..4949765 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
@@ -22,7 +22,7 @@ package org.apache.james.mpt.smtp.host;
 import java.util.Iterator;
 
 import org.apache.james.CassandraJamesServerMain;
-import org.apache.james.GuiceJmapJamesServer;
+import org.apache.james.GuiceJamesServer;
 import org.apache.james.backends.cassandra.EmbeddedCassandra;
 import org.apache.james.dnsservice.api.DNSService;
 import org.apache.james.mailbox.elasticsearch.EmbeddedElasticSearch;
@@ -42,7 +42,7 @@ public class CassandraJamesSmtpHostSystem extends ExternalSessionFactory impleme
     private EmbeddedCassandra embeddedCassandra;
     private EmbeddedElasticSearch embeddedElasticSearch;
 
-    private GuiceJmapJamesServer jamesServer;
+    private GuiceJamesServer jamesServer;
     private InMemoryDNSService inMemoryDNSService;
 
 
@@ -104,8 +104,8 @@ public class CassandraJamesSmtpHostSystem extends ExternalSessionFactory impleme
         return inMemoryDNSService;
     }
 
-    protected GuiceJmapJamesServer createJamesServer() {
-        return new GuiceJmapJamesServer()
+    protected GuiceJamesServer createJamesServer() {
+        return new GuiceJamesServer()
             .combineWith(CassandraJamesServerMain.cassandraServerModule)
             .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/ebbf1e6f/server/container/guice/cassandra-guice/src/main/java/org/apache/james/CassandraJamesServer.java
----------------------------------------------------------------------
diff --git a/server/container/guice/cassandra-guice/src/main/java/org/apache/james/CassandraJamesServer.java b/server/container/guice/cassandra-guice/src/main/java/org/apache/james/CassandraJamesServer.java
new file mode 100644
index 0000000..f1ef305
--- /dev/null
+++ b/server/container/guice/cassandra-guice/src/main/java/org/apache/james/CassandraJamesServer.java
@@ -0,0 +1,58 @@
+/****************************************************************
+ * 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;
+
+import java.util.Arrays;
+
+import org.apache.james.utils.JmapGuiceProbe;
+import org.apache.james.utils.WebAdminGuiceProbe;
+
+import com.google.common.collect.Iterables;
+import com.google.inject.Module;
+import com.google.inject.util.Modules;
+
+public class CassandraJamesServer extends GuiceJamesServer implements JmapServer, WebAdminServer {
+
+    public CassandraJamesServer() {
+        super();
+    }
+
+    public CassandraJamesServer(Module module) {
+        super(module);
+    }
+
+    public CassandraJamesServer combineWith(Module... modules) {
+        return new CassandraJamesServer(Modules.combine(Iterables.concat(Arrays.asList(module), Arrays.asList(modules))));
+    }
+
+    public CassandraJamesServer overrideWith(Module... overrides) {
+        return new CassandraJamesServer(Modules.override(module).with(overrides));
+    }
+
+    @Override
+    public JmapGuiceProbe getJmapProbe() {
+        return getGuiceProbeProvider().getProbe(JmapGuiceProbe.class);
+    }
+
+    @Override
+    public WebAdminGuiceProbe getWebAdminProbe() {
+        return getGuiceProbeProvider().getProbe(WebAdminGuiceProbe.class);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/james-project/blob/ebbf1e6f/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 12e163c..87f4a07 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,6 +27,7 @@ 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.JMAPServerModule;
 import org.apache.james.modules.server.ActiveMQQueueModule;
 import org.apache.james.modules.server.JMXServerModule;
 import org.apache.james.modules.server.QuotaModule;
@@ -37,6 +38,7 @@ import com.google.inject.util.Modules;
 public class CassandraJamesServerMain {
 
     public static final Module cassandraServerModule = Modules.combine(
+        new JMAPServerModule(),
         new CassandraUsersRepositoryModule(),
         new CassandraDomainListModule(),
         new CassandraRecipientRewriteTableModule(),
@@ -50,7 +52,7 @@ public class CassandraJamesServerMain {
 
 
     public static void main(String[] args) throws Exception {
-        GuiceJmapJamesServer server = new GuiceJmapJamesServer()
+        GuiceJamesServer server = new GuiceJamesServer()
                     .combineWith(cassandraServerModule, new JMXServerModule());
         server.start();
     }

http://git-wip-us.apache.org/repos/asf/james-project/blob/ebbf1e6f/server/container/guice/cassandra-guice/src/test/java/org/apache/james/CassandraJamesServerTest.java
----------------------------------------------------------------------
diff --git a/server/container/guice/cassandra-guice/src/test/java/org/apache/james/CassandraJamesServerTest.java b/server/container/guice/cassandra-guice/src/test/java/org/apache/james/CassandraJamesServerTest.java
index 2f53657..209a8d4 100644
--- a/server/container/guice/cassandra-guice/src/test/java/org/apache/james/CassandraJamesServerTest.java
+++ b/server/container/guice/cassandra-guice/src/test/java/org/apache/james/CassandraJamesServerTest.java
@@ -35,7 +35,7 @@ import com.google.inject.AbstractModule;
 import com.google.inject.Provides;
 import com.google.inject.Singleton;
 
-public class CassandraJamesServerTest extends AbstractJmapJamesServerTest {
+public class CassandraJamesServerTest extends AbstractJmapJamesServerTest<CassandraJamesServer> {
 
     private TemporaryFolder temporaryFolder = new TemporaryFolder();
     private EmbeddedElasticSearch embeddedElasticSearch = new EmbeddedElasticSearch(temporaryFolder);
@@ -45,8 +45,8 @@ public class CassandraJamesServerTest extends AbstractJmapJamesServerTest {
     public RuleChain chain = RuleChain.outerRule(temporaryFolder).around(embeddedElasticSearch);
 
     @Override
-    protected GuiceJmapJamesServer createJamesServer() {
-        return new GuiceJmapJamesServer()
+    protected CassandraJamesServer createJamesServer() {
+        return new CassandraJamesServer()
                 .combineWith(CassandraJamesServerMain.cassandraServerModule)
                 .overrideWith(new TestElasticSearchModule(embeddedElasticSearch),
                         new TestFilesystemModule(temporaryFolder),

http://git-wip-us.apache.org/repos/asf/james-project/blob/ebbf1e6f/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 06d7872..e866369 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
@@ -46,7 +46,7 @@ import com.google.inject.Singleton;
 
 public class JamesCapabilitiesServerTest {
 
-    private GuiceJmapJamesServer server;
+    private GuiceJamesServer server;
     private TemporaryFolder temporaryFolder = new TemporaryFolder();
     private EmbeddedElasticSearch embeddedElasticSearch = new EmbeddedElasticSearch(temporaryFolder);
 
@@ -58,10 +58,10 @@ public class JamesCapabilitiesServerTest {
         server.stop();
     }
     
-    private GuiceJmapJamesServer createCassandraJamesServer(final MailboxManager mailboxManager) {
+    private GuiceJamesServer createCassandraJamesServer(final MailboxManager mailboxManager) {
         Module mockMailboxManager = (binder) -> binder.bind(MailboxManager.class).toInstance(mailboxManager);
         
-        return new GuiceJmapJamesServer()
+        return new GuiceJamesServer()
             .combineWith(CassandraJamesServerMain.cassandraServerModule)
             .overrideWith(new TestElasticSearchModule(embeddedElasticSearch),
                 new TestFilesystemModule(temporaryFolder),

http://git-wip-us.apache.org/repos/asf/james-project/blob/ebbf1e6f/server/container/guice/guice-common/src/main/java/org/apache/james/GuiceJamesServer.java
----------------------------------------------------------------------
diff --git a/server/container/guice/guice-common/src/main/java/org/apache/james/GuiceJamesServer.java b/server/container/guice/guice-common/src/main/java/org/apache/james/GuiceJamesServer.java
index d847783..9fa2efc 100644
--- a/server/container/guice/guice-common/src/main/java/org/apache/james/GuiceJamesServer.java
+++ b/server/container/guice/guice-common/src/main/java/org/apache/james/GuiceJamesServer.java
@@ -19,19 +19,16 @@
 package org.apache.james;
 
 import java.util.Arrays;
-import java.util.Optional;
 
 import javax.annotation.PreDestroy;
 
 import org.apache.james.modules.CommonServicesModule;
 import org.apache.james.modules.MailetProcessingModule;
-import org.apache.james.modules.ProtocolsModuleWithoutJMAP;
+import org.apache.james.modules.ProtocolsModule;
 import org.apache.james.onami.lifecycle.Stager;
 import org.apache.james.utils.ConfigurationsPerformer;
-import org.apache.james.utils.ExtendedServerProbe;
+import org.apache.james.utils.GuiceProbeProvider;
 import org.apache.james.utils.GuiceServerProbe;
-import org.apache.james.webadmin.Port;
-import org.apache.james.webadmin.WebAdminServer;
 
 import com.google.common.collect.Iterables;
 import com.google.inject.Guice;
@@ -42,44 +39,34 @@ import com.google.inject.TypeLiteral;
 import com.google.inject.util.Modules;
 
 public class GuiceJamesServer {
-    private final Module module;
+    protected final Module module;
     private Stager<PreDestroy> preDestroy;
-    private GuiceServerProbe serverProbe;
-    private Optional<Port> webadminPort;
+    private GuiceProbeProvider guiceProbeProvider;
 
     public GuiceJamesServer() {
         this(Modules.combine(
                         new CommonServicesModule(),
-                        new ProtocolsModuleWithoutJMAP(),
+                        new ProtocolsModule(),
                         new MailetProcessingModule()));
     }
 
-    private GuiceJamesServer(Module module) {
+    protected GuiceJamesServer(Module module) {
         this.module = module;
     }
     
     public GuiceJamesServer combineWith(Module... modules) {
         return new GuiceJamesServer(Modules.combine(Iterables.concat(Arrays.asList(module), Arrays.asList(modules))));
     }
-    
+
     public GuiceJamesServer overrideWith(Module... overrides) {
         return new GuiceJamesServer(Modules.override(module).with(overrides));
     }
-    
+
     public void start() throws Exception {
         Injector injector = Guice.createInjector(module);
         preDestroy = injector.getInstance(Key.get(new TypeLiteral<Stager<PreDestroy>>() {}));
         injector.getInstance(ConfigurationsPerformer.class).initModules();
-        serverProbe = injector.getInstance(GuiceServerProbe.class);
-        webadminPort =locateWebAdminPort(injector);
-    }
-
-    private Optional<Port> locateWebAdminPort(Injector injector) {
-        try {
-            return Optional.of(injector.getInstance(WebAdminServer.class).getPort());
-        } catch(Exception e) {
-            return Optional.empty();
-        }
+        guiceProbeProvider = injector.getInstance(GuiceProbeProvider.class);
     }
 
     public void stop() {
@@ -88,12 +75,11 @@ public class GuiceJamesServer {
         }
     }
 
-    public ExtendedServerProbe serverProbe() {
-        return serverProbe;
+    public GuiceServerProbe serverProbe() {
+        return guiceProbeProvider.getProbe(GuiceServerProbe.class);
     }
 
-    public Optional<Port> getWebadminPort() {
-        return webadminPort;
+    protected GuiceProbeProvider getGuiceProbeProvider() {
+        return guiceProbeProvider;
     }
-
 }

http://git-wip-us.apache.org/repos/asf/james-project/blob/ebbf1e6f/server/container/guice/guice-common/src/main/java/org/apache/james/GuiceJmapJamesServer.java
----------------------------------------------------------------------
diff --git a/server/container/guice/guice-common/src/main/java/org/apache/james/GuiceJmapJamesServer.java b/server/container/guice/guice-common/src/main/java/org/apache/james/GuiceJmapJamesServer.java
deleted file mode 100644
index 8a85b81..0000000
--- a/server/container/guice/guice-common/src/main/java/org/apache/james/GuiceJmapJamesServer.java
+++ /dev/null
@@ -1,114 +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;
-
-import java.util.Arrays;
-import java.util.Optional;
-
-import javax.annotation.PreDestroy;
-
-import org.apache.james.jmap.JMAPServer;
-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.ExtendedJmapServerProbe;
-import org.apache.james.utils.JmapGuiceServerProbe;
-import org.apache.james.webadmin.Port;
-import org.apache.james.webadmin.WebAdminServer;
-
-import com.google.common.collect.Iterables;
-import com.google.inject.Guice;
-import com.google.inject.Injector;
-import com.google.inject.Key;
-import com.google.inject.Module;
-import com.google.inject.TypeLiteral;
-import com.google.inject.util.Modules;
-
-public class GuiceJmapJamesServer {
-
-    private final Module module;
-    private Stager<PreDestroy> preDestroy;
-    private JmapGuiceServerProbe serverProbe;
-    private Optional<Integer> jmapPort;
-    private Optional<Port> webadminPort;
-
-    public GuiceJmapJamesServer() {
-        this(Modules.combine(
-                        new CommonServicesModule(),
-                        new ProtocolsModule(),
-                        new MailetProcessingModule()));
-    }
-
-    private GuiceJmapJamesServer(Module module) {
-        this.module = module;
-    }
-    
-    public GuiceJmapJamesServer combineWith(Module... modules) {
-        return new GuiceJmapJamesServer(Modules.combine(Iterables.concat(Arrays.asList(module), Arrays.asList(modules))));
-    }
-    
-    public GuiceJmapJamesServer overrideWith(Module... overrides) {
-        return new GuiceJmapJamesServer(Modules.override(module).with(overrides));
-    }
-    
-    public void start() throws Exception {
-        Injector injector = Guice.createInjector(module);
-        preDestroy = injector.getInstance(Key.get(new TypeLiteral<Stager<PreDestroy>>() {}));
-        injector.getInstance(ConfigurationsPerformer.class).initModules();
-        serverProbe = injector.getInstance(JmapGuiceServerProbe.class);
-        jmapPort = locateJMAPPort(injector);
-        webadminPort =locateWebAdminPort(injector);
-    }
-
-    private Optional<Integer> locateJMAPPort(Injector injector) {
-        try {
-            return Optional.of(injector.getInstance(JMAPServer.class).getPort());
-        } catch(Exception e) {
-            return Optional.empty();
-        }
-    }
-
-    private Optional<Port> locateWebAdminPort(Injector injector) {
-        try {
-            return Optional.of(injector.getInstance(WebAdminServer.class).getPort());
-        } catch(Exception e) {
-            return Optional.empty();
-        }
-    }
-
-    public void stop() {
-        if (preDestroy != null) {
-            preDestroy.stage();
-        }
-    }
-
-    public ExtendedJmapServerProbe serverProbe() {
-        return serverProbe;
-    }
-
-    public Optional<Integer> getJmapPort() {
-        return jmapPort;
-    }
-
-    public Optional<Port> getWebadminPort() {
-        return webadminPort;
-    }
-}

http://git-wip-us.apache.org/repos/asf/james-project/blob/ebbf1e6f/server/container/guice/guice-common/src/main/java/org/apache/james/JmapServer.java
----------------------------------------------------------------------
diff --git a/server/container/guice/guice-common/src/main/java/org/apache/james/JmapServer.java b/server/container/guice/guice-common/src/main/java/org/apache/james/JmapServer.java
new file mode 100644
index 0000000..218c879
--- /dev/null
+++ b/server/container/guice/guice-common/src/main/java/org/apache/james/JmapServer.java
@@ -0,0 +1,26 @@
+/****************************************************************
+ * 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;
+
+import org.apache.james.utils.JmapGuiceProbe;
+
+public interface JmapServer {
+    JmapGuiceProbe getJmapProbe();
+}

http://git-wip-us.apache.org/repos/asf/james-project/blob/ebbf1e6f/server/container/guice/guice-common/src/main/java/org/apache/james/WebAdminServer.java
----------------------------------------------------------------------
diff --git a/server/container/guice/guice-common/src/main/java/org/apache/james/WebAdminServer.java b/server/container/guice/guice-common/src/main/java/org/apache/james/WebAdminServer.java
new file mode 100644
index 0000000..a08df88
--- /dev/null
+++ b/server/container/guice/guice-common/src/main/java/org/apache/james/WebAdminServer.java
@@ -0,0 +1,25 @@
+/****************************************************************
+ * 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;
+
+import org.apache.james.utils.WebAdminGuiceProbe;
+
+public interface WebAdminServer {
+    WebAdminGuiceProbe getWebAdminProbe();
+}

http://git-wip-us.apache.org/repos/asf/james-project/blob/ebbf1e6f/server/container/guice/guice-common/src/main/java/org/apache/james/modules/CommonServicesModule.java
----------------------------------------------------------------------
diff --git a/server/container/guice/guice-common/src/main/java/org/apache/james/modules/CommonServicesModule.java b/server/container/guice/guice-common/src/main/java/org/apache/james/modules/CommonServicesModule.java
index dfbbb8a..df0d349 100644
--- a/server/container/guice/guice-common/src/main/java/org/apache/james/modules/CommonServicesModule.java
+++ b/server/container/guice/guice-common/src/main/java/org/apache/james/modules/CommonServicesModule.java
@@ -24,6 +24,7 @@ import java.util.Optional;
 import javax.inject.Named;
 import javax.inject.Singleton;
 
+import com.google.inject.multibindings.Multibinder;
 import org.apache.commons.cli.MissingArgumentException;
 import org.apache.james.core.JamesServerResourceLoader;
 import org.apache.james.core.filesystem.FileSystemImpl;
@@ -37,6 +38,8 @@ import org.apache.james.onami.lifecycle.PreDestroyModule;
 import com.google.inject.AbstractModule;
 import com.google.inject.Provides;
 import com.google.inject.Scopes;
+import org.apache.james.utils.GuiceProbe;
+import org.apache.james.utils.GuiceServerProbe;
 
 public class CommonServicesModule extends AbstractModule {
     
@@ -56,6 +59,7 @@ public class CommonServicesModule extends AbstractModule {
         bind(FileSystemImpl.class).in(Scopes.SINGLETON);
 
         bind(FileSystem.class).to(FileSystemImpl.class);
+        Multibinder.newSetBinder(binder(), GuiceProbe.class).addBinding().to(GuiceServerProbe.class);
     }
 
     @Provides @Singleton @Named(CONFIGURATION_PATH)

http://git-wip-us.apache.org/repos/asf/james-project/blob/ebbf1e6f/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
index 28554b2..5a1822d 100644
--- 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
@@ -19,23 +19,19 @@
 package org.apache.james.modules;
 
 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.WebAdminServerModule;
-import org.apache.james.utils.JmapGuiceServerProbe;
 
 import com.google.inject.AbstractModule;
-import com.google.inject.Scopes;
 
 public class ProtocolsModule extends AbstractModule {
 
     @Override
     protected void configure() {
-        install(new JMAPServerModule());
         install(new IMAPServerModule());
         install(new ProtocolHandlerModule());
         install(new POP3ServerModule());
@@ -43,8 +39,6 @@ public class ProtocolsModule extends AbstractModule {
         install(new LMTPServerModule());
         install(new ManageSieveServerModule());
         install(new WebAdminServerModule());
-        
-        bind(JmapGuiceServerProbe.class).in(Scopes.SINGLETON);
     }
     
 }

http://git-wip-us.apache.org/repos/asf/james-project/blob/ebbf1e6f/server/container/guice/guice-common/src/main/java/org/apache/james/modules/ProtocolsModuleWithoutJMAP.java
----------------------------------------------------------------------
diff --git a/server/container/guice/guice-common/src/main/java/org/apache/james/modules/ProtocolsModuleWithoutJMAP.java b/server/container/guice/guice-common/src/main/java/org/apache/james/modules/ProtocolsModuleWithoutJMAP.java
deleted file mode 100644
index a945651..0000000
--- a/server/container/guice/guice-common/src/main/java/org/apache/james/modules/ProtocolsModuleWithoutJMAP.java
+++ /dev/null
@@ -1,30 +0,0 @@
-package org.apache.james.modules;
-
-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.WebAdminServerModule;
-import org.apache.james.utils.GuiceServerProbe;
-
-import com.google.inject.AbstractModule;
-import com.google.inject.Scopes;
-
-public class ProtocolsModuleWithoutJMAP extends AbstractModule {
-    @Override
-    protected void configure() {
-        install(new IMAPServerModule());
-        install(new ProtocolHandlerModule());
-        install(new POP3ServerModule());
-        install(new SMTPServerModule());
-        install(new LMTPServerModule());
-        install(new ManageSieveServerModule());
-        install(new WebAdminServerModule());
-
-        bind(GuiceServerProbe.class).in(Scopes.SINGLETON);
-
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/james-project/blob/ebbf1e6f/server/container/guice/guice-common/src/main/java/org/apache/james/modules/protocols/JMAPServerModule.java
----------------------------------------------------------------------
diff --git a/server/container/guice/guice-common/src/main/java/org/apache/james/modules/protocols/JMAPServerModule.java b/server/container/guice/guice-common/src/main/java/org/apache/james/modules/protocols/JMAPServerModule.java
index f317b21..a04e1db 100644
--- a/server/container/guice/guice-common/src/main/java/org/apache/james/modules/protocols/JMAPServerModule.java
+++ b/server/container/guice/guice-common/src/main/java/org/apache/james/modules/protocols/JMAPServerModule.java
@@ -27,6 +27,8 @@ import org.apache.james.jmap.JMAPServer;
 import org.apache.james.jmap.crypto.JamesSignatureHandler;
 import org.apache.james.lifecycle.api.Configurable;
 import org.apache.james.utils.ConfigurationPerformer;
+import org.apache.james.utils.GuiceProbe;
+import org.apache.james.utils.JmapGuiceProbe;
 import org.bouncycastle.jce.provider.BouncyCastleProvider;
 
 import com.google.common.base.Throwables;
@@ -42,6 +44,7 @@ public class JMAPServerModule extends AbstractModule {
     protected void configure() {
         install(new JMAPModule());
         Multibinder.newSetBinder(binder(), ConfigurationPerformer.class).addBinding().to(JMAPModuleConfigurationPerformer.class);
+        Multibinder.newSetBinder(binder(), GuiceProbe.class).addBinding().to(JmapGuiceProbe.class);
     }
 
     @Singleton

http://git-wip-us.apache.org/repos/asf/james-project/blob/ebbf1e6f/server/container/guice/guice-common/src/main/java/org/apache/james/modules/server/WebAdminServerModule.java
----------------------------------------------------------------------
diff --git a/server/container/guice/guice-common/src/main/java/org/apache/james/modules/server/WebAdminServerModule.java b/server/container/guice/guice-common/src/main/java/org/apache/james/modules/server/WebAdminServerModule.java
index 8fb0a6a..a9aed5c 100644
--- a/server/container/guice/guice-common/src/main/java/org/apache/james/modules/server/WebAdminServerModule.java
+++ b/server/container/guice/guice-common/src/main/java/org/apache/james/modules/server/WebAdminServerModule.java
@@ -29,7 +29,9 @@ import java.util.List;
 import org.apache.commons.configuration.ConfigurationException;
 import org.apache.james.lifecycle.api.Configurable;
 import org.apache.james.utils.ConfigurationPerformer;
+import org.apache.james.utils.GuiceProbe;
 import org.apache.james.utils.PropertiesProvider;
+import org.apache.james.utils.WebAdminGuiceProbe;
 import org.apache.james.webadmin.FixedPort;
 import org.apache.james.webadmin.Port;
 import org.apache.james.webadmin.Routes;
@@ -62,6 +64,7 @@ public class WebAdminServerModule extends AbstractModule {
         routesMultibinder.addBinding().to(UserMailboxesRoutes.class);
 
         Multibinder.newSetBinder(binder(), ConfigurationPerformer.class).addBinding().to(WebAdminServerModuleConfigurationPerformer.class);
+        Multibinder.newSetBinder(binder(), GuiceProbe.class).addBinding().to(WebAdminGuiceProbe.class);
     }
 
     @Provides

http://git-wip-us.apache.org/repos/asf/james-project/blob/ebbf1e6f/server/container/guice/guice-common/src/main/java/org/apache/james/utils/ExtendedJmapServerProbe.java
----------------------------------------------------------------------
diff --git a/server/container/guice/guice-common/src/main/java/org/apache/james/utils/ExtendedJmapServerProbe.java b/server/container/guice/guice-common/src/main/java/org/apache/james/utils/ExtendedJmapServerProbe.java
deleted file mode 100644
index 04f2292..0000000
--- a/server/container/guice/guice-common/src/main/java/org/apache/james/utils/ExtendedJmapServerProbe.java
+++ /dev/null
@@ -1,31 +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.utils;
-
-import org.apache.james.jmap.api.vacation.AccountId;
-import org.apache.james.jmap.api.vacation.Vacation;
-import org.apache.james.jmap.api.vacation.VacationPatch;
-
-public interface ExtendedJmapServerProbe extends ExtendedServerProbe {
-
-    void modifyVacation(AccountId accountId, VacationPatch vacationPatch);
-
-    Vacation retrieveVacation(AccountId accountId);
-}

http://git-wip-us.apache.org/repos/asf/james-project/blob/ebbf1e6f/server/container/guice/guice-common/src/main/java/org/apache/james/utils/GuiceProbe.java
----------------------------------------------------------------------
diff --git a/server/container/guice/guice-common/src/main/java/org/apache/james/utils/GuiceProbe.java b/server/container/guice/guice-common/src/main/java/org/apache/james/utils/GuiceProbe.java
new file mode 100644
index 0000000..4d3b520
--- /dev/null
+++ b/server/container/guice/guice-common/src/main/java/org/apache/james/utils/GuiceProbe.java
@@ -0,0 +1,22 @@
+/****************************************************************
+ * 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.utils;
+
+public interface GuiceProbe {
+}

http://git-wip-us.apache.org/repos/asf/james-project/blob/ebbf1e6f/server/container/guice/guice-common/src/main/java/org/apache/james/utils/GuiceProbeProvider.java
----------------------------------------------------------------------
diff --git a/server/container/guice/guice-common/src/main/java/org/apache/james/utils/GuiceProbeProvider.java b/server/container/guice/guice-common/src/main/java/org/apache/james/utils/GuiceProbeProvider.java
new file mode 100644
index 0000000..7b98b6f
--- /dev/null
+++ b/server/container/guice/guice-common/src/main/java/org/apache/james/utils/GuiceProbeProvider.java
@@ -0,0 +1,45 @@
+/****************************************************************
+ * 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.utils;
+
+import com.github.steveash.guavate.Guavate;
+import com.google.common.base.Preconditions;
+
+import javax.inject.Inject;
+import java.util.Map;
+import java.util.Optional;
+import java.util.Set;
+
+public class GuiceProbeProvider {
+    private final Map<Class<GuiceProbe>, GuiceProbe> registry;
+
+    @Inject
+    public GuiceProbeProvider(Set<GuiceProbe> guiceProbes) {
+        this.registry = guiceProbes.stream()
+            .collect(Guavate.toImmutableMap(guiceProbe -> (Class<GuiceProbe>) guiceProbe.getClass()));
+    }
+
+    public <T extends GuiceProbe> T getProbe(Class<T> clazz) {
+        Preconditions.checkNotNull(clazz);
+        return Optional.ofNullable(registry.get(clazz))
+            .map(probe -> (T) probe)
+            .orElseThrow(() -> new RuntimeException("No probe registered for class: " + clazz));
+    }
+}

http://git-wip-us.apache.org/repos/asf/james-project/blob/ebbf1e6f/server/container/guice/guice-common/src/main/java/org/apache/james/utils/GuiceServerProbe.java
----------------------------------------------------------------------
diff --git a/server/container/guice/guice-common/src/main/java/org/apache/james/utils/GuiceServerProbe.java b/server/container/guice/guice-common/src/main/java/org/apache/james/utils/GuiceServerProbe.java
index 9cb8c07..e7457dd 100644
--- a/server/container/guice/guice-common/src/main/java/org/apache/james/utils/GuiceServerProbe.java
+++ b/server/container/guice/guice-common/src/main/java/org/apache/james/utils/GuiceServerProbe.java
@@ -54,9 +54,9 @@ import com.google.common.base.Throwables;
 import com.google.common.collect.ImmutableList;
 import com.google.common.collect.Iterables;
 
-public class GuiceServerProbe implements ExtendedServerProbe {
+public class GuiceServerProbe implements ExtendedServerProbe, GuiceProbe {
 
-    private static final Logger LOGGER = LoggerFactory.getLogger(JmapGuiceServerProbe.class);
+    private static final Logger LOGGER = LoggerFactory.getLogger(JmapGuiceProbe.class);
 
     private final MailboxManager mailboxManager;
     private final MailboxMapperFactory mailboxMapperFactory;

http://git-wip-us.apache.org/repos/asf/james-project/blob/ebbf1e6f/server/container/guice/guice-common/src/main/java/org/apache/james/utils/JmapGuiceProbe.java
----------------------------------------------------------------------
diff --git a/server/container/guice/guice-common/src/main/java/org/apache/james/utils/JmapGuiceProbe.java b/server/container/guice/guice-common/src/main/java/org/apache/james/utils/JmapGuiceProbe.java
new file mode 100644
index 0000000..9d881e0
--- /dev/null
+++ b/server/container/guice/guice-common/src/main/java/org/apache/james/utils/JmapGuiceProbe.java
@@ -0,0 +1,56 @@
+/****************************************************************
+ * 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.utils;
+
+import org.apache.james.jmap.JMAPServer;
+import org.apache.james.jmap.api.vacation.AccountId;
+import org.apache.james.jmap.api.vacation.Vacation;
+import org.apache.james.jmap.api.vacation.VacationPatch;
+import org.apache.james.jmap.api.vacation.VacationRepository;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.inject.Inject;
+
+public class JmapGuiceProbe implements GuiceProbe {
+
+    private static final Logger LOGGER = LoggerFactory.getLogger(JmapGuiceProbe.class);
+
+    private final VacationRepository vacationRepository;
+    private final JMAPServer jmapServer;
+
+    @Inject
+    private JmapGuiceProbe(VacationRepository vacationRepository, JMAPServer jmapServer) {
+        this.vacationRepository = vacationRepository;
+        this.jmapServer = jmapServer;
+    }
+
+    public int getJmapPort() {
+        return jmapServer.getPort();
+    }
+
+    public void modifyVacation(AccountId accountId, VacationPatch vacationPatch) {
+        vacationRepository.modifyVacation(accountId, vacationPatch).join();
+    }
+
+    public Vacation retrieveVacation(AccountId accountId) {
+        return vacationRepository.retrieveVacation(accountId).join();
+    }
+}

http://git-wip-us.apache.org/repos/asf/james-project/blob/ebbf1e6f/server/container/guice/guice-common/src/main/java/org/apache/james/utils/JmapGuiceServerProbe.java
----------------------------------------------------------------------
diff --git a/server/container/guice/guice-common/src/main/java/org/apache/james/utils/JmapGuiceServerProbe.java b/server/container/guice/guice-common/src/main/java/org/apache/james/utils/JmapGuiceServerProbe.java
deleted file mode 100644
index b2ca5d5..0000000
--- a/server/container/guice/guice-common/src/main/java/org/apache/james/utils/JmapGuiceServerProbe.java
+++ /dev/null
@@ -1,368 +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.utils;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Collection;
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
-import java.util.stream.Collectors;
-
-import javax.inject.Inject;
-import javax.mail.Flags;
-
-import org.apache.commons.lang.NotImplementedException;
-import org.apache.james.adapter.mailbox.SerializableQuota;
-import org.apache.james.domainlist.api.DomainList;
-import org.apache.james.jmap.api.vacation.AccountId;
-import org.apache.james.jmap.api.vacation.Vacation;
-import org.apache.james.jmap.api.vacation.VacationPatch;
-import org.apache.james.jmap.api.vacation.VacationRepository;
-import org.apache.james.mailbox.MailboxManager;
-import org.apache.james.mailbox.MailboxSession;
-import org.apache.james.mailbox.MessageManager;
-import org.apache.james.mailbox.exception.MailboxException;
-import org.apache.james.mailbox.model.MailboxConstants;
-import org.apache.james.mailbox.model.MailboxMetaData;
-import org.apache.james.mailbox.model.MailboxPath;
-import org.apache.james.mailbox.model.MailboxQuery;
-import org.apache.james.mailbox.store.mail.MailboxMapper;
-import org.apache.james.mailbox.store.mail.MailboxMapperFactory;
-import org.apache.james.mailbox.store.mail.model.Mailbox;
-import org.apache.james.rrt.api.RecipientRewriteTable;
-import org.apache.james.rrt.lib.Mappings;
-import org.apache.james.sieverepository.api.SieveRepository;
-import org.apache.james.user.api.UsersRepository;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import com.google.common.base.Throwables;
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.Iterables;
-
-public class JmapGuiceServerProbe implements ExtendedJmapServerProbe {
-
-    private static final Logger LOGGER = LoggerFactory.getLogger(JmapGuiceServerProbe.class);
-
-    private final MailboxManager mailboxManager;
-    private final MailboxMapperFactory mailboxMapperFactory;
-    private final DomainList domainList;
-    private final UsersRepository usersRepository;
-    private final SieveRepository sieveRepository;
-    private final RecipientRewriteTable recipientRewriteTable;
-    private final VacationRepository vacationRepository;
-
-    @Inject
-    private JmapGuiceServerProbe(MailboxManager mailboxManager, MailboxMapperFactory mailboxMapperFactory,
-                             DomainList domainList, UsersRepository usersRepository, SieveRepository sieveRepository,
-                             RecipientRewriteTable recipientRewriteTable, VacationRepository vacationRepository) {
-        this.mailboxManager = mailboxManager;
-        this.mailboxMapperFactory = mailboxMapperFactory;
-        this.domainList = domainList;
-        this.usersRepository = usersRepository;
-        this.sieveRepository = sieveRepository;
-        this.recipientRewriteTable = recipientRewriteTable;
-        this.vacationRepository = vacationRepository;
-    }
-
-    @Override
-    public void close() throws IOException {
-    }
-
-    @Override
-    public void addUser(String userName, String password) throws Exception {
-        usersRepository.addUser(userName, password);
-    }
-
-    @Override
-    public void removeUser(String username) throws Exception {
-        usersRepository.removeUser(username);
-    }
-
-    @Override
-    public String[] listUsers() throws Exception {
-        return Iterables.toArray(ImmutableList.copyOf(usersRepository.list()), String.class);
-    }
-
-    @Override
-    public void setPassword(String userName, String password) throws Exception {
-        throw new NotImplementedException();
-    }
-
-    @Override
-    public void addDomain(String domain) throws Exception {
-        domainList.addDomain(domain);
-    }
-
-    @Override
-    public boolean containsDomain(String domain) throws Exception {
-        return domainList.containsDomain(domain);
-    }
-
-    @Override
-    public String getDefaultDomain() throws Exception {
-        return domainList.getDefaultDomain();
-    }
-
-    @Override
-    public void removeDomain(String domain) throws Exception {
-        domainList.removeDomain(domain);
-    }
-
-    @Override
-    public List<String> listDomains() throws Exception {
-        return domainList.getDomains();
-    }
-
-    @Override
-    public Map<String, Mappings> listMappings() throws Exception {
-        return recipientRewriteTable.getAllMappings();
-    }
-
-    @Override
-    public void addAddressMapping(String user, String domain, String toAddress) throws Exception {
-        recipientRewriteTable.addAddressMapping(user, domain, toAddress);
-    }
-
-    @Override
-    public void removeAddressMapping(String user, String domain, String fromAddress) throws Exception {
-        recipientRewriteTable.removeAddressMapping(user, domain, fromAddress);
-    }
-
-    @Override
-    public Mappings listUserDomainMappings(String user, String domain) throws Exception {
-        throw new NotImplementedException();
-    }
-
-    @Override
-    public void addRegexMapping(String user, String domain, String regex) throws Exception {
-        recipientRewriteTable.addRegexMapping(user, domain, regex);
-    }
-
-    @Override
-    public void removeRegexMapping(String user, String domain, String regex) throws Exception {
-        recipientRewriteTable.removeRegexMapping(user, domain, regex);
-    }
-
-    @Override
-    public void copyMailbox(String srcBean, String dstBean) throws Exception {
-        throw new NotImplementedException();
-    }
-
-    @Override
-    public void deleteUserMailboxesNames(String user) throws Exception {
-        throw new NotImplementedException();
-    }
-
-    @Override
-    public void createMailbox(String namespace, String user, String name) {
-        MailboxSession mailboxSession = null;
-        try {
-            mailboxSession = mailboxManager.createSystemSession(user, LOGGER);
-            mailboxManager.startProcessingRequest(mailboxSession);
-            mailboxManager.createMailbox(new MailboxPath(namespace, user, name), mailboxSession);
-        } catch (MailboxException e) {
-            throw Throwables.propagate(e);
-        } finally {
-            closeSession(mailboxSession);
-        }
-    }
-
-    @Override
-    public Mailbox getMailbox(String namespace, String user, String name) {
-        MailboxSession mailboxSession = null;
-        try {
-            mailboxSession = mailboxManager.createSystemSession(user, LOGGER);
-            MailboxMapper mailboxMapper = mailboxMapperFactory.getMailboxMapper(mailboxSession);
-            return mailboxMapper.findMailboxByPath(new MailboxPath(namespace, user, name));
-        } catch (MailboxException e) {
-            throw Throwables.propagate(e);
-        } finally {
-            closeSession(mailboxSession);
-        }
-    }
-
-    private void closeSession(MailboxSession session) {
-        if (session != null) {
-            mailboxManager.endProcessingRequest(session);
-            try {
-                mailboxManager.logout(session, true);
-            } catch (MailboxException e) {
-                throw Throwables.propagate(e);
-            }
-        }
-    }
-
-    @Override
-    public Collection<String> listUserMailboxes(String user) {
-        MailboxSession mailboxSession = null;
-        try {
-            mailboxSession = mailboxManager.createSystemSession(user, LOGGER);
-            mailboxManager.startProcessingRequest(mailboxSession);
-            return searchUserMailboxes(user, mailboxSession)
-                    .stream()
-                    .map(MailboxMetaData::getPath)
-                    .map(MailboxPath::getName)
-                    .collect(Collectors.toList());
-        } catch (MailboxException e) {
-            throw Throwables.propagate(e);
-        } finally {
-            closeSession(mailboxSession);
-        }
-    }
-
-    private List<MailboxMetaData> searchUserMailboxes(String username, MailboxSession session) throws MailboxException {
-        return mailboxManager.search(
-            new MailboxQuery(new MailboxPath(MailboxConstants.USER_NAMESPACE, username, ""),
-                "*",
-                session.getPathDelimiter()),
-            session);
-    }
-
-    @Override
-    public void deleteMailbox(String namespace, String user, String name) {
-        MailboxSession mailboxSession = null;
-        try {
-            mailboxSession = mailboxManager.createSystemSession(user, LOGGER);
-            mailboxManager.startProcessingRequest(mailboxSession);
-            mailboxManager.deleteMailbox(new MailboxPath(namespace, user, name), mailboxSession);
-        } catch (MailboxException e) {
-            throw Throwables.propagate(e);
-        } finally {
-            closeSession(mailboxSession);
-        }
-    }
-
-    @Override
-    public String getQuotaRoot(String namespace, String user, String name) throws MailboxException {
-        throw new NotImplementedException();
-    }
-
-    @Override
-    public SerializableQuota getMessageCountQuota(String quotaRoot) throws MailboxException {
-        throw new NotImplementedException();
-    }
-
-    @Override
-    public SerializableQuota getStorageQuota(String quotaRoot) throws MailboxException {
-        throw new NotImplementedException();
-    }
-
-    @Override
-    public long getMaxMessageCount(String quotaRoot) throws MailboxException {
-        throw new NotImplementedException();
-    }
-
-    @Override
-    public long getMaxStorage(String quotaRoot) throws MailboxException {
-        throw new NotImplementedException();
-    }
-
-    @Override
-    public long getDefaultMaxMessageCount() throws MailboxException {
-        throw new NotImplementedException();
-    }
-
-    @Override
-    public long getDefaultMaxStorage() throws MailboxException {
-        throw new NotImplementedException();
-    }
-
-    @Override
-    public void setMaxMessageCount(String quotaRoot, long maxMessageCount) throws MailboxException {
-        throw new NotImplementedException();
-    }
-
-    @Override
-    public void setMaxStorage(String quotaRoot, long maxSize) throws MailboxException {
-        throw new NotImplementedException();
-    }
-
-    @Override
-    public void setDefaultMaxMessageCount(long maxDefaultMessageCount) throws MailboxException {
-        throw new NotImplementedException();
-    }
-
-    @Override
-    public void setDefaultMaxStorage(long maxDefaultSize) throws MailboxException {
-        throw new NotImplementedException();
-    }
-
-    @Override
-    public void appendMessage(String username, MailboxPath mailboxPath, InputStream message, Date internalDate, boolean isRecent, Flags flags) 
-            throws MailboxException {
-        
-        MailboxSession mailboxSession = mailboxManager.createSystemSession(username, LOGGER);
-        MessageManager messageManager = mailboxManager.getMailbox(mailboxPath, mailboxSession);
-        messageManager.appendMessage(message, internalDate, mailboxSession, isRecent, flags);
-    }
-
-    @Override
-    public void reIndexMailbox(String namespace, String user, String name) throws Exception {
-        throw new NotImplementedException();
-    }
-
-    @Override
-    public void reIndexAll() throws Exception {
-        throw new NotImplementedException();
-    }
-
-    @Override
-    public long getSieveQuota() throws Exception {
-        return sieveRepository.getQuota();
-    }
-
-    @Override
-    public void setSieveQuota(long quota) throws Exception {
-        sieveRepository.setQuota(quota);
-    }
-
-    @Override
-    public void removeSieveQuota() throws Exception {
-        sieveRepository.removeQuota();
-    }
-
-    @Override
-    public long getSieveQuota(String user) throws Exception {
-        return sieveRepository.getQuota(user);
-    }
-
-    @Override
-    public void setSieveQuota(String user, long quota) throws Exception {
-        sieveRepository.setQuota(user, quota);
-    }
-
-    @Override
-    public void removeSieveQuota(String user) throws Exception {
-        sieveRepository.removeQuota(user);
-    }
-
-    @Override
-    public void modifyVacation(AccountId accountId, VacationPatch vacationPatch) {
-        vacationRepository.modifyVacation(accountId, vacationPatch).join();
-    }
-
-    @Override
-    public Vacation retrieveVacation(AccountId accountId) {
-        return vacationRepository.retrieveVacation(accountId).join();
-    }
-}

http://git-wip-us.apache.org/repos/asf/james-project/blob/ebbf1e6f/server/container/guice/guice-common/src/main/java/org/apache/james/utils/WebAdminGuiceProbe.java
----------------------------------------------------------------------
diff --git a/server/container/guice/guice-common/src/main/java/org/apache/james/utils/WebAdminGuiceProbe.java b/server/container/guice/guice-common/src/main/java/org/apache/james/utils/WebAdminGuiceProbe.java
new file mode 100644
index 0000000..a68155c
--- /dev/null
+++ b/server/container/guice/guice-common/src/main/java/org/apache/james/utils/WebAdminGuiceProbe.java
@@ -0,0 +1,37 @@
+/****************************************************************
+ * 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.utils;
+
+import javax.inject.Inject;
+
+import org.apache.james.webadmin.WebAdminServer;
+
+public class WebAdminGuiceProbe implements GuiceProbe {
+    private final WebAdminServer webAdminServer;
+
+    @Inject
+    public WebAdminGuiceProbe(WebAdminServer webAdminServer) {
+        this.webAdminServer = webAdminServer;
+    }
+
+    public int getWebAdminPort() {
+        return webAdminServer.getPort().toInt();
+    }
+}

http://git-wip-us.apache.org/repos/asf/james-project/blob/ebbf1e6f/server/container/guice/guice-common/src/test/java/org/apache/james/AbstractJmapJamesServerTest.java
----------------------------------------------------------------------
diff --git a/server/container/guice/guice-common/src/test/java/org/apache/james/AbstractJmapJamesServerTest.java b/server/container/guice/guice-common/src/test/java/org/apache/james/AbstractJmapJamesServerTest.java
index 43eb665..4de3ba6 100644
--- a/server/container/guice/guice-common/src/test/java/org/apache/james/AbstractJmapJamesServerTest.java
+++ b/server/container/guice/guice-common/src/test/java/org/apache/james/AbstractJmapJamesServerTest.java
@@ -30,6 +30,7 @@ import java.nio.ByteBuffer;
 import java.nio.channels.SocketChannel;
 import java.nio.charset.Charset;
 
+import org.apache.james.utils.JmapGuiceProbe;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
@@ -39,7 +40,7 @@ import com.jayway.restassured.RestAssured;
 import com.jayway.restassured.builder.RequestSpecBuilder;
 import com.jayway.restassured.http.ContentType;
 
-public abstract class AbstractJmapJamesServerTest {
+public abstract class AbstractJmapJamesServerTest<T extends GuiceJamesServer & JmapServer & WebAdminServer> {
 
     private static final int IMAP_PORT = 1143; // You need to be root (superuser) to bind to ports under 1024.
     private static final int IMAP_PORT_SSL = 1993;
@@ -47,7 +48,7 @@ public abstract class AbstractJmapJamesServerTest {
     private static final int SMTP_PORT = 1025;
     private static final int LMTP_PORT = 1024;
 
-    private GuiceJmapJamesServer server;
+    private T server;
     private SocketChannel socketChannel;
 
     @Before
@@ -60,12 +61,12 @@ public abstract class AbstractJmapJamesServerTest {
         		.setContentType(ContentType.JSON)
         		.setAccept(ContentType.JSON)
         		.setConfig(newConfig().encoderConfig(encoderConfig().defaultContentCharset(Charsets.UTF_8)))
-        		.setPort(server.getJmapPort()
-                        .orElseThrow(() -> new RuntimeException("Unable to locate JMAP port")))
+        		.setPort(server.getJmapProbe()
+                    .getJmapPort())
         		.build();
     }
 
-    protected abstract GuiceJmapJamesServer createJamesServer();
+    protected abstract T createJamesServer();
 
     protected abstract void clean();
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/ebbf1e6f/server/container/guice/guice-common/src/test/java/org/apache/james/utils/GuiceProbeProviderTest.java
----------------------------------------------------------------------
diff --git a/server/container/guice/guice-common/src/test/java/org/apache/james/utils/GuiceProbeProviderTest.java b/server/container/guice/guice-common/src/test/java/org/apache/james/utils/GuiceProbeProviderTest.java
new file mode 100644
index 0000000..f4f73ec
--- /dev/null
+++ b/server/container/guice/guice-common/src/test/java/org/apache/james/utils/GuiceProbeProviderTest.java
@@ -0,0 +1,68 @@
+/****************************************************************
+ * 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.utils;
+import static  org.assertj.core.api.Assertions.assertThat;
+
+import com.google.common.collect.ImmutableSet;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.ExpectedException;
+
+import static org.junit.Assert.*;
+
+public class GuiceProbeProviderTest {
+
+    private GuiceProbeProvider guiceProbeProvider;
+    @Rule
+    public ExpectedException expectedException = ExpectedException.none();
+    private GuiceProbe1 guiceProbe1;
+
+    @Before
+    public void setUp() throws Exception {
+        guiceProbe1 = new GuiceProbe1();
+        guiceProbeProvider = new GuiceProbeProvider(ImmutableSet.of(guiceProbe1));
+    }
+
+    @Test
+    public void getProveShouldThrowExcpetionWhenNull() {
+        expectedException.expect(NullPointerException.class);
+
+        guiceProbeProvider.getProbe(null);
+    }
+    @Test
+    public void getProbeShouldThrowRuntimeExceptionWhenEmpty() {
+        expectedException.expect(RuntimeException.class);
+
+        guiceProbeProvider.getProbe(GuiceProbe2.class);
+    }
+
+    @Test
+    public void getProbeShouldReturnRightProbe() {
+        assertThat(guiceProbeProvider.getProbe(GuiceProbe1.class)).isEqualTo(guiceProbe1);
+    }
+
+    class GuiceProbe1 implements GuiceProbe {
+
+    }
+
+    class GuiceProbe2 implements GuiceProbe {
+
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/james-project/blob/ebbf1e6f/server/container/guice/jpa-guice/src/main/java/org/apache/james/modules/data/JPASieveRepositoryModule.java
----------------------------------------------------------------------
diff --git a/server/container/guice/jpa-guice/src/main/java/org/apache/james/modules/data/JPASieveRepositoryModule.java b/server/container/guice/jpa-guice/src/main/java/org/apache/james/modules/data/JPASieveRepositoryModule.java
index 13fff5b..d5dac1c 100644
--- a/server/container/guice/jpa-guice/src/main/java/org/apache/james/modules/data/JPASieveRepositoryModule.java
+++ b/server/container/guice/jpa-guice/src/main/java/org/apache/james/modules/data/JPASieveRepositoryModule.java
@@ -1,3 +1,21 @@
+/****************************************************************
+ * 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.sieverepository.api.SieveRepository;

http://git-wip-us.apache.org/repos/asf/james-project/blob/ebbf1e6f/server/container/guice/jpa-guice/src/main/java/org/apache/james/modules/mailbox/LuceneSearchMailboxModule.java
----------------------------------------------------------------------
diff --git a/server/container/guice/jpa-guice/src/main/java/org/apache/james/modules/mailbox/LuceneSearchMailboxModule.java b/server/container/guice/jpa-guice/src/main/java/org/apache/james/modules/mailbox/LuceneSearchMailboxModule.java
index dbb3435..53cbc01 100644
--- a/server/container/guice/jpa-guice/src/main/java/org/apache/james/modules/mailbox/LuceneSearchMailboxModule.java
+++ b/server/container/guice/jpa-guice/src/main/java/org/apache/james/modules/mailbox/LuceneSearchMailboxModule.java
@@ -22,6 +22,10 @@ package org.apache.james.modules.mailbox;
 import java.io.File;
 import java.io.IOException;
 
+import org.apache.james.core.JamesServerResourceLoader;
+import org.apache.james.core.filesystem.FileSystemImpl;
+import org.apache.james.filesystem.api.FileSystem;
+import org.apache.james.filesystem.api.JamesDirectoriesProvider;
 import org.apache.james.mailbox.lucene.search.LuceneMessageSearchIndex;
 import org.apache.james.mailbox.store.search.ListeningMessageSearchIndex;
 import org.apache.james.mailbox.store.search.MessageSearchIndex;
@@ -44,7 +48,7 @@ public class LuceneSearchMailboxModule extends AbstractModule {
 
     @Provides
     @Singleton
-    Directory provideDirectory() throws IOException {
-        return FSDirectory.open(new File("Lucene"));
+    Directory provideDirectory(FileSystem fileSystem) throws IOException {
+        return FSDirectory.open(fileSystem.getBasedir());
     }
 }

http://git-wip-us.apache.org/repos/asf/james-project/blob/ebbf1e6f/server/container/guice/memory-guice/src/main/java/org/apache/james/MemoryJamesServer.java
----------------------------------------------------------------------
diff --git a/server/container/guice/memory-guice/src/main/java/org/apache/james/MemoryJamesServer.java b/server/container/guice/memory-guice/src/main/java/org/apache/james/MemoryJamesServer.java
new file mode 100644
index 0000000..7a5e52f
--- /dev/null
+++ b/server/container/guice/memory-guice/src/main/java/org/apache/james/MemoryJamesServer.java
@@ -0,0 +1,56 @@
+/****************************************************************
+ * 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;
+
+import java.util.Arrays;
+
+import org.apache.james.utils.JmapGuiceProbe;
+import org.apache.james.utils.WebAdminGuiceProbe;
+
+import com.google.common.collect.Iterables;
+import com.google.inject.Module;
+import com.google.inject.util.Modules;
+
+public class MemoryJamesServer extends GuiceJamesServer implements JmapServer, WebAdminServer {
+    public MemoryJamesServer() {
+        super();
+    }
+
+    public MemoryJamesServer(Module module) {
+        super(module);
+    }
+
+    public MemoryJamesServer combineWith(Module... modules) {
+        return new MemoryJamesServer(Modules.combine(Iterables.concat(Arrays.asList(module), Arrays.asList(modules))));
+    }
+
+    public MemoryJamesServer overrideWith(Module... overrides) {
+        return new MemoryJamesServer(Modules.override(module).with(overrides));
+    }
+
+    @Override
+    public JmapGuiceProbe getJmapProbe() {
+        return getGuiceProbeProvider().getProbe(JmapGuiceProbe.class);
+    }
+
+    @Override
+    public WebAdminGuiceProbe getWebAdminProbe() {
+        return getGuiceProbeProvider().getProbe(WebAdminGuiceProbe.class);
+    }
+}

http://git-wip-us.apache.org/repos/asf/james-project/blob/ebbf1e6f/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 43d6532..cfeeb42 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
@@ -22,6 +22,7 @@ package org.apache.james;
 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.protocols.JMAPServerModule;
 import org.apache.james.modules.server.JMXServerModule;
 import org.apache.james.modules.server.MemoryMailQueueModule;
 import org.apache.james.modules.server.QuotaModule;
@@ -32,6 +33,7 @@ import com.google.inject.util.Modules;
 public class MemoryJamesServerMain {
 
     public static final Module inMemoryServerModule = Modules.combine(
+        new JMAPServerModule(),
         new MemoryDataModule(),
         new MemoryDataJmapModule(),
         new MemoryMailboxModule(),
@@ -39,7 +41,7 @@ public class MemoryJamesServerMain {
         new MemoryMailQueueModule());
 
     public static void main(String[] args) throws Exception {
-        new GuiceJmapJamesServer()
+        new MemoryJamesServer()
             .combineWith(inMemoryServerModule, new JMXServerModule())
             .start();
     }

http://git-wip-us.apache.org/repos/asf/james-project/blob/ebbf1e6f/server/container/guice/memory-guice/src/test/java/org/apache/james/MemoryJamesServerTest.java
----------------------------------------------------------------------
diff --git a/server/container/guice/memory-guice/src/test/java/org/apache/james/MemoryJamesServerTest.java b/server/container/guice/memory-guice/src/test/java/org/apache/james/MemoryJamesServerTest.java
index 424c772..14d85ea 100644
--- a/server/container/guice/memory-guice/src/test/java/org/apache/james/MemoryJamesServerTest.java
+++ b/server/container/guice/memory-guice/src/test/java/org/apache/james/MemoryJamesServerTest.java
@@ -25,14 +25,14 @@ import org.apache.james.modules.TestJMAPServerModule;
 import org.junit.Rule;
 import org.junit.rules.TemporaryFolder;
 
-public class MemoryJamesServerTest extends AbstractJmapJamesServerTest {
+public class MemoryJamesServerTest extends AbstractJmapJamesServerTest<MemoryJamesServer> {
 
     @Rule
     public TemporaryFolder temporaryFolder = new TemporaryFolder();
 
     @Override
-    protected GuiceJmapJamesServer createJamesServer() {
-        return new GuiceJmapJamesServer()
+    protected MemoryJamesServer createJamesServer() {
+        return new MemoryJamesServer()
                 .combineWith(MemoryJamesServerMain.inMemoryServerModule)
                 .overrideWith(new TestFilesystemModule(temporaryFolder),
                         new TestJMAPServerModule(GetMessageListMethod.DEFAULT_MAXIMUM_LIMIT));

http://git-wip-us.apache.org/repos/asf/james-project/blob/ebbf1e6f/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/TemporaryJamesServer.java
----------------------------------------------------------------------
diff --git a/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/TemporaryJamesServer.java b/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/TemporaryJamesServer.java
index e440250..a23d552 100644
--- a/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/TemporaryJamesServer.java
+++ b/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/TemporaryJamesServer.java
@@ -28,11 +28,12 @@ import java.util.Arrays;
 
 import org.apache.commons.configuration.ConfigurationException;
 import org.apache.commons.io.IOUtils;
-import org.apache.james.GuiceJmapJamesServer;
+import org.apache.james.GuiceJamesServer;
+import org.apache.james.MemoryJamesServer;
 import org.apache.james.MemoryJamesServerMain;
 import org.apache.james.mailets.configuration.MailetContainer;
 import org.apache.james.modules.TestJMAPServerModule;
-import org.apache.james.utils.ExtendedJmapServerProbe;
+import org.apache.james.utils.GuiceServerProbe;
 import org.junit.rules.TemporaryFolder;
 
 import com.google.common.collect.ImmutableList;
@@ -44,13 +45,13 @@ public class TemporaryJamesServer {
 
     private static final int LIMIT_TO_3_MESSAGES = 3;
 
-    private final GuiceJmapJamesServer jamesServer;
+    private final MemoryJamesServer jamesServer;
 
 
     public TemporaryJamesServer(TemporaryFolder temporaryFolder, MailetContainer mailetContainer, Module... additionalModules) throws Exception {
         appendMailetConfigurations(temporaryFolder, mailetContainer);
 
-        jamesServer = new GuiceJmapJamesServer()
+        jamesServer = new MemoryJamesServer()
             .combineWith(MemoryJamesServerMain.inMemoryServerModule)
             .overrideWith(ImmutableList.<Module>builder().addAll(Arrays.asList(additionalModules))
                 .add(new TestJMAPServerModule(LIMIT_TO_3_MESSAGES))
@@ -76,7 +77,7 @@ public class TemporaryJamesServer {
         jamesServer.stop();
     }
 
-    public ExtendedJmapServerProbe getServerProbe() {
+    public GuiceServerProbe getServerProbe() {
         return jamesServer.serverProbe();
     }
 }

http://git-wip-us.apache.org/repos/asf/james-project/blob/ebbf1e6f/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraGetMailboxesMethodTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraGetMailboxesMethodTest.java b/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraGetMailboxesMethodTest.java
index c9c4207..ff36364 100644
--- a/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraGetMailboxesMethodTest.java
+++ b/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraGetMailboxesMethodTest.java
@@ -19,8 +19,8 @@
 
 package org.apache.james.jmap.cassandra;
 
+import org.apache.james.CassandraJamesServer;
 import org.apache.james.CassandraJamesServerMain;
-import org.apache.james.GuiceJmapJamesServer;
 import org.apache.james.backends.cassandra.EmbeddedCassandra;
 import org.apache.james.jmap.methods.integration.GetMailboxesMethodTest;
 import org.apache.james.mailbox.elasticsearch.EmbeddedElasticSearch;
@@ -30,7 +30,7 @@ import org.junit.rules.RuleChain;
 import org.junit.rules.TemporaryFolder;
 
 
-public class CassandraGetMailboxesMethodTest extends GetMailboxesMethodTest {
+public class CassandraGetMailboxesMethodTest extends GetMailboxesMethodTest<CassandraJamesServer> {
 
     private TemporaryFolder temporaryFolder = new TemporaryFolder();
     private EmbeddedElasticSearch embeddedElasticSearch = new EmbeddedElasticSearch(temporaryFolder);
@@ -42,8 +42,8 @@ public class CassandraGetMailboxesMethodTest extends GetMailboxesMethodTest {
         .around(embeddedElasticSearch);
 
     @Override
-    protected GuiceJmapJamesServer createJmapServer() {
-        return new GuiceJmapJamesServer()
+    protected CassandraJamesServer createJmapServer() {
+        return new CassandraJamesServer()
                     .combineWith(CassandraJamesServerMain.cassandraServerModule)
                     .overrideWith(new CassandraJmapServerModule(temporaryFolder, embeddedElasticSearch, cassandra));
     }

http://git-wip-us.apache.org/repos/asf/james-project/blob/ebbf1e6f/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraGetMessageListMethodTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraGetMessageListMethodTest.java b/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraGetMessageListMethodTest.java
index 387c801..c6b62f9 100644
--- a/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraGetMessageListMethodTest.java
+++ b/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraGetMessageListMethodTest.java
@@ -19,8 +19,8 @@
 
 package org.apache.james.jmap.cassandra;
 
+import org.apache.james.CassandraJamesServer;
 import org.apache.james.CassandraJamesServerMain;
-import org.apache.james.GuiceJmapJamesServer;
 import org.apache.james.backends.cassandra.EmbeddedCassandra;
 import org.apache.james.jmap.methods.integration.GetMessageListMethodTest;
 import org.apache.james.mailbox.elasticsearch.EmbeddedElasticSearch;
@@ -29,7 +29,7 @@ import org.junit.Rule;
 import org.junit.rules.RuleChain;
 import org.junit.rules.TemporaryFolder;
 
-public class CassandraGetMessageListMethodTest extends GetMessageListMethodTest {
+public class CassandraGetMessageListMethodTest extends GetMessageListMethodTest<CassandraJamesServer> {
 
     private TemporaryFolder temporaryFolder = new TemporaryFolder();
     private EmbeddedElasticSearch embeddedElasticSearch = new EmbeddedElasticSearch(temporaryFolder);
@@ -41,8 +41,8 @@ public class CassandraGetMessageListMethodTest extends GetMessageListMethodTest
         .around(embeddedElasticSearch);
     
     @Override
-    protected GuiceJmapJamesServer createJmapServer() {
-        return new GuiceJmapJamesServer()
+    protected CassandraJamesServer createJmapServer() {
+        return new CassandraJamesServer()
                 .combineWith(CassandraJamesServerMain.cassandraServerModule)
                 .overrideWith(new CassandraJmapServerModule(temporaryFolder, embeddedElasticSearch, cassandra));
     }

http://git-wip-us.apache.org/repos/asf/james-project/blob/ebbf1e6f/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraGetVacationResponseTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraGetVacationResponseTest.java b/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraGetVacationResponseTest.java
index 3aeca25..14227f6 100644
--- a/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraGetVacationResponseTest.java
+++ b/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraGetVacationResponseTest.java
@@ -19,8 +19,8 @@
 
 package org.apache.james.jmap.cassandra;
 
+import org.apache.james.CassandraJamesServer;
 import org.apache.james.CassandraJamesServerMain;
-import org.apache.james.GuiceJmapJamesServer;
 import org.apache.james.backends.cassandra.EmbeddedCassandra;
 import org.apache.james.jmap.methods.integration.GetVacationResponseTest;
 import org.apache.james.mailbox.elasticsearch.EmbeddedElasticSearch;
@@ -30,7 +30,7 @@ import org.junit.Rule;
 import org.junit.rules.RuleChain;
 import org.junit.rules.TemporaryFolder;
 
-public class CassandraGetVacationResponseTest extends GetVacationResponseTest {
+public class CassandraGetVacationResponseTest extends GetVacationResponseTest<CassandraJamesServer> {
 
     private TemporaryFolder temporaryFolder = new TemporaryFolder();
     private EmbeddedElasticSearch embeddedElasticSearch = new EmbeddedElasticSearch(temporaryFolder);
@@ -42,8 +42,8 @@ public class CassandraGetVacationResponseTest extends GetVacationResponseTest {
         .around(embeddedElasticSearch);
 
     @Override
-    protected GuiceJmapJamesServer createJmapServer(ZonedDateTimeProvider zonedDateTimeProvider) {
-        return new GuiceJmapJamesServer()
+    protected CassandraJamesServer createJmapServer(ZonedDateTimeProvider zonedDateTimeProvider) {
+        return new CassandraJamesServer()
                     .combineWith(CassandraJamesServerMain.cassandraServerModule)
                     .overrideWith(new CassandraJmapServerModule(temporaryFolder, embeddedElasticSearch, cassandra),
                         binder -> binder.bind(ZonedDateTimeProvider.class).toInstance(zonedDateTimeProvider));


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


[18/29] james-project git commit: JAMES-1842: Rename GuiceJamesServer to GuiceJmapJamesServer, AbstractJamesServerTest to AbstractJmapJamesServerTest, add more GuiceJamesServer

Posted by ad...@apache.org.
JAMES-1842: Rename GuiceJamesServer to GuiceJmapJamesServer, AbstractJamesServerTest to AbstractJmapJamesServerTest, add more GuiceJamesServer


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

Branch: refs/heads/master
Commit: 11771d03677b7f4ee7de9f41ae5295b8cfdeaf70
Parents: b9a9402
Author: Quynh Nguyen <qn...@linagora.com>
Authored: Mon Oct 31 11:24:21 2016 +0700
Committer: Quynh Nguyen <qn...@linagora.com>
Committed: Fri Nov 18 09:25:34 2016 +0700

----------------------------------------------------------------------
 .../org/apache/james/mailbox/jpa/JPAId.java     |   2 +-
 .../src/main/resources/META-INF/persistence.xml |   3 -
 .../apache/james/CassandraJamesServerTest.java  |   2 +-
 .../java/org/apache/james/GuiceJamesServer.java |  99 ++++++
 .../org/apache/james/GuiceJmapJamesServer.java  |   2 +-
 .../java/org/apache/james/jmap/JMAPModule.java  |  15 -
 .../james/modules/CommonServicesModule.java     |   2 -
 .../apache/james/modules/ProtocolsModule.java   |   4 +
 .../modules/ProtocolsModuleWithoutJMAP.java     |   5 +
 .../server/CamelMailetContainerModule.java      |  20 ++
 .../apache/james/utils/GuiceServerProbe.java    | 352 +++++++++++++++++++
 .../apache/james/AbstractJamesServerTest.java   |  33 +-
 .../james/AbstractJmapJamesServerTest.java      | 140 ++++++++
 .../james/jmap/MailetPreconditionTest.java      |   5 +-
 server/container/guice/jpa-guice/pom.xml        |  16 +-
 .../java/org/apache/james/JPAConfiguration.java |   3 +
 .../org/apache/james/JPAJamesServerMain.java    |  27 +-
 .../james/modules/data/JPADataJmapModule.java   |  22 --
 .../james/modules/data/JPADataModule.java       |  32 ++
 .../modules/data/JPASieveRepositoryModule.java  |  18 +
 .../james/modules/mailbox/JPAMailboxModule.java |   8 +-
 .../mailbox/LuceneSearchMailboxModule.java      |   5 -
 .../ScheduledExecutorServiceProvider.java       |  49 ---
 .../src/main/resources/META-INF/persistence.xml |  45 +++
 .../org/apache/james/JPAJamesServerTest.java    |   2 +-
 .../james/TestJPAConfigurationModule.java       |   5 +-
 .../src/test/resources/mailetcontainer.xml      |   1 -
 .../org/apache/james/MemoryJamesServerTest.java |   2 +-
 .../src/main/resources/META-INF/persistence.xml |   6 -
 server/pom.xml                                  |   7 +-
 30 files changed, 748 insertions(+), 184 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/11771d03/mailbox/jpa/src/main/java/org/apache/james/mailbox/jpa/JPAId.java
----------------------------------------------------------------------
diff --git a/mailbox/jpa/src/main/java/org/apache/james/mailbox/jpa/JPAId.java b/mailbox/jpa/src/main/java/org/apache/james/mailbox/jpa/JPAId.java
index 343476f..2992725 100644
--- a/mailbox/jpa/src/main/java/org/apache/james/mailbox/jpa/JPAId.java
+++ b/mailbox/jpa/src/main/java/org/apache/james/mailbox/jpa/JPAId.java
@@ -25,7 +25,7 @@ public class JPAId implements MailboxId {
     public static class Factory implements MailboxId.Factory {
         @Override
         public JPAId fromString(String serialized) {
-            return of(Long.parseLong(serialized));
+            return of(Long.valueOf(serialized));
         }
     }
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/11771d03/mailbox/jpa/src/main/resources/META-INF/persistence.xml
----------------------------------------------------------------------
diff --git a/mailbox/jpa/src/main/resources/META-INF/persistence.xml b/mailbox/jpa/src/main/resources/META-INF/persistence.xml
index a9cbc68..3ec5f22 100644
--- a/mailbox/jpa/src/main/resources/META-INF/persistence.xml
+++ b/mailbox/jpa/src/main/resources/META-INF/persistence.xml
@@ -30,9 +30,6 @@
         <class>org.apache.james.mailbox.jpa.mail.model.openjpa.JPAMailboxMessage</class>
         <class>org.apache.james.mailbox.jpa.mail.model.JPAProperty</class>
         <class>org.apache.james.mailbox.jpa.user.model.JPASubscription</class>
-        <class>org.apache.james.domainlist.jpa.model.JPADomain</class>
-        <class>org.apache.james.user.jpa.model.JPAUser</class>
-        <class>org.apache.james.rrt.jpa.model.JPARecipientRewrite</class>
         <properties>
             <property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema(ForeignKeys=true)"/>
             <property name="openjpa.jdbc.MappingDefaults" value="ForeignKeyDeleteAction=cascade, JoinForeignKeyDeleteAction=cascade"/>

http://git-wip-us.apache.org/repos/asf/james-project/blob/11771d03/server/container/guice/cassandra-guice/src/test/java/org/apache/james/CassandraJamesServerTest.java
----------------------------------------------------------------------
diff --git a/server/container/guice/cassandra-guice/src/test/java/org/apache/james/CassandraJamesServerTest.java b/server/container/guice/cassandra-guice/src/test/java/org/apache/james/CassandraJamesServerTest.java
index 41187a1..2f53657 100644
--- a/server/container/guice/cassandra-guice/src/test/java/org/apache/james/CassandraJamesServerTest.java
+++ b/server/container/guice/cassandra-guice/src/test/java/org/apache/james/CassandraJamesServerTest.java
@@ -35,7 +35,7 @@ import com.google.inject.AbstractModule;
 import com.google.inject.Provides;
 import com.google.inject.Singleton;
 
-public class CassandraJamesServerTest extends AbstractJamesServerTest {
+public class CassandraJamesServerTest extends AbstractJmapJamesServerTest {
 
     private TemporaryFolder temporaryFolder = new TemporaryFolder();
     private EmbeddedElasticSearch embeddedElasticSearch = new EmbeddedElasticSearch(temporaryFolder);

http://git-wip-us.apache.org/repos/asf/james-project/blob/11771d03/server/container/guice/guice-common/src/main/java/org/apache/james/GuiceJamesServer.java
----------------------------------------------------------------------
diff --git a/server/container/guice/guice-common/src/main/java/org/apache/james/GuiceJamesServer.java b/server/container/guice/guice-common/src/main/java/org/apache/james/GuiceJamesServer.java
new file mode 100644
index 0000000..d847783
--- /dev/null
+++ b/server/container/guice/guice-common/src/main/java/org/apache/james/GuiceJamesServer.java
@@ -0,0 +1,99 @@
+/****************************************************************
+ * 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;
+
+import java.util.Arrays;
+import java.util.Optional;
+
+import javax.annotation.PreDestroy;
+
+import org.apache.james.modules.CommonServicesModule;
+import org.apache.james.modules.MailetProcessingModule;
+import org.apache.james.modules.ProtocolsModuleWithoutJMAP;
+import org.apache.james.onami.lifecycle.Stager;
+import org.apache.james.utils.ConfigurationsPerformer;
+import org.apache.james.utils.ExtendedServerProbe;
+import org.apache.james.utils.GuiceServerProbe;
+import org.apache.james.webadmin.Port;
+import org.apache.james.webadmin.WebAdminServer;
+
+import com.google.common.collect.Iterables;
+import com.google.inject.Guice;
+import com.google.inject.Injector;
+import com.google.inject.Key;
+import com.google.inject.Module;
+import com.google.inject.TypeLiteral;
+import com.google.inject.util.Modules;
+
+public class GuiceJamesServer {
+    private final Module module;
+    private Stager<PreDestroy> preDestroy;
+    private GuiceServerProbe serverProbe;
+    private Optional<Port> webadminPort;
+
+    public GuiceJamesServer() {
+        this(Modules.combine(
+                        new CommonServicesModule(),
+                        new ProtocolsModuleWithoutJMAP(),
+                        new MailetProcessingModule()));
+    }
+
+    private GuiceJamesServer(Module module) {
+        this.module = module;
+    }
+    
+    public GuiceJamesServer combineWith(Module... modules) {
+        return new GuiceJamesServer(Modules.combine(Iterables.concat(Arrays.asList(module), Arrays.asList(modules))));
+    }
+    
+    public GuiceJamesServer overrideWith(Module... overrides) {
+        return new GuiceJamesServer(Modules.override(module).with(overrides));
+    }
+    
+    public void start() throws Exception {
+        Injector injector = Guice.createInjector(module);
+        preDestroy = injector.getInstance(Key.get(new TypeLiteral<Stager<PreDestroy>>() {}));
+        injector.getInstance(ConfigurationsPerformer.class).initModules();
+        serverProbe = injector.getInstance(GuiceServerProbe.class);
+        webadminPort =locateWebAdminPort(injector);
+    }
+
+    private Optional<Port> locateWebAdminPort(Injector injector) {
+        try {
+            return Optional.of(injector.getInstance(WebAdminServer.class).getPort());
+        } catch(Exception e) {
+            return Optional.empty();
+        }
+    }
+
+    public void stop() {
+        if (preDestroy != null) {
+            preDestroy.stage();
+        }
+    }
+
+    public ExtendedServerProbe serverProbe() {
+        return serverProbe;
+    }
+
+    public Optional<Port> getWebadminPort() {
+        return webadminPort;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/james-project/blob/11771d03/server/container/guice/guice-common/src/main/java/org/apache/james/GuiceJmapJamesServer.java
----------------------------------------------------------------------
diff --git a/server/container/guice/guice-common/src/main/java/org/apache/james/GuiceJmapJamesServer.java b/server/container/guice/guice-common/src/main/java/org/apache/james/GuiceJmapJamesServer.java
index d137fdf..8a85b81 100644
--- a/server/container/guice/guice-common/src/main/java/org/apache/james/GuiceJmapJamesServer.java
+++ b/server/container/guice/guice-common/src/main/java/org/apache/james/GuiceJmapJamesServer.java
@@ -57,7 +57,7 @@ public class GuiceJmapJamesServer {
                         new MailetProcessingModule()));
     }
 
-    public GuiceJmapJamesServer(Module module) {
+    private GuiceJmapJamesServer(Module module) {
         this.module = module;
     }
     

http://git-wip-us.apache.org/repos/asf/james-project/blob/11771d03/server/container/guice/guice-common/src/main/java/org/apache/james/jmap/JMAPModule.java
----------------------------------------------------------------------
diff --git a/server/container/guice/guice-common/src/main/java/org/apache/james/jmap/JMAPModule.java b/server/container/guice/guice-common/src/main/java/org/apache/james/jmap/JMAPModule.java
index 286cead..c38ea17 100644
--- a/server/container/guice/guice-common/src/main/java/org/apache/james/jmap/JMAPModule.java
+++ b/server/container/guice/guice-common/src/main/java/org/apache/james/jmap/JMAPModule.java
@@ -38,8 +38,6 @@ import org.apache.james.mailbox.MailboxManager;
 import org.apache.james.mailbox.MailboxManager.SearchCapabilities;
 import org.apache.james.mailetcontainer.impl.MatcherMailetPair;
 import org.apache.james.modules.server.CamelMailetContainerModule;
-import org.apache.james.transport.mailets.RemoveMimeHeader;
-import org.apache.james.transport.matchers.All;
 import org.apache.james.transport.matchers.RecipientIsLocal;
 import org.apache.james.utils.ConfigurationPerformer;
 import org.apache.james.utils.PropertiesProvider;
@@ -71,7 +69,6 @@ public class JMAPModule extends AbstractModule {
 
         Multibinder<CamelMailetContainerModule.TransportProcessorCheck> transportProcessorChecks = Multibinder.newSetBinder(binder(), CamelMailetContainerModule.TransportProcessorCheck.class);
         transportProcessorChecks.addBinding().to(VacationMailetCheck.class);
-        transportProcessorChecks.addBinding().to(BccMailetCheck.class);
         
         bind(SystemMailboxesProvider.class).to(SystemMailboxesProviderImpl.class);
     }
@@ -134,16 +131,4 @@ public class JMAPModule extends AbstractModule {
         }
     }
 
-    public static class BccMailetCheck implements CamelMailetContainerModule.TransportProcessorCheck {
-        @Override
-        public void check(List<MatcherMailetPair> pairs) throws ConfigurationException {
-            Preconditions.checkNotNull(pairs);
-            pairs.stream()
-                .filter(pair -> pair.getMailet().getClass().equals(RemoveMimeHeader.class))
-                .filter(pair -> pair.getMatcher().getClass().equals(All.class))
-                .filter(pair -> pair.getMailet().getMailetConfig().getInitParameter("name").equals("bcc"))
-                .findAny()
-                .orElseThrow(() -> new ConfigurationException("Missing RemoveMimeHeader in mailets configuration (mailetcontainer -> processors -> transport). Should be configured to remove Bcc header"));
-        }
-    }
 }

http://git-wip-us.apache.org/repos/asf/james-project/blob/11771d03/server/container/guice/guice-common/src/main/java/org/apache/james/modules/CommonServicesModule.java
----------------------------------------------------------------------
diff --git a/server/container/guice/guice-common/src/main/java/org/apache/james/modules/CommonServicesModule.java b/server/container/guice/guice-common/src/main/java/org/apache/james/modules/CommonServicesModule.java
index 10af893..dfbbb8a 100644
--- a/server/container/guice/guice-common/src/main/java/org/apache/james/modules/CommonServicesModule.java
+++ b/server/container/guice/guice-common/src/main/java/org/apache/james/modules/CommonServicesModule.java
@@ -33,7 +33,6 @@ import org.apache.james.modules.server.AsyncTasksExecutorModule;
 import org.apache.james.modules.server.ConfigurationProviderModule;
 import org.apache.james.modules.server.DNSServiceModule;
 import org.apache.james.onami.lifecycle.PreDestroyModule;
-import org.apache.james.utils.JmapGuiceServerProbe;
 
 import com.google.inject.AbstractModule;
 import com.google.inject.Provides;
@@ -55,7 +54,6 @@ public class CommonServicesModule extends AbstractModule {
         install(new AsyncTasksExecutorModule());
 
         bind(FileSystemImpl.class).in(Scopes.SINGLETON);
-        bind(JmapGuiceServerProbe.class).in(Scopes.SINGLETON);
 
         bind(FileSystem.class).to(FileSystemImpl.class);
     }

http://git-wip-us.apache.org/repos/asf/james-project/blob/11771d03/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
index c21391d..28554b2 100644
--- 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
@@ -26,8 +26,10 @@ 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 org.apache.james.utils.JmapGuiceServerProbe;
 
 import com.google.inject.AbstractModule;
+import com.google.inject.Scopes;
 
 public class ProtocolsModule extends AbstractModule {
 
@@ -41,6 +43,8 @@ public class ProtocolsModule extends AbstractModule {
         install(new LMTPServerModule());
         install(new ManageSieveServerModule());
         install(new WebAdminServerModule());
+        
+        bind(JmapGuiceServerProbe.class).in(Scopes.SINGLETON);
     }
     
 }

http://git-wip-us.apache.org/repos/asf/james-project/blob/11771d03/server/container/guice/guice-common/src/main/java/org/apache/james/modules/ProtocolsModuleWithoutJMAP.java
----------------------------------------------------------------------
diff --git a/server/container/guice/guice-common/src/main/java/org/apache/james/modules/ProtocolsModuleWithoutJMAP.java b/server/container/guice/guice-common/src/main/java/org/apache/james/modules/ProtocolsModuleWithoutJMAP.java
index 9c05696..a945651 100644
--- a/server/container/guice/guice-common/src/main/java/org/apache/james/modules/ProtocolsModuleWithoutJMAP.java
+++ b/server/container/guice/guice-common/src/main/java/org/apache/james/modules/ProtocolsModuleWithoutJMAP.java
@@ -7,8 +7,10 @@ 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 org.apache.james.utils.GuiceServerProbe;
 
 import com.google.inject.AbstractModule;
+import com.google.inject.Scopes;
 
 public class ProtocolsModuleWithoutJMAP extends AbstractModule {
     @Override
@@ -20,6 +22,9 @@ public class ProtocolsModuleWithoutJMAP extends AbstractModule {
         install(new LMTPServerModule());
         install(new ManageSieveServerModule());
         install(new WebAdminServerModule());
+
+        bind(GuiceServerProbe.class).in(Scopes.SINGLETON);
+
     }
 
 }

http://git-wip-us.apache.org/repos/asf/james-project/blob/11771d03/server/container/guice/guice-common/src/main/java/org/apache/james/modules/server/CamelMailetContainerModule.java
----------------------------------------------------------------------
diff --git a/server/container/guice/guice-common/src/main/java/org/apache/james/modules/server/CamelMailetContainerModule.java b/server/container/guice/guice-common/src/main/java/org/apache/james/modules/server/CamelMailetContainerModule.java
index 1decdd6..34a64a5 100644
--- a/server/container/guice/guice-common/src/main/java/org/apache/james/modules/server/CamelMailetContainerModule.java
+++ b/server/container/guice/guice-common/src/main/java/org/apache/james/modules/server/CamelMailetContainerModule.java
@@ -39,6 +39,8 @@ import org.apache.james.mailetcontainer.impl.MatcherMailetPair;
 import org.apache.james.mailetcontainer.impl.camel.CamelCompositeProcessor;
 import org.apache.james.mailetcontainer.impl.camel.CamelMailetProcessor;
 import org.apache.james.queue.api.MailQueueFactory;
+import org.apache.james.transport.mailets.RemoveMimeHeader;
+import org.apache.james.transport.matchers.All;
 import org.apache.james.user.api.UsersRepository;
 import org.apache.james.utils.ConfigurationPerformer;
 import org.apache.james.utils.ConfigurationProvider;
@@ -48,6 +50,7 @@ import org.apache.mailet.MailetContext;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import com.google.common.base.Preconditions;
 import com.google.common.base.Throwables;
 import com.google.common.collect.ImmutableList;
 import com.google.inject.AbstractModule;
@@ -75,6 +78,9 @@ public class CamelMailetContainerModule extends AbstractModule {
         bind(MatcherLoader.class).to(GuiceMatcherLoader.class);
 
         Multibinder.newSetBinder(binder(), ConfigurationPerformer.class).addBinding().to(MailetModuleConfigurationPerformer.class);
+
+        Multibinder<CamelMailetContainerModule.TransportProcessorCheck> transportProcessorChecks = Multibinder.newSetBinder(binder(), CamelMailetContainerModule.TransportProcessorCheck.class);
+        transportProcessorChecks.addBinding().to(BccMailetCheck.class);
     }
 
     @Provides
@@ -164,4 +170,18 @@ public class CamelMailetContainerModule extends AbstractModule {
     public interface TransportProcessorCheck {
         void check(List<MatcherMailetPair> pairs) throws ConfigurationException;
     }
+    
+    public static class BccMailetCheck implements CamelMailetContainerModule.TransportProcessorCheck {
+        @Override
+        public void check(List<MatcherMailetPair> pairs) throws ConfigurationException {
+            Preconditions.checkNotNull(pairs);
+            pairs.stream()
+                .filter(pair -> pair.getMailet().getClass().equals(RemoveMimeHeader.class))
+                .filter(pair -> pair.getMatcher().getClass().equals(All.class))
+                .filter(pair -> pair.getMailet().getMailetConfig().getInitParameter("name").equals("bcc"))
+                .findAny()
+                .orElseThrow(() -> new ConfigurationException("Missing RemoveMimeHeader in mailets configuration (mailetcontainer -> processors -> transport). Should be configured to remove Bcc header"));
+        }
+    }
+
 }

http://git-wip-us.apache.org/repos/asf/james-project/blob/11771d03/server/container/guice/guice-common/src/main/java/org/apache/james/utils/GuiceServerProbe.java
----------------------------------------------------------------------
diff --git a/server/container/guice/guice-common/src/main/java/org/apache/james/utils/GuiceServerProbe.java b/server/container/guice/guice-common/src/main/java/org/apache/james/utils/GuiceServerProbe.java
new file mode 100644
index 0000000..9cb8c07
--- /dev/null
+++ b/server/container/guice/guice-common/src/main/java/org/apache/james/utils/GuiceServerProbe.java
@@ -0,0 +1,352 @@
+/****************************************************************
+ * 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.utils;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Collection;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+import javax.inject.Inject;
+import javax.mail.Flags;
+
+import org.apache.commons.lang.NotImplementedException;
+import org.apache.james.adapter.mailbox.SerializableQuota;
+import org.apache.james.domainlist.api.DomainList;
+import org.apache.james.mailbox.MailboxManager;
+import org.apache.james.mailbox.MailboxSession;
+import org.apache.james.mailbox.MessageManager;
+import org.apache.james.mailbox.exception.MailboxException;
+import org.apache.james.mailbox.model.MailboxConstants;
+import org.apache.james.mailbox.model.MailboxMetaData;
+import org.apache.james.mailbox.model.MailboxPath;
+import org.apache.james.mailbox.model.MailboxQuery;
+import org.apache.james.mailbox.store.mail.MailboxMapper;
+import org.apache.james.mailbox.store.mail.MailboxMapperFactory;
+import org.apache.james.mailbox.store.mail.model.Mailbox;
+import org.apache.james.rrt.api.RecipientRewriteTable;
+import org.apache.james.rrt.lib.Mappings;
+import org.apache.james.sieverepository.api.SieveRepository;
+import org.apache.james.user.api.UsersRepository;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.google.common.base.Throwables;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.Iterables;
+
+public class GuiceServerProbe implements ExtendedServerProbe {
+
+    private static final Logger LOGGER = LoggerFactory.getLogger(JmapGuiceServerProbe.class);
+
+    private final MailboxManager mailboxManager;
+    private final MailboxMapperFactory mailboxMapperFactory;
+    private final DomainList domainList;
+    private final UsersRepository usersRepository;
+    private final SieveRepository sieveRepository;
+    private final RecipientRewriteTable recipientRewriteTable;
+
+    @Inject
+    private GuiceServerProbe(MailboxManager mailboxManager, MailboxMapperFactory mailboxMapperFactory,
+                             DomainList domainList, UsersRepository usersRepository, SieveRepository sieveRepository,
+                             RecipientRewriteTable recipientRewriteTable) {
+        this.mailboxManager = mailboxManager;
+        this.mailboxMapperFactory = mailboxMapperFactory;
+        this.domainList = domainList;
+        this.usersRepository = usersRepository;
+        this.sieveRepository = sieveRepository;
+        this.recipientRewriteTable = recipientRewriteTable;
+    }
+
+    @Override
+    public void close() throws IOException {
+    }
+
+    @Override
+    public void addUser(String userName, String password) throws Exception {
+        usersRepository.addUser(userName, password);
+    }
+
+    @Override
+    public void removeUser(String username) throws Exception {
+        usersRepository.removeUser(username);
+    }
+
+    @Override
+    public String[] listUsers() throws Exception {
+        return Iterables.toArray(ImmutableList.copyOf(usersRepository.list()), String.class);
+    }
+
+    @Override
+    public void setPassword(String userName, String password) throws Exception {
+        throw new NotImplementedException();
+    }
+
+    @Override
+    public void addDomain(String domain) throws Exception {
+        domainList.addDomain(domain);
+    }
+
+    @Override
+    public boolean containsDomain(String domain) throws Exception {
+        return domainList.containsDomain(domain);
+    }
+
+    @Override
+    public String getDefaultDomain() throws Exception {
+        return domainList.getDefaultDomain();
+    }
+
+    @Override
+    public void removeDomain(String domain) throws Exception {
+        domainList.removeDomain(domain);
+    }
+
+    @Override
+    public List<String> listDomains() throws Exception {
+        return domainList.getDomains();
+    }
+
+    @Override
+    public Map<String, Mappings> listMappings() throws Exception {
+        return recipientRewriteTable.getAllMappings();
+    }
+
+    @Override
+    public void addAddressMapping(String user, String domain, String toAddress) throws Exception {
+        recipientRewriteTable.addAddressMapping(user, domain, toAddress);
+    }
+
+    @Override
+    public void removeAddressMapping(String user, String domain, String fromAddress) throws Exception {
+        recipientRewriteTable.removeAddressMapping(user, domain, fromAddress);
+    }
+
+    @Override
+    public Mappings listUserDomainMappings(String user, String domain) throws Exception {
+        throw new NotImplementedException();
+    }
+
+    @Override
+    public void addRegexMapping(String user, String domain, String regex) throws Exception {
+        recipientRewriteTable.addRegexMapping(user, domain, regex);
+    }
+
+    @Override
+    public void removeRegexMapping(String user, String domain, String regex) throws Exception {
+        recipientRewriteTable.removeRegexMapping(user, domain, regex);
+    }
+
+    @Override
+    public void copyMailbox(String srcBean, String dstBean) throws Exception {
+        throw new NotImplementedException();
+    }
+
+    @Override
+    public void deleteUserMailboxesNames(String user) throws Exception {
+        throw new NotImplementedException();
+    }
+
+    @Override
+    public void createMailbox(String namespace, String user, String name) {
+        MailboxSession mailboxSession = null;
+        try {
+            mailboxSession = mailboxManager.createSystemSession(user, LOGGER);
+            mailboxManager.startProcessingRequest(mailboxSession);
+            mailboxManager.createMailbox(new MailboxPath(namespace, user, name), mailboxSession);
+        } catch (MailboxException e) {
+            throw Throwables.propagate(e);
+        } finally {
+            closeSession(mailboxSession);
+        }
+    }
+
+    @Override
+    public Mailbox getMailbox(String namespace, String user, String name) {
+        MailboxSession mailboxSession = null;
+        try {
+            mailboxSession = mailboxManager.createSystemSession(user, LOGGER);
+            MailboxMapper mailboxMapper = mailboxMapperFactory.getMailboxMapper(mailboxSession);
+            return mailboxMapper.findMailboxByPath(new MailboxPath(namespace, user, name));
+        } catch (MailboxException e) {
+            throw Throwables.propagate(e);
+        } finally {
+            closeSession(mailboxSession);
+        }
+    }
+
+    private void closeSession(MailboxSession session) {
+        if (session != null) {
+            mailboxManager.endProcessingRequest(session);
+            try {
+                mailboxManager.logout(session, true);
+            } catch (MailboxException e) {
+                throw Throwables.propagate(e);
+            }
+        }
+    }
+
+    @Override
+    public Collection<String> listUserMailboxes(String user) {
+        MailboxSession mailboxSession = null;
+        try {
+            mailboxSession = mailboxManager.createSystemSession(user, LOGGER);
+            mailboxManager.startProcessingRequest(mailboxSession);
+            return searchUserMailboxes(user, mailboxSession)
+                    .stream()
+                    .map(MailboxMetaData::getPath)
+                    .map(MailboxPath::getName)
+                    .collect(Collectors.toList());
+        } catch (MailboxException e) {
+            throw Throwables.propagate(e);
+        } finally {
+            closeSession(mailboxSession);
+        }
+    }
+
+    private List<MailboxMetaData> searchUserMailboxes(String username, MailboxSession session) throws MailboxException {
+        return mailboxManager.search(
+            new MailboxQuery(new MailboxPath(MailboxConstants.USER_NAMESPACE, username, ""),
+                "*",
+                session.getPathDelimiter()),
+            session);
+    }
+
+    @Override
+    public void deleteMailbox(String namespace, String user, String name) {
+        MailboxSession mailboxSession = null;
+        try {
+            mailboxSession = mailboxManager.createSystemSession(user, LOGGER);
+            mailboxManager.startProcessingRequest(mailboxSession);
+            mailboxManager.deleteMailbox(new MailboxPath(namespace, user, name), mailboxSession);
+        } catch (MailboxException e) {
+            throw Throwables.propagate(e);
+        } finally {
+            closeSession(mailboxSession);
+        }
+    }
+
+    @Override
+    public String getQuotaRoot(String namespace, String user, String name) throws MailboxException {
+        throw new NotImplementedException();
+    }
+
+    @Override
+    public SerializableQuota getMessageCountQuota(String quotaRoot) throws MailboxException {
+        throw new NotImplementedException();
+    }
+
+    @Override
+    public SerializableQuota getStorageQuota(String quotaRoot) throws MailboxException {
+        throw new NotImplementedException();
+    }
+
+    @Override
+    public long getMaxMessageCount(String quotaRoot) throws MailboxException {
+        throw new NotImplementedException();
+    }
+
+    @Override
+    public long getMaxStorage(String quotaRoot) throws MailboxException {
+        throw new NotImplementedException();
+    }
+
+    @Override
+    public long getDefaultMaxMessageCount() throws MailboxException {
+        throw new NotImplementedException();
+    }
+
+    @Override
+    public long getDefaultMaxStorage() throws MailboxException {
+        throw new NotImplementedException();
+    }
+
+    @Override
+    public void setMaxMessageCount(String quotaRoot, long maxMessageCount) throws MailboxException {
+        throw new NotImplementedException();
+    }
+
+    @Override
+    public void setMaxStorage(String quotaRoot, long maxSize) throws MailboxException {
+        throw new NotImplementedException();
+    }
+
+    @Override
+    public void setDefaultMaxMessageCount(long maxDefaultMessageCount) throws MailboxException {
+        throw new NotImplementedException();
+    }
+
+    @Override
+    public void setDefaultMaxStorage(long maxDefaultSize) throws MailboxException {
+        throw new NotImplementedException();
+    }
+
+    @Override
+    public void appendMessage(String username, MailboxPath mailboxPath, InputStream message, Date internalDate, boolean isRecent, Flags flags) 
+            throws MailboxException {
+        
+        MailboxSession mailboxSession = mailboxManager.createSystemSession(username, LOGGER);
+        MessageManager messageManager = mailboxManager.getMailbox(mailboxPath, mailboxSession);
+        messageManager.appendMessage(message, internalDate, mailboxSession, isRecent, flags);
+    }
+
+    @Override
+    public void reIndexMailbox(String namespace, String user, String name) throws Exception {
+        throw new NotImplementedException();
+    }
+
+    @Override
+    public void reIndexAll() throws Exception {
+        throw new NotImplementedException();
+    }
+
+    @Override
+    public long getSieveQuota() throws Exception {
+        return sieveRepository.getQuota();
+    }
+
+    @Override
+    public void setSieveQuota(long quota) throws Exception {
+        sieveRepository.setQuota(quota);
+    }
+
+    @Override
+    public void removeSieveQuota() throws Exception {
+        sieveRepository.removeQuota();
+    }
+
+    @Override
+    public long getSieveQuota(String user) throws Exception {
+        return sieveRepository.getQuota(user);
+    }
+
+    @Override
+    public void setSieveQuota(String user, long quota) throws Exception {
+        sieveRepository.setQuota(user, quota);
+    }
+
+    @Override
+    public void removeSieveQuota(String user) throws Exception {
+        sieveRepository.removeQuota(user);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/james-project/blob/11771d03/server/container/guice/guice-common/src/test/java/org/apache/james/AbstractJamesServerTest.java
----------------------------------------------------------------------
diff --git a/server/container/guice/guice-common/src/test/java/org/apache/james/AbstractJamesServerTest.java b/server/container/guice/guice-common/src/test/java/org/apache/james/AbstractJamesServerTest.java
index bdeeeff..fa85594 100644
--- a/server/container/guice/guice-common/src/test/java/org/apache/james/AbstractJamesServerTest.java
+++ b/server/container/guice/guice-common/src/test/java/org/apache/james/AbstractJamesServerTest.java
@@ -18,9 +18,6 @@
  ****************************************************************/
 package org.apache.james;
 
-import static com.jayway.restassured.RestAssured.given;
-import static com.jayway.restassured.config.EncoderConfig.encoderConfig;
-import static com.jayway.restassured.config.RestAssuredConfig.newConfig;
 import static org.assertj.core.api.Assertions.assertThat;
 
 import java.io.IOException;
@@ -31,15 +28,9 @@ import java.nio.channels.SocketChannel;
 import java.nio.charset.Charset;
 
 import org.junit.After;
-import org.junit.Assume;
 import org.junit.Before;
 import org.junit.Test;
 
-import com.google.common.base.Charsets;
-import com.jayway.restassured.RestAssured;
-import com.jayway.restassured.builder.RequestSpecBuilder;
-import com.jayway.restassured.http.ContentType;
-
 public abstract class AbstractJamesServerTest {
 
     private static final int IMAP_PORT = 1143; // You need to be root (superuser) to bind to ports under 1024.
@@ -47,9 +38,8 @@ public abstract class AbstractJamesServerTest {
     private static final int POP3_PORT = 1110;
     private static final int SMTP_PORT = 1025;
     private static final int LMTP_PORT = 1024;
-    private static final int JMAP_PORT = 1080;
 
-    private GuiceJmapJamesServer server;
+    private GuiceJamesServer server;
     private SocketChannel socketChannel;
 
     @Before
@@ -57,17 +47,9 @@ public abstract class AbstractJamesServerTest {
         server = createJamesServer();
         socketChannel = SocketChannel.open();
         server.start();
-
-        RestAssured.requestSpecification = new RequestSpecBuilder()
-        		.setContentType(ContentType.JSON)
-        		.setAccept(ContentType.JSON)
-        		.setConfig(newConfig().encoderConfig(encoderConfig().defaultContentCharset(Charsets.UTF_8)))
-        		.setPort(server.getJmapPort()
-        		        .orElse(JMAP_PORT))
-        		.build();
     }
 
-    protected abstract GuiceJmapJamesServer createJamesServer();
+    protected abstract GuiceJamesServer createJamesServer();
 
     protected abstract void clean();
 
@@ -123,17 +105,6 @@ public abstract class AbstractJamesServerTest {
         assertThat(getServerConnectionResponse(socketChannel)).contains("LMTP Server (JAMES Protocols Server) ready");
     }
 
-    @Test
-    public void connectJMAPServerShouldRespondBadRequest() throws Exception {
-        Assume.assumeTrue(server.getJmapPort().isPresent());
-        given()
-            .body("{\"badAttributeName\": \"value\"}")
-        .when()
-            .post("/authentication")
-        .then()
-            .statusCode(400);
-    }
-
     private String getServerConnectionResponse(SocketChannel socketChannel) throws IOException {
         ByteBuffer byteBuffer = ByteBuffer.allocate(1000);
         socketChannel.read(byteBuffer);

http://git-wip-us.apache.org/repos/asf/james-project/blob/11771d03/server/container/guice/guice-common/src/test/java/org/apache/james/AbstractJmapJamesServerTest.java
----------------------------------------------------------------------
diff --git a/server/container/guice/guice-common/src/test/java/org/apache/james/AbstractJmapJamesServerTest.java b/server/container/guice/guice-common/src/test/java/org/apache/james/AbstractJmapJamesServerTest.java
new file mode 100644
index 0000000..43eb665
--- /dev/null
+++ b/server/container/guice/guice-common/src/test/java/org/apache/james/AbstractJmapJamesServerTest.java
@@ -0,0 +1,140 @@
+/****************************************************************
+ * 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;
+
+import static com.jayway.restassured.RestAssured.given;
+import static com.jayway.restassured.config.EncoderConfig.encoderConfig;
+import static com.jayway.restassured.config.RestAssuredConfig.newConfig;
+import static org.assertj.core.api.Assertions.assertThat;
+
+import java.io.IOException;
+import java.net.InetAddress;
+import java.net.InetSocketAddress;
+import java.nio.ByteBuffer;
+import java.nio.channels.SocketChannel;
+import java.nio.charset.Charset;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import com.google.common.base.Charsets;
+import com.jayway.restassured.RestAssured;
+import com.jayway.restassured.builder.RequestSpecBuilder;
+import com.jayway.restassured.http.ContentType;
+
+public abstract class AbstractJmapJamesServerTest {
+
+    private static final int IMAP_PORT = 1143; // You need to be root (superuser) to bind to ports under 1024.
+    private static final int IMAP_PORT_SSL = 1993;
+    private static final int POP3_PORT = 1110;
+    private static final int SMTP_PORT = 1025;
+    private static final int LMTP_PORT = 1024;
+
+    private GuiceJmapJamesServer server;
+    private SocketChannel socketChannel;
+
+    @Before
+    public void setup() throws Exception {
+        server = createJamesServer();
+        socketChannel = SocketChannel.open();
+        server.start();
+
+        RestAssured.requestSpecification = new RequestSpecBuilder()
+        		.setContentType(ContentType.JSON)
+        		.setAccept(ContentType.JSON)
+        		.setConfig(newConfig().encoderConfig(encoderConfig().defaultContentCharset(Charsets.UTF_8)))
+        		.setPort(server.getJmapPort()
+                        .orElseThrow(() -> new RuntimeException("Unable to locate JMAP port")))
+        		.build();
+    }
+
+    protected abstract GuiceJmapJamesServer createJamesServer();
+
+    protected abstract void clean();
+
+    @After
+    public void tearDown() throws Exception {
+        server.stop();
+        clean();
+    }
+
+    @Test
+    public void hostnameShouldBeUsedAsDefaultDomain() throws Exception {
+        String expectedDefaultDomain = InetAddress.getLocalHost().getHostName();
+
+        assertThat(server.serverProbe().getDefaultDomain()).isEqualTo(expectedDefaultDomain);
+    }
+
+    @Test
+    public void hostnameShouldBeRetrievedWhenRestarting() throws Exception {
+        server.stop();
+        server.start();
+        String expectedDefaultDomain = InetAddress.getLocalHost().getHostName();
+
+        assertThat(server.serverProbe().getDefaultDomain()).isEqualTo(expectedDefaultDomain);
+    }
+
+    @Test
+    public void connectIMAPServerShouldSendShabangOnConnect() throws Exception {
+        socketChannel.connect(new InetSocketAddress("127.0.0.1", IMAP_PORT));
+        assertThat(getServerConnectionResponse(socketChannel)).startsWith("* OK JAMES IMAP4rev1 Server");
+    }
+
+    @Test
+    public void connectOnSecondaryIMAPServerIMAPServerShouldSendShabangOnConnect() throws Exception {
+        socketChannel.connect(new InetSocketAddress("127.0.0.1", IMAP_PORT_SSL));
+        assertThat(getServerConnectionResponse(socketChannel)).startsWith("* OK JAMES IMAP4rev1 Server");
+    }
+
+    @Test
+    public void connectPOP3ServerShouldSendShabangOnConnect() throws Exception {
+        socketChannel.connect(new InetSocketAddress("127.0.0.1", POP3_PORT));
+        assertThat(getServerConnectionResponse(socketChannel)).contains("POP3 server (JAMES POP3 Server ) ready");
+    }
+
+    @Test
+    public void connectSMTPServerShouldSendShabangOnConnect() throws Exception {
+        socketChannel.connect(new InetSocketAddress("127.0.0.1", SMTP_PORT));
+        assertThat(getServerConnectionResponse(socketChannel)).startsWith("220 JAMES Linagora's SMTP awesome Server");
+    }
+
+    @Test
+    public void connectLMTPServerShouldSendShabangOnConnect() throws Exception {
+        socketChannel.connect(new InetSocketAddress("127.0.0.1", LMTP_PORT));
+        assertThat(getServerConnectionResponse(socketChannel)).contains("LMTP Server (JAMES Protocols Server) ready");
+    }
+
+    @Test
+    public void connectJMAPServerShouldRespondBadRequest() throws Exception {
+        given()
+            .body("{\"badAttributeName\": \"value\"}")
+        .when()
+            .post("/authentication")
+        .then()
+            .statusCode(400);
+    }
+
+    private String getServerConnectionResponse(SocketChannel socketChannel) throws IOException {
+        ByteBuffer byteBuffer = ByteBuffer.allocate(1000);
+        socketChannel.read(byteBuffer);
+        byte[] bytes = byteBuffer.array();
+        return new String(bytes, Charset.forName("UTF-8"));
+    }
+}

http://git-wip-us.apache.org/repos/asf/james-project/blob/11771d03/server/container/guice/guice-common/src/test/java/org/apache/james/jmap/MailetPreconditionTest.java
----------------------------------------------------------------------
diff --git a/server/container/guice/guice-common/src/test/java/org/apache/james/jmap/MailetPreconditionTest.java b/server/container/guice/guice-common/src/test/java/org/apache/james/jmap/MailetPreconditionTest.java
index 21245c3..efcfd5c 100644
--- a/server/container/guice/guice-common/src/test/java/org/apache/james/jmap/MailetPreconditionTest.java
+++ b/server/container/guice/guice-common/src/test/java/org/apache/james/jmap/MailetPreconditionTest.java
@@ -25,6 +25,7 @@ import java.util.Properties;
 import org.apache.commons.configuration.ConfigurationException;
 import org.apache.james.jmap.mailet.VacationMailet;
 import org.apache.james.mailetcontainer.impl.MatcherMailetPair;
+import org.apache.james.modules.server.CamelMailetContainerModule;
 import org.apache.james.transport.mailets.Null;
 import org.apache.james.transport.mailets.RemoveMimeHeader;
 import org.apache.james.transport.matchers.All;
@@ -71,12 +72,12 @@ public class MailetPreconditionTest {
 
     @Test(expected = ConfigurationException.class)
     public void bccMailetCheckShouldThrowOnEmptyList() throws Exception {
-        new JMAPModule.BccMailetCheck().check(Lists.newArrayList());
+        new CamelMailetContainerModule.BccMailetCheck().check(Lists.newArrayList());
     }
 
     @Test(expected = NullPointerException.class)
     public void bccMailetCheckShouldThrowOnNullList() throws Exception {
-        new JMAPModule.BccMailetCheck().check(null);
+        new CamelMailetContainerModule.BccMailetCheck().check(null);
     }
 
     @Test(expected = ConfigurationException.class)

http://git-wip-us.apache.org/repos/asf/james-project/blob/11771d03/server/container/guice/jpa-guice/pom.xml
----------------------------------------------------------------------
diff --git a/server/container/guice/jpa-guice/pom.xml b/server/container/guice/jpa-guice/pom.xml
index b707871..73beb1d 100644
--- a/server/container/guice/jpa-guice/pom.xml
+++ b/server/container/guice/jpa-guice/pom.xml
@@ -191,11 +191,11 @@
                 </plugins>
             </build>
             <dependencies>
-<!--                <dependency>
-                    <groupId>${project.groupId}</groupId>
-                    <artifactId>apache-james-backends-cassandra</artifactId>
-                    <type>test-jar</type>
-                </dependency>-->
+                 <dependency>
+                    <groupId>org.apache.derby</groupId>
+                    <artifactId>derby</artifactId>
+                    <scope>test</scope>
+                </dependency>
                 <dependency>
                     <groupId>${project.groupId}</groupId>
                     <artifactId>apache-james-mailbox-jpa</artifactId>
@@ -212,12 +212,6 @@
                 </dependency>
                 <dependency>
                     <groupId>${project.groupId}</groupId>
-                    <artifactId>apache-james-mailbox-lucene</artifactId>
-                    <type>test-jar</type>
-                    <scope>test</scope>
-                </dependency>
-                <dependency>
-                    <groupId>${project.groupId}</groupId>
                     <artifactId>apache-james-mailbox-tika</artifactId>
                 </dependency>
                 <dependency>

http://git-wip-us.apache.org/repos/asf/james-project/blob/11771d03/server/container/guice/jpa-guice/src/main/java/org/apache/james/JPAConfiguration.java
----------------------------------------------------------------------
diff --git a/server/container/guice/jpa-guice/src/main/java/org/apache/james/JPAConfiguration.java b/server/container/guice/jpa-guice/src/main/java/org/apache/james/JPAConfiguration.java
index 8041205..c0f7d76 100644
--- a/server/container/guice/jpa-guice/src/main/java/org/apache/james/JPAConfiguration.java
+++ b/server/container/guice/jpa-guice/src/main/java/org/apache/james/JPAConfiguration.java
@@ -19,6 +19,7 @@
 package org.apache.james;
 
 import com.google.common.annotations.VisibleForTesting;
+import com.google.common.base.Preconditions;
 
 public class JPAConfiguration {
     public static Builder builder() {
@@ -40,6 +41,8 @@ public class JPAConfiguration {
         }
 
         public JPAConfiguration build() {
+            Preconditions.checkNotNull(driverName);
+            Preconditions.checkNotNull(driverURL);
             return new JPAConfiguration(driverName, driverURL);
         }
     }

http://git-wip-us.apache.org/repos/asf/james-project/blob/11771d03/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 090965d..ae623ce 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
@@ -19,13 +19,8 @@
 
 package org.apache.james;
 
-import org.apache.james.modules.CommonServicesModule;
-import org.apache.james.modules.MailetProcessingWithoutCamelModule;
-import org.apache.james.modules.ProtocolsModuleWithoutJMAP;
-import org.apache.james.modules.data.JPADataJmapModule;
-import org.apache.james.modules.data.JPADomainListModule;
-import org.apache.james.modules.data.JPARecipientRewriteTableModule;
-import org.apache.james.modules.data.JPAUsersRepositoryModule;
+import org.apache.james.modules.data.JPADataModule;
+import org.apache.james.modules.data.JPASieveRepositoryModule;
 import org.apache.james.modules.mailbox.JPAMailboxModule;
 import org.apache.james.modules.mailbox.LuceneSearchMailboxModule;
 import org.apache.james.modules.server.ActiveMQQueueModule;
@@ -36,25 +31,19 @@ import com.google.inject.Module;
 import com.google.inject.util.Modules;
 
 public class JPAJamesServerMain {
-    public static final Module mainServerModule = Modules.combine(
-            new CommonServicesModule(),
-            new ProtocolsModuleWithoutJMAP(),
-            new MailetProcessingWithoutCamelModule());
 
     public static final Module jpaServerModule = Modules.combine(
         new JPAMailboxModule(),
-        new JPAUsersRepositoryModule(),
-        new JPADomainListModule(),
-        new JPARecipientRewriteTableModule(),
-        new JPADataJmapModule(),
-        new LuceneSearchMailboxModule(),
+        new JPADataModule(),
+        new JPASieveRepositoryModule(),
         new QuotaModule(),
         new ActiveMQQueueModule());
 
-
     public static void main(String[] args) throws Exception {
-        GuiceJamesServer server = new GuiceJamesServer(mainServerModule)
-                    .combineWith(jpaServerModule, new JMXServerModule());
+        GuiceJamesServer server = new GuiceJamesServer()
+                    .combineWith(jpaServerModule, 
+                            new JMXServerModule(), 
+                            new LuceneSearchMailboxModule());
         server.start();
     }
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/11771d03/server/container/guice/jpa-guice/src/main/java/org/apache/james/modules/data/JPADataJmapModule.java
----------------------------------------------------------------------
diff --git a/server/container/guice/jpa-guice/src/main/java/org/apache/james/modules/data/JPADataJmapModule.java b/server/container/guice/jpa-guice/src/main/java/org/apache/james/modules/data/JPADataJmapModule.java
deleted file mode 100644
index 84eda74..0000000
--- a/server/container/guice/jpa-guice/src/main/java/org/apache/james/modules/data/JPADataJmapModule.java
+++ /dev/null
@@ -1,22 +0,0 @@
-package org.apache.james.modules.data;
-
-import org.apache.james.jmap.api.vacation.VacationRepository;
-import org.apache.james.jmap.vacation.NoneVacationRepository;
-import org.apache.james.sieverepository.api.SieveRepository;
-import org.apache.james.sieverepository.file.SieveFileRepository;
-
-import com.google.inject.AbstractModule;
-import com.google.inject.Scopes;
-
-public class JPADataJmapModule extends AbstractModule {
-
-    @Override
-    protected void configure() {
-        bind(NoneVacationRepository.class).in(Scopes.SINGLETON);
-        bind(VacationRepository.class).to(NoneVacationRepository.class);
-
-        bind(SieveFileRepository.class).in(Scopes.SINGLETON);
-        bind(SieveRepository.class).to(SieveFileRepository.class);
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/james-project/blob/11771d03/server/container/guice/jpa-guice/src/main/java/org/apache/james/modules/data/JPADataModule.java
----------------------------------------------------------------------
diff --git a/server/container/guice/jpa-guice/src/main/java/org/apache/james/modules/data/JPADataModule.java b/server/container/guice/jpa-guice/src/main/java/org/apache/james/modules/data/JPADataModule.java
new file mode 100644
index 0000000..ec8023e
--- /dev/null
+++ b/server/container/guice/jpa-guice/src/main/java/org/apache/james/modules/data/JPADataModule.java
@@ -0,0 +1,32 @@
+/****************************************************************
+ * 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 com.google.inject.AbstractModule;
+
+public class JPADataModule extends AbstractModule {
+
+    @Override
+    protected void configure() {
+        install(new JPAUsersRepositoryModule());
+        install(new JPADomainListModule());
+        install(new JPARecipientRewriteTableModule());
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/james-project/blob/11771d03/server/container/guice/jpa-guice/src/main/java/org/apache/james/modules/data/JPASieveRepositoryModule.java
----------------------------------------------------------------------
diff --git a/server/container/guice/jpa-guice/src/main/java/org/apache/james/modules/data/JPASieveRepositoryModule.java b/server/container/guice/jpa-guice/src/main/java/org/apache/james/modules/data/JPASieveRepositoryModule.java
new file mode 100644
index 0000000..13fff5b
--- /dev/null
+++ b/server/container/guice/jpa-guice/src/main/java/org/apache/james/modules/data/JPASieveRepositoryModule.java
@@ -0,0 +1,18 @@
+package org.apache.james.modules.data;
+
+import org.apache.james.sieverepository.api.SieveRepository;
+import org.apache.james.sieverepository.file.SieveFileRepository;
+
+import com.google.inject.AbstractModule;
+import com.google.inject.Scopes;
+
+public class JPASieveRepositoryModule extends AbstractModule {
+
+    @Override
+    protected void configure() {
+        bind(SieveFileRepository.class).in(Scopes.SINGLETON);
+
+        bind(SieveRepository.class).to(SieveFileRepository.class);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/james-project/blob/11771d03/server/container/guice/jpa-guice/src/main/java/org/apache/james/modules/mailbox/JPAMailboxModule.java
----------------------------------------------------------------------
diff --git a/server/container/guice/jpa-guice/src/main/java/org/apache/james/modules/mailbox/JPAMailboxModule.java b/server/container/guice/jpa-guice/src/main/java/org/apache/james/modules/mailbox/JPAMailboxModule.java
index 52c4237..c12cd00 100644
--- a/server/container/guice/jpa-guice/src/main/java/org/apache/james/modules/mailbox/JPAMailboxModule.java
+++ b/server/container/guice/jpa-guice/src/main/java/org/apache/james/modules/mailbox/JPAMailboxModule.java
@@ -46,8 +46,8 @@ import org.apache.james.mailbox.jpa.openjpa.OpenJPAMailboxManager;
 import org.apache.james.mailbox.model.MailboxId;
 import org.apache.james.mailbox.model.MessageId;
 import org.apache.james.mailbox.store.Authenticator;
+import org.apache.james.mailbox.store.JVMMailboxPathLocker;
 import org.apache.james.mailbox.store.MailboxSessionMapperFactory;
-import org.apache.james.mailbox.store.NoMailboxPathLocker;
 import org.apache.james.mailbox.store.mail.AttachmentMapperFactory;
 import org.apache.james.mailbox.store.mail.MailboxMapperFactory;
 import org.apache.james.mailbox.store.mail.MessageMapperFactory;
@@ -71,7 +71,7 @@ public class JPAMailboxModule extends AbstractModule {
     protected void configure() {
         bind(JPAMailboxSessionMapperFactory.class).in(Scopes.SINGLETON);
         bind(OpenJPAMailboxManager.class).in(Scopes.SINGLETON);
-        bind(NoMailboxPathLocker.class).in(Scopes.SINGLETON);
+        bind(JVMMailboxPathLocker.class).in(Scopes.SINGLETON);
         bind(JPASubscriptionManager.class).in(Scopes.SINGLETON);
         bind(JPAModSeqProvider.class).in(Scopes.SINGLETON);
         bind(JPAUidProvider.class).in(Scopes.SINGLETON);
@@ -90,7 +90,7 @@ public class JPAMailboxModule extends AbstractModule {
         bind(ModSeqProvider.class).to(JPAModSeqProvider.class);
         bind(UidProvider.class).to(JPAUidProvider.class);
         bind(SubscriptionManager.class).to(JPASubscriptionManager.class);
-        bind(MailboxPathLocker.class).to(NoMailboxPathLocker.class);
+        bind(MailboxPathLocker.class).to(JVMMailboxPathLocker.class);
         bind(Authenticator.class).to(UserRepositoryAuthenticator.class);
         bind(MailboxManager.class).to(OpenJPAMailboxManager.class);
         bind(MailboxId.Factory.class).to(JPAId.Factory.class);
@@ -122,7 +122,7 @@ public class JPAMailboxModule extends AbstractModule {
         properties.put("openjpa.ConnectionDriverName", jpaConfiguration.getDriverName());
         properties.put("openjpa.ConnectionURL", jpaConfiguration.getDriverURL());
 
-        return Persistence.createEntityManagerFactory("James", properties);
+        return Persistence.createEntityManagerFactory("Global", properties);
 
     }
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/11771d03/server/container/guice/jpa-guice/src/main/java/org/apache/james/modules/mailbox/LuceneSearchMailboxModule.java
----------------------------------------------------------------------
diff --git a/server/container/guice/jpa-guice/src/main/java/org/apache/james/modules/mailbox/LuceneSearchMailboxModule.java b/server/container/guice/jpa-guice/src/main/java/org/apache/james/modules/mailbox/LuceneSearchMailboxModule.java
index fa46463..dbb3435 100644
--- a/server/container/guice/jpa-guice/src/main/java/org/apache/james/modules/mailbox/LuceneSearchMailboxModule.java
+++ b/server/container/guice/jpa-guice/src/main/java/org/apache/james/modules/mailbox/LuceneSearchMailboxModule.java
@@ -22,11 +22,9 @@ package org.apache.james.modules.mailbox;
 import java.io.File;
 import java.io.IOException;
 
-import org.apache.james.mailbox.extractor.TextExtractor;
 import org.apache.james.mailbox.lucene.search.LuceneMessageSearchIndex;
 import org.apache.james.mailbox.store.search.ListeningMessageSearchIndex;
 import org.apache.james.mailbox.store.search.MessageSearchIndex;
-import org.apache.james.mailbox.tika.extractor.TikaTextExtractor;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.store.FSDirectory;
 
@@ -42,9 +40,6 @@ public class LuceneSearchMailboxModule extends AbstractModule {
         bind(LuceneMessageSearchIndex.class).in(Scopes.SINGLETON);
         bind(MessageSearchIndex.class).to(LuceneMessageSearchIndex.class);
         bind(ListeningMessageSearchIndex.class).to(LuceneMessageSearchIndex.class);
-
-        bind(TikaTextExtractor.class).in(Scopes.SINGLETON);
-        bind(TextExtractor.class).to(TikaTextExtractor.class);
     }
 
     @Provides

http://git-wip-us.apache.org/repos/asf/james-project/blob/11771d03/server/container/guice/jpa-guice/src/main/java/org/apache/james/modules/mailbox/ScheduledExecutorServiceProvider.java
----------------------------------------------------------------------
diff --git a/server/container/guice/jpa-guice/src/main/java/org/apache/james/modules/mailbox/ScheduledExecutorServiceProvider.java b/server/container/guice/jpa-guice/src/main/java/org/apache/james/modules/mailbox/ScheduledExecutorServiceProvider.java
deleted file mode 100644
index 48fe3f1..0000000
--- a/server/container/guice/jpa-guice/src/main/java/org/apache/james/modules/mailbox/ScheduledExecutorServiceProvider.java
+++ /dev/null
@@ -1,49 +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.mailbox;
-
-import java.util.concurrent.Executors;
-import java.util.concurrent.ScheduledExecutorService;
-
-import javax.annotation.PreDestroy;
-
-import com.google.common.annotations.VisibleForTesting;
-import com.google.inject.Provider;
-
-@VisibleForTesting
-class ScheduledExecutorServiceProvider implements Provider<ScheduledExecutorService> {
-
-    private final ScheduledExecutorService scheduler;
-
-    @VisibleForTesting
-    ScheduledExecutorServiceProvider() {
-        scheduler = Executors.newSingleThreadScheduledExecutor();
-    }
-
-    @Override
-    public ScheduledExecutorService get() {
-        return scheduler;
-    }
-
-    @PreDestroy
-    private void stop() {
-        scheduler.shutdown();
-    }
-}

http://git-wip-us.apache.org/repos/asf/james-project/blob/11771d03/server/container/guice/jpa-guice/src/main/resources/META-INF/persistence.xml
----------------------------------------------------------------------
diff --git a/server/container/guice/jpa-guice/src/main/resources/META-INF/persistence.xml b/server/container/guice/jpa-guice/src/main/resources/META-INF/persistence.xml
new file mode 100644
index 0000000..24a8d67
--- /dev/null
+++ b/server/container/guice/jpa-guice/src/main/resources/META-INF/persistence.xml
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  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.    
+-->
+
+<persistence xmlns="http://java.sun.com/xml/ns/persistence"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
+    version="2.0">
+
+    <persistence-unit name="Global" transaction-type="RESOURCE_LOCAL">
+        <class>org.apache.james.mailbox.jpa.mail.model.JPAMailbox</class>
+        <class>org.apache.james.mailbox.jpa.mail.model.JPAUserFlag</class>
+        <class>org.apache.james.mailbox.jpa.mail.model.openjpa.AbstractJPAMailboxMessage</class>
+        <class>org.apache.james.mailbox.jpa.mail.model.openjpa.JPAMailboxMessage</class>
+        <class>org.apache.james.mailbox.jpa.mail.model.JPAProperty</class>
+        <class>org.apache.james.mailbox.jpa.user.model.JPASubscription</class>
+        <class>org.apache.james.domainlist.jpa.model.JPADomain</class>
+        <class>org.apache.james.user.jpa.model.JPAUser</class>
+        <class>org.apache.james.rrt.jpa.model.JPARecipientRewrite</class>
+        <properties>
+            <property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema(ForeignKeys=true)"/>
+            <property name="openjpa.jdbc.MappingDefaults" value="ForeignKeyDeleteAction=cascade, JoinForeignKeyDeleteAction=cascade"/>
+            <property name="openjpa.jdbc.SchemaFactory" value="native(ForeignKeys=true)"/>
+            <property name="openjpa.jdbc.QuerySQLCache" value="false"/>
+        </properties>
+
+    </persistence-unit>
+
+</persistence>

http://git-wip-us.apache.org/repos/asf/james-project/blob/11771d03/server/container/guice/jpa-guice/src/test/java/org/apache/james/JPAJamesServerTest.java
----------------------------------------------------------------------
diff --git a/server/container/guice/jpa-guice/src/test/java/org/apache/james/JPAJamesServerTest.java b/server/container/guice/jpa-guice/src/test/java/org/apache/james/JPAJamesServerTest.java
index 23ac61c..0684be1 100644
--- a/server/container/guice/jpa-guice/src/test/java/org/apache/james/JPAJamesServerTest.java
+++ b/server/container/guice/jpa-guice/src/test/java/org/apache/james/JPAJamesServerTest.java
@@ -30,7 +30,7 @@ public class JPAJamesServerTest extends AbstractJamesServerTest {
 
     @Override
     protected GuiceJamesServer createJamesServer() {
-        return new GuiceJamesServer(JPAJamesServerMain.mainServerModule)
+        return new GuiceJamesServer()
             .combineWith(JPAJamesServerMain.jpaServerModule)
             .overrideWith(new TestFilesystemModule(temporaryFolder),
                     new TestJPAConfigurationModule());

http://git-wip-us.apache.org/repos/asf/james-project/blob/11771d03/server/container/guice/jpa-guice/src/test/java/org/apache/james/TestJPAConfigurationModule.java
----------------------------------------------------------------------
diff --git a/server/container/guice/jpa-guice/src/test/java/org/apache/james/TestJPAConfigurationModule.java b/server/container/guice/jpa-guice/src/test/java/org/apache/james/TestJPAConfigurationModule.java
index e1847cc..7c064c4 100644
--- a/server/container/guice/jpa-guice/src/test/java/org/apache/james/TestJPAConfigurationModule.java
+++ b/server/container/guice/jpa-guice/src/test/java/org/apache/james/TestJPAConfigurationModule.java
@@ -30,8 +30,8 @@ import com.google.inject.Provides;
 
 public class TestJPAConfigurationModule extends AbstractModule {
 
-    private static final String JDBC_EMBEDDED_URL = "jdbc:derby:../var/store/derby;create=true";
-    private static final String JDBC_EMBEDDED_DRIVER = "org.apache.derby.jdbc.EmbeddedDriver";
+    private static final String JDBC_EMBEDDED_URL = "jdbc:derby:memory:mailboxintegration;create=true";
+    private static final String JDBC_EMBEDDED_DRIVER = org.apache.derby.jdbc.EmbeddedDriver.class.getName();
 
     @Override
     protected void configure() {
@@ -45,5 +45,4 @@ public class TestJPAConfigurationModule extends AbstractModule {
                 .driverURL(JDBC_EMBEDDED_URL)
                 .build();
     }
-
 }

http://git-wip-us.apache.org/repos/asf/james-project/blob/11771d03/server/container/guice/jpa-guice/src/test/resources/mailetcontainer.xml
----------------------------------------------------------------------
diff --git a/server/container/guice/jpa-guice/src/test/resources/mailetcontainer.xml b/server/container/guice/jpa-guice/src/test/resources/mailetcontainer.xml
index b265f93..426cab8 100644
--- a/server/container/guice/jpa-guice/src/test/resources/mailetcontainer.xml
+++ b/server/container/guice/jpa-guice/src/test/resources/mailetcontainer.xml
@@ -55,7 +55,6 @@
                 <name>bcc</name>
             </mailet>
             <mailet match="All" class="RecipientRewriteTable" />
-            <mailet match="RecipientIsLocal" class="org.apache.james.jmap.mailet.VacationMailet"/>
             <mailet match="RecipientIsLocal" class="LocalDelivery"/>
             <mailet match="HostIsLocal" class="ToProcessor">
                 <processor>local-address-error</processor>

http://git-wip-us.apache.org/repos/asf/james-project/blob/11771d03/server/container/guice/memory-guice/src/test/java/org/apache/james/MemoryJamesServerTest.java
----------------------------------------------------------------------
diff --git a/server/container/guice/memory-guice/src/test/java/org/apache/james/MemoryJamesServerTest.java b/server/container/guice/memory-guice/src/test/java/org/apache/james/MemoryJamesServerTest.java
index 70adef1..424c772 100644
--- a/server/container/guice/memory-guice/src/test/java/org/apache/james/MemoryJamesServerTest.java
+++ b/server/container/guice/memory-guice/src/test/java/org/apache/james/MemoryJamesServerTest.java
@@ -25,7 +25,7 @@ import org.apache.james.modules.TestJMAPServerModule;
 import org.junit.Rule;
 import org.junit.rules.TemporaryFolder;
 
-public class MemoryJamesServerTest extends AbstractJamesServerTest {
+public class MemoryJamesServerTest extends AbstractJmapJamesServerTest {
 
     @Rule
     public TemporaryFolder temporaryFolder = new TemporaryFolder();

http://git-wip-us.apache.org/repos/asf/james-project/blob/11771d03/server/data/data-jpa/src/main/resources/META-INF/persistence.xml
----------------------------------------------------------------------
diff --git a/server/data/data-jpa/src/main/resources/META-INF/persistence.xml b/server/data/data-jpa/src/main/resources/META-INF/persistence.xml
index 9e7bdf9..14a6a4f 100644
--- a/server/data/data-jpa/src/main/resources/META-INF/persistence.xml
+++ b/server/data/data-jpa/src/main/resources/META-INF/persistence.xml
@@ -26,12 +26,6 @@
     <persistence-unit name="James" transaction-type="JTA">
        <provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>
         <jta-data-source>osgi:service/javax.sql.DataSource/(osgi.jndi.service.name=jdbc/james)</jta-data-source>
-        <class>org.apache.james.mailbox.jpa.mail.model.JPAMailbox</class>
-        <class>org.apache.james.mailbox.jpa.mail.model.JPAUserFlag</class>
-        <class>org.apache.james.mailbox.jpa.mail.model.openjpa.AbstractJPAMailboxMessage</class>
-        <class>org.apache.james.mailbox.jpa.mail.model.openjpa.JPAMailboxMessage</class>
-        <class>org.apache.james.mailbox.jpa.mail.model.JPAProperty</class>
-        <class>org.apache.james.mailbox.jpa.user.model.JPASubscription</class>
         <class>org.apache.james.domainlist.jpa.model.JPADomain</class>
         <class>org.apache.james.user.jpa.model.JPAUser</class>
         <class>org.apache.james.rrt.jpa.model.JPARecipientRewrite</class>

http://git-wip-us.apache.org/repos/asf/james-project/blob/11771d03/server/pom.xml
----------------------------------------------------------------------
diff --git a/server/pom.xml b/server/pom.xml
index efd8a5d..f86c171 100644
--- a/server/pom.xml
+++ b/server/pom.xml
@@ -703,12 +703,6 @@
                 <version>${project.version}</version>
             </dependency>
             <dependency>
-                <groupId>org.apache.james</groupId>
-                <artifactId>apache-james-mailbox-lucene</artifactId>
-                <version>${project.version}</version>
-                <type>test-jar</type>
-            </dependency>
-            <dependency>
                 <groupId>org.apache.james.protocols</groupId>
                 <artifactId>protocols-imap</artifactId>
                 <version>${project.version}</version>
@@ -1197,6 +1191,7 @@
                 <groupId>org.apache.openjpa</groupId>
                 <artifactId>openjpa</artifactId>
                 <version>${openjpa.version}</version>
+                <scope>runtime</scope>
             </dependency>
             <dependency>
                 <groupId>org.apache.geronimo.specs</groupId>


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


[06/29] james-project git commit: JAMES-1842: Related JPA objects should be injectable

Posted by ad...@apache.org.
JAMES-1842: Related JPA objects should be injectable


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

Branch: refs/heads/master
Commit: 3ed07d6a8578eeebe8a26e48b14d1b50c4b7cff2
Parents: 978e722
Author: Quynh Nguyen <qn...@linagora.com>
Authored: Fri Oct 28 12:16:15 2016 +0700
Committer: Quynh Nguyen <qn...@linagora.com>
Committed: Fri Nov 18 09:25:34 2016 +0700

----------------------------------------------------------------------
 .../apache/james/mailbox/jpa/JPAMailboxSessionMapperFactory.java  | 2 ++
 .../java/org/apache/james/mailbox/jpa/JPASubscriptionManager.java | 3 +++
 .../java/org/apache/james/mailbox/jpa/mail/JPAModSeqProvider.java | 2 ++
 .../java/org/apache/james/mailbox/jpa/mail/JPAUidProvider.java    | 2 ++
 .../apache/james/mailbox/jpa/openjpa/OpenJPAMailboxManager.java   | 3 +++
 .../james/mailbox/lucene/search/LuceneMessageSearchIndex.java     | 3 ++-
 .../main/java/org/apache/james/domainlist/jpa/JPADomainList.java  | 2 ++
 7 files changed, 16 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/3ed07d6a/mailbox/jpa/src/main/java/org/apache/james/mailbox/jpa/JPAMailboxSessionMapperFactory.java
----------------------------------------------------------------------
diff --git a/mailbox/jpa/src/main/java/org/apache/james/mailbox/jpa/JPAMailboxSessionMapperFactory.java b/mailbox/jpa/src/main/java/org/apache/james/mailbox/jpa/JPAMailboxSessionMapperFactory.java
index 9a219af..dfdd356 100644
--- a/mailbox/jpa/src/main/java/org/apache/james/mailbox/jpa/JPAMailboxSessionMapperFactory.java
+++ b/mailbox/jpa/src/main/java/org/apache/james/mailbox/jpa/JPAMailboxSessionMapperFactory.java
@@ -18,6 +18,7 @@
  ****************************************************************/
 package org.apache.james.mailbox.jpa;
 
+import javax.inject.Inject;
 import javax.persistence.EntityManager;
 import javax.persistence.EntityManagerFactory;
 
@@ -47,6 +48,7 @@ public class JPAMailboxSessionMapperFactory extends MailboxSessionMapperFactory
     private final UidProvider uidProvider;
     private final ModSeqProvider modSeqProvider;
 
+    @Inject
     public JPAMailboxSessionMapperFactory(EntityManagerFactory entityManagerFactory, UidProvider uidProvider, ModSeqProvider modSeqProvider) {
         this.entityManagerFactory = entityManagerFactory;
         this.uidProvider = uidProvider;

http://git-wip-us.apache.org/repos/asf/james-project/blob/3ed07d6a/mailbox/jpa/src/main/java/org/apache/james/mailbox/jpa/JPASubscriptionManager.java
----------------------------------------------------------------------
diff --git a/mailbox/jpa/src/main/java/org/apache/james/mailbox/jpa/JPASubscriptionManager.java b/mailbox/jpa/src/main/java/org/apache/james/mailbox/jpa/JPASubscriptionManager.java
index bf5a0e6..8251052 100644
--- a/mailbox/jpa/src/main/java/org/apache/james/mailbox/jpa/JPASubscriptionManager.java
+++ b/mailbox/jpa/src/main/java/org/apache/james/mailbox/jpa/JPASubscriptionManager.java
@@ -18,6 +18,8 @@
  ****************************************************************/
 package org.apache.james.mailbox.jpa;
 
+import javax.inject.Inject;
+
 import org.apache.james.mailbox.MailboxSession;
 import org.apache.james.mailbox.jpa.user.model.JPASubscription;
 import org.apache.james.mailbox.store.StoreSubscriptionManager;
@@ -29,6 +31,7 @@ import org.apache.james.mailbox.store.user.model.Subscription;
  */
 public class JPASubscriptionManager extends StoreSubscriptionManager {
     
+    @Inject
     public JPASubscriptionManager(JPAMailboxSessionMapperFactory mapperFactory) {
         super(mapperFactory);
     }

http://git-wip-us.apache.org/repos/asf/james-project/blob/3ed07d6a/mailbox/jpa/src/main/java/org/apache/james/mailbox/jpa/mail/JPAModSeqProvider.java
----------------------------------------------------------------------
diff --git a/mailbox/jpa/src/main/java/org/apache/james/mailbox/jpa/mail/JPAModSeqProvider.java b/mailbox/jpa/src/main/java/org/apache/james/mailbox/jpa/mail/JPAModSeqProvider.java
index 7d002d6..5896243 100644
--- a/mailbox/jpa/src/main/java/org/apache/james/mailbox/jpa/mail/JPAModSeqProvider.java
+++ b/mailbox/jpa/src/main/java/org/apache/james/mailbox/jpa/mail/JPAModSeqProvider.java
@@ -18,6 +18,7 @@
  ****************************************************************/
 package org.apache.james.mailbox.jpa.mail;
 
+import javax.inject.Inject;
 import javax.persistence.EntityManager;
 import javax.persistence.EntityManagerFactory;
 import javax.persistence.PersistenceException;
@@ -34,6 +35,7 @@ public class JPAModSeqProvider extends AbstractLockingModSeqProvider {
 
     private final EntityManagerFactory factory;
 
+    @Inject
     public JPAModSeqProvider(MailboxPathLocker locker, EntityManagerFactory factory) {
         super(locker);
         this.factory = factory;

http://git-wip-us.apache.org/repos/asf/james-project/blob/3ed07d6a/mailbox/jpa/src/main/java/org/apache/james/mailbox/jpa/mail/JPAUidProvider.java
----------------------------------------------------------------------
diff --git a/mailbox/jpa/src/main/java/org/apache/james/mailbox/jpa/mail/JPAUidProvider.java b/mailbox/jpa/src/main/java/org/apache/james/mailbox/jpa/mail/JPAUidProvider.java
index e7e5c21..08d391d 100644
--- a/mailbox/jpa/src/main/java/org/apache/james/mailbox/jpa/mail/JPAUidProvider.java
+++ b/mailbox/jpa/src/main/java/org/apache/james/mailbox/jpa/mail/JPAUidProvider.java
@@ -18,6 +18,7 @@
  ****************************************************************/
 package org.apache.james.mailbox.jpa.mail;
 
+import javax.inject.Inject;
 import javax.persistence.EntityManager;
 import javax.persistence.EntityManagerFactory;
 import javax.persistence.PersistenceException;
@@ -37,6 +38,7 @@ public class JPAUidProvider extends AbstractLockingUidProvider {
 
     private final EntityManagerFactory factory;
 
+    @Inject
     public JPAUidProvider(MailboxPathLocker locker, EntityManagerFactory factory) {
         super(locker);
         this.factory = factory;

http://git-wip-us.apache.org/repos/asf/james-project/blob/3ed07d6a/mailbox/jpa/src/main/java/org/apache/james/mailbox/jpa/openjpa/OpenJPAMailboxManager.java
----------------------------------------------------------------------
diff --git a/mailbox/jpa/src/main/java/org/apache/james/mailbox/jpa/openjpa/OpenJPAMailboxManager.java b/mailbox/jpa/src/main/java/org/apache/james/mailbox/jpa/openjpa/OpenJPAMailboxManager.java
index 637731c..514a606 100644
--- a/mailbox/jpa/src/main/java/org/apache/james/mailbox/jpa/openjpa/OpenJPAMailboxManager.java
+++ b/mailbox/jpa/src/main/java/org/apache/james/mailbox/jpa/openjpa/OpenJPAMailboxManager.java
@@ -20,6 +20,8 @@
 package org.apache.james.mailbox.jpa.openjpa;
 
 
+import javax.inject.Inject;
+
 import org.apache.james.mailbox.MailboxPathLocker;
 import org.apache.james.mailbox.MailboxSession;
 import org.apache.james.mailbox.acl.GroupMembershipResolver;
@@ -67,6 +69,7 @@ public class OpenJPAMailboxManager extends JPAMailboxManager {
         }
     }
     
+    @Inject
     public OpenJPAMailboxManager(JPAMailboxSessionMapperFactory mapperFactory, Authenticator authenticator, 
             MailboxACLResolver aclResolver, GroupMembershipResolver groupMembershipResolver, 
             MessageParser messageParser, MessageId.Factory messageIdFactory) {

http://git-wip-us.apache.org/repos/asf/james-project/blob/3ed07d6a/mailbox/lucene/src/main/java/org/apache/james/mailbox/lucene/search/LuceneMessageSearchIndex.java
----------------------------------------------------------------------
diff --git a/mailbox/lucene/src/main/java/org/apache/james/mailbox/lucene/search/LuceneMessageSearchIndex.java b/mailbox/lucene/src/main/java/org/apache/james/mailbox/lucene/search/LuceneMessageSearchIndex.java
index a1557bb..8a683d9 100644
--- a/mailbox/lucene/src/main/java/org/apache/james/mailbox/lucene/search/LuceneMessageSearchIndex.java
+++ b/mailbox/lucene/src/main/java/org/apache/james/mailbox/lucene/search/LuceneMessageSearchIndex.java
@@ -37,6 +37,7 @@ import java.util.Map;
 import java.util.Set;
 import java.util.TimeZone;
 
+import javax.inject.Inject;
 import javax.mail.Flags;
 import javax.mail.Flags.Flag;
 
@@ -346,7 +347,7 @@ public class LuceneMessageSearchIndex extends ListeningMessageSearchIndex {
 
     private boolean suffixMatch = false;
 
-    
+    @Inject
     public LuceneMessageSearchIndex(MessageMapperFactory factory, MailboxId.Factory mailboxIdFactory, Directory directory) throws CorruptIndexException, LockObtainFailedException, IOException {
         this(factory, mailboxIdFactory, directory, false, true);
     }

http://git-wip-us.apache.org/repos/asf/james-project/blob/3ed07d6a/server/data/data-jpa/src/main/java/org/apache/james/domainlist/jpa/JPADomainList.java
----------------------------------------------------------------------
diff --git a/server/data/data-jpa/src/main/java/org/apache/james/domainlist/jpa/JPADomainList.java b/server/data/data-jpa/src/main/java/org/apache/james/domainlist/jpa/JPADomainList.java
index f5cde85..489ae4a 100644
--- a/server/data/data-jpa/src/main/java/org/apache/james/domainlist/jpa/JPADomainList.java
+++ b/server/data/data-jpa/src/main/java/org/apache/james/domainlist/jpa/JPADomainList.java
@@ -22,6 +22,7 @@ import java.util.ArrayList;
 import java.util.List;
 
 import javax.annotation.PostConstruct;
+import javax.inject.Inject;
 import javax.persistence.EntityManager;
 import javax.persistence.EntityManagerFactory;
 import javax.persistence.EntityTransaction;
@@ -52,6 +53,7 @@ public class JPADomainList extends AbstractDomainList {
      *
      * @param entityManagerFactory
      */
+    @Inject
     @PersistenceUnit(unitName = "James")
     public void setEntityManagerFactory(EntityManagerFactory entityManagerFactory) {
         this.entityManagerFactory = entityManagerFactory;


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


[20/29] james-project git commit: JAMES-1842 Remove tika dependency

Posted by ad...@apache.org.
JAMES-1842 Remove tika dependency


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

Branch: refs/heads/master
Commit: 59f7382df73368c1632b7e7adda1ebc20fe43cac
Parents: df98b6e
Author: Quynh Nguyen <qn...@linagora.com>
Authored: Thu Nov 10 14:50:23 2016 +0700
Committer: Quynh Nguyen <qn...@linagora.com>
Committed: Fri Nov 18 09:25:35 2016 +0700

----------------------------------------------------------------------
 server/container/guice/jpa-guice/pom.xml | 4 ----
 1 file changed, 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/59f7382d/server/container/guice/jpa-guice/pom.xml
----------------------------------------------------------------------
diff --git a/server/container/guice/jpa-guice/pom.xml b/server/container/guice/jpa-guice/pom.xml
index 28567a9..148ac96 100644
--- a/server/container/guice/jpa-guice/pom.xml
+++ b/server/container/guice/jpa-guice/pom.xml
@@ -212,10 +212,6 @@
                 </dependency>
                 <dependency>
                     <groupId>${project.groupId}</groupId>
-                    <artifactId>apache-james-mailbox-tika</artifactId>
-                </dependency>
-                <dependency>
-                    <groupId>${project.groupId}</groupId>
                     <artifactId>james-server-data-jpa</artifactId>
                 </dependency>
                 <dependency>


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


[21/29] james-project git commit: JAMES-1842: require inject on persistence unit

Posted by ad...@apache.org.
JAMES-1842: require inject on persistence unit


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

Branch: refs/heads/master
Commit: 0e5cf23b5d8a605545e44b8a8fa53ff8c764f45a
Parents: 59f7382
Author: Quynh Nguyen <qn...@linagora.com>
Authored: Wed Nov 16 09:36:32 2016 +0700
Committer: Quynh Nguyen <qn...@linagora.com>
Committed: Fri Nov 18 09:25:35 2016 +0700

----------------------------------------------------------------------
 .../james/rrt/jpa/JPARecipientRewriteTable.java | 28 +++++++++++---------
 .../james/user/jpa/JPAUsersRepository.java      |  2 ++
 2 files changed, 17 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/0e5cf23b/server/data/data-jpa/src/main/java/org/apache/james/rrt/jpa/JPARecipientRewriteTable.java
----------------------------------------------------------------------
diff --git a/server/data/data-jpa/src/main/java/org/apache/james/rrt/jpa/JPARecipientRewriteTable.java b/server/data/data-jpa/src/main/java/org/apache/james/rrt/jpa/JPARecipientRewriteTable.java
index 0b04e59..936e804 100644
--- a/server/data/data-jpa/src/main/java/org/apache/james/rrt/jpa/JPARecipientRewriteTable.java
+++ b/server/data/data-jpa/src/main/java/org/apache/james/rrt/jpa/JPARecipientRewriteTable.java
@@ -22,6 +22,7 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
+import javax.inject.Inject;
 import javax.persistence.EntityManager;
 import javax.persistence.EntityManagerFactory;
 import javax.persistence.EntityTransaction;
@@ -31,8 +32,8 @@ import javax.persistence.PersistenceUnit;
 import org.apache.james.rrt.api.RecipientRewriteTableException;
 import org.apache.james.rrt.jpa.model.JPARecipientRewrite;
 import org.apache.james.rrt.lib.AbstractRecipientRewriteTable;
-import org.apache.james.rrt.lib.Mappings;
-import org.apache.james.rrt.lib.MappingsImpl;
+import org.apache.james.rrt.lib.Mappings;
+import org.apache.james.rrt.lib.MappingsImpl;
 
 /**
  * Class responsible to implement the Virtual User Table in database with JPA
@@ -50,6 +51,7 @@ public class JPARecipientRewriteTable extends AbstractRecipientRewriteTable {
      * 
      * @param entityManagerFactory
      */
+    @Inject
     @PersistenceUnit(unitName="James")
     public void setEntityManagerFactory(EntityManagerFactory entityManagerFactory) {
         this.entityManagerFactory = entityManagerFactory;
@@ -62,10 +64,10 @@ public class JPARecipientRewriteTable extends AbstractRecipientRewriteTable {
     protected void addMappingInternal(String user, String domain, String mapping) throws RecipientRewriteTableException {
         String fixedUser = getFixedUser(user);
         String fixedDomain = getFixedDomain(domain);
-        Mappings map = getUserDomainMappings(fixedUser, fixedDomain);
+        Mappings map = getUserDomainMappings(fixedUser, fixedDomain);
         if (map != null && map.size() != 0) {
-            Mappings updatedMappings = MappingsImpl.from(map).add(mapping).build();
-            doUpdateMapping(fixedUser, fixedDomain, updatedMappings.serialize());
+            Mappings updatedMappings = MappingsImpl.from(map).add(mapping).build();
+            doUpdateMapping(fixedUser, fixedDomain, updatedMappings.serialize());
         } else {
             doAddMapping(fixedUser, fixedDomain, mapping);
         }
@@ -111,7 +113,7 @@ public class JPARecipientRewriteTable extends AbstractRecipientRewriteTable {
      * @throws RecipientRewriteTableException
      * @see org.apache.james.rrt.lib.AbstractRecipientRewriteTable#mapAddress(java.lang.String, java.lang.String)
      */
-    protected Mappings getUserDomainMappingsInternal(String user, String domain) throws RecipientRewriteTableException {
+    protected Mappings getUserDomainMappingsInternal(String user, String domain) throws RecipientRewriteTableException {
         EntityManager entityManager = entityManagerFactory.createEntityManager();
         final EntityTransaction transaction = entityManager.getTransaction();
         try {
@@ -120,7 +122,7 @@ public class JPARecipientRewriteTable extends AbstractRecipientRewriteTable {
             List<JPARecipientRewrite> virtualUsers = entityManager.createNamedQuery("selectUserDomainMapping").setParameter("user", user).setParameter("domain", domain).getResultList();
             transaction.commit();
             if (virtualUsers.size() > 0) {
-                return MappingsImpl.fromRawString(virtualUsers.get(0).getTargetAddress());
+                return MappingsImpl.fromRawString(virtualUsers.get(0).getTargetAddress());
             }
         } catch (PersistenceException e) {
             getLogger().debug("Failed to get user domain mappings", e);
@@ -139,17 +141,17 @@ public class JPARecipientRewriteTable extends AbstractRecipientRewriteTable {
      * @throws RecipientRewriteTableException
      * @see org.apache.james.rrt.lib.AbstractRecipientRewriteTable#getAllMappingsInternal()
      */
-    protected Map<String, Mappings> getAllMappingsInternal() throws RecipientRewriteTableException {
+    protected Map<String, Mappings> getAllMappingsInternal() throws RecipientRewriteTableException {
         EntityManager entityManager = entityManagerFactory.createEntityManager();
         final EntityTransaction transaction = entityManager.getTransaction();
-        Map<String, Mappings> mapping = new HashMap<String, Mappings>();
+        Map<String, Mappings> mapping = new HashMap<String, Mappings>();
         try {
             transaction.begin();
             @SuppressWarnings("unchecked")
             List<JPARecipientRewrite> virtualUsers = entityManager.createNamedQuery("selectAllMappings").getResultList();
             transaction.commit();
             for (JPARecipientRewrite virtualUser : virtualUsers) {
-                mapping.put(virtualUser.getUser() + "@" + virtualUser.getDomain(), MappingsImpl.fromRawString(virtualUser.getTargetAddress()));
+                mapping.put(virtualUser.getUser() + "@" + virtualUser.getDomain(), MappingsImpl.fromRawString(virtualUser.getTargetAddress()));
             }
             if (mapping.size() > 0)
                 return mapping;
@@ -173,10 +175,10 @@ public class JPARecipientRewriteTable extends AbstractRecipientRewriteTable {
     protected void removeMappingInternal(String user, String domain, String mapping) throws RecipientRewriteTableException {
         String fixedUser = getFixedUser(user);
         String fixedDomain = getFixedDomain(domain);
-        Mappings map = getUserDomainMappings(fixedUser, fixedDomain);
+        Mappings map = getUserDomainMappings(fixedUser, fixedDomain);
         if (map != null && map.size() > 1) {
-            Mappings updatedMappings = map.remove(mapping);
-            doUpdateMapping(fixedUser, fixedDomain, updatedMappings.serialize());
+            Mappings updatedMappings = map.remove(mapping);
+            doUpdateMapping(fixedUser, fixedDomain, updatedMappings.serialize());
         } else {
             doRemoveMapping(fixedUser, fixedDomain, mapping);
         }

http://git-wip-us.apache.org/repos/asf/james-project/blob/0e5cf23b/server/data/data-jpa/src/main/java/org/apache/james/user/jpa/JPAUsersRepository.java
----------------------------------------------------------------------
diff --git a/server/data/data-jpa/src/main/java/org/apache/james/user/jpa/JPAUsersRepository.java b/server/data/data-jpa/src/main/java/org/apache/james/user/jpa/JPAUsersRepository.java
index ba8b3a3..11d674b 100644
--- a/server/data/data-jpa/src/main/java/org/apache/james/user/jpa/JPAUsersRepository.java
+++ b/server/data/data-jpa/src/main/java/org/apache/james/user/jpa/JPAUsersRepository.java
@@ -23,6 +23,7 @@ import java.util.Collections;
 import java.util.Iterator;
 
 import javax.annotation.PostConstruct;
+import javax.inject.Inject;
 import javax.persistence.EntityManager;
 import javax.persistence.EntityManagerFactory;
 import javax.persistence.EntityTransaction;
@@ -52,6 +53,7 @@ public class JPAUsersRepository extends AbstractUsersRepository {
      * @param entityManagerFactory
      *            the entityManager to set
      */
+    @Inject
     @PersistenceUnit(unitName="James")
     public final void setEntityManagerFactory(EntityManagerFactory entityManagerFactory) {
         this.entityManagerFactory = entityManagerFactory;


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


[09/29] james-project git commit: JAMES-1842: JMAP port should be Optional

Posted by ad...@apache.org.
JAMES-1842: JMAP port should be Optional


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

Branch: refs/heads/master
Commit: 978e722ebee120f42b835911b644f5758fefe3e7
Parents: ff57437
Author: Quynh Nguyen <qn...@linagora.com>
Authored: Fri Oct 28 12:07:17 2016 +0700
Committer: Quynh Nguyen <qn...@linagora.com>
Committed: Fri Nov 18 09:25:34 2016 +0700

----------------------------------------------------------------------
 .../java/org/apache/james/GuiceJamesServer.java     | 16 ++++++++++++----
 .../org/apache/james/AbstractJamesServerTest.java   |  6 +++++-
 .../apache/james/jmap/JMAPAuthenticationTest.java   |  3 ++-
 .../apache/james/jmap/VacationIntegrationTest.java  |  3 ++-
 .../methods/integration/GetMailboxesMethodTest.java |  3 ++-
 .../integration/GetMessageListMethodTest.java       |  3 ++-
 .../integration/GetVacationResponseTest.java        |  3 ++-
 .../methods/integration/SetMailboxesMethodTest.java |  3 ++-
 .../methods/integration/SetMessagesMethodTest.java  |  3 ++-
 .../integration/SetVacationResponseTest.java        |  3 ++-
 .../methods/integration/cucumber/MainStepdefs.java  |  3 ++-
 11 files changed, 35 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/978e722e/server/container/guice/guice-common/src/main/java/org/apache/james/GuiceJamesServer.java
----------------------------------------------------------------------
diff --git a/server/container/guice/guice-common/src/main/java/org/apache/james/GuiceJamesServer.java b/server/container/guice/guice-common/src/main/java/org/apache/james/GuiceJamesServer.java
index 39411b0..b3dc728 100644
--- a/server/container/guice/guice-common/src/main/java/org/apache/james/GuiceJamesServer.java
+++ b/server/container/guice/guice-common/src/main/java/org/apache/james/GuiceJamesServer.java
@@ -47,7 +47,7 @@ public class GuiceJamesServer {
     private final Module module;
     private Stager<PreDestroy> preDestroy;
     private GuiceServerProbe serverProbe;
-    private int jmapPort;
+    private Optional<Integer> jmapPort;
     private Optional<Port> webadminPort;
 
     public GuiceJamesServer() {
@@ -57,7 +57,7 @@ public class GuiceJamesServer {
                         new MailetProcessingModule()));
     }
 
-    private GuiceJamesServer(Module module) {
+    public GuiceJamesServer(Module module) {
         this.module = module;
     }
     
@@ -74,10 +74,18 @@ public class GuiceJamesServer {
         preDestroy = injector.getInstance(Key.get(new TypeLiteral<Stager<PreDestroy>>() {}));
         injector.getInstance(ConfigurationsPerformer.class).initModules();
         serverProbe = injector.getInstance(GuiceServerProbe.class);
-        jmapPort = injector.getInstance(JMAPServer.class).getPort();
+        jmapPort = locateJMAPPort(injector);
         webadminPort =locateWebAdminPort(injector);
     }
 
+    private Optional<Integer> locateJMAPPort(Injector injector) {
+        try {
+            return Optional.of(injector.getInstance(JMAPServer.class).getPort());
+        } catch(Exception e) {
+            return Optional.empty();
+        }
+    }
+
     private Optional<Port> locateWebAdminPort(Injector injector) {
         try {
             return Optional.of(injector.getInstance(WebAdminServer.class).getPort());
@@ -96,7 +104,7 @@ public class GuiceJamesServer {
         return serverProbe;
     }
 
-    public int getJmapPort() {
+    public Optional<Integer> getJmapPort() {
         return jmapPort;
     }
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/978e722e/server/container/guice/guice-common/src/test/java/org/apache/james/AbstractJamesServerTest.java
----------------------------------------------------------------------
diff --git a/server/container/guice/guice-common/src/test/java/org/apache/james/AbstractJamesServerTest.java b/server/container/guice/guice-common/src/test/java/org/apache/james/AbstractJamesServerTest.java
index 6529ef4..11fc881 100644
--- a/server/container/guice/guice-common/src/test/java/org/apache/james/AbstractJamesServerTest.java
+++ b/server/container/guice/guice-common/src/test/java/org/apache/james/AbstractJamesServerTest.java
@@ -31,6 +31,7 @@ import java.nio.channels.SocketChannel;
 import java.nio.charset.Charset;
 
 import org.junit.After;
+import org.junit.Assume;
 import org.junit.Before;
 import org.junit.Test;
 
@@ -46,6 +47,7 @@ public abstract class AbstractJamesServerTest {
     private static final int POP3_PORT = 1110;
     private static final int SMTP_PORT = 1025;
     private static final int LMTP_PORT = 1024;
+    private static final int JMAP_PORT = 1080;
 
     private GuiceJamesServer server;
     private SocketChannel socketChannel;
@@ -60,7 +62,8 @@ public abstract class AbstractJamesServerTest {
         		.setContentType(ContentType.JSON)
         		.setAccept(ContentType.JSON)
         		.setConfig(newConfig().encoderConfig(encoderConfig().defaultContentCharset(Charsets.UTF_8)))
-        		.setPort(server.getJmapPort())
+        		.setPort(server.getJmapPort()
+        		        .orElse(JMAP_PORT))
         		.build();
     }
 
@@ -122,6 +125,7 @@ public abstract class AbstractJamesServerTest {
 
     @Test
     public void connectJMAPServerShouldRespondBadRequest() throws Exception {
+        Assume.assumeTrue(server.getJmapPort().isPresent());
         given()
             .body("{\"badAttributeName\": \"value\"}")
         .when()

http://git-wip-us.apache.org/repos/asf/james-project/blob/978e722e/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/JMAPAuthenticationTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/JMAPAuthenticationTest.java b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/JMAPAuthenticationTest.java
index cd17481..12e6a1a 100644
--- a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/JMAPAuthenticationTest.java
+++ b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/JMAPAuthenticationTest.java
@@ -63,7 +63,8 @@ public abstract class JMAPAuthenticationTest {
         jmapServer.start();
         RestAssured.requestSpecification = new RequestSpecBuilder()
         		.setConfig(newConfig().encoderConfig(encoderConfig().defaultContentCharset(Charsets.UTF_8)))
-        		.setPort(jmapServer.getJmapPort())
+        		.setPort(jmapServer.getJmapPort()
+                        .orElseThrow(() -> new RuntimeException("Unable to locate JMAP port")))
         		.build();
         
         userCredentials = UserCredentials.builder()

http://git-wip-us.apache.org/repos/asf/james-project/blob/978e722e/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/VacationIntegrationTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/VacationIntegrationTest.java b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/VacationIntegrationTest.java
index dff1898..653bfe0 100644
--- a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/VacationIntegrationTest.java
+++ b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/VacationIntegrationTest.java
@@ -87,7 +87,8 @@ public abstract class VacationIntegrationTest {
         		.setContentType(ContentType.JSON)
         		.setAccept(ContentType.JSON)
         		.setConfig(newConfig().encoderConfig(encoderConfig().defaultContentCharset(Charsets.UTF_8)))
-        		.setPort(guiceJamesServer.getJmapPort())
+        		.setPort(guiceJamesServer.getJmapPort()
+                        .orElseThrow(() -> new RuntimeException("Unable to locate JMAP port")))
         		.build();
 
         Duration slowPacedPollInterval = Duration.FIVE_HUNDRED_MILLISECONDS;

http://git-wip-us.apache.org/repos/asf/james-project/blob/978e722e/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetMailboxesMethodTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetMailboxesMethodTest.java b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetMailboxesMethodTest.java
index f59850a..d77362b 100644
--- a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetMailboxesMethodTest.java
+++ b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetMailboxesMethodTest.java
@@ -69,7 +69,8 @@ public abstract class GetMailboxesMethodTest {
         		.setContentType(ContentType.JSON)
         		.setAccept(ContentType.JSON)
         		.setConfig(newConfig().encoderConfig(encoderConfig().defaultContentCharset(Charsets.UTF_8)))
-        		.setPort(jmapServer.getJmapPort())
+        		.setPort(jmapServer.getJmapPort()
+                        .orElseThrow(() -> new RuntimeException("Unable to locate JMAP port")))
         		.build();
 
         String domain = "domain.tld";

http://git-wip-us.apache.org/repos/asf/james-project/blob/978e722e/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetMessageListMethodTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetMessageListMethodTest.java b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetMessageListMethodTest.java
index ee24d6b..b05fc07 100644
--- a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetMessageListMethodTest.java
+++ b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetMessageListMethodTest.java
@@ -73,7 +73,8 @@ public abstract class GetMessageListMethodTest {
                 .setContentType(ContentType.JSON)
                 .setAccept(ContentType.JSON)
                 .setConfig(newConfig().encoderConfig(encoderConfig().defaultContentCharset(Charsets.UTF_8)))
-                .setPort(jmapServer.getJmapPort())
+                .setPort(jmapServer.getJmapPort()
+                        .orElseThrow(() -> new RuntimeException("Unable to locate JMAP port")))
                 .build();
 
         this.domain = "domain.tld";

http://git-wip-us.apache.org/repos/asf/james-project/blob/978e722e/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetVacationResponseTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetVacationResponseTest.java b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetVacationResponseTest.java
index c93f6d8..a6f5604 100644
--- a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetVacationResponseTest.java
+++ b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetVacationResponseTest.java
@@ -76,7 +76,8 @@ public abstract class GetVacationResponseTest {
         		.setContentType(ContentType.JSON)
         		.setAccept(ContentType.JSON)
         		.setConfig(newConfig().encoderConfig(encoderConfig().defaultContentCharset(Charsets.UTF_8)))
-        		.setPort(jmapServer.getJmapPort())
+        		.setPort(jmapServer.getJmapPort()
+                        .orElseThrow(() -> new RuntimeException("Unable to locate JMAP port")))
         		.build();
 
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/978e722e/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/SetMailboxesMethodTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/SetMailboxesMethodTest.java b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/SetMailboxesMethodTest.java
index 1fa49cc..29fffdc 100644
--- a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/SetMailboxesMethodTest.java
+++ b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/SetMailboxesMethodTest.java
@@ -75,7 +75,8 @@ public abstract class SetMailboxesMethodTest {
         		.setContentType(ContentType.JSON)
         		.setAccept(ContentType.JSON)
         		.setConfig(newConfig().encoderConfig(encoderConfig().defaultContentCharset(Charsets.UTF_8)))
-        		.setPort(jmapServer.getJmapPort())
+        		.setPort(jmapServer.getJmapPort()
+                        .orElseThrow(() -> new RuntimeException("Unable to locate JMAP port")))
         		.build();
         RestAssured.enableLoggingOfRequestAndResponseIfValidationFails();
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/978e722e/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/SetMessagesMethodTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/SetMessagesMethodTest.java b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/SetMessagesMethodTest.java
index 6cf9ec7..ba864b1 100644
--- a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/SetMessagesMethodTest.java
+++ b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/SetMessagesMethodTest.java
@@ -106,7 +106,8 @@ public abstract class SetMessagesMethodTest {
                 .setContentType(ContentType.JSON)
                 .setAccept(ContentType.JSON)
                 .setConfig(newConfig().encoderConfig(encoderConfig().defaultContentCharset(Charsets.UTF_8)))
-                .setPort(jmapServer.getJmapPort())
+                .setPort(jmapServer.getJmapPort()
+                        .orElseThrow(() -> new RuntimeException("Unable to locate JMAP port")))
                 .build();
 
         username = "username@" + USERS_DOMAIN;

http://git-wip-us.apache.org/repos/asf/james-project/blob/978e722e/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/SetVacationResponseTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/SetVacationResponseTest.java b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/SetVacationResponseTest.java
index 4303e23..2e90360 100644
--- a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/SetVacationResponseTest.java
+++ b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/SetVacationResponseTest.java
@@ -68,7 +68,8 @@ public abstract class SetVacationResponseTest {
         		.setContentType(ContentType.JSON)
         		.setAccept(ContentType.JSON)
         		.setConfig(newConfig().encoderConfig(encoderConfig().defaultContentCharset(Charsets.UTF_8)))
-        		.setPort(jmapServer.getJmapPort())
+        		.setPort(jmapServer.getJmapPort()
+                        .orElseThrow(() -> new RuntimeException("Unable to locate JMAP port")))
         		.build();
 
         jmapServer.serverProbe().addDomain(USERS_DOMAIN);

http://git-wip-us.apache.org/repos/asf/james-project/blob/978e722e/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/MainStepdefs.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/MainStepdefs.java b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/MainStepdefs.java
index a5327ed..ed36491 100644
--- a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/MainStepdefs.java
+++ b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/MainStepdefs.java
@@ -41,7 +41,8 @@ public class MainStepdefs {
         return new URIBuilder()
                 .setScheme("http")
                 .setHost("localhost")
-                .setPort(jmapServer.getJmapPort())
+                .setPort(jmapServer.getJmapPort()
+                        .orElseThrow(() -> new RuntimeException("Unable to locate JMAP port")))
                 .setCharset(Charsets.UTF_8);
     }
     


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


[28/29] james-project git commit: JAMES-1842: Introduce GuiceJamesServer interface

Posted by ad...@apache.org.
JAMES-1842: Introduce GuiceJamesServer interface


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

Branch: refs/heads/master
Commit: fdb400d41c9add031b0af1ff17b21ceba2db0095
Parents: 932f16c
Author: Antoine Duprat <ad...@apache.org>
Authored: Wed Nov 16 09:59:04 2016 +0100
Committer: Quynh Nguyen <qn...@linagora.com>
Committed: Fri Nov 18 09:33:20 2016 +0700

----------------------------------------------------------------------
 .../java/org/apache/james/GuiceJamesServer.java | 30 ++++++++++++++++++++
 .../org/apache/james/GuiceJamesServerImpl.java  |  5 +++-
 2 files changed, 34 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/fdb400d4/server/container/guice/guice-common/src/main/java/org/apache/james/GuiceJamesServer.java
----------------------------------------------------------------------
diff --git a/server/container/guice/guice-common/src/main/java/org/apache/james/GuiceJamesServer.java b/server/container/guice/guice-common/src/main/java/org/apache/james/GuiceJamesServer.java
new file mode 100644
index 0000000..d77521b
--- /dev/null
+++ b/server/container/guice/guice-common/src/main/java/org/apache/james/GuiceJamesServer.java
@@ -0,0 +1,30 @@
+/****************************************************************
+ * 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;
+
+import org.apache.james.utils.GuiceServerProbe;
+
+public interface GuiceJamesServer {
+
+    void start() throws Exception;
+
+    void stop();
+
+    GuiceServerProbe serverProbe();
+}

http://git-wip-us.apache.org/repos/asf/james-project/blob/fdb400d4/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 0ebd7c6..e33c72c 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
@@ -38,7 +38,7 @@ import com.google.inject.Module;
 import com.google.inject.TypeLiteral;
 import com.google.inject.util.Modules;
 
-public class GuiceJamesServerImpl {
+public class GuiceJamesServerImpl implements GuiceJamesServer {
     protected final Module module;
     private Stager<PreDestroy> preDestroy;
     private GuiceProbeProvider guiceProbeProvider;
@@ -62,6 +62,7 @@ public class GuiceJamesServerImpl {
         return new GuiceJamesServerImpl(Modules.override(module).with(overrides));
     }
 
+    @Override
     public void start() throws Exception {
         Injector injector = Guice.createInjector(module);
         preDestroy = injector.getInstance(Key.get(new TypeLiteral<Stager<PreDestroy>>() {}));
@@ -69,12 +70,14 @@ public class GuiceJamesServerImpl {
         guiceProbeProvider = injector.getInstance(GuiceProbeProvider.class);
     }
 
+    @Override
     public void stop() {
         if (preDestroy != null) {
             preDestroy.stage();
         }
     }
 
+    @Override
     public GuiceServerProbe serverProbe() {
         return guiceProbeProvider.getProbe(GuiceServerProbe.class);
     }


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


[22/29] james-project git commit: JAMES-1842: replace tab by spaces

Posted by ad...@apache.org.
JAMES-1842: replace tab by spaces


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

Branch: refs/heads/master
Commit: 0aafb2d5538d0471a624d142d90359d63c028ff4
Parents: 0e5cf23
Author: Quynh Nguyen <qn...@linagora.com>
Authored: Wed Nov 16 09:41:44 2016 +0700
Committer: Quynh Nguyen <qn...@linagora.com>
Committed: Fri Nov 18 09:25:35 2016 +0700

----------------------------------------------------------------------
 .../jmap/methods/integration/GetMailboxesMethodTest.java  | 10 +++++-----
 .../jmap/methods/integration/GetVacationResponseTest.java | 10 +++++-----
 .../jmap/methods/integration/SetMailboxesMethodTest.java  | 10 +++++-----
 .../jmap/methods/integration/SetVacationResponseTest.java | 10 +++++-----
 4 files changed, 20 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/0aafb2d5/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetMailboxesMethodTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetMailboxesMethodTest.java b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetMailboxesMethodTest.java
index ca3d38c..e1f7622 100644
--- a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetMailboxesMethodTest.java
+++ b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetMailboxesMethodTest.java
@@ -67,12 +67,12 @@ public abstract class GetMailboxesMethodTest<T extends GuiceJamesServer & JmapSe
         jmapServer.start();
         
         RestAssured.requestSpecification = new RequestSpecBuilder()
-        		.setContentType(ContentType.JSON)
-        		.setAccept(ContentType.JSON)
-        		.setConfig(newConfig().encoderConfig(encoderConfig().defaultContentCharset(Charsets.UTF_8)))
-        		.setPort(jmapServer.getJmapProbe()
+                .setContentType(ContentType.JSON)
+                .setAccept(ContentType.JSON)
+                .setConfig(newConfig().encoderConfig(encoderConfig().defaultContentCharset(Charsets.UTF_8)))
+                .setPort(jmapServer.getJmapProbe()
                     .getJmapPort())
-        		.build();
+                .build();
 
         String domain = "domain.tld";
         username = "username@" + domain;

http://git-wip-us.apache.org/repos/asf/james-project/blob/0aafb2d5/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetVacationResponseTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetVacationResponseTest.java b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetVacationResponseTest.java
index 15c69eb..ec6e5cc 100644
--- a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetVacationResponseTest.java
+++ b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetVacationResponseTest.java
@@ -78,11 +78,11 @@ public abstract class GetVacationResponseTest<T extends GuiceJamesServer & JmapS
 
         jmapGuiceProbe = jmapServer.getJmapProbe();
         RestAssured.requestSpecification = new RequestSpecBuilder()
-        		.setContentType(ContentType.JSON)
-        		.setAccept(ContentType.JSON)
-        		.setConfig(newConfig().encoderConfig(encoderConfig().defaultContentCharset(Charsets.UTF_8)))
-        		.setPort(jmapGuiceProbe.getJmapPort())
-        		.build();
+                .setContentType(ContentType.JSON)
+                .setAccept(ContentType.JSON)
+                .setConfig(newConfig().encoderConfig(encoderConfig().defaultContentCharset(Charsets.UTF_8)))
+                .setPort(jmapGuiceProbe.getJmapPort())
+                .build();
 
 
         jmapServer.serverProbe().addDomain(USERS_DOMAIN);

http://git-wip-us.apache.org/repos/asf/james-project/blob/0aafb2d5/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/SetMailboxesMethodTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/SetMailboxesMethodTest.java b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/SetMailboxesMethodTest.java
index 5196788..8b69679 100644
--- a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/SetMailboxesMethodTest.java
+++ b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/SetMailboxesMethodTest.java
@@ -75,12 +75,12 @@ public abstract class SetMailboxesMethodTest<T extends GuiceJamesServer & JmapSe
         jmapServer.start();
 
         RestAssured.requestSpecification = new RequestSpecBuilder()
-        		.setContentType(ContentType.JSON)
-        		.setAccept(ContentType.JSON)
-        		.setConfig(newConfig().encoderConfig(encoderConfig().defaultContentCharset(Charsets.UTF_8)))
-        		.setPort(jmapServer.getJmapProbe()
+                .setContentType(ContentType.JSON)
+                .setAccept(ContentType.JSON)
+                .setConfig(newConfig().encoderConfig(encoderConfig().defaultContentCharset(Charsets.UTF_8)))
+                .setPort(jmapServer.getJmapProbe()
                     .getJmapPort())
-        		.build();
+                .build();
         RestAssured.enableLoggingOfRequestAndResponseIfValidationFails();
 
         username = "username@" + USERS_DOMAIN;

http://git-wip-us.apache.org/repos/asf/james-project/blob/0aafb2d5/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/SetVacationResponseTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/SetVacationResponseTest.java b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/SetVacationResponseTest.java
index be04ecb..07a49a5 100644
--- a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/SetVacationResponseTest.java
+++ b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/SetVacationResponseTest.java
@@ -70,12 +70,12 @@ public abstract class SetVacationResponseTest<T extends GuiceJamesServer & JmapS
         jmapServer.start();
         jmapGuiceProbe = jmapServer.getJmapProbe();
         RestAssured.requestSpecification = new RequestSpecBuilder()
-        		.setContentType(ContentType.JSON)
-        		.setAccept(ContentType.JSON)
-        		.setConfig(newConfig().encoderConfig(encoderConfig().defaultContentCharset(Charsets.UTF_8)))
-        		.setPort(jmapGuiceProbe
+                .setContentType(ContentType.JSON)
+                .setAccept(ContentType.JSON)
+                .setConfig(newConfig().encoderConfig(encoderConfig().defaultContentCharset(Charsets.UTF_8)))
+                .setPort(jmapGuiceProbe
                     .getJmapPort())
-        		.build();
+                .build();
 
         jmapServer.serverProbe().addDomain(USERS_DOMAIN);
         jmapServer.serverProbe().addUser(USER, PASSWORD);


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


[02/29] james-project git commit: JAMES-1842: Introduce SieveFile repository module

Posted by ad...@apache.org.
JAMES-1842: Introduce SieveFile repository module


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

Branch: refs/heads/master
Commit: f824e277aebb8f6acd69b081e1788853a5acb7e9
Parents: ebbf1e6
Author: Quynh Nguyen <qn...@linagora.com>
Authored: Thu Nov 10 14:04:47 2016 +0700
Committer: Quynh Nguyen <qn...@linagora.com>
Committed: Fri Nov 18 09:25:34 2016 +0700

----------------------------------------------------------------------
 .../modules/data/SieveFileRepositoryModule.java | 36 ++++++++++++++++++++
 .../org/apache/james/JPAJamesServerMain.java    |  4 +--
 .../modules/data/JPASieveRepositoryModule.java  | 36 --------------------
 .../james/modules/data/MemoryDataModule.java    |  5 ++-
 4 files changed, 40 insertions(+), 41 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/f824e277/server/container/guice/guice-common/src/main/java/org/apache/james/modules/data/SieveFileRepositoryModule.java
----------------------------------------------------------------------
diff --git a/server/container/guice/guice-common/src/main/java/org/apache/james/modules/data/SieveFileRepositoryModule.java b/server/container/guice/guice-common/src/main/java/org/apache/james/modules/data/SieveFileRepositoryModule.java
new file mode 100644
index 0000000..c6b36fd
--- /dev/null
+++ b/server/container/guice/guice-common/src/main/java/org/apache/james/modules/data/SieveFileRepositoryModule.java
@@ -0,0 +1,36 @@
+/****************************************************************
+ * 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.sieverepository.api.SieveRepository;
+import org.apache.james.sieverepository.file.SieveFileRepository;
+
+import com.google.inject.AbstractModule;
+import com.google.inject.Scopes;
+
+public class SieveFileRepositoryModule extends AbstractModule {
+
+    @Override
+    protected void configure() {
+        bind(SieveFileRepository.class).in(Scopes.SINGLETON);
+
+        bind(SieveRepository.class).to(SieveFileRepository.class);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/james-project/blob/f824e277/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 ae623ce..97aeaa3 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
@@ -20,7 +20,7 @@
 package org.apache.james;
 
 import org.apache.james.modules.data.JPADataModule;
-import org.apache.james.modules.data.JPASieveRepositoryModule;
+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.server.ActiveMQQueueModule;
@@ -35,7 +35,7 @@ public class JPAJamesServerMain {
     public static final Module jpaServerModule = Modules.combine(
         new JPAMailboxModule(),
         new JPADataModule(),
-        new JPASieveRepositoryModule(),
+        new SieveFileRepositoryModule(),
         new QuotaModule(),
         new ActiveMQQueueModule());
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/f824e277/server/container/guice/jpa-guice/src/main/java/org/apache/james/modules/data/JPASieveRepositoryModule.java
----------------------------------------------------------------------
diff --git a/server/container/guice/jpa-guice/src/main/java/org/apache/james/modules/data/JPASieveRepositoryModule.java b/server/container/guice/jpa-guice/src/main/java/org/apache/james/modules/data/JPASieveRepositoryModule.java
deleted file mode 100644
index d5dac1c..0000000
--- a/server/container/guice/jpa-guice/src/main/java/org/apache/james/modules/data/JPASieveRepositoryModule.java
+++ /dev/null
@@ -1,36 +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.data;
-
-import org.apache.james.sieverepository.api.SieveRepository;
-import org.apache.james.sieverepository.file.SieveFileRepository;
-
-import com.google.inject.AbstractModule;
-import com.google.inject.Scopes;
-
-public class JPASieveRepositoryModule extends AbstractModule {
-
-    @Override
-    protected void configure() {
-        bind(SieveFileRepository.class).in(Scopes.SINGLETON);
-
-        bind(SieveRepository.class).to(SieveFileRepository.class);
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/james-project/blob/f824e277/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 320e24f..b809df8 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
@@ -50,6 +50,8 @@ public class MemoryDataModule extends AbstractModule {
 
     @Override
     protected void configure() {
+        install(new SieveFileRepositoryModule());
+
         bind(MemoryDomainList.class).in(Scopes.SINGLETON);
         bind(DomainList.class).to(MemoryDomainList.class);
 
@@ -59,9 +61,6 @@ public class MemoryDataModule extends AbstractModule {
         bind(MemoryUsersRepository.class).toInstance(MemoryUsersRepository.withVirtualHosting());
         bind(UsersRepository.class).to(MemoryUsersRepository.class);
 
-        bind(SieveFileRepository.class).in(Scopes.SINGLETON);
-        bind(SieveRepository.class).to(SieveFileRepository.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


[15/29] james-project git commit: JAMES-1842: Add more interface for ExtendServerProbe

Posted by ad...@apache.org.
JAMES-1842: Add more interface for ExtendServerProbe


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

Branch: refs/heads/master
Commit: e48ef9def640fc6116511ab5f5657679a145cdf0
Parents: 0c37cef
Author: Quynh Nguyen <qn...@linagora.com>
Authored: Fri Oct 28 16:29:05 2016 +0700
Committer: Quynh Nguyen <qn...@linagora.com>
Committed: Fri Nov 18 09:25:34 2016 +0700

----------------------------------------------------------------------
 .../james/utils/ExtendedJmapServerProbe.java    | 17 +--------
 .../apache/james/utils/ExtendedServerProbe.java | 40 ++++++++++++++++++++
 2 files changed, 41 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/e48ef9de/server/container/guice/guice-common/src/main/java/org/apache/james/utils/ExtendedJmapServerProbe.java
----------------------------------------------------------------------
diff --git a/server/container/guice/guice-common/src/main/java/org/apache/james/utils/ExtendedJmapServerProbe.java b/server/container/guice/guice-common/src/main/java/org/apache/james/utils/ExtendedJmapServerProbe.java
index 415dfcc..04f2292 100644
--- a/server/container/guice/guice-common/src/main/java/org/apache/james/utils/ExtendedJmapServerProbe.java
+++ b/server/container/guice/guice-common/src/main/java/org/apache/james/utils/ExtendedJmapServerProbe.java
@@ -19,26 +19,11 @@
 
 package org.apache.james.utils;
 
-import java.io.InputStream;
-import java.util.Date;
-
-import javax.mail.Flags;
-
-import org.apache.james.cli.probe.ServerProbe;
 import org.apache.james.jmap.api.vacation.AccountId;
 import org.apache.james.jmap.api.vacation.Vacation;
 import org.apache.james.jmap.api.vacation.VacationPatch;
-import org.apache.james.mailbox.exception.BadCredentialsException;
-import org.apache.james.mailbox.exception.MailboxException;
-import org.apache.james.mailbox.model.MailboxPath;
-import org.apache.james.mailbox.store.mail.model.Mailbox;
-
-public interface ExtendedJmapServerProbe extends ServerProbe {
-
-    void appendMessage(String username, MailboxPath mailboxPath, InputStream message, Date internalDate, boolean isRecent, Flags flags) 
-            throws BadCredentialsException, MailboxException;
 
-    Mailbox getMailbox(String namespace, String user, String name);
+public interface ExtendedJmapServerProbe extends ExtendedServerProbe {
 
     void modifyVacation(AccountId accountId, VacationPatch vacationPatch);
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/e48ef9de/server/container/guice/guice-common/src/main/java/org/apache/james/utils/ExtendedServerProbe.java
----------------------------------------------------------------------
diff --git a/server/container/guice/guice-common/src/main/java/org/apache/james/utils/ExtendedServerProbe.java b/server/container/guice/guice-common/src/main/java/org/apache/james/utils/ExtendedServerProbe.java
new file mode 100644
index 0000000..7bc1a39
--- /dev/null
+++ b/server/container/guice/guice-common/src/main/java/org/apache/james/utils/ExtendedServerProbe.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.utils;
+
+import java.io.InputStream;
+import java.util.Date;
+
+import javax.mail.Flags;
+
+import org.apache.james.cli.probe.ServerProbe;
+import org.apache.james.mailbox.exception.BadCredentialsException;
+import org.apache.james.mailbox.exception.MailboxException;
+import org.apache.james.mailbox.model.MailboxPath;
+import org.apache.james.mailbox.store.mail.model.Mailbox;
+
+public interface ExtendedServerProbe extends ServerProbe {
+
+    void appendMessage(String username, MailboxPath mailboxPath, InputStream message, Date internalDate, boolean isRecent, Flags flags) 
+            throws BadCredentialsException, MailboxException;
+
+    Mailbox getMailbox(String namespace, String user, String name);
+
+}


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


[24/29] james-project git commit: JAMES-1842 Refactor JPA Guice

Posted by ad...@apache.org.
JAMES-1842 Refactor JPA 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/fd3c4396
Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/fd3c4396
Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/fd3c4396

Branch: refs/heads/master
Commit: fd3c4396fe444d2770e8d4a2d5d1b49883c15f73
Parents: e849d6e
Author: Quynh Nguyen <qn...@linagora.com>
Authored: Wed Nov 16 17:46:43 2016 +0700
Committer: Quynh Nguyen <qn...@linagora.com>
Committed: Fri Nov 18 09:33:20 2016 +0700

----------------------------------------------------------------------
 .../java/org/apache/james/JmapJamesServer.java  | 23 ++++++++++++++++++++
 .../java/org/apache/james/JmapJamesServer.java  | 23 --------------------
 .../org/apache/james/JPAJamesServerMain.java    |  2 +-
 .../org/apache/james/JPAJamesServerTest.java    |  4 ++--
 .../james/JamesCapabilitiesServerTest.java      |  2 +-
 5 files changed, 27 insertions(+), 27 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/fd3c4396/server/container/guice/guice-common/src/main/java/org/apache/james/JmapJamesServer.java
----------------------------------------------------------------------
diff --git a/server/container/guice/guice-common/src/main/java/org/apache/james/JmapJamesServer.java b/server/container/guice/guice-common/src/main/java/org/apache/james/JmapJamesServer.java
new file mode 100644
index 0000000..cf374ba
--- /dev/null
+++ b/server/container/guice/guice-common/src/main/java/org/apache/james/JmapJamesServer.java
@@ -0,0 +1,23 @@
+/****************************************************************
+ * 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;
+
+public interface JmapJamesServer extends GuiceJamesServer, JmapServer, WebAdminServer {
+
+}

http://git-wip-us.apache.org/repos/asf/james-project/blob/fd3c4396/server/container/guice/guice-common/src/test/java/org/apache/james/JmapJamesServer.java
----------------------------------------------------------------------
diff --git a/server/container/guice/guice-common/src/test/java/org/apache/james/JmapJamesServer.java b/server/container/guice/guice-common/src/test/java/org/apache/james/JmapJamesServer.java
deleted file mode 100644
index cf374ba..0000000
--- a/server/container/guice/guice-common/src/test/java/org/apache/james/JmapJamesServer.java
+++ /dev/null
@@ -1,23 +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;
-
-public interface JmapJamesServer extends GuiceJamesServer, JmapServer, WebAdminServer {
-
-}

http://git-wip-us.apache.org/repos/asf/james-project/blob/fd3c4396/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 97aeaa3..5ae97a3 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
@@ -40,7 +40,7 @@ public class JPAJamesServerMain {
         new ActiveMQQueueModule());
 
     public static void main(String[] args) throws Exception {
-        GuiceJamesServer server = new GuiceJamesServer()
+        GuiceJamesServerImpl server = new GuiceJamesServerImpl()
                     .combineWith(jpaServerModule, 
                             new JMXServerModule(), 
                             new LuceneSearchMailboxModule());

http://git-wip-us.apache.org/repos/asf/james-project/blob/fd3c4396/server/container/guice/jpa-guice/src/test/java/org/apache/james/JPAJamesServerTest.java
----------------------------------------------------------------------
diff --git a/server/container/guice/jpa-guice/src/test/java/org/apache/james/JPAJamesServerTest.java b/server/container/guice/jpa-guice/src/test/java/org/apache/james/JPAJamesServerTest.java
index 0684be1..8ab4ad6 100644
--- a/server/container/guice/jpa-guice/src/test/java/org/apache/james/JPAJamesServerTest.java
+++ b/server/container/guice/jpa-guice/src/test/java/org/apache/james/JPAJamesServerTest.java
@@ -29,8 +29,8 @@ public class JPAJamesServerTest extends AbstractJamesServerTest {
     public TemporaryFolder temporaryFolder = new TemporaryFolder();
 
     @Override
-    protected GuiceJamesServer createJamesServer() {
-        return new GuiceJamesServer()
+    protected GuiceJamesServerImpl createJamesServer() {
+        return new GuiceJamesServerImpl()
             .combineWith(JPAJamesServerMain.jpaServerModule)
             .overrideWith(new TestFilesystemModule(temporaryFolder),
                     new TestJPAConfigurationModule());

http://git-wip-us.apache.org/repos/asf/james-project/blob/fd3c4396/server/container/guice/jpa-guice/src/test/java/org/apache/james/JamesCapabilitiesServerTest.java
----------------------------------------------------------------------
diff --git a/server/container/guice/jpa-guice/src/test/java/org/apache/james/JamesCapabilitiesServerTest.java b/server/container/guice/jpa-guice/src/test/java/org/apache/james/JamesCapabilitiesServerTest.java
index 82e728a..ad2a17c 100644
--- a/server/container/guice/jpa-guice/src/test/java/org/apache/james/JamesCapabilitiesServerTest.java
+++ b/server/container/guice/jpa-guice/src/test/java/org/apache/james/JamesCapabilitiesServerTest.java
@@ -49,7 +49,7 @@ public class JamesCapabilitiesServerTest {
     private GuiceJamesServer createJPAJamesServer(final MailboxManager mailboxManager) {
         Module mockMailboxManager = (binder) -> binder.bind(MailboxManager.class).toInstance(mailboxManager);
         
-        return new GuiceJamesServer()
+        return new GuiceJamesServerImpl()
             .combineWith(JPAJamesServerMain.jpaServerModule)
             .overrideWith(
                 new TestFilesystemModule(temporaryFolder),


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


[19/29] james-project git commit: JAMES-1842: Rename GuiceJamesServer to GuiceJmapJamesServer

Posted by ad...@apache.org.
JAMES-1842: Rename GuiceJamesServer to GuiceJmapJamesServer


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

Branch: refs/heads/master
Commit: b9a94026675405de38e3e298b217e9a8f66baa6f
Parents: 91be31f
Author: Quynh Nguyen <qn...@linagora.com>
Authored: Fri Oct 28 16:43:45 2016 +0700
Committer: Quynh Nguyen <qn...@linagora.com>
Committed: Fri Nov 18 09:25:34 2016 +0700

----------------------------------------------------------------------
 .../smtp/host/CassandraJamesSmtpHostSystem.java |   8 +-
 .../apache/james/CassandraJamesServerMain.java  |   2 +-
 .../apache/james/CassandraJamesServerTest.java  |   4 +-
 .../james/JamesCapabilitiesServerTest.java      |   6 +-
 .../java/org/apache/james/GuiceJamesServer.java | 114 -------------------
 .../org/apache/james/GuiceJmapJamesServer.java  | 114 +++++++++++++++++++
 .../apache/james/AbstractJamesServerTest.java   |   4 +-
 .../org/apache/james/MemoryJamesServerMain.java |   2 +-
 .../org/apache/james/MemoryJamesServerTest.java |   4 +-
 .../james/mailets/TemporaryJamesServer.java     |   6 +-
 .../CassandraGetMailboxesMethodTest.java        |   6 +-
 .../CassandraGetMessageListMethodTest.java      |   6 +-
 .../CassandraGetVacationResponseTest.java       |   6 +-
 .../CassandraJmapAuthenticationTest.java        |   6 +-
 .../CassandraSetMailboxesMethodTest.java        |   6 +-
 .../CassandraSetMessagesMethodTest.java         |   6 +-
 .../CassandraSetVacationResponseTest.java       |   6 +-
 .../CassandraVacationIntegrationTest.java       |   6 +-
 .../cassandra/cucumber/CassandraStepdefs.java   |   4 +-
 .../james/jmap/JMAPAuthenticationTest.java      |   6 +-
 .../james/jmap/VacationIntegrationTest.java     |   6 +-
 .../integration/GetMailboxesMethodTest.java     |   6 +-
 .../integration/GetMessageListMethodTest.java   |   6 +-
 .../integration/GetVacationResponseTest.java    |   6 +-
 .../integration/SetMailboxesMethodTest.java     |   6 +-
 .../integration/SetMessagesMethodTest.java      |   6 +-
 .../integration/SetVacationResponseTest.java    |   6 +-
 .../integration/cucumber/MainStepdefs.java      |   4 +-
 .../memory/MemoryGetMailboxesMethodTest.java    |   6 +-
 .../memory/MemoryGetMessageListMethodTest.java  |   6 +-
 .../MemoryGetVacationResponseMethodTest.java    |   6 +-
 .../memory/MemoryJmapAuthenticationTest.java    |   6 +-
 .../memory/MemorySetMailboxesMethodTest.java    |   6 +-
 .../memory/MemorySetMessagesMethodTest.java     |   6 +-
 .../MemorySetVacationResponseMethodTest.java    |   6 +-
 .../memory/MemoryVacationIntegrationTest.java   |   6 +-
 .../jmap/memory/cucumber/MemoryStepdefs.java    |   4 +-
 .../WebAdminServerIntegrationTest.java          |   6 +-
 38 files changed, 213 insertions(+), 213 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/b9a94026/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 4949765..836e4e5 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
@@ -22,7 +22,7 @@ package org.apache.james.mpt.smtp.host;
 import java.util.Iterator;
 
 import org.apache.james.CassandraJamesServerMain;
-import org.apache.james.GuiceJamesServer;
+import org.apache.james.GuiceJmapJamesServer;
 import org.apache.james.backends.cassandra.EmbeddedCassandra;
 import org.apache.james.dnsservice.api.DNSService;
 import org.apache.james.mailbox.elasticsearch.EmbeddedElasticSearch;
@@ -42,7 +42,7 @@ public class CassandraJamesSmtpHostSystem extends ExternalSessionFactory impleme
     private EmbeddedCassandra embeddedCassandra;
     private EmbeddedElasticSearch embeddedElasticSearch;
 
-    private GuiceJamesServer jamesServer;
+    private GuiceJmapJamesServer jamesServer;
     private InMemoryDNSService inMemoryDNSService;
 
 
@@ -104,8 +104,8 @@ public class CassandraJamesSmtpHostSystem extends ExternalSessionFactory impleme
         return inMemoryDNSService;
     }
 
-    protected GuiceJamesServer createJamesServer() {
-        return new GuiceJamesServer()
+    protected GuiceJmapJamesServer createJamesServer() {
+        return new GuiceJmapJamesServer()
             .combineWith(CassandraJamesServerMain.cassandraServerModule)
             .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/b9a94026/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 766b902..12e163c 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
@@ -50,7 +50,7 @@ public class CassandraJamesServerMain {
 
 
     public static void main(String[] args) throws Exception {
-        GuiceJamesServer server = new GuiceJamesServer()
+        GuiceJmapJamesServer server = new GuiceJmapJamesServer()
                     .combineWith(cassandraServerModule, new JMXServerModule());
         server.start();
     }

http://git-wip-us.apache.org/repos/asf/james-project/blob/b9a94026/server/container/guice/cassandra-guice/src/test/java/org/apache/james/CassandraJamesServerTest.java
----------------------------------------------------------------------
diff --git a/server/container/guice/cassandra-guice/src/test/java/org/apache/james/CassandraJamesServerTest.java b/server/container/guice/cassandra-guice/src/test/java/org/apache/james/CassandraJamesServerTest.java
index 3870b42..41187a1 100644
--- a/server/container/guice/cassandra-guice/src/test/java/org/apache/james/CassandraJamesServerTest.java
+++ b/server/container/guice/cassandra-guice/src/test/java/org/apache/james/CassandraJamesServerTest.java
@@ -45,8 +45,8 @@ public class CassandraJamesServerTest extends AbstractJamesServerTest {
     public RuleChain chain = RuleChain.outerRule(temporaryFolder).around(embeddedElasticSearch);
 
     @Override
-    protected GuiceJamesServer createJamesServer() {
-        return new GuiceJamesServer()
+    protected GuiceJmapJamesServer createJamesServer() {
+        return new GuiceJmapJamesServer()
                 .combineWith(CassandraJamesServerMain.cassandraServerModule)
                 .overrideWith(new TestElasticSearchModule(embeddedElasticSearch),
                         new TestFilesystemModule(temporaryFolder),

http://git-wip-us.apache.org/repos/asf/james-project/blob/b9a94026/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 e866369..06d7872 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
@@ -46,7 +46,7 @@ import com.google.inject.Singleton;
 
 public class JamesCapabilitiesServerTest {
 
-    private GuiceJamesServer server;
+    private GuiceJmapJamesServer server;
     private TemporaryFolder temporaryFolder = new TemporaryFolder();
     private EmbeddedElasticSearch embeddedElasticSearch = new EmbeddedElasticSearch(temporaryFolder);
 
@@ -58,10 +58,10 @@ public class JamesCapabilitiesServerTest {
         server.stop();
     }
     
-    private GuiceJamesServer createCassandraJamesServer(final MailboxManager mailboxManager) {
+    private GuiceJmapJamesServer createCassandraJamesServer(final MailboxManager mailboxManager) {
         Module mockMailboxManager = (binder) -> binder.bind(MailboxManager.class).toInstance(mailboxManager);
         
-        return new GuiceJamesServer()
+        return new GuiceJmapJamesServer()
             .combineWith(CassandraJamesServerMain.cassandraServerModule)
             .overrideWith(new TestElasticSearchModule(embeddedElasticSearch),
                 new TestFilesystemModule(temporaryFolder),

http://git-wip-us.apache.org/repos/asf/james-project/blob/b9a94026/server/container/guice/guice-common/src/main/java/org/apache/james/GuiceJamesServer.java
----------------------------------------------------------------------
diff --git a/server/container/guice/guice-common/src/main/java/org/apache/james/GuiceJamesServer.java b/server/container/guice/guice-common/src/main/java/org/apache/james/GuiceJamesServer.java
deleted file mode 100644
index 6d0209d..0000000
--- a/server/container/guice/guice-common/src/main/java/org/apache/james/GuiceJamesServer.java
+++ /dev/null
@@ -1,114 +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;
-
-import java.util.Arrays;
-import java.util.Optional;
-
-import javax.annotation.PreDestroy;
-
-import org.apache.james.jmap.JMAPServer;
-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.ExtendedJmapServerProbe;
-import org.apache.james.utils.JmapGuiceServerProbe;
-import org.apache.james.webadmin.Port;
-import org.apache.james.webadmin.WebAdminServer;
-
-import com.google.common.collect.Iterables;
-import com.google.inject.Guice;
-import com.google.inject.Injector;
-import com.google.inject.Key;
-import com.google.inject.Module;
-import com.google.inject.TypeLiteral;
-import com.google.inject.util.Modules;
-
-public class GuiceJamesServer {
-
-    private final Module module;
-    private Stager<PreDestroy> preDestroy;
-    private JmapGuiceServerProbe serverProbe;
-    private Optional<Integer> jmapPort;
-    private Optional<Port> webadminPort;
-
-    public GuiceJamesServer() {
-        this(Modules.combine(
-                        new CommonServicesModule(),
-                        new ProtocolsModule(),
-                        new MailetProcessingModule()));
-    }
-
-    public GuiceJamesServer(Module module) {
-        this.module = module;
-    }
-    
-    public GuiceJamesServer combineWith(Module... modules) {
-        return new GuiceJamesServer(Modules.combine(Iterables.concat(Arrays.asList(module), Arrays.asList(modules))));
-    }
-    
-    public GuiceJamesServer overrideWith(Module... overrides) {
-        return new GuiceJamesServer(Modules.override(module).with(overrides));
-    }
-    
-    public void start() throws Exception {
-        Injector injector = Guice.createInjector(module);
-        preDestroy = injector.getInstance(Key.get(new TypeLiteral<Stager<PreDestroy>>() {}));
-        injector.getInstance(ConfigurationsPerformer.class).initModules();
-        serverProbe = injector.getInstance(JmapGuiceServerProbe.class);
-        jmapPort = locateJMAPPort(injector);
-        webadminPort =locateWebAdminPort(injector);
-    }
-
-    private Optional<Integer> locateJMAPPort(Injector injector) {
-        try {
-            return Optional.of(injector.getInstance(JMAPServer.class).getPort());
-        } catch(Exception e) {
-            return Optional.empty();
-        }
-    }
-
-    private Optional<Port> locateWebAdminPort(Injector injector) {
-        try {
-            return Optional.of(injector.getInstance(WebAdminServer.class).getPort());
-        } catch(Exception e) {
-            return Optional.empty();
-        }
-    }
-
-    public void stop() {
-        if (preDestroy != null) {
-            preDestroy.stage();
-        }
-    }
-
-    public ExtendedJmapServerProbe serverProbe() {
-        return serverProbe;
-    }
-
-    public Optional<Integer> getJmapPort() {
-        return jmapPort;
-    }
-
-    public Optional<Port> getWebadminPort() {
-        return webadminPort;
-    }
-}

http://git-wip-us.apache.org/repos/asf/james-project/blob/b9a94026/server/container/guice/guice-common/src/main/java/org/apache/james/GuiceJmapJamesServer.java
----------------------------------------------------------------------
diff --git a/server/container/guice/guice-common/src/main/java/org/apache/james/GuiceJmapJamesServer.java b/server/container/guice/guice-common/src/main/java/org/apache/james/GuiceJmapJamesServer.java
new file mode 100644
index 0000000..d137fdf
--- /dev/null
+++ b/server/container/guice/guice-common/src/main/java/org/apache/james/GuiceJmapJamesServer.java
@@ -0,0 +1,114 @@
+/****************************************************************
+ * 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;
+
+import java.util.Arrays;
+import java.util.Optional;
+
+import javax.annotation.PreDestroy;
+
+import org.apache.james.jmap.JMAPServer;
+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.ExtendedJmapServerProbe;
+import org.apache.james.utils.JmapGuiceServerProbe;
+import org.apache.james.webadmin.Port;
+import org.apache.james.webadmin.WebAdminServer;
+
+import com.google.common.collect.Iterables;
+import com.google.inject.Guice;
+import com.google.inject.Injector;
+import com.google.inject.Key;
+import com.google.inject.Module;
+import com.google.inject.TypeLiteral;
+import com.google.inject.util.Modules;
+
+public class GuiceJmapJamesServer {
+
+    private final Module module;
+    private Stager<PreDestroy> preDestroy;
+    private JmapGuiceServerProbe serverProbe;
+    private Optional<Integer> jmapPort;
+    private Optional<Port> webadminPort;
+
+    public GuiceJmapJamesServer() {
+        this(Modules.combine(
+                        new CommonServicesModule(),
+                        new ProtocolsModule(),
+                        new MailetProcessingModule()));
+    }
+
+    public GuiceJmapJamesServer(Module module) {
+        this.module = module;
+    }
+    
+    public GuiceJmapJamesServer combineWith(Module... modules) {
+        return new GuiceJmapJamesServer(Modules.combine(Iterables.concat(Arrays.asList(module), Arrays.asList(modules))));
+    }
+    
+    public GuiceJmapJamesServer overrideWith(Module... overrides) {
+        return new GuiceJmapJamesServer(Modules.override(module).with(overrides));
+    }
+    
+    public void start() throws Exception {
+        Injector injector = Guice.createInjector(module);
+        preDestroy = injector.getInstance(Key.get(new TypeLiteral<Stager<PreDestroy>>() {}));
+        injector.getInstance(ConfigurationsPerformer.class).initModules();
+        serverProbe = injector.getInstance(JmapGuiceServerProbe.class);
+        jmapPort = locateJMAPPort(injector);
+        webadminPort =locateWebAdminPort(injector);
+    }
+
+    private Optional<Integer> locateJMAPPort(Injector injector) {
+        try {
+            return Optional.of(injector.getInstance(JMAPServer.class).getPort());
+        } catch(Exception e) {
+            return Optional.empty();
+        }
+    }
+
+    private Optional<Port> locateWebAdminPort(Injector injector) {
+        try {
+            return Optional.of(injector.getInstance(WebAdminServer.class).getPort());
+        } catch(Exception e) {
+            return Optional.empty();
+        }
+    }
+
+    public void stop() {
+        if (preDestroy != null) {
+            preDestroy.stage();
+        }
+    }
+
+    public ExtendedJmapServerProbe serverProbe() {
+        return serverProbe;
+    }
+
+    public Optional<Integer> getJmapPort() {
+        return jmapPort;
+    }
+
+    public Optional<Port> getWebadminPort() {
+        return webadminPort;
+    }
+}

http://git-wip-us.apache.org/repos/asf/james-project/blob/b9a94026/server/container/guice/guice-common/src/test/java/org/apache/james/AbstractJamesServerTest.java
----------------------------------------------------------------------
diff --git a/server/container/guice/guice-common/src/test/java/org/apache/james/AbstractJamesServerTest.java b/server/container/guice/guice-common/src/test/java/org/apache/james/AbstractJamesServerTest.java
index 11fc881..bdeeeff 100644
--- a/server/container/guice/guice-common/src/test/java/org/apache/james/AbstractJamesServerTest.java
+++ b/server/container/guice/guice-common/src/test/java/org/apache/james/AbstractJamesServerTest.java
@@ -49,7 +49,7 @@ public abstract class AbstractJamesServerTest {
     private static final int LMTP_PORT = 1024;
     private static final int JMAP_PORT = 1080;
 
-    private GuiceJamesServer server;
+    private GuiceJmapJamesServer server;
     private SocketChannel socketChannel;
 
     @Before
@@ -67,7 +67,7 @@ public abstract class AbstractJamesServerTest {
         		.build();
     }
 
-    protected abstract GuiceJamesServer createJamesServer();
+    protected abstract GuiceJmapJamesServer createJamesServer();
 
     protected abstract void clean();
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/b9a94026/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 4fc14d3..43d6532 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
@@ -39,7 +39,7 @@ public class MemoryJamesServerMain {
         new MemoryMailQueueModule());
 
     public static void main(String[] args) throws Exception {
-        new GuiceJamesServer()
+        new GuiceJmapJamesServer()
             .combineWith(inMemoryServerModule, new JMXServerModule())
             .start();
     }

http://git-wip-us.apache.org/repos/asf/james-project/blob/b9a94026/server/container/guice/memory-guice/src/test/java/org/apache/james/MemoryJamesServerTest.java
----------------------------------------------------------------------
diff --git a/server/container/guice/memory-guice/src/test/java/org/apache/james/MemoryJamesServerTest.java b/server/container/guice/memory-guice/src/test/java/org/apache/james/MemoryJamesServerTest.java
index 4dc6fae..70adef1 100644
--- a/server/container/guice/memory-guice/src/test/java/org/apache/james/MemoryJamesServerTest.java
+++ b/server/container/guice/memory-guice/src/test/java/org/apache/james/MemoryJamesServerTest.java
@@ -31,8 +31,8 @@ public class MemoryJamesServerTest extends AbstractJamesServerTest {
     public TemporaryFolder temporaryFolder = new TemporaryFolder();
 
     @Override
-    protected GuiceJamesServer createJamesServer() {
-        return new GuiceJamesServer()
+    protected GuiceJmapJamesServer createJamesServer() {
+        return new GuiceJmapJamesServer()
                 .combineWith(MemoryJamesServerMain.inMemoryServerModule)
                 .overrideWith(new TestFilesystemModule(temporaryFolder),
                         new TestJMAPServerModule(GetMessageListMethod.DEFAULT_MAXIMUM_LIMIT));

http://git-wip-us.apache.org/repos/asf/james-project/blob/b9a94026/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/TemporaryJamesServer.java
----------------------------------------------------------------------
diff --git a/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/TemporaryJamesServer.java b/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/TemporaryJamesServer.java
index 531fec4..e440250 100644
--- a/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/TemporaryJamesServer.java
+++ b/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/TemporaryJamesServer.java
@@ -28,7 +28,7 @@ import java.util.Arrays;
 
 import org.apache.commons.configuration.ConfigurationException;
 import org.apache.commons.io.IOUtils;
-import org.apache.james.GuiceJamesServer;
+import org.apache.james.GuiceJmapJamesServer;
 import org.apache.james.MemoryJamesServerMain;
 import org.apache.james.mailets.configuration.MailetContainer;
 import org.apache.james.modules.TestJMAPServerModule;
@@ -44,13 +44,13 @@ public class TemporaryJamesServer {
 
     private static final int LIMIT_TO_3_MESSAGES = 3;
 
-    private final GuiceJamesServer jamesServer;
+    private final GuiceJmapJamesServer jamesServer;
 
 
     public TemporaryJamesServer(TemporaryFolder temporaryFolder, MailetContainer mailetContainer, Module... additionalModules) throws Exception {
         appendMailetConfigurations(temporaryFolder, mailetContainer);
 
-        jamesServer = new GuiceJamesServer()
+        jamesServer = new GuiceJmapJamesServer()
             .combineWith(MemoryJamesServerMain.inMemoryServerModule)
             .overrideWith(ImmutableList.<Module>builder().addAll(Arrays.asList(additionalModules))
                 .add(new TestJMAPServerModule(LIMIT_TO_3_MESSAGES))

http://git-wip-us.apache.org/repos/asf/james-project/blob/b9a94026/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraGetMailboxesMethodTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraGetMailboxesMethodTest.java b/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraGetMailboxesMethodTest.java
index c3caa2c..c9c4207 100644
--- a/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraGetMailboxesMethodTest.java
+++ b/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraGetMailboxesMethodTest.java
@@ -20,7 +20,7 @@
 package org.apache.james.jmap.cassandra;
 
 import org.apache.james.CassandraJamesServerMain;
-import org.apache.james.GuiceJamesServer;
+import org.apache.james.GuiceJmapJamesServer;
 import org.apache.james.backends.cassandra.EmbeddedCassandra;
 import org.apache.james.jmap.methods.integration.GetMailboxesMethodTest;
 import org.apache.james.mailbox.elasticsearch.EmbeddedElasticSearch;
@@ -42,8 +42,8 @@ public class CassandraGetMailboxesMethodTest extends GetMailboxesMethodTest {
         .around(embeddedElasticSearch);
 
     @Override
-    protected GuiceJamesServer createJmapServer() {
-        return new GuiceJamesServer()
+    protected GuiceJmapJamesServer createJmapServer() {
+        return new GuiceJmapJamesServer()
                     .combineWith(CassandraJamesServerMain.cassandraServerModule)
                     .overrideWith(new CassandraJmapServerModule(temporaryFolder, embeddedElasticSearch, cassandra));
     }

http://git-wip-us.apache.org/repos/asf/james-project/blob/b9a94026/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraGetMessageListMethodTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraGetMessageListMethodTest.java b/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraGetMessageListMethodTest.java
index efe5e37..387c801 100644
--- a/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraGetMessageListMethodTest.java
+++ b/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraGetMessageListMethodTest.java
@@ -20,7 +20,7 @@
 package org.apache.james.jmap.cassandra;
 
 import org.apache.james.CassandraJamesServerMain;
-import org.apache.james.GuiceJamesServer;
+import org.apache.james.GuiceJmapJamesServer;
 import org.apache.james.backends.cassandra.EmbeddedCassandra;
 import org.apache.james.jmap.methods.integration.GetMessageListMethodTest;
 import org.apache.james.mailbox.elasticsearch.EmbeddedElasticSearch;
@@ -41,8 +41,8 @@ public class CassandraGetMessageListMethodTest extends GetMessageListMethodTest
         .around(embeddedElasticSearch);
     
     @Override
-    protected GuiceJamesServer createJmapServer() {
-        return new GuiceJamesServer()
+    protected GuiceJmapJamesServer createJmapServer() {
+        return new GuiceJmapJamesServer()
                 .combineWith(CassandraJamesServerMain.cassandraServerModule)
                 .overrideWith(new CassandraJmapServerModule(temporaryFolder, embeddedElasticSearch, cassandra));
     }

http://git-wip-us.apache.org/repos/asf/james-project/blob/b9a94026/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraGetVacationResponseTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraGetVacationResponseTest.java b/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraGetVacationResponseTest.java
index 66f1687..3aeca25 100644
--- a/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraGetVacationResponseTest.java
+++ b/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraGetVacationResponseTest.java
@@ -20,7 +20,7 @@
 package org.apache.james.jmap.cassandra;
 
 import org.apache.james.CassandraJamesServerMain;
-import org.apache.james.GuiceJamesServer;
+import org.apache.james.GuiceJmapJamesServer;
 import org.apache.james.backends.cassandra.EmbeddedCassandra;
 import org.apache.james.jmap.methods.integration.GetVacationResponseTest;
 import org.apache.james.mailbox.elasticsearch.EmbeddedElasticSearch;
@@ -42,8 +42,8 @@ public class CassandraGetVacationResponseTest extends GetVacationResponseTest {
         .around(embeddedElasticSearch);
 
     @Override
-    protected GuiceJamesServer createJmapServer(ZonedDateTimeProvider zonedDateTimeProvider) {
-        return new GuiceJamesServer()
+    protected GuiceJmapJamesServer createJmapServer(ZonedDateTimeProvider zonedDateTimeProvider) {
+        return new GuiceJmapJamesServer()
                     .combineWith(CassandraJamesServerMain.cassandraServerModule)
                     .overrideWith(new CassandraJmapServerModule(temporaryFolder, embeddedElasticSearch, cassandra),
                         binder -> binder.bind(ZonedDateTimeProvider.class).toInstance(zonedDateTimeProvider));

http://git-wip-us.apache.org/repos/asf/james-project/blob/b9a94026/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraJmapAuthenticationTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraJmapAuthenticationTest.java b/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraJmapAuthenticationTest.java
index 790fe30..510876c 100644
--- a/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraJmapAuthenticationTest.java
+++ b/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraJmapAuthenticationTest.java
@@ -19,7 +19,7 @@
 package org.apache.james.jmap.cassandra;
 
 import org.apache.james.CassandraJamesServerMain;
-import org.apache.james.GuiceJamesServer;
+import org.apache.james.GuiceJmapJamesServer;
 import org.apache.james.backends.cassandra.EmbeddedCassandra;
 import org.apache.james.jmap.FixedDateZonedDateTimeProvider;
 import org.apache.james.jmap.JMAPAuthenticationTest;
@@ -42,8 +42,8 @@ public class CassandraJmapAuthenticationTest extends JMAPAuthenticationTest {
         .around(embeddedElasticSearch);
 
     @Override
-    protected GuiceJamesServer createJmapServer(FixedDateZonedDateTimeProvider zonedDateTimeProvider) {
-        return new GuiceJamesServer()
+    protected GuiceJmapJamesServer createJmapServer(FixedDateZonedDateTimeProvider zonedDateTimeProvider) {
+        return new GuiceJmapJamesServer()
                     .combineWith(CassandraJamesServerMain.cassandraServerModule)
                     .overrideWith(new CassandraJmapServerModule(temporaryFolder, embeddedElasticSearch, cassandra),
                             (binder) -> binder.bind(ZonedDateTimeProvider.class).toInstance(zonedDateTimeProvider));

http://git-wip-us.apache.org/repos/asf/james-project/blob/b9a94026/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraSetMailboxesMethodTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraSetMailboxesMethodTest.java b/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraSetMailboxesMethodTest.java
index e6ffe4f..443f48b 100644
--- a/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraSetMailboxesMethodTest.java
+++ b/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraSetMailboxesMethodTest.java
@@ -20,7 +20,7 @@
 package org.apache.james.jmap.cassandra;
 
 import org.apache.james.CassandraJamesServerMain;
-import org.apache.james.GuiceJamesServer;
+import org.apache.james.GuiceJmapJamesServer;
 import org.apache.james.backends.cassandra.EmbeddedCassandra;
 import org.apache.james.jmap.methods.integration.SetMailboxesMethodTest;
 import org.apache.james.mailbox.elasticsearch.EmbeddedElasticSearch;
@@ -41,8 +41,8 @@ public class CassandraSetMailboxesMethodTest extends SetMailboxesMethodTest {
         .around(embeddedElasticSearch);
 
     @Override
-    protected GuiceJamesServer createJmapServer() {
-        return new GuiceJamesServer()
+    protected GuiceJmapJamesServer createJmapServer() {
+        return new GuiceJmapJamesServer()
                     .combineWith(CassandraJamesServerMain.cassandraServerModule)
                     .overrideWith(new CassandraJmapServerModule(temporaryFolder, embeddedElasticSearch, cassandra));
     }

http://git-wip-us.apache.org/repos/asf/james-project/blob/b9a94026/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraSetMessagesMethodTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraSetMessagesMethodTest.java b/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraSetMessagesMethodTest.java
index 446d41a..a244fa3 100644
--- a/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraSetMessagesMethodTest.java
+++ b/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraSetMessagesMethodTest.java
@@ -20,7 +20,7 @@
 package org.apache.james.jmap.cassandra;
 
 import org.apache.james.CassandraJamesServerMain;
-import org.apache.james.GuiceJamesServer;
+import org.apache.james.GuiceJmapJamesServer;
 import org.apache.james.backends.cassandra.EmbeddedCassandra;
 import org.apache.james.jmap.methods.integration.SetMessagesMethodTest;
 import org.apache.james.mailbox.elasticsearch.EmbeddedElasticSearch;
@@ -41,8 +41,8 @@ public class CassandraSetMessagesMethodTest extends SetMessagesMethodTest {
         .around(embeddedElasticSearch);
 
     @Override
-    protected GuiceJamesServer createJmapServer() {
-        return new GuiceJamesServer()
+    protected GuiceJmapJamesServer createJmapServer() {
+        return new GuiceJmapJamesServer()
                     .combineWith(CassandraJamesServerMain.cassandraServerModule)
                     .overrideWith(new CassandraJmapServerModule(temporaryFolder, embeddedElasticSearch, cassandra));
     }

http://git-wip-us.apache.org/repos/asf/james-project/blob/b9a94026/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraSetVacationResponseTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraSetVacationResponseTest.java b/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraSetVacationResponseTest.java
index e4efd42..7bb2370 100644
--- a/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraSetVacationResponseTest.java
+++ b/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraSetVacationResponseTest.java
@@ -20,7 +20,7 @@
 package org.apache.james.jmap.cassandra;
 
 import org.apache.james.CassandraJamesServerMain;
-import org.apache.james.GuiceJamesServer;
+import org.apache.james.GuiceJmapJamesServer;
 import org.apache.james.backends.cassandra.EmbeddedCassandra;
 import org.apache.james.jmap.methods.integration.SetVacationResponseTest;
 import org.apache.james.mailbox.elasticsearch.EmbeddedElasticSearch;
@@ -41,8 +41,8 @@ public class CassandraSetVacationResponseTest extends SetVacationResponseTest {
         .around(embeddedElasticSearch);
 
     @Override
-    protected GuiceJamesServer createJmapServer() {
-        return new GuiceJamesServer()
+    protected GuiceJmapJamesServer createJmapServer() {
+        return new GuiceJmapJamesServer()
                     .combineWith(CassandraJamesServerMain.cassandraServerModule)
                     .overrideWith(new CassandraJmapServerModule(temporaryFolder, embeddedElasticSearch, cassandra));
     }

http://git-wip-us.apache.org/repos/asf/james-project/blob/b9a94026/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraVacationIntegrationTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraVacationIntegrationTest.java b/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraVacationIntegrationTest.java
index b5a383d..1540198 100644
--- a/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraVacationIntegrationTest.java
+++ b/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraVacationIntegrationTest.java
@@ -20,7 +20,7 @@
 package org.apache.james.jmap.cassandra;
 
 import org.apache.james.CassandraJamesServerMain;
-import org.apache.james.GuiceJamesServer;
+import org.apache.james.GuiceJmapJamesServer;
 import org.apache.james.backends.cassandra.EmbeddedCassandra;
 import org.apache.james.jmap.VacationIntegrationTest;
 import org.apache.james.mailbox.elasticsearch.EmbeddedElasticSearch;
@@ -42,8 +42,8 @@ public class CassandraVacationIntegrationTest extends VacationIntegrationTest {
         .around(embeddedElasticSearch);
 
     @Override
-    protected GuiceJamesServer createJmapServer() {
-        return new GuiceJamesServer()
+    protected GuiceJmapJamesServer createJmapServer() {
+        return new GuiceJmapJamesServer()
             .combineWith(CassandraJamesServerMain.cassandraServerModule)
             .overrideWith(new CassandraJmapServerModule(temporaryFolder, embeddedElasticSearch, cassandra));
     }

http://git-wip-us.apache.org/repos/asf/james-project/blob/b9a94026/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 0ba38d1..322f781 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
@@ -24,7 +24,7 @@ import java.util.Arrays;
 import javax.inject.Inject;
 
 import org.apache.james.CassandraJamesServerMain;
-import org.apache.james.GuiceJamesServer;
+import org.apache.james.GuiceJmapJamesServer;
 import org.apache.james.backends.cassandra.EmbeddedCassandra;
 import org.apache.james.jmap.methods.integration.cucumber.MainStepdefs;
 import org.apache.james.mailbox.elasticsearch.EmbeddedElasticSearch;
@@ -54,7 +54,7 @@ public class CassandraStepdefs {
     public void init() throws Exception {
         temporaryFolder.create();
         embeddedElasticSearch.before();
-        mainStepdefs.jmapServer = new GuiceJamesServer()
+        mainStepdefs.jmapServer = new GuiceJmapJamesServer()
                 .combineWith(CassandraJamesServerMain.cassandraServerModule)
                 .overrideWith(new CassandraJmapServerModule(temporaryFolder, embeddedElasticSearch, cassandra));
         mainStepdefs.awaitMethod = () -> embeddedElasticSearch.awaitForElasticSearch();

http://git-wip-us.apache.org/repos/asf/james-project/blob/b9a94026/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/JMAPAuthenticationTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/JMAPAuthenticationTest.java b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/JMAPAuthenticationTest.java
index 12e6a1a..7fd0c4a 100644
--- a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/JMAPAuthenticationTest.java
+++ b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/JMAPAuthenticationTest.java
@@ -32,7 +32,7 @@ import java.time.ZonedDateTime;
 import java.time.format.DateTimeFormatter;
 import java.util.UUID;
 
-import org.apache.james.GuiceJamesServer;
+import org.apache.james.GuiceJmapJamesServer;
 import org.apache.james.jmap.model.ContinuationToken;
 import org.junit.After;
 import org.junit.Before;
@@ -49,11 +49,11 @@ public abstract class JMAPAuthenticationTest {
     private static final ZonedDateTime newDate = ZonedDateTime.parse("2011-12-03T10:16:30+01:00", DateTimeFormatter.ISO_OFFSET_DATE_TIME);
     private static final ZonedDateTime afterExpirationDate = ZonedDateTime.parse("2011-12-03T10:30:31+01:00", DateTimeFormatter.ISO_OFFSET_DATE_TIME);
 
-    protected abstract GuiceJamesServer createJmapServer(FixedDateZonedDateTimeProvider zonedDateTimeProvider);
+    protected abstract GuiceJmapJamesServer createJmapServer(FixedDateZonedDateTimeProvider zonedDateTimeProvider);
 
     private UserCredentials userCredentials;
     private FixedDateZonedDateTimeProvider zonedDateTimeProvider;
-    private GuiceJamesServer jmapServer;
+    private GuiceJmapJamesServer jmapServer;
 
     @Before
     public void setup() throws Throwable {

http://git-wip-us.apache.org/repos/asf/james-project/blob/b9a94026/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/VacationIntegrationTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/VacationIntegrationTest.java b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/VacationIntegrationTest.java
index 653bfe0..927885c 100644
--- a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/VacationIntegrationTest.java
+++ b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/VacationIntegrationTest.java
@@ -31,7 +31,7 @@ import java.util.List;
 import java.util.Map;
 import java.util.concurrent.TimeUnit;
 
-import org.apache.james.GuiceJamesServer;
+import org.apache.james.GuiceJmapJamesServer;
 import org.apache.james.jmap.api.access.AccessToken;
 import org.apache.james.jmap.api.vacation.AccountId;
 import org.apache.james.jmap.api.vacation.VacationPatch;
@@ -62,9 +62,9 @@ public abstract class VacationIntegrationTest {
     public static final String ORIGINAL_MESSAGE_TEXT_BODY = "Hello someone, and thank you for joining example.com!";
 
     private ConditionFactory calmlyAwait;
-    private GuiceJamesServer guiceJamesServer;
+    private GuiceJmapJamesServer guiceJamesServer;
 
-    protected abstract GuiceJamesServer createJmapServer();
+    protected abstract GuiceJmapJamesServer createJmapServer();
 
     protected abstract void await();
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/b9a94026/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetMailboxesMethodTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetMailboxesMethodTest.java b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetMailboxesMethodTest.java
index d77362b..53cd799 100644
--- a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetMailboxesMethodTest.java
+++ b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetMailboxesMethodTest.java
@@ -35,7 +35,7 @@ import java.util.Date;
 
 import javax.mail.Flags;
 
-import org.apache.james.GuiceJamesServer;
+import org.apache.james.GuiceJmapJamesServer;
 import org.apache.james.jmap.JmapAuthentication;
 import org.apache.james.jmap.api.access.AccessToken;
 import org.apache.james.mailbox.model.MailboxConstants;
@@ -54,11 +54,11 @@ public abstract class GetMailboxesMethodTest {
     private static final String NAME = "[0][0]";
     private static final String ARGUMENTS = "[0][1]";
 
-    protected abstract GuiceJamesServer createJmapServer();
+    protected abstract GuiceJmapJamesServer createJmapServer();
 
     private AccessToken accessToken;
     private String username;
-    private GuiceJamesServer jmapServer;
+    private GuiceJmapJamesServer jmapServer;
 
     @Before
     public void setup() throws Throwable {

http://git-wip-us.apache.org/repos/asf/james-project/blob/b9a94026/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetMessageListMethodTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetMessageListMethodTest.java b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetMessageListMethodTest.java
index b05fc07..69d72c8 100644
--- a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetMessageListMethodTest.java
+++ b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetMessageListMethodTest.java
@@ -36,7 +36,7 @@ import java.util.List;
 
 import javax.mail.Flags;
 
-import org.apache.james.GuiceJamesServer;
+import org.apache.james.GuiceJmapJamesServer;
 import org.apache.james.jmap.JmapAuthentication;
 import org.apache.james.jmap.api.access.AccessToken;
 import org.apache.james.mailbox.model.MailboxConstants;
@@ -56,14 +56,14 @@ public abstract class GetMessageListMethodTest {
     private static final String NAME = "[0][0]";
     private static final String ARGUMENTS = "[0][1]";
 
-    protected abstract GuiceJamesServer createJmapServer();
+    protected abstract GuiceJmapJamesServer createJmapServer();
 
     protected abstract void await();
 
     private AccessToken accessToken;
     private String username;
     private String domain;
-    private GuiceJamesServer jmapServer;
+    private GuiceJmapJamesServer jmapServer;
 
     @Before
     public void setup() throws Throwable {

http://git-wip-us.apache.org/repos/asf/james-project/blob/b9a94026/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetVacationResponseTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetVacationResponseTest.java b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetVacationResponseTest.java
index a6f5604..8fce0ee 100644
--- a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetVacationResponseTest.java
+++ b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetVacationResponseTest.java
@@ -28,7 +28,7 @@ import static org.hamcrest.core.IsNull.nullValue;
 
 import java.time.ZonedDateTime;
 
-import org.apache.james.GuiceJamesServer;
+import org.apache.james.GuiceJmapJamesServer;
 import org.apache.james.jmap.FixedDateZonedDateTimeProvider;
 import org.apache.james.jmap.JmapAuthentication;
 import org.apache.james.jmap.api.access.AccessToken;
@@ -56,12 +56,12 @@ public abstract class GetVacationResponseTest {
     public static final ZonedDateTime DATE_2014 = ZonedDateTime.parse("2014-09-30T14:10:00+02:00");
     public static final ZonedDateTime DATE_2016 = ZonedDateTime.parse("2016-04-15T11:56:32.224+07:00[Asia/Vientiane]");
 
-    protected abstract GuiceJamesServer createJmapServer(ZonedDateTimeProvider zonedDateTimeProvider);
+    protected abstract GuiceJmapJamesServer createJmapServer(ZonedDateTimeProvider zonedDateTimeProvider);
 
     protected abstract void await();
 
     private AccessToken accessToken;
-    private GuiceJamesServer jmapServer;
+    private GuiceJmapJamesServer jmapServer;
     private FixedDateZonedDateTimeProvider fixedDateZonedDateTimeProvider;
 
     @Before

http://git-wip-us.apache.org/repos/asf/james-project/blob/b9a94026/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/SetMailboxesMethodTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/SetMailboxesMethodTest.java b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/SetMailboxesMethodTest.java
index 29fffdc..ba0b30e 100644
--- a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/SetMailboxesMethodTest.java
+++ b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/SetMailboxesMethodTest.java
@@ -36,7 +36,7 @@ import static org.hamcrest.Matchers.not;
 import static org.hamcrest.Matchers.nullValue;
 import static org.hamcrest.collection.IsMapWithSize.aMapWithSize;
 
-import org.apache.james.GuiceJamesServer;
+import org.apache.james.GuiceJmapJamesServer;
 import org.apache.james.jmap.JmapAuthentication;
 import org.apache.james.jmap.api.access.AccessToken;
 import org.apache.james.mailbox.model.MailboxConstants;
@@ -58,13 +58,13 @@ public abstract class SetMailboxesMethodTest {
     private static final String ARGUMENTS = "[0][1]";
     private static final String USERS_DOMAIN = "domain.tld";
 
-    protected abstract GuiceJamesServer createJmapServer();
+    protected abstract GuiceJmapJamesServer createJmapServer();
 
     protected abstract void await();
 
     private AccessToken accessToken;
     private String username;
-    private GuiceJamesServer jmapServer;
+    private GuiceJmapJamesServer jmapServer;
 
     @Before
     public void setup() throws Throwable {

http://git-wip-us.apache.org/repos/asf/james-project/blob/b9a94026/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/SetMessagesMethodTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/SetMessagesMethodTest.java b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/SetMessagesMethodTest.java
index ba864b1..959ed44 100644
--- a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/SetMessagesMethodTest.java
+++ b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/SetMessagesMethodTest.java
@@ -50,7 +50,7 @@ import javax.mail.Flags;
 
 import com.google.common.collect.ImmutableList;
 import org.apache.commons.io.IOUtils;
-import org.apache.james.GuiceJamesServer;
+import org.apache.james.GuiceJmapJamesServer;
 import org.apache.james.jmap.JmapAuthentication;
 import org.apache.james.jmap.api.access.AccessToken;
 import org.apache.james.jmap.model.mailbox.Role;
@@ -90,13 +90,13 @@ public abstract class SetMessagesMethodTest {
 
     private ConditionFactory calmlyAwait;
 
-    protected abstract GuiceJamesServer createJmapServer();
+    protected abstract GuiceJmapJamesServer createJmapServer();
 
     protected abstract void await();
 
     private AccessToken accessToken;
     private String username;
-    private GuiceJamesServer jmapServer;
+    private GuiceJmapJamesServer jmapServer;
 
     @Before
     public void setup() throws Throwable {

http://git-wip-us.apache.org/repos/asf/james-project/blob/b9a94026/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/SetVacationResponseTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/SetVacationResponseTest.java b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/SetVacationResponseTest.java
index 2e90360..23a35e9 100644
--- a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/SetVacationResponseTest.java
+++ b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/SetVacationResponseTest.java
@@ -28,7 +28,7 @@ import static org.hamcrest.Matchers.equalTo;
 import java.time.ZonedDateTime;
 import java.util.Optional;
 
-import org.apache.james.GuiceJamesServer;
+import org.apache.james.GuiceJmapJamesServer;
 import org.apache.james.jmap.JmapAuthentication;
 import org.apache.james.jmap.api.access.AccessToken;
 import org.apache.james.jmap.api.vacation.AccountId;
@@ -53,12 +53,12 @@ public abstract class SetVacationResponseTest {
     public static final String PASSWORD = "password";
     public static final String SUBJECT = "subject";
 
-    protected abstract GuiceJamesServer createJmapServer();
+    protected abstract GuiceJmapJamesServer createJmapServer();
 
     protected abstract void await();
 
     private AccessToken accessToken;
-    private GuiceJamesServer jmapServer;
+    private GuiceJmapJamesServer jmapServer;
 
     @Before
     public void setup() throws Throwable {

http://git-wip-us.apache.org/repos/asf/james-project/blob/b9a94026/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/MainStepdefs.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/MainStepdefs.java b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/MainStepdefs.java
index ed36491..3d91cf2 100644
--- a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/MainStepdefs.java
+++ b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/MainStepdefs.java
@@ -20,7 +20,7 @@
 package org.apache.james.jmap.methods.integration.cucumber;
 
 import org.apache.http.client.utils.URIBuilder;
-import org.apache.james.GuiceJamesServer;
+import org.apache.james.GuiceJmapJamesServer;
 
 import com.google.common.base.Charsets;
 
@@ -29,7 +29,7 @@ import cucumber.runtime.java.guice.ScenarioScoped;
 @ScenarioScoped
 public class MainStepdefs {
 
-    public GuiceJamesServer jmapServer;
+    public GuiceJmapJamesServer jmapServer;
     public Runnable awaitMethod = () -> {};
 
     public void init() throws Exception {

http://git-wip-us.apache.org/repos/asf/james-project/blob/b9a94026/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/MemoryGetMailboxesMethodTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/MemoryGetMailboxesMethodTest.java b/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/MemoryGetMailboxesMethodTest.java
index b929d53..f352177 100644
--- a/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/MemoryGetMailboxesMethodTest.java
+++ b/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/MemoryGetMailboxesMethodTest.java
@@ -19,7 +19,7 @@
 
 package org.apache.james.jmap.memory;
 
-import org.apache.james.GuiceJamesServer;
+import org.apache.james.GuiceJmapJamesServer;
 import org.apache.james.MemoryJamesServerMain;
 import org.apache.james.jmap.methods.integration.GetMailboxesMethodTest;
 import org.apache.james.jmap.servers.MemoryJmapServerModule;
@@ -32,8 +32,8 @@ public class MemoryGetMailboxesMethodTest extends GetMailboxesMethodTest {
     public TemporaryFolder temporaryFolder = new TemporaryFolder();
 
     @Override
-    protected GuiceJamesServer createJmapServer() {
-        return new GuiceJamesServer()
+    protected GuiceJmapJamesServer createJmapServer() {
+        return new GuiceJmapJamesServer()
                 .combineWith(MemoryJamesServerMain.inMemoryServerModule)
                 .overrideWith(new MemoryJmapServerModule(temporaryFolder));
     }

http://git-wip-us.apache.org/repos/asf/james-project/blob/b9a94026/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/MemoryGetMessageListMethodTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/MemoryGetMessageListMethodTest.java b/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/MemoryGetMessageListMethodTest.java
index 10991ad..3c22d03 100644
--- a/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/MemoryGetMessageListMethodTest.java
+++ b/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/MemoryGetMessageListMethodTest.java
@@ -19,7 +19,7 @@
 
 package org.apache.james.jmap.memory;
 
-import org.apache.james.GuiceJamesServer;
+import org.apache.james.GuiceJmapJamesServer;
 import org.apache.james.MemoryJamesServerMain;
 import org.apache.james.jmap.methods.integration.GetMessageListMethodTest;
 import org.apache.james.jmap.servers.MemoryJmapServerModule;
@@ -32,8 +32,8 @@ public class MemoryGetMessageListMethodTest extends GetMessageListMethodTest {
     public TemporaryFolder temporaryFolder = new TemporaryFolder();
 
     @Override
-    protected GuiceJamesServer createJmapServer() {
-        return new GuiceJamesServer()
+    protected GuiceJmapJamesServer createJmapServer() {
+        return new GuiceJmapJamesServer()
                     .combineWith(MemoryJamesServerMain.inMemoryServerModule)
                     .overrideWith(new MemoryJmapServerModule(temporaryFolder));
     }

http://git-wip-us.apache.org/repos/asf/james-project/blob/b9a94026/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/MemoryGetVacationResponseMethodTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/MemoryGetVacationResponseMethodTest.java b/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/MemoryGetVacationResponseMethodTest.java
index c2c3a92..14bdfbf 100644
--- a/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/MemoryGetVacationResponseMethodTest.java
+++ b/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/MemoryGetVacationResponseMethodTest.java
@@ -19,7 +19,7 @@
 
 package org.apache.james.jmap.memory;
 
-import org.apache.james.GuiceJamesServer;
+import org.apache.james.GuiceJmapJamesServer;
 import org.apache.james.MemoryJamesServerMain;
 import org.apache.james.jmap.methods.integration.GetVacationResponseTest;
 import org.apache.james.jmap.servers.MemoryJmapServerModule;
@@ -33,8 +33,8 @@ public class MemoryGetVacationResponseMethodTest extends GetVacationResponseTest
     public TemporaryFolder temporaryFolder = new TemporaryFolder();
 
     @Override
-    protected GuiceJamesServer createJmapServer(ZonedDateTimeProvider zonedDateTimeProvider) {
-        return new GuiceJamesServer()
+    protected GuiceJmapJamesServer createJmapServer(ZonedDateTimeProvider zonedDateTimeProvider) {
+        return new GuiceJmapJamesServer()
                     .combineWith(MemoryJamesServerMain.inMemoryServerModule)
                     .overrideWith(new MemoryJmapServerModule(temporaryFolder),
                         binder -> binder.bind(ZonedDateTimeProvider.class).toInstance(zonedDateTimeProvider));

http://git-wip-us.apache.org/repos/asf/james-project/blob/b9a94026/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/MemoryJmapAuthenticationTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/MemoryJmapAuthenticationTest.java b/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/MemoryJmapAuthenticationTest.java
index b66eb89..50880f0 100644
--- a/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/MemoryJmapAuthenticationTest.java
+++ b/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/MemoryJmapAuthenticationTest.java
@@ -19,7 +19,7 @@
 
 package org.apache.james.jmap.memory;
 
-import org.apache.james.GuiceJamesServer;
+import org.apache.james.GuiceJmapJamesServer;
 import org.apache.james.MemoryJamesServerMain;
 import org.apache.james.jmap.FixedDateZonedDateTimeProvider;
 import org.apache.james.jmap.JMAPAuthenticationTest;
@@ -34,8 +34,8 @@ public class MemoryJmapAuthenticationTest extends JMAPAuthenticationTest {
     public TemporaryFolder temporaryFolder = new TemporaryFolder();
 
     @Override
-    protected GuiceJamesServer createJmapServer(FixedDateZonedDateTimeProvider zonedDateTimeProvider) {
-        return new GuiceJamesServer()
+    protected GuiceJmapJamesServer createJmapServer(FixedDateZonedDateTimeProvider zonedDateTimeProvider) {
+        return new GuiceJmapJamesServer()
                 .combineWith(MemoryJamesServerMain.inMemoryServerModule)
                 .overrideWith(new MemoryJmapServerModule(temporaryFolder),
                              (binder) -> binder.bind(ZonedDateTimeProvider.class).toInstance(zonedDateTimeProvider));

http://git-wip-us.apache.org/repos/asf/james-project/blob/b9a94026/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/MemorySetMailboxesMethodTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/MemorySetMailboxesMethodTest.java b/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/MemorySetMailboxesMethodTest.java
index 474a492..c8ebc7a 100644
--- a/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/MemorySetMailboxesMethodTest.java
+++ b/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/MemorySetMailboxesMethodTest.java
@@ -19,7 +19,7 @@
 
 package org.apache.james.jmap.memory;
 
-import org.apache.james.GuiceJamesServer;
+import org.apache.james.GuiceJmapJamesServer;
 import org.apache.james.MemoryJamesServerMain;
 import org.apache.james.jmap.methods.integration.SetMailboxesMethodTest;
 import org.apache.james.jmap.servers.MemoryJmapServerModule;
@@ -32,8 +32,8 @@ public class MemorySetMailboxesMethodTest extends SetMailboxesMethodTest {
     public TemporaryFolder temporaryFolder = new TemporaryFolder();
 
     @Override
-    protected GuiceJamesServer createJmapServer() {
-        return new GuiceJamesServer()
+    protected GuiceJmapJamesServer createJmapServer() {
+        return new GuiceJmapJamesServer()
                     .combineWith(MemoryJamesServerMain.inMemoryServerModule)
                     .overrideWith(new MemoryJmapServerModule(temporaryFolder));
     }

http://git-wip-us.apache.org/repos/asf/james-project/blob/b9a94026/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/MemorySetMessagesMethodTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/MemorySetMessagesMethodTest.java b/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/MemorySetMessagesMethodTest.java
index 2d0b43d..5b5e3d2 100644
--- a/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/MemorySetMessagesMethodTest.java
+++ b/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/MemorySetMessagesMethodTest.java
@@ -19,7 +19,7 @@
 
 package org.apache.james.jmap.memory;
 
-import org.apache.james.GuiceJamesServer;
+import org.apache.james.GuiceJmapJamesServer;
 import org.apache.james.MemoryJamesServerMain;
 import org.apache.james.jmap.methods.integration.SetMessagesMethodTest;
 import org.apache.james.jmap.servers.MemoryJmapServerModule;
@@ -32,8 +32,8 @@ public class MemorySetMessagesMethodTest extends SetMessagesMethodTest {
     public TemporaryFolder temporaryFolder = new TemporaryFolder();
 
     @Override
-    protected GuiceJamesServer createJmapServer() {
-        return new GuiceJamesServer()
+    protected GuiceJmapJamesServer createJmapServer() {
+        return new GuiceJmapJamesServer()
                     .combineWith(MemoryJamesServerMain.inMemoryServerModule)
                     .overrideWith(new MemoryJmapServerModule(temporaryFolder));
     }

http://git-wip-us.apache.org/repos/asf/james-project/blob/b9a94026/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/MemorySetVacationResponseMethodTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/MemorySetVacationResponseMethodTest.java b/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/MemorySetVacationResponseMethodTest.java
index bcd5a85..3524510 100644
--- a/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/MemorySetVacationResponseMethodTest.java
+++ b/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/MemorySetVacationResponseMethodTest.java
@@ -19,7 +19,7 @@
 
 package org.apache.james.jmap.memory;
 
-import org.apache.james.GuiceJamesServer;
+import org.apache.james.GuiceJmapJamesServer;
 import org.apache.james.MemoryJamesServerMain;
 import org.apache.james.jmap.methods.integration.SetVacationResponseTest;
 import org.apache.james.jmap.servers.MemoryJmapServerModule;
@@ -32,8 +32,8 @@ public class MemorySetVacationResponseMethodTest extends SetVacationResponseTest
     public TemporaryFolder temporaryFolder = new TemporaryFolder();
 
     @Override
-    protected GuiceJamesServer createJmapServer() {
-        return new GuiceJamesServer()
+    protected GuiceJmapJamesServer createJmapServer() {
+        return new GuiceJmapJamesServer()
                     .combineWith(MemoryJamesServerMain.inMemoryServerModule)
                     .overrideWith(new MemoryJmapServerModule(temporaryFolder));
     }

http://git-wip-us.apache.org/repos/asf/james-project/blob/b9a94026/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/MemoryVacationIntegrationTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/MemoryVacationIntegrationTest.java b/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/MemoryVacationIntegrationTest.java
index de4eb41..e238e01 100644
--- a/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/MemoryVacationIntegrationTest.java
+++ b/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/MemoryVacationIntegrationTest.java
@@ -19,7 +19,7 @@
 
 package org.apache.james.jmap.memory;
 
-import org.apache.james.GuiceJamesServer;
+import org.apache.james.GuiceJmapJamesServer;
 import org.apache.james.MemoryJamesServerMain;
 import org.apache.james.jmap.VacationIntegrationTest;
 import org.apache.james.jmap.servers.MemoryJmapServerModule;
@@ -32,8 +32,8 @@ public class MemoryVacationIntegrationTest extends VacationIntegrationTest {
     public TemporaryFolder temporaryFolder = new TemporaryFolder();
 
     @Override
-    protected GuiceJamesServer createJmapServer() {
-        return new GuiceJamesServer()
+    protected GuiceJmapJamesServer createJmapServer() {
+        return new GuiceJmapJamesServer()
             .combineWith(MemoryJamesServerMain.inMemoryServerModule)
             .overrideWith(new MemoryJmapServerModule(temporaryFolder));
     }

http://git-wip-us.apache.org/repos/asf/james-project/blob/b9a94026/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/cucumber/MemoryStepdefs.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/cucumber/MemoryStepdefs.java b/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/cucumber/MemoryStepdefs.java
index 2aa16b1..66fe90c 100644
--- a/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/cucumber/MemoryStepdefs.java
+++ b/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/cucumber/MemoryStepdefs.java
@@ -21,7 +21,7 @@ package org.apache.james.jmap.memory.cucumber;
 
 import javax.inject.Inject;
 
-import org.apache.james.GuiceJamesServer;
+import org.apache.james.GuiceJmapJamesServer;
 import org.apache.james.MemoryJamesServerMain;
 import org.apache.james.jmap.methods.integration.cucumber.MainStepdefs;
 import org.apache.james.jmap.servers.MemoryJmapServerModule;
@@ -46,7 +46,7 @@ public class MemoryStepdefs {
     @Before
     public void init() throws Exception {
         temporaryFolder.create();
-        mainStepdefs.jmapServer = new GuiceJamesServer()
+        mainStepdefs.jmapServer = new GuiceJmapJamesServer()
                 .combineWith(MemoryJamesServerMain.inMemoryServerModule)
                 .overrideWith(new MemoryJmapServerModule(temporaryFolder));
         mainStepdefs.init();

http://git-wip-us.apache.org/repos/asf/james-project/blob/b9a94026/server/protocols/webadmin-integration-test/src/test/java/org/apache/james/webadmin/integration/WebAdminServerIntegrationTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/webadmin-integration-test/src/test/java/org/apache/james/webadmin/integration/WebAdminServerIntegrationTest.java b/server/protocols/webadmin-integration-test/src/test/java/org/apache/james/webadmin/integration/WebAdminServerIntegrationTest.java
index 1477090..84ebdb1 100644
--- a/server/protocols/webadmin-integration-test/src/test/java/org/apache/james/webadmin/integration/WebAdminServerIntegrationTest.java
+++ b/server/protocols/webadmin-integration-test/src/test/java/org/apache/james/webadmin/integration/WebAdminServerIntegrationTest.java
@@ -28,7 +28,7 @@ import static org.assertj.core.api.Assertions.assertThat;
 import static org.hamcrest.Matchers.is;
 
 import org.apache.james.CassandraJamesServerMain;
-import org.apache.james.GuiceJamesServer;
+import org.apache.james.GuiceJmapJamesServer;
 import org.apache.james.backends.cassandra.EmbeddedCassandra;
 import org.apache.james.mailbox.elasticsearch.EmbeddedElasticSearch;
 import org.apache.james.modules.CassandraJmapServerModule;
@@ -65,11 +65,11 @@ public class WebAdminServerIntegrationTest {
         .outerRule(temporaryFolder)
         .around(embeddedElasticSearch);
 
-    private GuiceJamesServer guiceJamesServer;
+    private GuiceJmapJamesServer guiceJamesServer;
 
     @Before
     public void setUp() throws Exception {
-        guiceJamesServer = new GuiceJamesServer()
+        guiceJamesServer = new GuiceJmapJamesServer()
             .combineWith(CassandraJamesServerMain.cassandraServerModule)
             .overrideWith(new CassandraJmapServerModule(temporaryFolder, embeddedElasticSearch, cassandra),
                 new WebAdminConfigurationModule());


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


[17/29] james-project git commit: JAMES-1842: Rename ExtendedServerProbe to ExtendedJmapServerProbe

Posted by ad...@apache.org.
JAMES-1842: Rename ExtendedServerProbe to ExtendedJmapServerProbe


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

Branch: refs/heads/master
Commit: 0c37cef36a4ac4d941d09225e755ebcb32fb72c1
Parents: 270a97f
Author: Quynh Nguyen <qn...@linagora.com>
Authored: Fri Oct 28 16:20:28 2016 +0700
Committer: Quynh Nguyen <qn...@linagora.com>
Committed: Fri Nov 18 09:25:34 2016 +0700

----------------------------------------------------------------------
 .../java/org/apache/james/GuiceJamesServer.java |  4 +-
 .../james/utils/ExtendedJmapServerProbe.java    | 46 ++++++++++++++++++++
 .../apache/james/utils/ExtendedServerProbe.java | 46 --------------------
 .../apache/james/utils/GuiceServerProbe.java    |  4 +-
 .../james/mailets/TemporaryJamesServer.java     |  4 +-
 5 files changed, 52 insertions(+), 52 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/0c37cef3/server/container/guice/guice-common/src/main/java/org/apache/james/GuiceJamesServer.java
----------------------------------------------------------------------
diff --git a/server/container/guice/guice-common/src/main/java/org/apache/james/GuiceJamesServer.java b/server/container/guice/guice-common/src/main/java/org/apache/james/GuiceJamesServer.java
index b3dc728..e9ce3f6 100644
--- a/server/container/guice/guice-common/src/main/java/org/apache/james/GuiceJamesServer.java
+++ b/server/container/guice/guice-common/src/main/java/org/apache/james/GuiceJamesServer.java
@@ -29,7 +29,7 @@ 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.ExtendedServerProbe;
+import org.apache.james.utils.ExtendedJmapServerProbe;
 import org.apache.james.utils.GuiceServerProbe;
 import org.apache.james.webadmin.Port;
 import org.apache.james.webadmin.WebAdminServer;
@@ -100,7 +100,7 @@ public class GuiceJamesServer {
         }
     }
 
-    public ExtendedServerProbe serverProbe() {
+    public ExtendedJmapServerProbe serverProbe() {
         return serverProbe;
     }
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/0c37cef3/server/container/guice/guice-common/src/main/java/org/apache/james/utils/ExtendedJmapServerProbe.java
----------------------------------------------------------------------
diff --git a/server/container/guice/guice-common/src/main/java/org/apache/james/utils/ExtendedJmapServerProbe.java b/server/container/guice/guice-common/src/main/java/org/apache/james/utils/ExtendedJmapServerProbe.java
new file mode 100644
index 0000000..415dfcc
--- /dev/null
+++ b/server/container/guice/guice-common/src/main/java/org/apache/james/utils/ExtendedJmapServerProbe.java
@@ -0,0 +1,46 @@
+/****************************************************************
+ * 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.utils;
+
+import java.io.InputStream;
+import java.util.Date;
+
+import javax.mail.Flags;
+
+import org.apache.james.cli.probe.ServerProbe;
+import org.apache.james.jmap.api.vacation.AccountId;
+import org.apache.james.jmap.api.vacation.Vacation;
+import org.apache.james.jmap.api.vacation.VacationPatch;
+import org.apache.james.mailbox.exception.BadCredentialsException;
+import org.apache.james.mailbox.exception.MailboxException;
+import org.apache.james.mailbox.model.MailboxPath;
+import org.apache.james.mailbox.store.mail.model.Mailbox;
+
+public interface ExtendedJmapServerProbe extends ServerProbe {
+
+    void appendMessage(String username, MailboxPath mailboxPath, InputStream message, Date internalDate, boolean isRecent, Flags flags) 
+            throws BadCredentialsException, MailboxException;
+
+    Mailbox getMailbox(String namespace, String user, String name);
+
+    void modifyVacation(AccountId accountId, VacationPatch vacationPatch);
+
+    Vacation retrieveVacation(AccountId accountId);
+}

http://git-wip-us.apache.org/repos/asf/james-project/blob/0c37cef3/server/container/guice/guice-common/src/main/java/org/apache/james/utils/ExtendedServerProbe.java
----------------------------------------------------------------------
diff --git a/server/container/guice/guice-common/src/main/java/org/apache/james/utils/ExtendedServerProbe.java b/server/container/guice/guice-common/src/main/java/org/apache/james/utils/ExtendedServerProbe.java
deleted file mode 100644
index 4120abe..0000000
--- a/server/container/guice/guice-common/src/main/java/org/apache/james/utils/ExtendedServerProbe.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.utils;
-
-import java.io.InputStream;
-import java.util.Date;
-
-import javax.mail.Flags;
-
-import org.apache.james.cli.probe.ServerProbe;
-import org.apache.james.jmap.api.vacation.AccountId;
-import org.apache.james.jmap.api.vacation.Vacation;
-import org.apache.james.jmap.api.vacation.VacationPatch;
-import org.apache.james.mailbox.exception.BadCredentialsException;
-import org.apache.james.mailbox.exception.MailboxException;
-import org.apache.james.mailbox.model.MailboxPath;
-import org.apache.james.mailbox.store.mail.model.Mailbox;
-
-public interface ExtendedServerProbe extends ServerProbe {
-
-    void appendMessage(String username, MailboxPath mailboxPath, InputStream message, Date internalDate, boolean isRecent, Flags flags) 
-            throws BadCredentialsException, MailboxException;
-
-    Mailbox getMailbox(String namespace, String user, String name);
-
-    void modifyVacation(AccountId accountId, VacationPatch vacationPatch);
-
-    Vacation retrieveVacation(AccountId accountId);
-}

http://git-wip-us.apache.org/repos/asf/james-project/blob/0c37cef3/server/container/guice/guice-common/src/main/java/org/apache/james/utils/GuiceServerProbe.java
----------------------------------------------------------------------
diff --git a/server/container/guice/guice-common/src/main/java/org/apache/james/utils/GuiceServerProbe.java b/server/container/guice/guice-common/src/main/java/org/apache/james/utils/GuiceServerProbe.java
index 4b313cc..cbc7f81 100644
--- a/server/container/guice/guice-common/src/main/java/org/apache/james/utils/GuiceServerProbe.java
+++ b/server/container/guice/guice-common/src/main/java/org/apache/james/utils/GuiceServerProbe.java
@@ -35,8 +35,8 @@ import org.apache.james.adapter.mailbox.SerializableQuota;
 import org.apache.james.domainlist.api.DomainList;
 import org.apache.james.jmap.api.vacation.AccountId;
 import org.apache.james.jmap.api.vacation.Vacation;
-import org.apache.james.jmap.api.vacation.VacationRepository;
 import org.apache.james.jmap.api.vacation.VacationPatch;
+import org.apache.james.jmap.api.vacation.VacationRepository;
 import org.apache.james.mailbox.MailboxManager;
 import org.apache.james.mailbox.MailboxSession;
 import org.apache.james.mailbox.MessageManager;
@@ -59,7 +59,7 @@ import com.google.common.base.Throwables;
 import com.google.common.collect.ImmutableList;
 import com.google.common.collect.Iterables;
 
-public class GuiceServerProbe implements ExtendedServerProbe {
+public class GuiceServerProbe implements ExtendedJmapServerProbe {
 
     private static final Logger LOGGER = LoggerFactory.getLogger(GuiceServerProbe.class);
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/0c37cef3/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/TemporaryJamesServer.java
----------------------------------------------------------------------
diff --git a/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/TemporaryJamesServer.java b/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/TemporaryJamesServer.java
index 2dd1c87..531fec4 100644
--- a/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/TemporaryJamesServer.java
+++ b/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/TemporaryJamesServer.java
@@ -32,7 +32,7 @@ import org.apache.james.GuiceJamesServer;
 import org.apache.james.MemoryJamesServerMain;
 import org.apache.james.mailets.configuration.MailetContainer;
 import org.apache.james.modules.TestJMAPServerModule;
-import org.apache.james.utils.ExtendedServerProbe;
+import org.apache.james.utils.ExtendedJmapServerProbe;
 import org.junit.rules.TemporaryFolder;
 
 import com.google.common.collect.ImmutableList;
@@ -76,7 +76,7 @@ public class TemporaryJamesServer {
         jamesServer.stop();
     }
 
-    public ExtendedServerProbe getServerProbe() {
+    public ExtendedJmapServerProbe getServerProbe() {
         return jamesServer.serverProbe();
     }
 }


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


[29/29] james-project git commit: Merge remote-tracking branch 'quynhn/JPA_Guice'

Posted by ad...@apache.org.
Merge remote-tracking branch 'quynhn/JPA_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/56acfd06
Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/56acfd06
Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/56acfd06

Branch: refs/heads/master
Commit: 56acfd067a5600c3403bbe8a14cbd91b945ba71a
Parents: 73a7c46 fd3c439
Author: Antoine Duprat <ad...@apache.org>
Authored: Fri Nov 18 10:53:22 2016 +0100
Committer: Antoine Duprat <ad...@apache.org>
Committed: Fri Nov 18 10:53:22 2016 +0100

----------------------------------------------------------------------
 dockerfiles/compilation/java-8/compile.sh       |   4 +-
 .../META-INF/spring/mailbox-cassandra.xml       |   4 +-
 .../org/apache/james/mailbox/jpa/JPAId.java     |   2 +-
 .../jpa/JPAMailboxSessionMapperFactory.java     |   2 +
 .../mailbox/jpa/JPASubscriptionManager.java     |   3 +
 .../mailbox/jpa/mail/JPAModSeqProvider.java     |   2 +
 .../james/mailbox/jpa/mail/JPAUidProvider.java  |   2 +
 .../jpa/openjpa/OpenJPAMailboxManager.java      |   3 +
 .../resources/META-INF/spring/mailbox-jpa.xml   |  12 +-
 .../lucene/search/LuceneMessageSearchIndex.java |   3 +-
 .../META-INF/spring/mailbox-maildir.xml         |   4 +-
 .../META-INF/spring/mailbox-memory.xml          |   4 +-
 .../META-INF/spring/spring-mailbox.xml          |   3 +-
 .../smtp/host/CassandraJamesSmtpHostSystem.java |   8 +-
 .../filesystem/api/AbstractFileSystemTest.java  |   1 -
 .../sample-configuration/cassandra.properties   |   6 +
 .../sample-configuration/dnsservice.xml         |  29 ++
 .../sample-configuration/domainlist.xml         |  28 ++
 .../elasticsearch.properties                    |  26 ++
 .../sample-configuration/imapserver.xml         |  54 +++
 .../sample-configuration/jmap.properties        |  11 +
 .../sample-configuration/jmx.properties         |  28 ++
 .../sample-configuration/lmtpserver.xml         |  41 +++
 .../sample-configuration/mailetcontainer.xml    | 138 ++++++++
 .../mailrepositorystore.xml                     |  34 ++
 .../sample-configuration/pop3server.xml         |  42 +++
 .../recipientrewritetable.xml                   |  27 ++
 .../sample-configuration/smtpserver.xml         | 105 ++++++
 .../sample-configuration/usersrepository.xml    |  27 ++
 .../org/apache/james/CassandraJamesServer.java  |  58 ++++
 .../apache/james/CassandraJamesServerMain.java  |   4 +-
 .../apache/james/CassandraJamesServerTest.java  |   6 +-
 .../james/JamesCapabilitiesServerTest.java      |   6 +-
 .../sample-configuration/cassandra.properties   |   6 -
 .../sample-configuration/dnsservice.xml         |  29 --
 .../sample-configuration/domainlist.xml         |  28 --
 .../elasticsearch.properties                    |  26 --
 .../sample-configuration/imapserver.xml         |  54 ---
 .../sample-configuration/jcr-repository.xml     |  72 ----
 .../sample-configuration/jmap.properties        |  11 -
 .../sample-configuration/jmx.properties         |  28 --
 .../sample-configuration/lmtpserver.xml         |  41 ---
 .../sample-configuration/mailetcontainer.xml    | 137 --------
 .../mailrepositorystore.xml                     |  34 --
 .../sample-configuration/pop3server.xml         |  42 ---
 .../recipientrewritetable.xml                   |  27 --
 .../sample-configuration/smtpserver.xml         | 105 ------
 .../sample-configuration/usersrepository.xml    |  27 --
 .../java/org/apache/james/GuiceJamesServer.java |  84 +----
 .../org/apache/james/GuiceJamesServerImpl.java  |  88 +++++
 .../java/org/apache/james/JmapJamesServer.java  |  23 ++
 .../main/java/org/apache/james/JmapServer.java  |  26 ++
 .../java/org/apache/james/WebAdminServer.java   |  25 ++
 .../java/org/apache/james/jmap/JMAPModule.java  |  15 -
 .../james/modules/CommonServicesModule.java     |   6 +-
 .../apache/james/modules/ProtocolsModule.java   |   2 -
 .../modules/data/SieveFileRepositoryModule.java |  36 ++
 .../modules/protocols/JMAPServerModule.java     |   3 +
 .../server/CamelMailetContainerModule.java      |  20 ++
 .../modules/server/WebAdminServerModule.java    |   3 +
 .../apache/james/utils/ExtendedServerProbe.java |   6 -
 .../java/org/apache/james/utils/GuiceProbe.java |  22 ++
 .../apache/james/utils/GuiceProbeProvider.java  |  47 +++
 .../apache/james/utils/GuiceServerProbe.java    |  22 +-
 .../org/apache/james/utils/JmapGuiceProbe.java  |  52 +++
 .../apache/james/utils/WebAdminGuiceProbe.java  |  37 +++
 .../apache/james/AbstractJamesServerTest.java   |  29 +-
 .../james/AbstractJmapJamesServerTest.java      | 140 ++++++++
 .../james/jmap/MailetPreconditionTest.java      |   5 +-
 .../james/utils/GuiceProbeProviderTest.java     |  67 ++++
 server/container/guice/jpa-guice/README.adoc    |  40 +++
 server/container/guice/jpa-guice/pom.xml        | 326 +++++++++++++++++++
 .../sample-configuration/dnsservice.xml         |  29 ++
 .../sample-configuration/domainlist.xml         |  28 ++
 .../sample-configuration/imapserver.xml         |  54 +++
 .../james-database.properties                   |  40 +++
 .../sample-configuration/jmx.properties         |  28 ++
 .../sample-configuration/lmtpserver.xml         |  41 +++
 .../sample-configuration/mailetcontainer.xml    | 137 ++++++++
 .../mailrepositorystore.xml                     |  34 ++
 .../sample-configuration/pop3server.xml         |  42 +++
 .../recipientrewritetable.xml                   |  27 ++
 .../sample-configuration/smtpserver.xml         | 105 ++++++
 .../sample-configuration/usersrepository.xml    |  27 ++
 .../java/org/apache/james/JPAConfiguration.java |  66 ++++
 .../org/apache/james/JPAJamesServerMain.java    |  50 +++
 .../james/modules/data/JPADataModule.java       |  32 ++
 .../james/modules/data/JPADomainListModule.java |  77 +++++
 .../data/JPARecipientRewriteTableModule.java    |  78 +++++
 .../modules/data/JPAUsersRepositoryModule.java  |  79 +++++
 .../james/modules/mailbox/JPAMailboxModule.java | 138 ++++++++
 .../mailbox/LuceneSearchMailboxModule.java      |  50 +++
 .../src/main/resources/META-INF/persistence.xml |  45 +++
 .../jpa-guice/src/main/resources/logback.xml    |  22 ++
 .../org/apache/james/JPAJamesServerTest.java    |  44 +++
 .../james/JamesCapabilitiesServerTest.java      |  75 +++++
 .../james/TestJPAConfigurationModule.java       |  48 +++
 .../jpa-guice/src/test/resources/dnsservice.xml |  29 ++
 .../test/resources/fakemailrepositorystore.xml  |  31 ++
 .../jpa-guice/src/test/resources/imapserver.xml |  54 +++
 .../guice/jpa-guice/src/test/resources/keystore | Bin 0 -> 2245 bytes
 .../jpa-guice/src/test/resources/lmtpserver.xml |  41 +++
 .../src/test/resources/mailetcontainer.xml      | 112 +++++++
 .../src/test/resources/mailrepositorystore.xml  |  31 ++
 .../src/test/resources/managesieveserver.xml    |  65 ++++
 .../jpa-guice/src/test/resources/pop3server.xml |  42 +++
 .../jpa-guice/src/test/resources/smtpserver.xml | 105 ++++++
 .../sample-configuration/dnsservice.xml         |  29 ++
 .../sample-configuration/domainlist.xml         |  28 ++
 .../sample-configuration/imapserver.xml         |  54 +++
 .../sample-configuration/jmap.properties        |  11 +
 .../sample-configuration/jmx.properties         |  28 ++
 .../sample-configuration/lmtpserver.xml         |  41 +++
 .../sample-configuration/mailetcontainer.xml    | 137 ++++++++
 .../mailrepositorystore.xml                     |  34 ++
 .../sample-configuration/pop3server.xml         |  42 +++
 .../recipientrewritetable.xml                   |  27 ++
 .../sample-configuration/smtpserver.xml         | 105 ++++++
 .../sample-configuration/usersrepository.xml    |  27 ++
 .../org/apache/james/MemoryJamesServer.java     |  56 ++++
 .../org/apache/james/MemoryJamesServerMain.java |   4 +-
 .../james/modules/data/MemoryDataModule.java    |   7 +-
 .../org/apache/james/MemoryJamesServerTest.java |   6 +-
 server/container/guice/pom.xml                  |   1 +
 .../james/domainlist/jpa/JPADomainList.java     |   2 +
 .../james/rrt/jpa/JPARecipientRewriteTable.java |  28 +-
 .../james/user/jpa/JPAUsersRepository.java      |   2 +
 .../james/mailets/TemporaryJamesServer.java     |  10 +-
 server/pom.xml                                  |   6 +
 .../CassandraGetMailboxesMethodTest.java        |   8 +-
 .../CassandraGetMessageListMethodTest.java      |   8 +-
 .../CassandraGetVacationResponseTest.java       |   8 +-
 .../CassandraJmapAuthenticationTest.java        |   8 +-
 .../CassandraSetMailboxesMethodTest.java        |   8 +-
 .../CassandraSetMessagesMethodTest.java         |   8 +-
 .../CassandraSetVacationResponseTest.java       |   8 +-
 .../CassandraVacationIntegrationTest.java       |   8 +-
 .../cassandra/cucumber/CassandraStepdefs.java   |   4 +-
 .../james/jmap/JMAPAuthenticationTest.java      |  13 +-
 .../james/jmap/VacationIntegrationTest.java     |  18 +-
 .../integration/GetMailboxesMethodTest.java     |  21 +-
 .../integration/GetMessageListMethodTest.java   |  13 +-
 .../integration/GetVacationResponseTest.java    |  33 +-
 .../integration/SetMailboxesMethodTest.java     |  21 +-
 .../integration/SetMessagesMethodTest.java      |  15 +-
 .../integration/SetVacationResponseTest.java    |  40 ++-
 .../integration/cucumber/MainStepdefs.java      |   7 +-
 .../integration/cucumber/UploadStepdefs.java    |   4 +-
 .../memory/MemoryGetMailboxesMethodTest.java    |   8 +-
 .../memory/MemoryGetMessageListMethodTest.java  |   8 +-
 .../MemoryGetVacationResponseMethodTest.java    |   8 +-
 .../memory/MemoryJmapAuthenticationTest.java    |   8 +-
 .../memory/MemorySetMailboxesMethodTest.java    |   8 +-
 .../memory/MemorySetMessagesMethodTest.java     |   8 +-
 .../MemorySetVacationResponseMethodTest.java    |   8 +-
 .../memory/MemoryVacationIntegrationTest.java   |   8 +-
 .../jmap/memory/cucumber/MemoryStepdefs.java    |   4 +-
 .../WebAdminServerIntegrationTest.java          |  11 +-
 158 files changed, 4409 insertions(+), 1032 deletions(-)
----------------------------------------------------------------------



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


[14/29] james-project git commit: JAMES-1842: JPA needs lucene so it should not run exclude-lucene profile

Posted by ad...@apache.org.
JAMES-1842: JPA needs lucene so it should not run exclude-lucene profile


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

Branch: refs/heads/master
Commit: c659fcb1aded8ec1059e8f55c5ab88848f2f2fbd
Parents: 11771d0
Author: Quynh Nguyen <qn...@linagora.com>
Authored: Mon Oct 31 16:45:09 2016 +0700
Committer: Quynh Nguyen <qn...@linagora.com>
Committed: Fri Nov 18 09:25:34 2016 +0700

----------------------------------------------------------------------
 dockerfiles/compilation/java-8/compile.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/c659fcb1/dockerfiles/compilation/java-8/compile.sh
----------------------------------------------------------------------
diff --git a/dockerfiles/compilation/java-8/compile.sh b/dockerfiles/compilation/java-8/compile.sh
index a9f6da2..966f872 100755
--- a/dockerfiles/compilation/java-8/compile.sh
+++ b/dockerfiles/compilation/java-8/compile.sh
@@ -44,9 +44,9 @@ git checkout $SHA1
 # Compilation
 
 if [ "$SKIPTESTS" = "skipTests" ]; then
-   mvn package -DskipTests -Pcassandra,elasticsearch,inmemory,exclude-lucene,with-assembly,with-jetm
+   mvn package -DskipTests -Pcassandra,elasticsearch,inmemory,with-assembly,with-jetm
 else
-   mvn package -Pcassandra,inmemory,elasticsearch,exclude-lucene,with-assembly,with-jetm
+   mvn package -Pcassandra,inmemory,elasticsearch,with-assembly,with-jetm
 fi
 
 # Retrieve result


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


[07/29] james-project git commit: JAMES-1842: Inversion of control on GuiceProbe

Posted by ad...@apache.org.
http://git-wip-us.apache.org/repos/asf/james-project/blob/ebbf1e6f/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraJmapAuthenticationTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraJmapAuthenticationTest.java b/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraJmapAuthenticationTest.java
index 510876c..d7801d8 100644
--- a/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraJmapAuthenticationTest.java
+++ b/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraJmapAuthenticationTest.java
@@ -18,8 +18,8 @@
  ****************************************************************/
 package org.apache.james.jmap.cassandra;
 
+import org.apache.james.CassandraJamesServer;
 import org.apache.james.CassandraJamesServerMain;
-import org.apache.james.GuiceJmapJamesServer;
 import org.apache.james.backends.cassandra.EmbeddedCassandra;
 import org.apache.james.jmap.FixedDateZonedDateTimeProvider;
 import org.apache.james.jmap.JMAPAuthenticationTest;
@@ -30,7 +30,7 @@ import org.junit.Rule;
 import org.junit.rules.RuleChain;
 import org.junit.rules.TemporaryFolder;
 
-public class CassandraJmapAuthenticationTest extends JMAPAuthenticationTest {
+public class CassandraJmapAuthenticationTest extends JMAPAuthenticationTest<CassandraJamesServer> {
 
     private TemporaryFolder temporaryFolder = new TemporaryFolder();
     private EmbeddedElasticSearch embeddedElasticSearch = new EmbeddedElasticSearch(temporaryFolder);
@@ -42,8 +42,8 @@ public class CassandraJmapAuthenticationTest extends JMAPAuthenticationTest {
         .around(embeddedElasticSearch);
 
     @Override
-    protected GuiceJmapJamesServer createJmapServer(FixedDateZonedDateTimeProvider zonedDateTimeProvider) {
-        return new GuiceJmapJamesServer()
+    protected CassandraJamesServer createJmapServer(FixedDateZonedDateTimeProvider zonedDateTimeProvider) {
+        return new CassandraJamesServer()
                     .combineWith(CassandraJamesServerMain.cassandraServerModule)
                     .overrideWith(new CassandraJmapServerModule(temporaryFolder, embeddedElasticSearch, cassandra),
                             (binder) -> binder.bind(ZonedDateTimeProvider.class).toInstance(zonedDateTimeProvider));

http://git-wip-us.apache.org/repos/asf/james-project/blob/ebbf1e6f/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraSetMailboxesMethodTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraSetMailboxesMethodTest.java b/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraSetMailboxesMethodTest.java
index 443f48b..59017a3 100644
--- a/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraSetMailboxesMethodTest.java
+++ b/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraSetMailboxesMethodTest.java
@@ -19,8 +19,8 @@
 
 package org.apache.james.jmap.cassandra;
 
+import org.apache.james.CassandraJamesServer;
 import org.apache.james.CassandraJamesServerMain;
-import org.apache.james.GuiceJmapJamesServer;
 import org.apache.james.backends.cassandra.EmbeddedCassandra;
 import org.apache.james.jmap.methods.integration.SetMailboxesMethodTest;
 import org.apache.james.mailbox.elasticsearch.EmbeddedElasticSearch;
@@ -29,7 +29,7 @@ import org.junit.Rule;
 import org.junit.rules.RuleChain;
 import org.junit.rules.TemporaryFolder;
 
-public class CassandraSetMailboxesMethodTest extends SetMailboxesMethodTest {
+public class CassandraSetMailboxesMethodTest extends SetMailboxesMethodTest<CassandraJamesServer> {
 
     private TemporaryFolder temporaryFolder = new TemporaryFolder();
     private EmbeddedElasticSearch embeddedElasticSearch = new EmbeddedElasticSearch(temporaryFolder);
@@ -41,8 +41,8 @@ public class CassandraSetMailboxesMethodTest extends SetMailboxesMethodTest {
         .around(embeddedElasticSearch);
 
     @Override
-    protected GuiceJmapJamesServer createJmapServer() {
-        return new GuiceJmapJamesServer()
+    protected CassandraJamesServer createJmapServer() {
+        return new CassandraJamesServer()
                     .combineWith(CassandraJamesServerMain.cassandraServerModule)
                     .overrideWith(new CassandraJmapServerModule(temporaryFolder, embeddedElasticSearch, cassandra));
     }

http://git-wip-us.apache.org/repos/asf/james-project/blob/ebbf1e6f/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraSetMessagesMethodTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraSetMessagesMethodTest.java b/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraSetMessagesMethodTest.java
index a244fa3..af02e92 100644
--- a/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraSetMessagesMethodTest.java
+++ b/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraSetMessagesMethodTest.java
@@ -19,8 +19,8 @@
 
 package org.apache.james.jmap.cassandra;
 
+import org.apache.james.CassandraJamesServer;
 import org.apache.james.CassandraJamesServerMain;
-import org.apache.james.GuiceJmapJamesServer;
 import org.apache.james.backends.cassandra.EmbeddedCassandra;
 import org.apache.james.jmap.methods.integration.SetMessagesMethodTest;
 import org.apache.james.mailbox.elasticsearch.EmbeddedElasticSearch;
@@ -29,7 +29,7 @@ import org.junit.Rule;
 import org.junit.rules.RuleChain;
 import org.junit.rules.TemporaryFolder;
 
-public class CassandraSetMessagesMethodTest extends SetMessagesMethodTest {
+public class CassandraSetMessagesMethodTest extends SetMessagesMethodTest<CassandraJamesServer> {
 
     private TemporaryFolder temporaryFolder = new TemporaryFolder();
     private EmbeddedElasticSearch embeddedElasticSearch = new EmbeddedElasticSearch(temporaryFolder);
@@ -41,8 +41,8 @@ public class CassandraSetMessagesMethodTest extends SetMessagesMethodTest {
         .around(embeddedElasticSearch);
 
     @Override
-    protected GuiceJmapJamesServer createJmapServer() {
-        return new GuiceJmapJamesServer()
+    protected CassandraJamesServer createJmapServer() {
+        return new CassandraJamesServer()
                     .combineWith(CassandraJamesServerMain.cassandraServerModule)
                     .overrideWith(new CassandraJmapServerModule(temporaryFolder, embeddedElasticSearch, cassandra));
     }

http://git-wip-us.apache.org/repos/asf/james-project/blob/ebbf1e6f/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraSetVacationResponseTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraSetVacationResponseTest.java b/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraSetVacationResponseTest.java
index 7bb2370..64e848c 100644
--- a/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraSetVacationResponseTest.java
+++ b/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraSetVacationResponseTest.java
@@ -19,8 +19,8 @@
 
 package org.apache.james.jmap.cassandra;
 
+import org.apache.james.CassandraJamesServer;
 import org.apache.james.CassandraJamesServerMain;
-import org.apache.james.GuiceJmapJamesServer;
 import org.apache.james.backends.cassandra.EmbeddedCassandra;
 import org.apache.james.jmap.methods.integration.SetVacationResponseTest;
 import org.apache.james.mailbox.elasticsearch.EmbeddedElasticSearch;
@@ -29,7 +29,7 @@ import org.junit.Rule;
 import org.junit.rules.RuleChain;
 import org.junit.rules.TemporaryFolder;
 
-public class CassandraSetVacationResponseTest extends SetVacationResponseTest {
+public class CassandraSetVacationResponseTest extends SetVacationResponseTest<CassandraJamesServer> {
 
     private TemporaryFolder temporaryFolder = new TemporaryFolder();
     private EmbeddedElasticSearch embeddedElasticSearch = new EmbeddedElasticSearch(temporaryFolder);
@@ -41,8 +41,8 @@ public class CassandraSetVacationResponseTest extends SetVacationResponseTest {
         .around(embeddedElasticSearch);
 
     @Override
-    protected GuiceJmapJamesServer createJmapServer() {
-        return new GuiceJmapJamesServer()
+    protected CassandraJamesServer createJmapServer() {
+        return new CassandraJamesServer()
                     .combineWith(CassandraJamesServerMain.cassandraServerModule)
                     .overrideWith(new CassandraJmapServerModule(temporaryFolder, embeddedElasticSearch, cassandra));
     }

http://git-wip-us.apache.org/repos/asf/james-project/blob/ebbf1e6f/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraVacationIntegrationTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraVacationIntegrationTest.java b/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraVacationIntegrationTest.java
index 1540198..5792447 100644
--- a/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraVacationIntegrationTest.java
+++ b/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraVacationIntegrationTest.java
@@ -19,8 +19,9 @@
 
 package org.apache.james.jmap.cassandra;
 
+import org.apache.james.CassandraJamesServer;
 import org.apache.james.CassandraJamesServerMain;
-import org.apache.james.GuiceJmapJamesServer;
+import org.apache.james.GuiceJamesServer;
 import org.apache.james.backends.cassandra.EmbeddedCassandra;
 import org.apache.james.jmap.VacationIntegrationTest;
 import org.apache.james.mailbox.elasticsearch.EmbeddedElasticSearch;
@@ -29,7 +30,7 @@ import org.junit.Rule;
 import org.junit.rules.RuleChain;
 import org.junit.rules.TemporaryFolder;
 
-public class CassandraVacationIntegrationTest extends VacationIntegrationTest {
+public class CassandraVacationIntegrationTest extends VacationIntegrationTest<CassandraJamesServer> {
 
 
     private TemporaryFolder temporaryFolder = new TemporaryFolder();
@@ -42,8 +43,8 @@ public class CassandraVacationIntegrationTest extends VacationIntegrationTest {
         .around(embeddedElasticSearch);
 
     @Override
-    protected GuiceJmapJamesServer createJmapServer() {
-        return new GuiceJmapJamesServer()
+    protected CassandraJamesServer createJmapServer() {
+        return new CassandraJamesServer()
             .combineWith(CassandraJamesServerMain.cassandraServerModule)
             .overrideWith(new CassandraJmapServerModule(temporaryFolder, embeddedElasticSearch, cassandra));
     }

http://git-wip-us.apache.org/repos/asf/james-project/blob/ebbf1e6f/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 322f781..39f4b65 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
@@ -23,8 +23,8 @@ import java.util.Arrays;
 
 import javax.inject.Inject;
 
+import org.apache.james.CassandraJamesServer;
 import org.apache.james.CassandraJamesServerMain;
-import org.apache.james.GuiceJmapJamesServer;
 import org.apache.james.backends.cassandra.EmbeddedCassandra;
 import org.apache.james.jmap.methods.integration.cucumber.MainStepdefs;
 import org.apache.james.mailbox.elasticsearch.EmbeddedElasticSearch;
@@ -54,7 +54,7 @@ public class CassandraStepdefs {
     public void init() throws Exception {
         temporaryFolder.create();
         embeddedElasticSearch.before();
-        mainStepdefs.jmapServer = new GuiceJmapJamesServer()
+        mainStepdefs.jmapServer = new CassandraJamesServer()
                 .combineWith(CassandraJamesServerMain.cassandraServerModule)
                 .overrideWith(new CassandraJmapServerModule(temporaryFolder, embeddedElasticSearch, cassandra));
         mainStepdefs.awaitMethod = () -> embeddedElasticSearch.awaitForElasticSearch();

http://git-wip-us.apache.org/repos/asf/james-project/blob/ebbf1e6f/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/JMAPAuthenticationTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/JMAPAuthenticationTest.java b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/JMAPAuthenticationTest.java
index 7fd0c4a..1fa5c87 100644
--- a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/JMAPAuthenticationTest.java
+++ b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/JMAPAuthenticationTest.java
@@ -32,8 +32,11 @@ import java.time.ZonedDateTime;
 import java.time.format.DateTimeFormatter;
 import java.util.UUID;
 
-import org.apache.james.GuiceJmapJamesServer;
+import org.apache.james.GuiceJamesServer;
+import org.apache.james.JmapServer;
+import org.apache.james.WebAdminServer;
 import org.apache.james.jmap.model.ContinuationToken;
+import org.apache.james.utils.JmapGuiceProbe;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
@@ -43,17 +46,17 @@ import com.jayway.restassured.RestAssured;
 import com.jayway.restassured.builder.RequestSpecBuilder;
 import com.jayway.restassured.http.ContentType;
 
-public abstract class JMAPAuthenticationTest {
+public abstract class JMAPAuthenticationTest<T extends GuiceJamesServer & JmapServer & WebAdminServer> {
 
     private static final ZonedDateTime oldDate = ZonedDateTime.parse("2011-12-03T10:15:30+01:00", DateTimeFormatter.ISO_OFFSET_DATE_TIME);
     private static final ZonedDateTime newDate = ZonedDateTime.parse("2011-12-03T10:16:30+01:00", DateTimeFormatter.ISO_OFFSET_DATE_TIME);
     private static final ZonedDateTime afterExpirationDate = ZonedDateTime.parse("2011-12-03T10:30:31+01:00", DateTimeFormatter.ISO_OFFSET_DATE_TIME);
 
-    protected abstract GuiceJmapJamesServer createJmapServer(FixedDateZonedDateTimeProvider zonedDateTimeProvider);
+    protected abstract T createJmapServer(FixedDateZonedDateTimeProvider zonedDateTimeProvider);
 
     private UserCredentials userCredentials;
     private FixedDateZonedDateTimeProvider zonedDateTimeProvider;
-    private GuiceJmapJamesServer jmapServer;
+    private T jmapServer;
 
     @Before
     public void setup() throws Throwable {
@@ -63,8 +66,8 @@ public abstract class JMAPAuthenticationTest {
         jmapServer.start();
         RestAssured.requestSpecification = new RequestSpecBuilder()
         		.setConfig(newConfig().encoderConfig(encoderConfig().defaultContentCharset(Charsets.UTF_8)))
-        		.setPort(jmapServer.getJmapPort()
-                        .orElseThrow(() -> new RuntimeException("Unable to locate JMAP port")))
+        		.setPort(jmapServer.getJmapProbe()
+                    .getJmapPort())
         		.build();
         
         userCredentials = UserCredentials.builder()

http://git-wip-us.apache.org/repos/asf/james-project/blob/ebbf1e6f/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/VacationIntegrationTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/VacationIntegrationTest.java b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/VacationIntegrationTest.java
index 927885c..7c6ee22 100644
--- a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/VacationIntegrationTest.java
+++ b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/VacationIntegrationTest.java
@@ -31,11 +31,14 @@ import java.util.List;
 import java.util.Map;
 import java.util.concurrent.TimeUnit;
 
-import org.apache.james.GuiceJmapJamesServer;
+import org.apache.james.GuiceJamesServer;
+import org.apache.james.JmapServer;
+import org.apache.james.WebAdminServer;
 import org.apache.james.jmap.api.access.AccessToken;
 import org.apache.james.jmap.api.vacation.AccountId;
 import org.apache.james.jmap.api.vacation.VacationPatch;
 import org.apache.james.mailbox.model.MailboxConstants;
+import org.apache.james.utils.JmapGuiceProbe;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
@@ -48,7 +51,7 @@ import com.jayway.restassured.RestAssured;
 import com.jayway.restassured.builder.RequestSpecBuilder;
 import com.jayway.restassured.http.ContentType;
 
-public abstract class VacationIntegrationTest {
+public abstract class VacationIntegrationTest<T extends GuiceJamesServer & JmapServer & WebAdminServer> {
 
     private static final String ARGUMENTS = "[0][1]";
     private static final String SECOND_NAME = "[1][0]";
@@ -62,9 +65,10 @@ public abstract class VacationIntegrationTest {
     public static final String ORIGINAL_MESSAGE_TEXT_BODY = "Hello someone, and thank you for joining example.com!";
 
     private ConditionFactory calmlyAwait;
-    private GuiceJmapJamesServer guiceJamesServer;
+    private T guiceJamesServer;
+    private JmapGuiceProbe jmapGuiceProbe;
 
-    protected abstract GuiceJmapJamesServer createJmapServer();
+    protected abstract T createJmapServer();
 
     protected abstract void await();
 
@@ -83,12 +87,13 @@ public abstract class VacationIntegrationTest {
         guiceJamesServer.serverProbe().createMailbox(MailboxConstants.USER_NAMESPACE, USER_2, "INBOX");
         await();
 
+        jmapGuiceProbe = guiceJamesServer.getJmapProbe();
         RestAssured.requestSpecification = new RequestSpecBuilder()
         		.setContentType(ContentType.JSON)
         		.setAccept(ContentType.JSON)
         		.setConfig(newConfig().encoderConfig(encoderConfig().defaultContentCharset(Charsets.UTF_8)))
-        		.setPort(guiceJamesServer.getJmapPort()
-                        .orElseThrow(() -> new RuntimeException("Unable to locate JMAP port")))
+        		.setPort(jmapGuiceProbe
+                    .getJmapPort())
         		.build();
 
         Duration slowPacedPollInterval = Duration.FIVE_HUNDRED_MILLISECONDS;
@@ -134,7 +139,7 @@ public abstract class VacationIntegrationTest {
         // Given
         AccessToken user1AccessToken = JmapAuthentication.authenticateJamesUser(USER_1, PASSWORD);
         AccessToken user2AccessToken = JmapAuthentication.authenticateJamesUser(USER_2, PASSWORD);
-        guiceJamesServer.serverProbe().modifyVacation(
+        jmapGuiceProbe.modifyVacation(
             AccountId.fromString(USER_1),
             VacationPatch.builder()
                 .isEnabled(true)

http://git-wip-us.apache.org/repos/asf/james-project/blob/ebbf1e6f/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetMailboxesMethodTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetMailboxesMethodTest.java b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetMailboxesMethodTest.java
index 53cd799..ca3d38c 100644
--- a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetMailboxesMethodTest.java
+++ b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetMailboxesMethodTest.java
@@ -19,6 +19,27 @@
 
 package org.apache.james.jmap.methods.integration;
 
+import com.google.common.base.Charsets;
+import com.jayway.restassured.RestAssured;
+import com.jayway.restassured.builder.RequestSpecBuilder;
+import com.jayway.restassured.http.ContentType;
+import org.apache.james.GuiceJamesServer;
+import org.apache.james.JmapServer;
+import org.apache.james.WebAdminServer;
+import org.apache.james.jmap.JmapAuthentication;
+import org.apache.james.jmap.api.access.AccessToken;
+import org.apache.james.mailbox.model.MailboxConstants;
+import org.apache.james.mailbox.model.MailboxPath;
+import org.apache.james.mailbox.store.mail.model.Mailbox;
+import org.apache.james.utils.JmapGuiceProbe;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import javax.mail.Flags;
+import java.io.ByteArrayInputStream;
+import java.util.Date;
+
 import static com.jayway.restassured.RestAssured.given;
 import static com.jayway.restassured.config.EncoderConfig.encoderConfig;
 import static com.jayway.restassured.config.RestAssuredConfig.newConfig;
@@ -30,35 +51,15 @@ import static org.hamcrest.Matchers.isEmptyOrNullString;
 import static org.hamcrest.Matchers.not;
 import static org.hamcrest.Matchers.nullValue;
 
-import java.io.ByteArrayInputStream;
-import java.util.Date;
-
-import javax.mail.Flags;
-
-import org.apache.james.GuiceJmapJamesServer;
-import org.apache.james.jmap.JmapAuthentication;
-import org.apache.james.jmap.api.access.AccessToken;
-import org.apache.james.mailbox.model.MailboxConstants;
-import org.apache.james.mailbox.model.MailboxPath;
-import org.apache.james.mailbox.store.mail.model.Mailbox;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import com.google.common.base.Charsets;
-import com.jayway.restassured.RestAssured;
-import com.jayway.restassured.builder.RequestSpecBuilder;
-import com.jayway.restassured.http.ContentType;
-
-public abstract class GetMailboxesMethodTest {
+public abstract class GetMailboxesMethodTest<T extends GuiceJamesServer & JmapServer & WebAdminServer> {
     private static final String NAME = "[0][0]";
     private static final String ARGUMENTS = "[0][1]";
 
-    protected abstract GuiceJmapJamesServer createJmapServer();
+    protected abstract T createJmapServer();
 
     private AccessToken accessToken;
     private String username;
-    private GuiceJmapJamesServer jmapServer;
+    private T jmapServer;
 
     @Before
     public void setup() throws Throwable {
@@ -69,8 +70,8 @@ public abstract class GetMailboxesMethodTest {
         		.setContentType(ContentType.JSON)
         		.setAccept(ContentType.JSON)
         		.setConfig(newConfig().encoderConfig(encoderConfig().defaultContentCharset(Charsets.UTF_8)))
-        		.setPort(jmapServer.getJmapPort()
-                        .orElseThrow(() -> new RuntimeException("Unable to locate JMAP port")))
+        		.setPort(jmapServer.getJmapProbe()
+                    .getJmapPort())
         		.build();
 
         String domain = "domain.tld";

http://git-wip-us.apache.org/repos/asf/james-project/blob/ebbf1e6f/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetMessageListMethodTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetMessageListMethodTest.java b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetMessageListMethodTest.java
index 69d72c8..cbb6df7 100644
--- a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetMessageListMethodTest.java
+++ b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetMessageListMethodTest.java
@@ -36,12 +36,15 @@ import java.util.List;
 
 import javax.mail.Flags;
 
-import org.apache.james.GuiceJmapJamesServer;
+import org.apache.james.GuiceJamesServer;
+import org.apache.james.JmapServer;
+import org.apache.james.WebAdminServer;
 import org.apache.james.jmap.JmapAuthentication;
 import org.apache.james.jmap.api.access.AccessToken;
 import org.apache.james.mailbox.model.MailboxConstants;
 import org.apache.james.mailbox.model.MailboxId;
 import org.apache.james.mailbox.model.MailboxPath;
+import org.apache.james.utils.JmapGuiceProbe;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Ignore;
@@ -52,18 +55,18 @@ import com.jayway.restassured.RestAssured;
 import com.jayway.restassured.builder.RequestSpecBuilder;
 import com.jayway.restassured.http.ContentType;
 
-public abstract class GetMessageListMethodTest {
+public abstract class GetMessageListMethodTest<T extends GuiceJamesServer & JmapServer & WebAdminServer> {
     private static final String NAME = "[0][0]";
     private static final String ARGUMENTS = "[0][1]";
 
-    protected abstract GuiceJmapJamesServer createJmapServer();
+    protected abstract T createJmapServer();
 
     protected abstract void await();
 
     private AccessToken accessToken;
     private String username;
     private String domain;
-    private GuiceJmapJamesServer jmapServer;
+    private T jmapServer;
 
     @Before
     public void setup() throws Throwable {
@@ -73,8 +76,8 @@ public abstract class GetMessageListMethodTest {
                 .setContentType(ContentType.JSON)
                 .setAccept(ContentType.JSON)
                 .setConfig(newConfig().encoderConfig(encoderConfig().defaultContentCharset(Charsets.UTF_8)))
-                .setPort(jmapServer.getJmapPort()
-                        .orElseThrow(() -> new RuntimeException("Unable to locate JMAP port")))
+                .setPort(jmapServer.getJmapProbe()
+                    .getJmapPort())
                 .build();
 
         this.domain = "domain.tld";

http://git-wip-us.apache.org/repos/asf/james-project/blob/ebbf1e6f/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetVacationResponseTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetVacationResponseTest.java b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetVacationResponseTest.java
index 8fce0ee..15c69eb 100644
--- a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetVacationResponseTest.java
+++ b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetVacationResponseTest.java
@@ -28,13 +28,16 @@ import static org.hamcrest.core.IsNull.nullValue;
 
 import java.time.ZonedDateTime;
 
-import org.apache.james.GuiceJmapJamesServer;
+import org.apache.james.GuiceJamesServer;
+import org.apache.james.JmapServer;
+import org.apache.james.WebAdminServer;
 import org.apache.james.jmap.FixedDateZonedDateTimeProvider;
 import org.apache.james.jmap.JmapAuthentication;
 import org.apache.james.jmap.api.access.AccessToken;
 import org.apache.james.jmap.api.vacation.AccountId;
 import org.apache.james.jmap.api.vacation.VacationPatch;
 import org.apache.james.util.date.ZonedDateTimeProvider;
+import org.apache.james.utils.JmapGuiceProbe;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
@@ -44,7 +47,7 @@ import com.jayway.restassured.RestAssured;
 import com.jayway.restassured.builder.RequestSpecBuilder;
 import com.jayway.restassured.http.ContentType;
 
-public abstract class GetVacationResponseTest {
+public abstract class GetVacationResponseTest<T extends GuiceJamesServer & JmapServer & WebAdminServer> {
 
     private static final String NAME = "[0][0]";
     private static final String ARGUMENTS = "[0][1]";
@@ -55,13 +58,14 @@ public abstract class GetVacationResponseTest {
     public static final ZonedDateTime DATE_2015 = ZonedDateTime.parse("2015-10-15T14:10:00Z");
     public static final ZonedDateTime DATE_2014 = ZonedDateTime.parse("2014-09-30T14:10:00+02:00");
     public static final ZonedDateTime DATE_2016 = ZonedDateTime.parse("2016-04-15T11:56:32.224+07:00[Asia/Vientiane]");
+    private JmapGuiceProbe jmapGuiceProbe;
 
-    protected abstract GuiceJmapJamesServer createJmapServer(ZonedDateTimeProvider zonedDateTimeProvider);
+    protected abstract T createJmapServer(ZonedDateTimeProvider zonedDateTimeProvider);
 
     protected abstract void await();
 
     private AccessToken accessToken;
-    private GuiceJmapJamesServer jmapServer;
+    private T jmapServer;
     private FixedDateZonedDateTimeProvider fixedDateZonedDateTimeProvider;
 
     @Before
@@ -72,12 +76,12 @@ public abstract class GetVacationResponseTest {
         jmapServer = createJmapServer(fixedDateZonedDateTimeProvider);
         jmapServer.start();
 
+        jmapGuiceProbe = jmapServer.getJmapProbe();
         RestAssured.requestSpecification = new RequestSpecBuilder()
         		.setContentType(ContentType.JSON)
         		.setAccept(ContentType.JSON)
         		.setConfig(newConfig().encoderConfig(encoderConfig().defaultContentCharset(Charsets.UTF_8)))
-        		.setPort(jmapServer.getJmapPort()
-                        .orElseThrow(() -> new RuntimeException("Unable to locate JMAP port")))
+        		.setPort(jmapGuiceProbe.getJmapPort())
         		.build();
 
 
@@ -120,7 +124,7 @@ public abstract class GetVacationResponseTest {
 
     @Test
     public void getVacationResponseShouldReturnStoredValue() {
-        jmapServer.serverProbe().modifyVacation(AccountId.fromString(USER),
+        jmapGuiceProbe.modifyVacation(AccountId.fromString(USER),
             VacationPatch.builder()
                 .isEnabled(true)
                 .fromDate(ZonedDateTime.parse("2014-09-30T14:10:00Z"))
@@ -155,7 +159,7 @@ public abstract class GetVacationResponseTest {
 
     @Test
     public void getVacationResponseShouldReturnStoredValueWithNonDefaultTimezone() {
-        jmapServer.serverProbe().modifyVacation(AccountId.fromString(USER),
+        jmapGuiceProbe.modifyVacation(AccountId.fromString(USER),
             VacationPatch.builder()
                 .isEnabled(true)
                 .fromDate(ZonedDateTime.parse("2014-09-30T14:10:00+02:00"))
@@ -186,7 +190,7 @@ public abstract class GetVacationResponseTest {
 
     @Test
     public void getVacationResponseShouldReturnIsActivatedWhenInRange() {
-        jmapServer.serverProbe().modifyVacation(AccountId.fromString(USER),
+        jmapGuiceProbe.modifyVacation(AccountId.fromString(USER),
             VacationPatch.builder()
                 .isEnabled(true)
                 .fromDate(DATE_2014)
@@ -215,7 +219,7 @@ public abstract class GetVacationResponseTest {
     public void getVacationResponseShouldNotReturnIsActivatedWhenOutOfRange() {
         fixedDateZonedDateTimeProvider.setFixedDateTime(DATE_2014);
 
-        jmapServer.serverProbe().modifyVacation(AccountId.fromString(USER),
+        jmapGuiceProbe.modifyVacation(AccountId.fromString(USER),
             VacationPatch.builder()
                 .isEnabled(true)
                 .fromDate(DATE_2015)
@@ -242,7 +246,7 @@ public abstract class GetVacationResponseTest {
 
     @Test
     public void accountIdIsNotSupported() {
-        jmapServer.serverProbe().modifyVacation(AccountId.fromString(USER),
+        jmapGuiceProbe.modifyVacation(AccountId.fromString(USER),
             VacationPatch.builder()
                 .isEnabled(true)
                 .fromDate(ZonedDateTime.parse("2014-09-30T14:10:00+02:00"))

http://git-wip-us.apache.org/repos/asf/james-project/blob/ebbf1e6f/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/SetMailboxesMethodTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/SetMailboxesMethodTest.java b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/SetMailboxesMethodTest.java
index ba0b30e..5196788 100644
--- a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/SetMailboxesMethodTest.java
+++ b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/SetMailboxesMethodTest.java
@@ -36,12 +36,15 @@ import static org.hamcrest.Matchers.not;
 import static org.hamcrest.Matchers.nullValue;
 import static org.hamcrest.collection.IsMapWithSize.aMapWithSize;
 
-import org.apache.james.GuiceJmapJamesServer;
+import org.apache.james.GuiceJamesServer;
+import org.apache.james.JmapServer;
+import org.apache.james.WebAdminServer;
 import org.apache.james.jmap.JmapAuthentication;
 import org.apache.james.jmap.api.access.AccessToken;
 import org.apache.james.mailbox.model.MailboxConstants;
 import org.apache.james.mailbox.model.MailboxId;
 import org.apache.james.mailbox.store.mail.model.Mailbox;
+import org.apache.james.utils.JmapGuiceProbe;
 import org.hamcrest.Matchers;
 import org.junit.After;
 import org.junit.Before;
@@ -52,19 +55,19 @@ import com.jayway.restassured.RestAssured;
 import com.jayway.restassured.builder.RequestSpecBuilder;
 import com.jayway.restassured.http.ContentType;
 
-public abstract class SetMailboxesMethodTest {
+public abstract class SetMailboxesMethodTest<T extends GuiceJamesServer & JmapServer & WebAdminServer> {
 
     private static final String NAME = "[0][0]";
     private static final String ARGUMENTS = "[0][1]";
     private static final String USERS_DOMAIN = "domain.tld";
 
-    protected abstract GuiceJmapJamesServer createJmapServer();
+    protected abstract T createJmapServer();
 
     protected abstract void await();
 
     private AccessToken accessToken;
     private String username;
-    private GuiceJmapJamesServer jmapServer;
+    private T jmapServer;
 
     @Before
     public void setup() throws Throwable {
@@ -75,8 +78,8 @@ public abstract class SetMailboxesMethodTest {
         		.setContentType(ContentType.JSON)
         		.setAccept(ContentType.JSON)
         		.setConfig(newConfig().encoderConfig(encoderConfig().defaultContentCharset(Charsets.UTF_8)))
-        		.setPort(jmapServer.getJmapPort()
-                        .orElseThrow(() -> new RuntimeException("Unable to locate JMAP port")))
+        		.setPort(jmapServer.getJmapProbe()
+                    .getJmapPort())
         		.build();
         RestAssured.enableLoggingOfRequestAndResponseIfValidationFails();
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/ebbf1e6f/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/SetMessagesMethodTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/SetMessagesMethodTest.java b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/SetMessagesMethodTest.java
index 959ed44..c45a35b 100644
--- a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/SetMessagesMethodTest.java
+++ b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/SetMessagesMethodTest.java
@@ -48,9 +48,10 @@ import java.util.stream.Collectors;
 
 import javax.mail.Flags;
 
-import com.google.common.collect.ImmutableList;
 import org.apache.commons.io.IOUtils;
-import org.apache.james.GuiceJmapJamesServer;
+import org.apache.james.GuiceJamesServer;
+import org.apache.james.JmapServer;
+import org.apache.james.WebAdminServer;
 import org.apache.james.jmap.JmapAuthentication;
 import org.apache.james.jmap.api.access.AccessToken;
 import org.apache.james.jmap.model.mailbox.Role;
@@ -60,6 +61,7 @@ import org.apache.james.mailbox.model.MailboxConstants;
 import org.apache.james.mailbox.model.MailboxPath;
 import org.apache.james.mailbox.store.mail.model.Mailbox;
 import org.apache.james.util.ZeroedInputStream;
+import org.apache.james.utils.JmapGuiceProbe;
 import org.hamcrest.Matcher;
 import org.hamcrest.Matchers;
 import org.junit.After;
@@ -68,6 +70,7 @@ import org.junit.Ignore;
 import org.junit.Test;
 
 import com.google.common.base.Charsets;
+import com.google.common.collect.ImmutableList;
 import com.google.common.io.ByteStreams;
 import com.jayway.awaitility.Awaitility;
 import com.jayway.awaitility.Duration;
@@ -78,7 +81,7 @@ import com.jayway.restassured.builder.ResponseSpecBuilder;
 import com.jayway.restassured.http.ContentType;
 import com.jayway.restassured.specification.ResponseSpecification;
 
-public abstract class SetMessagesMethodTest {
+public abstract class SetMessagesMethodTest<T extends GuiceJamesServer & JmapServer & WebAdminServer> {
 
     private static final int _1MB = 1024*1024;
     private static final String NAME = "[0][0]";
@@ -90,13 +93,13 @@ public abstract class SetMessagesMethodTest {
 
     private ConditionFactory calmlyAwait;
 
-    protected abstract GuiceJmapJamesServer createJmapServer();
+    protected abstract T createJmapServer();
 
     protected abstract void await();
 
     private AccessToken accessToken;
     private String username;
-    private GuiceJmapJamesServer jmapServer;
+    private T jmapServer;
 
     @Before
     public void setup() throws Throwable {
@@ -106,8 +109,8 @@ public abstract class SetMessagesMethodTest {
                 .setContentType(ContentType.JSON)
                 .setAccept(ContentType.JSON)
                 .setConfig(newConfig().encoderConfig(encoderConfig().defaultContentCharset(Charsets.UTF_8)))
-                .setPort(jmapServer.getJmapPort()
-                        .orElseThrow(() -> new RuntimeException("Unable to locate JMAP port")))
+                .setPort(jmapServer.getJmapProbe()
+                    .getJmapPort())
                 .build();
 
         username = "username@" + USERS_DOMAIN;

http://git-wip-us.apache.org/repos/asf/james-project/blob/ebbf1e6f/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/SetVacationResponseTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/SetVacationResponseTest.java b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/SetVacationResponseTest.java
index 23a35e9..be04ecb 100644
--- a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/SetVacationResponseTest.java
+++ b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/SetVacationResponseTest.java
@@ -28,13 +28,16 @@ import static org.hamcrest.Matchers.equalTo;
 import java.time.ZonedDateTime;
 import java.util.Optional;
 
-import org.apache.james.GuiceJmapJamesServer;
+import org.apache.james.GuiceJamesServer;
+import org.apache.james.JmapServer;
+import org.apache.james.WebAdminServer;
 import org.apache.james.jmap.JmapAuthentication;
 import org.apache.james.jmap.api.access.AccessToken;
 import org.apache.james.jmap.api.vacation.AccountId;
 import org.apache.james.jmap.api.vacation.Vacation;
 import org.apache.james.jmap.api.vacation.VacationPatch;
 import org.apache.james.util.ValuePatch;
+import org.apache.james.utils.JmapGuiceProbe;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
@@ -44,7 +47,7 @@ import com.jayway.restassured.RestAssured;
 import com.jayway.restassured.builder.RequestSpecBuilder;
 import com.jayway.restassured.http.ContentType;
 
-public abstract class SetVacationResponseTest {
+public abstract class SetVacationResponseTest<T extends GuiceJamesServer & JmapServer & WebAdminServer> {
 
     private static final String NAME = "[0][0]";
     private static final String ARGUMENTS = "[0][1]";
@@ -52,24 +55,26 @@ public abstract class SetVacationResponseTest {
     public static final String USER = "username@" + USERS_DOMAIN;
     public static final String PASSWORD = "password";
     public static final String SUBJECT = "subject";
+    private JmapGuiceProbe jmapGuiceProbe;
 
-    protected abstract GuiceJmapJamesServer createJmapServer();
+    protected abstract T createJmapServer();
 
     protected abstract void await();
 
     private AccessToken accessToken;
-    private GuiceJmapJamesServer jmapServer;
+    private T jmapServer;
 
     @Before
     public void setup() throws Throwable {
         jmapServer = createJmapServer();
         jmapServer.start();
+        jmapGuiceProbe = jmapServer.getJmapProbe();
         RestAssured.requestSpecification = new RequestSpecBuilder()
         		.setContentType(ContentType.JSON)
         		.setAccept(ContentType.JSON)
         		.setConfig(newConfig().encoderConfig(encoderConfig().defaultContentCharset(Charsets.UTF_8)))
-        		.setPort(jmapServer.getJmapPort()
-                        .orElseThrow(() -> new RuntimeException("Unable to locate JMAP port")))
+        		.setPort(jmapGuiceProbe
+                    .getJmapPort())
         		.build();
 
         jmapServer.serverProbe().addDomain(USERS_DOMAIN);
@@ -200,7 +205,7 @@ public abstract class SetVacationResponseTest {
             .body(NAME, equalTo("vacationResponseSet"))
             .body(ARGUMENTS + ".updated[0]", equalTo("singleton"));
 
-        Vacation vacation = jmapServer.serverProbe().retrieveVacation(AccountId.fromString(USER));
+        Vacation vacation = jmapGuiceProbe.retrieveVacation(AccountId.fromString(USER));
         assertThat(vacation.getTextBody()).contains("Message explaining my wonderful vacations");
         assertThat(vacation.getHtmlBody()).contains("<p>Here is the HTML version</p>");
         assertThat(vacation.isEnabled()).isTrue();
@@ -211,7 +216,7 @@ public abstract class SetVacationResponseTest {
 
     @Test
     public void setVacationResponseShouldAllowResets() {
-        jmapServer.serverProbe().modifyVacation(AccountId.fromString(USER),
+        jmapGuiceProbe.modifyVacation(AccountId.fromString(USER),
             VacationPatch.builder()
                 .textBody(ValuePatch.modifyTo("any value"))
                 .build());
@@ -239,7 +244,7 @@ public abstract class SetVacationResponseTest {
             .body(NAME, equalTo("vacationResponseSet"))
             .body(ARGUMENTS + ".updated[0]", equalTo("singleton"));
 
-        assertThat(jmapServer.serverProbe().retrieveVacation(AccountId.fromString(USER)))
+        assertThat(jmapGuiceProbe.retrieveVacation(AccountId.fromString(USER)))
             .isEqualTo(Vacation.builder()
                 .enabled(false)
                 .build());
@@ -249,7 +254,7 @@ public abstract class SetVacationResponseTest {
     public void setVacationResponseShouldNotAlterAbsentProperties() {
         String textBody = "any value";
         String subject = "any subject";
-        jmapServer.serverProbe().modifyVacation(AccountId.fromString(USER),
+        jmapGuiceProbe.modifyVacation(AccountId.fromString(USER),
             VacationPatch.builder()
                 .textBody(ValuePatch.modifyTo(textBody))
                 .build());
@@ -279,7 +284,7 @@ public abstract class SetVacationResponseTest {
             .body(NAME, equalTo("vacationResponseSet"))
             .body(ARGUMENTS + ".updated[0]", equalTo("singleton"));
 
-        assertThat(jmapServer.serverProbe().retrieveVacation(AccountId.fromString(USER)))
+        assertThat(jmapGuiceProbe.retrieveVacation(AccountId.fromString(USER)))
             .isEqualTo(Vacation.builder()
                 .enabled(false)
                 .subject(Optional.of(subject))
@@ -289,7 +294,7 @@ public abstract class SetVacationResponseTest {
 
     @Test
     public void setVacationResponseShouldAllowPartialUpdates() {
-        jmapServer.serverProbe().modifyVacation(AccountId.fromString(USER),
+        jmapGuiceProbe.modifyVacation(AccountId.fromString(USER),
             VacationPatch.builder()
                 .textBody(ValuePatch.modifyTo("any value"))
                 .build());
@@ -318,7 +323,7 @@ public abstract class SetVacationResponseTest {
             .body(NAME, equalTo("vacationResponseSet"))
             .body(ARGUMENTS + ".updated[0]", equalTo("singleton"));
 
-        assertThat(jmapServer.serverProbe().retrieveVacation(AccountId.fromString(USER)))
+        assertThat(jmapGuiceProbe.retrieveVacation(AccountId.fromString(USER)))
             .isEqualTo(Vacation.builder()
                 .enabled(false)
                 .textBody(newTextBody)
@@ -353,7 +358,7 @@ public abstract class SetVacationResponseTest {
             .body(NAME, equalTo("vacationResponseSet"))
             .body(ARGUMENTS + ".updated[0]", equalTo("singleton"));
 
-        Vacation vacation = jmapServer.serverProbe().retrieveVacation(AccountId.fromString(USER));
+        Vacation vacation = jmapGuiceProbe.retrieveVacation(AccountId.fromString(USER));
         assertThat(vacation.getTextBody()).contains("Message explaining my wonderful vacations");
         assertThat(vacation.isEnabled()).isTrue();
         assertThat(vacation.getFromDate()).contains(ZonedDateTime.parse("2016-04-03T02:01+07:00[Asia/Vientiane]"));

http://git-wip-us.apache.org/repos/asf/james-project/blob/ebbf1e6f/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/MainStepdefs.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/MainStepdefs.java b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/MainStepdefs.java
index 3d91cf2..525b563 100644
--- a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/MainStepdefs.java
+++ b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/MainStepdefs.java
@@ -20,16 +20,18 @@
 package org.apache.james.jmap.methods.integration.cucumber;
 
 import org.apache.http.client.utils.URIBuilder;
-import org.apache.james.GuiceJmapJamesServer;
+import org.apache.james.GuiceJamesServer;
+import org.apache.james.JmapServer;
+import org.apache.james.WebAdminServer;
+import org.apache.james.utils.JmapGuiceProbe;
 
 import com.google.common.base.Charsets;
-
 import cucumber.runtime.java.guice.ScenarioScoped;
 
 @ScenarioScoped
-public class MainStepdefs {
+public class MainStepdefs<T extends GuiceJamesServer & JmapServer & WebAdminServer> {
 
-    public GuiceJmapJamesServer jmapServer;
+    public T jmapServer;
     public Runnable awaitMethod = () -> {};
 
     public void init() throws Exception {
@@ -41,8 +43,8 @@ public class MainStepdefs {
         return new URIBuilder()
                 .setScheme("http")
                 .setHost("localhost")
-                .setPort(jmapServer.getJmapPort()
-                        .orElseThrow(() -> new RuntimeException("Unable to locate JMAP port")))
+                .setPort(jmapServer.getJmapProbe()
+                    .getJmapPort())
                 .setCharset(Charsets.UTF_8);
     }
     

http://git-wip-us.apache.org/repos/asf/james-project/blob/ebbf1e6f/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/MemoryGetMailboxesMethodTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/MemoryGetMailboxesMethodTest.java b/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/MemoryGetMailboxesMethodTest.java
index f352177..0be8484 100644
--- a/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/MemoryGetMailboxesMethodTest.java
+++ b/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/MemoryGetMailboxesMethodTest.java
@@ -19,21 +19,21 @@
 
 package org.apache.james.jmap.memory;
 
-import org.apache.james.GuiceJmapJamesServer;
+import org.apache.james.MemoryJamesServer;
 import org.apache.james.MemoryJamesServerMain;
 import org.apache.james.jmap.methods.integration.GetMailboxesMethodTest;
 import org.apache.james.jmap.servers.MemoryJmapServerModule;
 import org.junit.Rule;
 import org.junit.rules.TemporaryFolder;
 
-public class MemoryGetMailboxesMethodTest extends GetMailboxesMethodTest {
+public class MemoryGetMailboxesMethodTest extends GetMailboxesMethodTest<MemoryJamesServer> {
 
     @Rule
     public TemporaryFolder temporaryFolder = new TemporaryFolder();
 
     @Override
-    protected GuiceJmapJamesServer createJmapServer() {
-        return new GuiceJmapJamesServer()
+    protected MemoryJamesServer createJmapServer() {
+        return new MemoryJamesServer()
                 .combineWith(MemoryJamesServerMain.inMemoryServerModule)
                 .overrideWith(new MemoryJmapServerModule(temporaryFolder));
     }

http://git-wip-us.apache.org/repos/asf/james-project/blob/ebbf1e6f/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/MemoryGetMessageListMethodTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/MemoryGetMessageListMethodTest.java b/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/MemoryGetMessageListMethodTest.java
index 3c22d03..845e1fa 100644
--- a/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/MemoryGetMessageListMethodTest.java
+++ b/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/MemoryGetMessageListMethodTest.java
@@ -19,21 +19,21 @@
 
 package org.apache.james.jmap.memory;
 
-import org.apache.james.GuiceJmapJamesServer;
+import org.apache.james.MemoryJamesServer;
 import org.apache.james.MemoryJamesServerMain;
 import org.apache.james.jmap.methods.integration.GetMessageListMethodTest;
 import org.apache.james.jmap.servers.MemoryJmapServerModule;
 import org.junit.Rule;
 import org.junit.rules.TemporaryFolder;
 
-public class MemoryGetMessageListMethodTest extends GetMessageListMethodTest {
+public class MemoryGetMessageListMethodTest extends GetMessageListMethodTest<MemoryJamesServer> {
 
     @Rule
     public TemporaryFolder temporaryFolder = new TemporaryFolder();
 
     @Override
-    protected GuiceJmapJamesServer createJmapServer() {
-        return new GuiceJmapJamesServer()
+    protected MemoryJamesServer createJmapServer() {
+        return new MemoryJamesServer()
                     .combineWith(MemoryJamesServerMain.inMemoryServerModule)
                     .overrideWith(new MemoryJmapServerModule(temporaryFolder));
     }

http://git-wip-us.apache.org/repos/asf/james-project/blob/ebbf1e6f/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/MemoryGetVacationResponseMethodTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/MemoryGetVacationResponseMethodTest.java b/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/MemoryGetVacationResponseMethodTest.java
index 14bdfbf..02d8ada 100644
--- a/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/MemoryGetVacationResponseMethodTest.java
+++ b/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/MemoryGetVacationResponseMethodTest.java
@@ -19,7 +19,7 @@
 
 package org.apache.james.jmap.memory;
 
-import org.apache.james.GuiceJmapJamesServer;
+import org.apache.james.MemoryJamesServer;
 import org.apache.james.MemoryJamesServerMain;
 import org.apache.james.jmap.methods.integration.GetVacationResponseTest;
 import org.apache.james.jmap.servers.MemoryJmapServerModule;
@@ -27,14 +27,14 @@ import org.apache.james.util.date.ZonedDateTimeProvider;
 import org.junit.Rule;
 import org.junit.rules.TemporaryFolder;
 
-public class MemoryGetVacationResponseMethodTest extends GetVacationResponseTest {
+public class MemoryGetVacationResponseMethodTest extends GetVacationResponseTest<MemoryJamesServer> {
 
     @Rule
     public TemporaryFolder temporaryFolder = new TemporaryFolder();
 
     @Override
-    protected GuiceJmapJamesServer createJmapServer(ZonedDateTimeProvider zonedDateTimeProvider) {
-        return new GuiceJmapJamesServer()
+    protected MemoryJamesServer createJmapServer(ZonedDateTimeProvider zonedDateTimeProvider) {
+        return new MemoryJamesServer()
                     .combineWith(MemoryJamesServerMain.inMemoryServerModule)
                     .overrideWith(new MemoryJmapServerModule(temporaryFolder),
                         binder -> binder.bind(ZonedDateTimeProvider.class).toInstance(zonedDateTimeProvider));

http://git-wip-us.apache.org/repos/asf/james-project/blob/ebbf1e6f/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/MemoryJmapAuthenticationTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/MemoryJmapAuthenticationTest.java b/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/MemoryJmapAuthenticationTest.java
index 50880f0..927c513 100644
--- a/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/MemoryJmapAuthenticationTest.java
+++ b/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/MemoryJmapAuthenticationTest.java
@@ -19,7 +19,7 @@
 
 package org.apache.james.jmap.memory;
 
-import org.apache.james.GuiceJmapJamesServer;
+import org.apache.james.MemoryJamesServer;
 import org.apache.james.MemoryJamesServerMain;
 import org.apache.james.jmap.FixedDateZonedDateTimeProvider;
 import org.apache.james.jmap.JMAPAuthenticationTest;
@@ -28,14 +28,14 @@ import org.apache.james.util.date.ZonedDateTimeProvider;
 import org.junit.Rule;
 import org.junit.rules.TemporaryFolder;
 
-public class MemoryJmapAuthenticationTest extends JMAPAuthenticationTest {
+public class MemoryJmapAuthenticationTest extends JMAPAuthenticationTest<MemoryJamesServer> {
 
     @Rule
     public TemporaryFolder temporaryFolder = new TemporaryFolder();
 
     @Override
-    protected GuiceJmapJamesServer createJmapServer(FixedDateZonedDateTimeProvider zonedDateTimeProvider) {
-        return new GuiceJmapJamesServer()
+    protected MemoryJamesServer createJmapServer(FixedDateZonedDateTimeProvider zonedDateTimeProvider) {
+        return new MemoryJamesServer()
                 .combineWith(MemoryJamesServerMain.inMemoryServerModule)
                 .overrideWith(new MemoryJmapServerModule(temporaryFolder),
                              (binder) -> binder.bind(ZonedDateTimeProvider.class).toInstance(zonedDateTimeProvider));

http://git-wip-us.apache.org/repos/asf/james-project/blob/ebbf1e6f/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/MemorySetMailboxesMethodTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/MemorySetMailboxesMethodTest.java b/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/MemorySetMailboxesMethodTest.java
index c8ebc7a..4e98f06 100644
--- a/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/MemorySetMailboxesMethodTest.java
+++ b/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/MemorySetMailboxesMethodTest.java
@@ -19,21 +19,21 @@
 
 package org.apache.james.jmap.memory;
 
-import org.apache.james.GuiceJmapJamesServer;
+import org.apache.james.MemoryJamesServer;
 import org.apache.james.MemoryJamesServerMain;
 import org.apache.james.jmap.methods.integration.SetMailboxesMethodTest;
 import org.apache.james.jmap.servers.MemoryJmapServerModule;
 import org.junit.Rule;
 import org.junit.rules.TemporaryFolder;
 
-public class MemorySetMailboxesMethodTest extends SetMailboxesMethodTest {
+public class MemorySetMailboxesMethodTest extends SetMailboxesMethodTest<MemoryJamesServer> {
 
     @Rule
     public TemporaryFolder temporaryFolder = new TemporaryFolder();
 
     @Override
-    protected GuiceJmapJamesServer createJmapServer() {
-        return new GuiceJmapJamesServer()
+    protected MemoryJamesServer createJmapServer() {
+        return new MemoryJamesServer()
                     .combineWith(MemoryJamesServerMain.inMemoryServerModule)
                     .overrideWith(new MemoryJmapServerModule(temporaryFolder));
     }

http://git-wip-us.apache.org/repos/asf/james-project/blob/ebbf1e6f/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/MemorySetMessagesMethodTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/MemorySetMessagesMethodTest.java b/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/MemorySetMessagesMethodTest.java
index 5b5e3d2..98697d2 100644
--- a/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/MemorySetMessagesMethodTest.java
+++ b/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/MemorySetMessagesMethodTest.java
@@ -19,21 +19,21 @@
 
 package org.apache.james.jmap.memory;
 
-import org.apache.james.GuiceJmapJamesServer;
+import org.apache.james.MemoryJamesServer;
 import org.apache.james.MemoryJamesServerMain;
 import org.apache.james.jmap.methods.integration.SetMessagesMethodTest;
 import org.apache.james.jmap.servers.MemoryJmapServerModule;
 import org.junit.Rule;
 import org.junit.rules.TemporaryFolder;
 
-public class MemorySetMessagesMethodTest extends SetMessagesMethodTest {
+public class MemorySetMessagesMethodTest extends SetMessagesMethodTest<MemoryJamesServer> {
 
     @Rule
     public TemporaryFolder temporaryFolder = new TemporaryFolder();
 
     @Override
-    protected GuiceJmapJamesServer createJmapServer() {
-        return new GuiceJmapJamesServer()
+    protected MemoryJamesServer createJmapServer() {
+        return new MemoryJamesServer()
                     .combineWith(MemoryJamesServerMain.inMemoryServerModule)
                     .overrideWith(new MemoryJmapServerModule(temporaryFolder));
     }

http://git-wip-us.apache.org/repos/asf/james-project/blob/ebbf1e6f/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/MemorySetVacationResponseMethodTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/MemorySetVacationResponseMethodTest.java b/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/MemorySetVacationResponseMethodTest.java
index 3524510..816a510 100644
--- a/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/MemorySetVacationResponseMethodTest.java
+++ b/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/MemorySetVacationResponseMethodTest.java
@@ -19,21 +19,21 @@
 
 package org.apache.james.jmap.memory;
 
-import org.apache.james.GuiceJmapJamesServer;
+import org.apache.james.MemoryJamesServer;
 import org.apache.james.MemoryJamesServerMain;
 import org.apache.james.jmap.methods.integration.SetVacationResponseTest;
 import org.apache.james.jmap.servers.MemoryJmapServerModule;
 import org.junit.Rule;
 import org.junit.rules.TemporaryFolder;
 
-public class MemorySetVacationResponseMethodTest extends SetVacationResponseTest {
+public class MemorySetVacationResponseMethodTest extends SetVacationResponseTest<MemoryJamesServer> {
 
     @Rule
     public TemporaryFolder temporaryFolder = new TemporaryFolder();
 
     @Override
-    protected GuiceJmapJamesServer createJmapServer() {
-        return new GuiceJmapJamesServer()
+    protected MemoryJamesServer createJmapServer() {
+        return new MemoryJamesServer()
                     .combineWith(MemoryJamesServerMain.inMemoryServerModule)
                     .overrideWith(new MemoryJmapServerModule(temporaryFolder));
     }

http://git-wip-us.apache.org/repos/asf/james-project/blob/ebbf1e6f/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/MemoryVacationIntegrationTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/MemoryVacationIntegrationTest.java b/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/MemoryVacationIntegrationTest.java
index e238e01..253c8ba 100644
--- a/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/MemoryVacationIntegrationTest.java
+++ b/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/MemoryVacationIntegrationTest.java
@@ -19,21 +19,21 @@
 
 package org.apache.james.jmap.memory;
 
-import org.apache.james.GuiceJmapJamesServer;
+import org.apache.james.MemoryJamesServer;
 import org.apache.james.MemoryJamesServerMain;
 import org.apache.james.jmap.VacationIntegrationTest;
 import org.apache.james.jmap.servers.MemoryJmapServerModule;
 import org.junit.Rule;
 import org.junit.rules.TemporaryFolder;
 
-public class MemoryVacationIntegrationTest extends VacationIntegrationTest {
+public class MemoryVacationIntegrationTest extends VacationIntegrationTest<MemoryJamesServer> {
 
     @Rule
     public TemporaryFolder temporaryFolder = new TemporaryFolder();
 
     @Override
-    protected GuiceJmapJamesServer createJmapServer() {
-        return new GuiceJmapJamesServer()
+    protected MemoryJamesServer createJmapServer() {
+        return new MemoryJamesServer()
             .combineWith(MemoryJamesServerMain.inMemoryServerModule)
             .overrideWith(new MemoryJmapServerModule(temporaryFolder));
     }

http://git-wip-us.apache.org/repos/asf/james-project/blob/ebbf1e6f/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/cucumber/MemoryStepdefs.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/cucumber/MemoryStepdefs.java b/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/cucumber/MemoryStepdefs.java
index 66fe90c..fc36fc7 100644
--- a/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/cucumber/MemoryStepdefs.java
+++ b/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/cucumber/MemoryStepdefs.java
@@ -21,7 +21,7 @@ package org.apache.james.jmap.memory.cucumber;
 
 import javax.inject.Inject;
 
-import org.apache.james.GuiceJmapJamesServer;
+import org.apache.james.MemoryJamesServer;
 import org.apache.james.MemoryJamesServerMain;
 import org.apache.james.jmap.methods.integration.cucumber.MainStepdefs;
 import org.apache.james.jmap.servers.MemoryJmapServerModule;
@@ -46,7 +46,7 @@ public class MemoryStepdefs {
     @Before
     public void init() throws Exception {
         temporaryFolder.create();
-        mainStepdefs.jmapServer = new GuiceJmapJamesServer()
+        mainStepdefs.jmapServer = new MemoryJamesServer()
                 .combineWith(MemoryJamesServerMain.inMemoryServerModule)
                 .overrideWith(new MemoryJmapServerModule(temporaryFolder));
         mainStepdefs.init();

http://git-wip-us.apache.org/repos/asf/james-project/blob/ebbf1e6f/server/protocols/webadmin-integration-test/src/test/java/org/apache/james/webadmin/integration/WebAdminServerIntegrationTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/webadmin-integration-test/src/test/java/org/apache/james/webadmin/integration/WebAdminServerIntegrationTest.java b/server/protocols/webadmin-integration-test/src/test/java/org/apache/james/webadmin/integration/WebAdminServerIntegrationTest.java
index 84ebdb1..83a33e4 100644
--- a/server/protocols/webadmin-integration-test/src/test/java/org/apache/james/webadmin/integration/WebAdminServerIntegrationTest.java
+++ b/server/protocols/webadmin-integration-test/src/test/java/org/apache/james/webadmin/integration/WebAdminServerIntegrationTest.java
@@ -27,8 +27,8 @@ import static org.apache.james.webadmin.Constants.SEPARATOR;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.hamcrest.Matchers.is;
 
+import org.apache.james.CassandraJamesServer;
 import org.apache.james.CassandraJamesServerMain;
-import org.apache.james.GuiceJmapJamesServer;
 import org.apache.james.backends.cassandra.EmbeddedCassandra;
 import org.apache.james.mailbox.elasticsearch.EmbeddedElasticSearch;
 import org.apache.james.modules.CassandraJmapServerModule;
@@ -65,11 +65,11 @@ public class WebAdminServerIntegrationTest {
         .outerRule(temporaryFolder)
         .around(embeddedElasticSearch);
 
-    private GuiceJmapJamesServer guiceJamesServer;
+    private CassandraJamesServer guiceJamesServer;
 
     @Before
     public void setUp() throws Exception {
-        guiceJamesServer = new GuiceJmapJamesServer()
+        guiceJamesServer = new CassandraJamesServer()
             .combineWith(CassandraJamesServerMain.cassandraServerModule)
             .overrideWith(new CassandraJmapServerModule(temporaryFolder, embeddedElasticSearch, cassandra),
                 new WebAdminConfigurationModule());
@@ -79,10 +79,7 @@ public class WebAdminServerIntegrationTest {
         		.setContentType(ContentType.JSON)
         		.setAccept(ContentType.JSON)
         		.setConfig(newConfig().encoderConfig(encoderConfig().defaultContentCharset(Charsets.UTF_8)))
-        		.setPort(guiceJamesServer
-        					.getWebadminPort()
-				            .orElseThrow(() -> new RuntimeException("Unable to locate Web Admin port"))
-				            .toInt())
+        		.setPort(guiceJamesServer.getWebAdminProbe().getWebAdminPort())
         		.build();
     }
 


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


[11/29] james-project git commit: JAMES-1842: Add jpa-guice module

Posted by ad...@apache.org.
JAMES-1842: Add jpa-guice module


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

Branch: refs/heads/master
Commit: d65e484a701c04efd570fc8fbc6050a5f273ed33
Parents: 4bc564d
Author: Quynh Nguyen <qn...@linagora.com>
Authored: Fri Oct 28 12:24:15 2016 +0700
Committer: Quynh Nguyen <qn...@linagora.com>
Committed: Fri Nov 18 09:25:34 2016 +0700

----------------------------------------------------------------------
 .../james-database.properties                   |  40 +++
 .../MailetProcessingWithoutCamelModule.java     |  34 ++
 .../modules/ProtocolsModuleWithoutJMAP.java     |  25 ++
 server/container/guice/jpa-guice/README.adoc    |  40 +++
 server/container/guice/jpa-guice/pom.xml        | 336 +++++++++++++++++++
 .../java/org/apache/james/JPAConfiguration.java |  63 ++++
 .../org/apache/james/JPAJamesServerMain.java    |  61 ++++
 .../james/modules/data/JPADataJmapModule.java   |  22 ++
 .../james/modules/data/JPADomainListModule.java |  77 +++++
 .../data/JPARecipientRewriteTableModule.java    |  78 +++++
 .../modules/data/JPAUsersRepositoryModule.java  |  79 +++++
 .../james/modules/mailbox/JPAMailboxModule.java | 134 ++++++++
 .../mailbox/LuceneSearchMailboxModule.java      |  55 +++
 .../ScheduledExecutorServiceProvider.java       |  49 +++
 .../jpa-guice/src/main/resources/logback.xml    |  22 ++
 .../org/apache/james/JPAJamesServerTest.java    |  44 +++
 .../james/JamesCapabilitiesServerTest.java      |  75 +++++
 .../james/TestJPAConfigurationModule.java       |  49 +++
 .../jpa-guice/src/test/resources/dnsservice.xml |  29 ++
 .../test/resources/fakemailrepositorystore.xml  |  31 ++
 .../jpa-guice/src/test/resources/imapserver.xml |  54 +++
 .../guice/jpa-guice/src/test/resources/keystore | Bin 0 -> 2245 bytes
 .../jpa-guice/src/test/resources/lmtpserver.xml |  41 +++
 .../src/test/resources/mailetcontainer.xml      | 113 +++++++
 .../src/test/resources/mailrepositorystore.xml  |  31 ++
 .../src/test/resources/managesieveserver.xml    |  65 ++++
 .../jpa-guice/src/test/resources/pop3server.xml |  42 +++
 .../jpa-guice/src/test/resources/smtpserver.xml | 105 ++++++
 server/container/guice/pom.xml                  |   1 +
 29 files changed, 1795 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/d65e484a/server/container/guice/guice-common/sample-configuration/james-database.properties
----------------------------------------------------------------------
diff --git a/server/container/guice/guice-common/sample-configuration/james-database.properties b/server/container/guice/guice-common/sample-configuration/james-database.properties
new file mode 100644
index 0000000..b3ac7eb
--- /dev/null
+++ b/server/container/guice/guice-common/sample-configuration/james-database.properties
@@ -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.
+
+#  This template file can be used as example for James Server configuration
+#  DO NOT USE IT AS SUCH AND ADAPT IT TO YOUR NEEDS
+
+# See http://james.apache.org/server/3/config.html for usage
+
+# Use derby as default
+database.driverClassName=org.apache.derby.jdbc.EmbeddedDriver
+database.url=jdbc:derby:../var/store/derby;create=true
+database.username=app
+database.password=app
+
+# Supported adapters are:
+# DB2, DERBY, H2, HSQL, INFORMIX, MYSQL, ORACLE, POSTGRESQL, SQL_SERVER, SYBASE 
+vendorAdapter.database=DERBY
+
+# Use streaming for Blobs
+# This is only supported on a limited set of databases atm. You should check if its supported by your DB before enable
+# it. 
+# 
+# See:
+# http://openjpa.apache.org/builds/latest/docs/manual/ref_guide_mapping_jpa.html  #7.11.  LOB Streaming 
+# 
+openjpa.streaming=false
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/james-project/blob/d65e484a/server/container/guice/guice-common/src/main/java/org/apache/james/modules/MailetProcessingWithoutCamelModule.java
----------------------------------------------------------------------
diff --git a/server/container/guice/guice-common/src/main/java/org/apache/james/modules/MailetProcessingWithoutCamelModule.java b/server/container/guice/guice-common/src/main/java/org/apache/james/modules/MailetProcessingWithoutCamelModule.java
new file mode 100644
index 0000000..78fbc98
--- /dev/null
+++ b/server/container/guice/guice-common/src/main/java/org/apache/james/modules/MailetProcessingWithoutCamelModule.java
@@ -0,0 +1,34 @@
+/****************************************************************
+ * 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.server.MailStoreRepositoryModule;
+import org.apache.james.modules.server.SieveModule;
+
+import com.google.inject.AbstractModule;
+
+public class MailetProcessingWithoutCamelModule extends AbstractModule {
+
+    @Override
+    protected void configure() {
+        install(new SieveModule());
+        install(new MailStoreRepositoryModule());
+    }
+    
+}

http://git-wip-us.apache.org/repos/asf/james-project/blob/d65e484a/server/container/guice/guice-common/src/main/java/org/apache/james/modules/ProtocolsModuleWithoutJMAP.java
----------------------------------------------------------------------
diff --git a/server/container/guice/guice-common/src/main/java/org/apache/james/modules/ProtocolsModuleWithoutJMAP.java b/server/container/guice/guice-common/src/main/java/org/apache/james/modules/ProtocolsModuleWithoutJMAP.java
new file mode 100644
index 0000000..9c05696
--- /dev/null
+++ b/server/container/guice/guice-common/src/main/java/org/apache/james/modules/ProtocolsModuleWithoutJMAP.java
@@ -0,0 +1,25 @@
+package org.apache.james.modules;
+
+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.WebAdminServerModule;
+
+import com.google.inject.AbstractModule;
+
+public class ProtocolsModuleWithoutJMAP extends AbstractModule {
+    @Override
+    protected void configure() {
+        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/d65e484a/server/container/guice/jpa-guice/README.adoc
----------------------------------------------------------------------
diff --git a/server/container/guice/jpa-guice/README.adoc b/server/container/guice/jpa-guice/README.adoc
new file mode 100644
index 0000000..8f47705
--- /dev/null
+++ b/server/container/guice/jpa-guice/README.adoc
@@ -0,0 +1,40 @@
+= Guice-JPA Module How-to
+
+== Building
+
+=== Requirements
+
+ * Java 8 SDK
+ * Docker
+ * Maven
+
+=== Building the artifacts
+
+An usual compilation using maven will produce two artifacts into target directory :
+
+ * james-server-jpa-guice-${version}.jar
+ * james-server-jpa-guice-${version}.lib
+
+== Running
+
+=== Requirements
+
+=== James Launch
+
+To run james, you have to create a directory containing required configuration files.
+
+A sample directory (appropriately named sample-directory) is provided with some
+default value you may need to replace.
+
+You also need to generate a keystore with the following command :
+[source]
+----
+$ keytool -genkey -alias james -keyalg RSA -keystore conf/keystore
+----
+
+Once everything is set up, you just have to run the jar with :
+
+[source]
+----
+$ java -Dworking.directory=sample-configuration -jar target/james-server-jpa-guice-${version}.jar
+----

http://git-wip-us.apache.org/repos/asf/james-project/blob/d65e484a/server/container/guice/jpa-guice/pom.xml
----------------------------------------------------------------------
diff --git a/server/container/guice/jpa-guice/pom.xml b/server/container/guice/jpa-guice/pom.xml
new file mode 100644
index 0000000..b707871
--- /dev/null
+++ b/server/container/guice/jpa-guice/pom.xml
@@ -0,0 +1,336 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.apache.james</groupId>
+        <artifactId>james-server-guice</artifactId>
+        <version>3.0.0-beta5-SNAPSHOT</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+
+    <artifactId>james-server-jpa-guice</artifactId>
+    <packaging>jar</packaging>
+
+    <name>Apache James :: Server :: JPA - guice injection</name>
+    <description>An advanced email server - JPA backend with guice injection</description>
+
+    <properties>
+        <jpa.includes>empty</jpa.includes>
+    </properties>
+
+    <profiles>
+        <profile>
+            <id>disable-build-for-older-jdk</id>
+            <activation>
+                <jdk>(,1.8)</jdk>
+            </activation>
+            <build>
+                <plugins>
+                    <plugin>
+                        <artifactId>maven-jar-plugin</artifactId>
+                        <executions>
+                            <execution>
+                                <id>default-jar</id>
+                                <phase>none</phase>
+                            </execution>
+                            <execution>
+                                <id>jar</id>
+                                <phase>none</phase>
+                            </execution>
+                            <execution>
+                                <id>test-jar</id>
+                                <phase>none</phase>
+                            </execution>
+                        </executions>
+                    </plugin>
+                    <plugin>
+                        <artifactId>maven-compiler-plugin</artifactId>
+                        <executions>
+                            <execution>
+                                <id>default-compile</id>
+                                <phase>none</phase>
+                            </execution>
+                            <execution>
+                                <id>default-testCompile</id>
+                                <phase>none</phase>
+                            </execution>
+                        </executions>
+                    </plugin>
+                    <plugin>
+                        <artifactId>maven-surefire-plugin</artifactId>
+                        <executions>
+                            <execution>
+                                <id>default-test</id>
+                                <phase>none</phase>
+                            </execution>
+                        </executions>
+                    </plugin>
+                    <plugin>
+                        <artifactId>maven-source-plugin</artifactId>
+                        <executions>
+                            <execution>
+                                <id>attach-sources</id>
+                                <phase>none</phase>
+                            </execution>
+                        </executions>
+                    </plugin>
+                    <plugin>
+                        <artifactId>maven-install-plugin</artifactId>
+                        <executions>
+                            <execution>
+                                <id>default-install</id>
+                                <phase>none</phase>
+                            </execution>
+                        </executions>
+                    </plugin>
+                    <plugin>
+                        <artifactId>maven-resources-plugin</artifactId>
+                        <executions>
+                            <execution>
+                                <id>default-resources</id>
+                                <phase>none</phase>
+                            </execution>
+                            <execution>
+                                <id>default-testResources</id>
+                                <phase>none</phase>
+                            </execution>
+                        </executions>
+                    </plugin>
+                    <plugin>
+                        <artifactId>maven-site-plugin</artifactId>
+                        <executions>
+                            <execution>
+                                <id>attach-descriptor</id>
+                                <phase>none</phase>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+        <profile>
+            <id>build-for-jdk-8</id>
+            <activation>
+                <jdk>[1.8,)</jdk>
+            </activation>
+            <build>
+                <plugins>
+                    <plugin>
+                      <groupId>org.apache.maven.plugins</groupId>
+                      <artifactId>maven-dependency-plugin</artifactId>
+                      <executions>
+                        <execution>
+                          <id>copy-dependencies</id>
+                          <phase>package</phase>
+                          <goals>
+                            <goal>copy-dependencies</goal>
+                          </goals>
+                          <configuration>
+                            <outputDirectory>${project.build.directory}/${project.build.finalName}.lib</outputDirectory>
+                          </configuration>
+                        </execution>
+                      </executions>
+                    </plugin>
+                    <plugin>
+                      <groupId>org.apache.maven.plugins</groupId>
+                      <artifactId>maven-jar-plugin</artifactId>
+                      <executions>
+                          <execution>
+                              <id>default-jar</id>
+                              <goals>
+                                  <goal>jar</goal>
+                              </goals>
+                              <configuration>
+                                  <archive>
+                                      <manifest>
+                                          <addClasspath>true</addClasspath>
+                                          <classpathPrefix>${project.build.finalName}.lib/</classpathPrefix>
+                                          <mainClass>org.apache.james.JPAJamesServerMain</mainClass>
+                                          <useUniqueVersions>false</useUniqueVersions>
+                                      </manifest>
+                                  </archive>
+                              </configuration>
+                          </execution>
+                          <execution>
+                              <id>test-jar</id>
+                              <goals>
+                                  <goal>test-jar</goal>
+                              </goals>
+                          </execution>
+                      </executions>
+                    </plugin>
+                    <plugin>
+                        <groupId>org.apache.maven.plugins</groupId>
+                        <artifactId>maven-compiler-plugin</artifactId>
+                        <configuration>
+                            <source>1.8</source>
+                            <target>1.8</target>
+                        </configuration>
+                    </plugin>
+                </plugins>
+            </build>
+            <dependencies>
+<!--                <dependency>
+                    <groupId>${project.groupId}</groupId>
+                    <artifactId>apache-james-backends-cassandra</artifactId>
+                    <type>test-jar</type>
+                </dependency>-->
+                <dependency>
+                    <groupId>${project.groupId}</groupId>
+                    <artifactId>apache-james-mailbox-jpa</artifactId>
+                </dependency>
+                <dependency>
+                    <groupId>${project.groupId}</groupId>
+                    <artifactId>apache-james-mailbox-jpa</artifactId>
+                    <scope>test</scope>
+                    <type>test-jar</type>
+                </dependency>
+                <dependency>
+                    <groupId>${project.groupId}</groupId>
+                    <artifactId>apache-james-mailbox-lucene</artifactId>
+                </dependency>
+                <dependency>
+                    <groupId>${project.groupId}</groupId>
+                    <artifactId>apache-james-mailbox-lucene</artifactId>
+                    <type>test-jar</type>
+                    <scope>test</scope>
+                </dependency>
+                <dependency>
+                    <groupId>${project.groupId}</groupId>
+                    <artifactId>apache-james-mailbox-tika</artifactId>
+                </dependency>
+                <dependency>
+                    <groupId>${project.groupId}</groupId>
+                    <artifactId>james-server-data-jpa</artifactId>
+                </dependency>
+                <dependency>
+                    <groupId>${project.groupId}</groupId>
+                    <artifactId>james-server-guice-common</artifactId>
+                </dependency>
+                <dependency>
+                    <groupId>${project.groupId}</groupId>
+                    <artifactId>james-server-guice-common</artifactId>
+                    <type>test-jar</type>
+                    <scope>test</scope>
+                </dependency>
+                <dependency>
+                    <groupId>ch.qos.logback</groupId>
+                    <artifactId>logback-classic</artifactId>
+                    <version>1.1.7</version>
+                </dependency>
+                <dependency>
+                    <groupId>com.jayway.awaitility</groupId>
+                    <artifactId>awaitility</artifactId>
+                </dependency>
+                <dependency>
+                    <groupId>com.jayway.restassured</groupId>
+                    <artifactId>rest-assured</artifactId>
+                    <scope>test</scope>
+                </dependency>
+                 <dependency>
+                    <groupId>com.nurkiewicz.asyncretry</groupId>
+                    <artifactId>asyncretry</artifactId>
+                </dependency>
+                <dependency>
+                    <groupId>org.assertj</groupId>
+                    <artifactId>assertj-core</artifactId>
+                    <version>${assertj-3.version}</version>
+                    <scope>test</scope>
+                </dependency>
+                <dependency>
+                    <groupId>org.mockito</groupId>
+                    <artifactId>mockito-core</artifactId>
+                    <scope>test</scope>
+                </dependency>
+                <dependency>
+                    <groupId>org.apache.openjpa</groupId>
+                    <artifactId>openjpa</artifactId>
+                </dependency>
+                <dependency>
+                    <groupId>org.apache.geronimo.specs</groupId>
+                    <artifactId>geronimo-jpa_2.0_spec</artifactId>
+                </dependency>
+            </dependencies>
+        </profile>
+        <profile>
+            <id>jpa</id>
+            <properties>
+                <jpa.includes>**/*.java</jpa.includes>
+            </properties>
+        </profile>
+        <profile>
+            <id>animal-sniffer-java-8</id>
+            <activation>
+                <jdk>[1.8,)</jdk>
+            </activation>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.codehaus.mojo</groupId>
+                        <artifactId>animal-sniffer-maven-plugin</artifactId>
+                        <configuration>
+                            <signature>
+                                <groupId>org.codehaus.mojo.signature</groupId>
+                                <artifactId>java18</artifactId>
+                                <version>1.0</version>
+                            </signature>
+                        </configuration>
+                        <executions>
+                            <execution>
+                                <id>check_java_8</id>
+                                <phase>test</phase>
+                                <goals>
+                                    <goal>check</goal>
+                                </goals>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+    </profiles>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-bundle-plugin</artifactId>
+                <extensions>true</extensions>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-surefire-plugin</artifactId>
+                <configuration>
+                   <excludes>
+                       <exclude>**/suite/*.java</exclude>
+                       <exclude>**/suite/**/*.java</exclude>
+                   </excludes>
+                   <includes>
+                       <include>${jpa.includes}</include>
+                   </includes>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+</project>

http://git-wip-us.apache.org/repos/asf/james-project/blob/d65e484a/server/container/guice/jpa-guice/src/main/java/org/apache/james/JPAConfiguration.java
----------------------------------------------------------------------
diff --git a/server/container/guice/jpa-guice/src/main/java/org/apache/james/JPAConfiguration.java b/server/container/guice/jpa-guice/src/main/java/org/apache/james/JPAConfiguration.java
new file mode 100644
index 0000000..8041205
--- /dev/null
+++ b/server/container/guice/jpa-guice/src/main/java/org/apache/james/JPAConfiguration.java
@@ -0,0 +1,63 @@
+/****************************************************************
+ * 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;
+
+import com.google.common.annotations.VisibleForTesting;
+
+public class JPAConfiguration {
+    public static Builder builder() {
+        return new Builder();
+    }
+
+    public static class Builder {
+        private String driverName;
+        private String driverURL;
+
+        public Builder driverName(String driverName) {
+            this.driverName = driverName;
+            return this;
+        }
+
+        public Builder driverURL(String driverURL) {
+            this.driverURL = driverURL;
+            return this;
+        }
+
+        public JPAConfiguration build() {
+            return new JPAConfiguration(driverName, driverURL);
+        }
+    }
+
+    private final String driverName;
+    private final String driverURL;
+
+    @VisibleForTesting JPAConfiguration(String driverName, String driverURL) {
+        this.driverName = driverName;
+        this.driverURL = driverURL;
+    }
+
+    public String getDriverName() {
+        return driverName;
+    }
+
+    public String getDriverURL() {
+        return driverURL;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/james-project/blob/d65e484a/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
new file mode 100644
index 0000000..090965d
--- /dev/null
+++ b/server/container/guice/jpa-guice/src/main/java/org/apache/james/JPAJamesServerMain.java
@@ -0,0 +1,61 @@
+/****************************************************************
+ * 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;
+
+import org.apache.james.modules.CommonServicesModule;
+import org.apache.james.modules.MailetProcessingWithoutCamelModule;
+import org.apache.james.modules.ProtocolsModuleWithoutJMAP;
+import org.apache.james.modules.data.JPADataJmapModule;
+import org.apache.james.modules.data.JPADomainListModule;
+import org.apache.james.modules.data.JPARecipientRewriteTableModule;
+import org.apache.james.modules.data.JPAUsersRepositoryModule;
+import org.apache.james.modules.mailbox.JPAMailboxModule;
+import org.apache.james.modules.mailbox.LuceneSearchMailboxModule;
+import org.apache.james.modules.server.ActiveMQQueueModule;
+import org.apache.james.modules.server.JMXServerModule;
+import org.apache.james.modules.server.QuotaModule;
+
+import com.google.inject.Module;
+import com.google.inject.util.Modules;
+
+public class JPAJamesServerMain {
+    public static final Module mainServerModule = Modules.combine(
+            new CommonServicesModule(),
+            new ProtocolsModuleWithoutJMAP(),
+            new MailetProcessingWithoutCamelModule());
+
+    public static final Module jpaServerModule = Modules.combine(
+        new JPAMailboxModule(),
+        new JPAUsersRepositoryModule(),
+        new JPADomainListModule(),
+        new JPARecipientRewriteTableModule(),
+        new JPADataJmapModule(),
+        new LuceneSearchMailboxModule(),
+        new QuotaModule(),
+        new ActiveMQQueueModule());
+
+
+    public static void main(String[] args) throws Exception {
+        GuiceJamesServer server = new GuiceJamesServer(mainServerModule)
+                    .combineWith(jpaServerModule, new JMXServerModule());
+        server.start();
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/james-project/blob/d65e484a/server/container/guice/jpa-guice/src/main/java/org/apache/james/modules/data/JPADataJmapModule.java
----------------------------------------------------------------------
diff --git a/server/container/guice/jpa-guice/src/main/java/org/apache/james/modules/data/JPADataJmapModule.java b/server/container/guice/jpa-guice/src/main/java/org/apache/james/modules/data/JPADataJmapModule.java
new file mode 100644
index 0000000..84eda74
--- /dev/null
+++ b/server/container/guice/jpa-guice/src/main/java/org/apache/james/modules/data/JPADataJmapModule.java
@@ -0,0 +1,22 @@
+package org.apache.james.modules.data;
+
+import org.apache.james.jmap.api.vacation.VacationRepository;
+import org.apache.james.jmap.vacation.NoneVacationRepository;
+import org.apache.james.sieverepository.api.SieveRepository;
+import org.apache.james.sieverepository.file.SieveFileRepository;
+
+import com.google.inject.AbstractModule;
+import com.google.inject.Scopes;
+
+public class JPADataJmapModule extends AbstractModule {
+
+    @Override
+    protected void configure() {
+        bind(NoneVacationRepository.class).in(Scopes.SINGLETON);
+        bind(VacationRepository.class).to(NoneVacationRepository.class);
+
+        bind(SieveFileRepository.class).in(Scopes.SINGLETON);
+        bind(SieveRepository.class).to(SieveFileRepository.class);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/james-project/blob/d65e484a/server/container/guice/jpa-guice/src/main/java/org/apache/james/modules/data/JPADomainListModule.java
----------------------------------------------------------------------
diff --git a/server/container/guice/jpa-guice/src/main/java/org/apache/james/modules/data/JPADomainListModule.java b/server/container/guice/jpa-guice/src/main/java/org/apache/james/modules/data/JPADomainListModule.java
new file mode 100644
index 0000000..4bb0030
--- /dev/null
+++ b/server/container/guice/jpa-guice/src/main/java/org/apache/james/modules/data/JPADomainListModule.java
@@ -0,0 +1,77 @@
+/****************************************************************
+ * 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 com.google.common.base.Throwables;
+import com.google.common.collect.ImmutableList;
+import com.google.inject.AbstractModule;
+import com.google.inject.Inject;
+import com.google.inject.Scopes;
+import com.google.inject.Singleton;
+import com.google.inject.multibindings.Multibinder;
+import org.apache.commons.configuration.ConfigurationException;
+import org.apache.james.domainlist.api.DomainList;
+import org.apache.james.domainlist.jpa.JPADomainList;
+import org.apache.james.lifecycle.api.Configurable;
+import org.apache.james.utils.ConfigurationPerformer;
+import org.apache.james.utils.ConfigurationProvider;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.List;
+
+public class JPADomainListModule extends AbstractModule {
+
+    private static final Logger LOGGER = LoggerFactory.getLogger(DomainList.class);
+    
+    @Override
+    public void configure() {
+        bind(JPADomainList.class).in(Scopes.SINGLETON);
+        bind(DomainList.class).to(JPADomainList.class);
+        Multibinder.newSetBinder(binder(), ConfigurationPerformer.class).addBinding().to(JPADomainListConfigurationPerformer.class);
+    }
+    
+    @Singleton
+    public static class JPADomainListConfigurationPerformer implements ConfigurationPerformer {
+
+        private final ConfigurationProvider configurationProvider;
+        private final JPADomainList jpaDomainList;
+
+        @Inject
+        public JPADomainListConfigurationPerformer(ConfigurationProvider configurationProvider, JPADomainList jpaDomainList) {
+            this.configurationProvider = configurationProvider;
+            this.jpaDomainList = jpaDomainList;
+        }
+
+        @Override
+        public void initModule() {
+            try {
+                jpaDomainList.setLog(LOGGER);
+                jpaDomainList.configure(configurationProvider.getConfiguration("domainlist"));
+            } catch (ConfigurationException e) {
+                Throwables.propagate(e);
+            }
+        }
+
+        @Override
+        public List<Class<? extends Configurable>> forClasses() {
+            return ImmutableList.of(JPADomainList.class);
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/james-project/blob/d65e484a/server/container/guice/jpa-guice/src/main/java/org/apache/james/modules/data/JPARecipientRewriteTableModule.java
----------------------------------------------------------------------
diff --git a/server/container/guice/jpa-guice/src/main/java/org/apache/james/modules/data/JPARecipientRewriteTableModule.java b/server/container/guice/jpa-guice/src/main/java/org/apache/james/modules/data/JPARecipientRewriteTableModule.java
new file mode 100644
index 0000000..a1f55b3
--- /dev/null
+++ b/server/container/guice/jpa-guice/src/main/java/org/apache/james/modules/data/JPARecipientRewriteTableModule.java
@@ -0,0 +1,78 @@
+/****************************************************************
+ * 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 com.google.common.base.Throwables;
+import com.google.common.collect.ImmutableList;
+import com.google.inject.AbstractModule;
+import com.google.inject.Inject;
+import com.google.inject.Scopes;
+import com.google.inject.Singleton;
+import com.google.inject.multibindings.Multibinder;
+import org.apache.commons.configuration.ConfigurationException;
+import org.apache.james.lifecycle.api.Configurable;
+import org.apache.james.rrt.api.RecipientRewriteTable;
+import org.apache.james.rrt.jpa.JPARecipientRewriteTable;
+import org.apache.james.utils.ConfigurationPerformer;
+import org.apache.james.utils.ConfigurationProvider;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.List;
+
+public class JPARecipientRewriteTableModule extends AbstractModule {
+
+    private static final Logger LOGGER = LoggerFactory.getLogger(RecipientRewriteTable.class);
+
+    @Override
+    public void configure() {
+        bind(JPARecipientRewriteTable.class).in(Scopes.SINGLETON);
+        bind(RecipientRewriteTable.class).to(JPARecipientRewriteTable.class);
+        Multibinder.newSetBinder(binder(), ConfigurationPerformer.class).addBinding().to(JPARecipientRewriteTablePerformer.class);
+    }
+
+    @Singleton
+    public static class JPARecipientRewriteTablePerformer implements ConfigurationPerformer {
+
+        private final ConfigurationProvider configurationProvider;
+        private final JPARecipientRewriteTable recipientRewriteTable;
+
+        @Inject
+        public JPARecipientRewriteTablePerformer(ConfigurationProvider configurationProvider, JPARecipientRewriteTable recipientRewriteTable) {
+            this.configurationProvider = configurationProvider;
+            this.recipientRewriteTable = recipientRewriteTable;
+        }
+
+        @Override
+        public void initModule() {
+            try {
+                recipientRewriteTable.setLog(LOGGER);
+                recipientRewriteTable.configure(configurationProvider.getConfiguration("recipientrewritetable"));
+            } catch (ConfigurationException e) {
+                Throwables.propagate(e);
+            }
+        }
+
+        @Override
+        public List<Class<? extends Configurable>> forClasses() {
+            return ImmutableList.of(JPARecipientRewriteTable.class);
+        }
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/james-project/blob/d65e484a/server/container/guice/jpa-guice/src/main/java/org/apache/james/modules/data/JPAUsersRepositoryModule.java
----------------------------------------------------------------------
diff --git a/server/container/guice/jpa-guice/src/main/java/org/apache/james/modules/data/JPAUsersRepositoryModule.java b/server/container/guice/jpa-guice/src/main/java/org/apache/james/modules/data/JPAUsersRepositoryModule.java
new file mode 100644
index 0000000..ca26073
--- /dev/null
+++ b/server/container/guice/jpa-guice/src/main/java/org/apache/james/modules/data/JPAUsersRepositoryModule.java
@@ -0,0 +1,79 @@
+/****************************************************************
+ * 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 com.google.common.base.Throwables;
+import com.google.common.collect.ImmutableList;
+import com.google.inject.AbstractModule;
+import com.google.inject.Inject;
+import com.google.inject.Scopes;
+import com.google.inject.Singleton;
+import com.google.inject.multibindings.Multibinder;
+import org.apache.commons.configuration.ConfigurationException;
+import org.apache.james.lifecycle.api.Configurable;
+import org.apache.james.user.api.UsersRepository;
+import org.apache.james.user.jpa.JPAUsersRepository;
+import org.apache.james.utils.ConfigurationPerformer;
+import org.apache.james.utils.ConfigurationProvider;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.List;
+
+public class JPAUsersRepositoryModule extends AbstractModule {
+
+    private static final Logger LOGGER = LoggerFactory.getLogger(JPAUsersRepositoryModule.class);
+
+    @Override
+    public void configure() {
+        bind(JPAUsersRepository.class).in(Scopes.SINGLETON);
+        bind(UsersRepository.class).to(JPAUsersRepository.class);
+
+        Multibinder.newSetBinder(binder(), ConfigurationPerformer.class).addBinding().to(JPAUsersRepositoryConfigurationPerformer.class);
+    }
+
+    @Singleton
+    public static class JPAUsersRepositoryConfigurationPerformer implements ConfigurationPerformer {
+
+        private final ConfigurationProvider configurationProvider;
+        private final JPAUsersRepository usersRepository;
+
+        @Inject
+        public JPAUsersRepositoryConfigurationPerformer(ConfigurationProvider configurationProvider, JPAUsersRepository usersRepository) {
+            this.configurationProvider = configurationProvider;
+            this.usersRepository = usersRepository;
+        }
+
+        @Override
+        public void initModule() {
+            try {
+                usersRepository.setLog(LOGGER);
+                usersRepository.configure(configurationProvider.getConfiguration("usersrepository"));
+            } catch (ConfigurationException e) {
+                Throwables.propagate(e);
+            }
+        }
+
+        @Override
+        public List<Class<? extends Configurable>> forClasses() {
+            return ImmutableList.of(JPAUsersRepository.class);
+        }
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/james-project/blob/d65e484a/server/container/guice/jpa-guice/src/main/java/org/apache/james/modules/mailbox/JPAMailboxModule.java
----------------------------------------------------------------------
diff --git a/server/container/guice/jpa-guice/src/main/java/org/apache/james/modules/mailbox/JPAMailboxModule.java b/server/container/guice/jpa-guice/src/main/java/org/apache/james/modules/mailbox/JPAMailboxModule.java
new file mode 100644
index 0000000..7f5f6eb
--- /dev/null
+++ b/server/container/guice/jpa-guice/src/main/java/org/apache/james/modules/mailbox/JPAMailboxModule.java
@@ -0,0 +1,134 @@
+/****************************************************************
+ * 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.mailbox;
+
+import java.io.FileNotFoundException;
+import java.util.HashMap;
+
+import javax.inject.Singleton;
+import javax.persistence.EntityManagerFactory;
+import javax.persistence.Persistence;
+
+import org.apache.commons.configuration.ConfigurationException;
+import org.apache.commons.configuration.PropertiesConfiguration;
+import org.apache.james.JPAConfiguration;
+import org.apache.james.adapter.mailbox.store.UserRepositoryAuthenticator;
+import org.apache.james.mailbox.MailboxManager;
+import org.apache.james.mailbox.MailboxPathLocker;
+import org.apache.james.mailbox.SubscriptionManager;
+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.MailboxException;
+import org.apache.james.mailbox.jpa.JPAId;
+import org.apache.james.mailbox.jpa.JPAMailboxSessionMapperFactory;
+import org.apache.james.mailbox.jpa.JPASubscriptionManager;
+import org.apache.james.mailbox.jpa.mail.JPAModSeqProvider;
+import org.apache.james.mailbox.jpa.mail.JPAUidProvider;
+import org.apache.james.mailbox.jpa.openjpa.OpenJPAMailboxManager;
+import org.apache.james.mailbox.model.MailboxId;
+import org.apache.james.mailbox.store.Authenticator;
+import org.apache.james.mailbox.store.MailboxSessionMapperFactory;
+import org.apache.james.mailbox.store.NoMailboxPathLocker;
+import org.apache.james.mailbox.store.mail.AttachmentMapperFactory;
+import org.apache.james.mailbox.store.mail.MailboxMapperFactory;
+import org.apache.james.mailbox.store.mail.MessageMapperFactory;
+import org.apache.james.mailbox.store.mail.ModSeqProvider;
+import org.apache.james.mailbox.store.mail.UidProvider;
+import org.apache.james.modules.Names;
+import org.apache.james.utils.MailboxManagerDefinition;
+import org.apache.james.utils.PropertiesProvider;
+
+import com.google.inject.AbstractModule;
+import com.google.inject.Inject;
+import com.google.inject.Provides;
+import com.google.inject.Scopes;
+import com.google.inject.multibindings.Multibinder;
+import com.google.inject.name.Named;
+
+public class JPAMailboxModule extends AbstractModule {
+
+    @Override
+    protected void configure() {
+        bind(JPAMailboxSessionMapperFactory.class).in(Scopes.SINGLETON);
+        bind(OpenJPAMailboxManager.class).in(Scopes.SINGLETON);
+        bind(NoMailboxPathLocker.class).in(Scopes.SINGLETON);
+        bind(JPASubscriptionManager.class).in(Scopes.SINGLETON);
+        bind(JPAModSeqProvider.class).in(Scopes.SINGLETON);
+        bind(JPAUidProvider.class).in(Scopes.SINGLETON);
+        bind(UserRepositoryAuthenticator.class).in(Scopes.SINGLETON);
+        bind(JPAId.Factory.class).in(Scopes.SINGLETON);
+        bind(SimpleGroupMembershipResolver.class).in(Scopes.SINGLETON);
+        bind(UnionMailboxACLResolver.class).in(Scopes.SINGLETON);
+
+        bind(MessageMapperFactory.class).to(JPAMailboxSessionMapperFactory.class);
+        bind(MailboxMapperFactory.class).to(JPAMailboxSessionMapperFactory.class);
+        bind(AttachmentMapperFactory.class).to(JPAMailboxSessionMapperFactory.class);
+        bind(MailboxSessionMapperFactory.class).to(JPAMailboxSessionMapperFactory.class);
+
+        bind(ModSeqProvider.class).to(JPAModSeqProvider.class);
+        bind(UidProvider.class).to(JPAUidProvider.class);
+        bind(SubscriptionManager.class).to(JPASubscriptionManager.class);
+        bind(MailboxPathLocker.class).to(NoMailboxPathLocker.class);
+        bind(Authenticator.class).to(UserRepositoryAuthenticator.class);
+        bind(MailboxManager.class).to(OpenJPAMailboxManager.class);
+        bind(MailboxId.Factory.class).to(JPAId.Factory.class);
+        bind(GroupMembershipResolver.class).to(SimpleGroupMembershipResolver.class);
+        bind(MailboxACLResolver.class).to(UnionMailboxACLResolver.class);
+        
+        Multibinder.newSetBinder(binder(), MailboxManagerDefinition.class).addBinding().to(JPAMailboxManagerDefinition.class);
+    }
+
+    @Provides @Named(Names.MAILBOXMANAGER_NAME) @Singleton
+    public MailboxManager provideMailboxManager(OpenJPAMailboxManager jpaMailboxManager) throws MailboxException {
+        jpaMailboxManager.init();
+        return jpaMailboxManager;
+    }
+    
+    @Singleton
+    private static class JPAMailboxManagerDefinition extends MailboxManagerDefinition {
+        @Inject
+        private JPAMailboxManagerDefinition(OpenJPAMailboxManager manager) {
+            super("jpa-mailboxmanager", manager);
+        }
+    }
+    
+    @Provides
+    @Singleton
+    public EntityManagerFactory provideEntityManagerFactory(JPAConfiguration jpaConfiguration) {
+        HashMap<String, String> properties = new HashMap<String, String>();
+        
+        properties.put("openjpa.ConnectionDriverName", jpaConfiguration.getDriverName());
+        properties.put("openjpa.ConnectionURL", jpaConfiguration.getDriverURL());
+
+        return Persistence.createEntityManagerFactory("James", properties);
+
+    }
+
+    @Provides
+    @Singleton
+    JPAConfiguration provideConfiguration(PropertiesProvider propertiesProvider) throws FileNotFoundException, ConfigurationException{
+        PropertiesConfiguration dataSource = propertiesProvider.getConfiguration("james-database");
+        return JPAConfiguration.builder()
+                .driverName(dataSource.getString("database.driverClassName"))
+                .driverURL(dataSource.getString("database.url"))
+                .build();
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/james-project/blob/d65e484a/server/container/guice/jpa-guice/src/main/java/org/apache/james/modules/mailbox/LuceneSearchMailboxModule.java
----------------------------------------------------------------------
diff --git a/server/container/guice/jpa-guice/src/main/java/org/apache/james/modules/mailbox/LuceneSearchMailboxModule.java b/server/container/guice/jpa-guice/src/main/java/org/apache/james/modules/mailbox/LuceneSearchMailboxModule.java
new file mode 100644
index 0000000..fa46463
--- /dev/null
+++ b/server/container/guice/jpa-guice/src/main/java/org/apache/james/modules/mailbox/LuceneSearchMailboxModule.java
@@ -0,0 +1,55 @@
+/****************************************************************
+ * 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.mailbox;
+
+import java.io.File;
+import java.io.IOException;
+
+import org.apache.james.mailbox.extractor.TextExtractor;
+import org.apache.james.mailbox.lucene.search.LuceneMessageSearchIndex;
+import org.apache.james.mailbox.store.search.ListeningMessageSearchIndex;
+import org.apache.james.mailbox.store.search.MessageSearchIndex;
+import org.apache.james.mailbox.tika.extractor.TikaTextExtractor;
+import org.apache.lucene.store.Directory;
+import org.apache.lucene.store.FSDirectory;
+
+import com.google.inject.AbstractModule;
+import com.google.inject.Provides;
+import com.google.inject.Scopes;
+import com.google.inject.Singleton;
+
+public class LuceneSearchMailboxModule extends AbstractModule {
+
+    @Override
+    protected void configure() {
+        bind(LuceneMessageSearchIndex.class).in(Scopes.SINGLETON);
+        bind(MessageSearchIndex.class).to(LuceneMessageSearchIndex.class);
+        bind(ListeningMessageSearchIndex.class).to(LuceneMessageSearchIndex.class);
+
+        bind(TikaTextExtractor.class).in(Scopes.SINGLETON);
+        bind(TextExtractor.class).to(TikaTextExtractor.class);
+    }
+
+    @Provides
+    @Singleton
+    Directory provideDirectory() throws IOException {
+        return FSDirectory.open(new File("Lucene"));
+    }
+}

http://git-wip-us.apache.org/repos/asf/james-project/blob/d65e484a/server/container/guice/jpa-guice/src/main/java/org/apache/james/modules/mailbox/ScheduledExecutorServiceProvider.java
----------------------------------------------------------------------
diff --git a/server/container/guice/jpa-guice/src/main/java/org/apache/james/modules/mailbox/ScheduledExecutorServiceProvider.java b/server/container/guice/jpa-guice/src/main/java/org/apache/james/modules/mailbox/ScheduledExecutorServiceProvider.java
new file mode 100644
index 0000000..48fe3f1
--- /dev/null
+++ b/server/container/guice/jpa-guice/src/main/java/org/apache/james/modules/mailbox/ScheduledExecutorServiceProvider.java
@@ -0,0 +1,49 @@
+/****************************************************************
+ * 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.mailbox;
+
+import java.util.concurrent.Executors;
+import java.util.concurrent.ScheduledExecutorService;
+
+import javax.annotation.PreDestroy;
+
+import com.google.common.annotations.VisibleForTesting;
+import com.google.inject.Provider;
+
+@VisibleForTesting
+class ScheduledExecutorServiceProvider implements Provider<ScheduledExecutorService> {
+
+    private final ScheduledExecutorService scheduler;
+
+    @VisibleForTesting
+    ScheduledExecutorServiceProvider() {
+        scheduler = Executors.newSingleThreadScheduledExecutor();
+    }
+
+    @Override
+    public ScheduledExecutorService get() {
+        return scheduler;
+    }
+
+    @PreDestroy
+    private void stop() {
+        scheduler.shutdown();
+    }
+}

http://git-wip-us.apache.org/repos/asf/james-project/blob/d65e484a/server/container/guice/jpa-guice/src/main/resources/logback.xml
----------------------------------------------------------------------
diff --git a/server/container/guice/jpa-guice/src/main/resources/logback.xml b/server/container/guice/jpa-guice/src/main/resources/logback.xml
new file mode 100644
index 0000000..0e1ff22
--- /dev/null
+++ b/server/container/guice/jpa-guice/src/main/resources/logback.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configuration>
+
+        <contextListener class="ch.qos.logback.classic.jul.LevelChangePropagator">
+                <resetJUL>true</resetJUL>
+        </contextListener>
+
+        <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
+                <encoder>
+                        <pattern>%d{HH:mm:ss.SSS} [%-5level] %logger{15} - %msg%n%rEx</pattern>
+                        <immediateFlush>false</immediateFlush>
+                </encoder>
+        </appender>
+
+        <root level="WARN">
+                <appender-ref ref="CONSOLE" />
+        </root>
+
+        <logger name="org.apache.james" level="INFO"/>
+
+
+</configuration>

http://git-wip-us.apache.org/repos/asf/james-project/blob/d65e484a/server/container/guice/jpa-guice/src/test/java/org/apache/james/JPAJamesServerTest.java
----------------------------------------------------------------------
diff --git a/server/container/guice/jpa-guice/src/test/java/org/apache/james/JPAJamesServerTest.java b/server/container/guice/jpa-guice/src/test/java/org/apache/james/JPAJamesServerTest.java
new file mode 100644
index 0000000..23ac61c
--- /dev/null
+++ b/server/container/guice/jpa-guice/src/test/java/org/apache/james/JPAJamesServerTest.java
@@ -0,0 +1,44 @@
+/****************************************************************
+ * 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;
+
+import org.apache.james.modules.TestFilesystemModule;
+import org.junit.Rule;
+import org.junit.rules.TemporaryFolder;
+
+public class JPAJamesServerTest extends AbstractJamesServerTest {
+
+    @Rule
+    public TemporaryFolder temporaryFolder = new TemporaryFolder();
+
+    @Override
+    protected GuiceJamesServer createJamesServer() {
+        return new GuiceJamesServer(JPAJamesServerMain.mainServerModule)
+            .combineWith(JPAJamesServerMain.jpaServerModule)
+            .overrideWith(new TestFilesystemModule(temporaryFolder),
+                    new TestJPAConfigurationModule());
+    }
+
+    @Override
+    protected void clean() {
+    }
+    
+
+}

http://git-wip-us.apache.org/repos/asf/james-project/blob/d65e484a/server/container/guice/jpa-guice/src/test/java/org/apache/james/JamesCapabilitiesServerTest.java
----------------------------------------------------------------------
diff --git a/server/container/guice/jpa-guice/src/test/java/org/apache/james/JamesCapabilitiesServerTest.java b/server/container/guice/jpa-guice/src/test/java/org/apache/james/JamesCapabilitiesServerTest.java
new file mode 100644
index 0000000..82e728a
--- /dev/null
+++ b/server/container/guice/jpa-guice/src/test/java/org/apache/james/JamesCapabilitiesServerTest.java
@@ -0,0 +1,75 @@
+/****************************************************************
+ * 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;
+
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
+import java.util.EnumSet;
+
+import org.apache.james.mailbox.MailboxManager;
+import org.apache.james.modules.TestFilesystemModule;
+import org.junit.After;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.RuleChain;
+import org.junit.rules.TemporaryFolder;
+
+import com.google.inject.Module;
+
+public class JamesCapabilitiesServerTest {
+
+    private GuiceJamesServer server;
+    private TemporaryFolder temporaryFolder = new TemporaryFolder();
+
+    @Rule
+    public RuleChain chain = RuleChain.outerRule(temporaryFolder);
+
+    @After
+    public void teardown() {
+        server.stop();
+    }
+    
+    private GuiceJamesServer createJPAJamesServer(final MailboxManager mailboxManager) {
+        Module mockMailboxManager = (binder) -> binder.bind(MailboxManager.class).toInstance(mailboxManager);
+        
+        return new GuiceJamesServer()
+            .combineWith(JPAJamesServerMain.jpaServerModule)
+            .overrideWith(
+                new TestFilesystemModule(temporaryFolder),
+                new TestJPAConfigurationModule(),
+                mockMailboxManager);
+    }
+    
+    @Test
+    public void startShouldSucceedWhenRequiredCapabilities() throws Exception {
+        MailboxManager mailboxManager = mock(MailboxManager.class);
+        when(mailboxManager.getSupportedMailboxCapabilities())
+            .thenReturn(EnumSet.noneOf(MailboxManager.MailboxCapabilities.class));
+        when(mailboxManager.getSupportedMessageCapabilities())
+            .thenReturn(EnumSet.noneOf(MailboxManager.MessageCapabilities.class));
+        when(mailboxManager.getSupportedSearchCapabilities())
+            .thenReturn(EnumSet.noneOf(MailboxManager.SearchCapabilities.class));
+
+        server = createJPAJamesServer(mailboxManager);
+
+        server.start();
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/james-project/blob/d65e484a/server/container/guice/jpa-guice/src/test/java/org/apache/james/TestJPAConfigurationModule.java
----------------------------------------------------------------------
diff --git a/server/container/guice/jpa-guice/src/test/java/org/apache/james/TestJPAConfigurationModule.java b/server/container/guice/jpa-guice/src/test/java/org/apache/james/TestJPAConfigurationModule.java
new file mode 100644
index 0000000..e1847cc
--- /dev/null
+++ b/server/container/guice/jpa-guice/src/test/java/org/apache/james/TestJPAConfigurationModule.java
@@ -0,0 +1,49 @@
+/****************************************************************
+ * 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;
+
+import java.io.FileNotFoundException;
+
+import javax.inject.Singleton;
+
+import org.apache.commons.configuration.ConfigurationException;
+
+import com.google.inject.AbstractModule;
+import com.google.inject.Provides;
+
+public class TestJPAConfigurationModule extends AbstractModule {
+
+    private static final String JDBC_EMBEDDED_URL = "jdbc:derby:../var/store/derby;create=true";
+    private static final String JDBC_EMBEDDED_DRIVER = "org.apache.derby.jdbc.EmbeddedDriver";
+
+    @Override
+    protected void configure() {
+    }
+
+    @Provides
+    @Singleton
+    JPAConfiguration provideConfiguration() throws FileNotFoundException, ConfigurationException{
+        return JPAConfiguration.builder()
+                .driverName(JDBC_EMBEDDED_DRIVER)
+                .driverURL(JDBC_EMBEDDED_URL)
+                .build();
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/james-project/blob/d65e484a/server/container/guice/jpa-guice/src/test/resources/dnsservice.xml
----------------------------------------------------------------------
diff --git a/server/container/guice/jpa-guice/src/test/resources/dnsservice.xml b/server/container/guice/jpa-guice/src/test/resources/dnsservice.xml
new file mode 100644
index 0000000..0978a00
--- /dev/null
+++ b/server/container/guice/jpa-guice/src/test/resources/dnsservice.xml
@@ -0,0 +1,29 @@
+<?xml version="1.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.                                           
+ -->
+
+<dnsservice>
+  <servers>
+    <server>8.8.8.8</server>
+    <server>62.210.16.6</server>
+  </servers>
+  <autodiscover>false</autodiscover>
+  <authoritative>false</authoritative>
+  <maxcachesize>50000</maxcachesize>
+</dnsservice>

http://git-wip-us.apache.org/repos/asf/james-project/blob/d65e484a/server/container/guice/jpa-guice/src/test/resources/fakemailrepositorystore.xml
----------------------------------------------------------------------
diff --git a/server/container/guice/jpa-guice/src/test/resources/fakemailrepositorystore.xml b/server/container/guice/jpa-guice/src/test/resources/fakemailrepositorystore.xml
new file mode 100644
index 0000000..2d19a80
--- /dev/null
+++ b/server/container/guice/jpa-guice/src/test/resources/fakemailrepositorystore.xml
@@ -0,0 +1,31 @@
+<?xml version="1.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.
+ -->
+
+<mailrepositorystore>
+    <mailrepositories>
+        <mailrepository class="org.apache.james.mailrepository.None">
+            <protocols>
+                <protocol>file</protocol>
+            </protocols>
+            <config FIFO="false" CACHEKEYS="true"/>
+        </mailrepository>
+    </mailrepositories>
+</mailrepositorystore>

http://git-wip-us.apache.org/repos/asf/james-project/blob/d65e484a/server/container/guice/jpa-guice/src/test/resources/imapserver.xml
----------------------------------------------------------------------
diff --git a/server/container/guice/jpa-guice/src/test/resources/imapserver.xml b/server/container/guice/jpa-guice/src/test/resources/imapserver.xml
new file mode 100644
index 0000000..ff478a9
--- /dev/null
+++ b/server/container/guice/jpa-guice/src/test/resources/imapserver.xml
@@ -0,0 +1,54 @@
+<?xml version="1.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.
+-->
+
+
+<imapservers>
+	<imapserver enabled="true">
+		<jmxName>imapserver</jmxName>
+		<bind>0.0.0.0:1143</bind>
+		<connectionBacklog>200</connectionBacklog>
+		<tls socketTLS="false" startTLS="false">
+			<!-- To create a new keystore execute:
+            keytool -genkey -alias james -keyalg RSA -keystore /path/to/james/conf/keystore
+              -->
+			<keystore>file://conf/keystore</keystore>
+			<secret>james72laBalle</secret>
+			<provider>org.bouncycastle.jce.provider.BouncyCastleProvider</provider>
+		</tls>
+		<connectionLimit>0</connectionLimit>
+		<connectionLimitPerIP>0</connectionLimitPerIP>
+	</imapserver>
+	<imapserver enabled="true">
+		<jmxName>imapserver-ssl</jmxName>
+		<bind>0.0.0.0:1993</bind>
+		<connectionBacklog>200</connectionBacklog>
+		<tls socketTLS="false" startTLS="false">
+			<!-- To create a new keystore execute:
+              keytool -genkey -alias james -keyalg RSA -keystore /path/to/james/conf/keystore
+             -->
+			<keystore>file://conf/keystore</keystore>
+			<secret>james72laBalle</secret>
+			<provider>org.bouncycastle.jce.provider.BouncyCastleProvider</provider>
+		</tls>
+		<connectionLimit>0</connectionLimit>
+		<connectionLimitPerIP>0</connectionLimitPerIP>
+	</imapserver>
+</imapservers>

http://git-wip-us.apache.org/repos/asf/james-project/blob/d65e484a/server/container/guice/jpa-guice/src/test/resources/keystore
----------------------------------------------------------------------
diff --git a/server/container/guice/jpa-guice/src/test/resources/keystore b/server/container/guice/jpa-guice/src/test/resources/keystore
new file mode 100644
index 0000000..536a6c7
Binary files /dev/null and b/server/container/guice/jpa-guice/src/test/resources/keystore differ

http://git-wip-us.apache.org/repos/asf/james-project/blob/d65e484a/server/container/guice/jpa-guice/src/test/resources/lmtpserver.xml
----------------------------------------------------------------------
diff --git a/server/container/guice/jpa-guice/src/test/resources/lmtpserver.xml b/server/container/guice/jpa-guice/src/test/resources/lmtpserver.xml
new file mode 100644
index 0000000..5c4a9c7
--- /dev/null
+++ b/server/container/guice/jpa-guice/src/test/resources/lmtpserver.xml
@@ -0,0 +1,41 @@
+<?xml version="1.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.                                           
+ -->
+
+<lmtpservers>
+
+    <lmtpserver enabled="true">
+        <jmxName>lmtpserver</jmxName>
+        <!-- LMTP should not be reachable from outside your network so bind it to loopback-->
+        <bind>127.0.0.1:1024</bind>
+        <connectionBacklog>200</connectionBacklog>
+        <connectiontimeout>1200</connectiontimeout>
+        <!-- Set the maximum simultaneous incoming connections for this service -->
+        <connectionLimit>0</connectionLimit>
+        <!-- Set the maximum simultaneous incoming connections per IP for this service -->
+        <connectionLimitPerIP>0</connectionLimitPerIP>
+        <!--  This sets the maximum allowed message size (in kilobytes) for this -->
+        <!--  LMTP service. If unspecified, the value defaults to 0, which means no limit. -->
+        <maxmessagesize>0</maxmessagesize>
+        <handlerchain>
+            <handler class="org.apache.james.lmtpserver.CoreCmdHandlerLoader"/>
+        </handlerchain>
+    </lmtpserver>
+
+</lmtpservers>

http://git-wip-us.apache.org/repos/asf/james-project/blob/d65e484a/server/container/guice/jpa-guice/src/test/resources/mailetcontainer.xml
----------------------------------------------------------------------
diff --git a/server/container/guice/jpa-guice/src/test/resources/mailetcontainer.xml b/server/container/guice/jpa-guice/src/test/resources/mailetcontainer.xml
new file mode 100644
index 0000000..b265f93
--- /dev/null
+++ b/server/container/guice/jpa-guice/src/test/resources/mailetcontainer.xml
@@ -0,0 +1,113 @@
+<?xml version="1.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.
+ -->
+
+<mailetcontainer enableJmx="false">
+
+    <context>
+        <postmaster>postmaster@james.minet.net</postmaster>
+    </context>
+
+    <spooler>
+        <threads>20</threads>
+    </spooler>
+
+    <processors>
+        <processor state="root" enableJmx="false">
+            <mailet match="All" class="PostmasterAlias"/>
+            <mailet match="RelayLimit=30" class="Null"/>
+            <mailet match="All" class="ToProcessor">
+                <processor>transport</processor>
+            </mailet>
+        </processor>
+
+        <processor state="error" enableJmx="false">
+            <mailet match="All" class="Bounce"/>
+            <mailet match="All" class="ToRepository">
+                <repositoryPath>file://var/mail/error/</repositoryPath>
+            </mailet>
+        </processor>
+
+
+        <processor state="transport" enableJmx="false">
+            <mailet match="SMTPAuthSuccessful" class="SetMimeHeader">
+                <name>X-UserIsAuth</name>
+                <value>true</value>
+            </mailet>
+            <mailet match="All" class="RemoveMimeHeader">
+                <name>bcc</name>
+            </mailet>
+            <mailet match="All" class="RecipientRewriteTable" />
+            <mailet match="RecipientIsLocal" class="org.apache.james.jmap.mailet.VacationMailet"/>
+            <mailet match="RecipientIsLocal" class="LocalDelivery"/>
+            <mailet match="HostIsLocal" class="ToProcessor">
+                <processor>local-address-error</processor>
+                <notice>550 - Requested action not taken: no such user here</notice>
+            </mailet>
+            <mailet match="SMTPAuthSuccessful" class="RemoteDelivery">
+                <outgoingQueue>outgoing</outgoingQueue>
+                <delayTime>5000, 100000, 500000</delayTime>
+                <maxRetries>25</maxRetries>
+                <maxDnsProblemRetries>0</maxDnsProblemRetries>
+                <deliveryThreads>10</deliveryThreads>
+                <sendpartial>true</sendpartial>
+                <bounceProcessor>bounces</bounceProcessor>
+            </mailet>
+            <mailet match="All" class="ToProcessor">
+                <processor>relay-denied</processor>
+            </mailet>
+        </processor>
+
+        <processor state="spam" enableJmx="false">
+            <mailet match="All" class="ToRepository">
+                <repositoryPath>file://var/mail/spam/</repositoryPath>
+            </mailet>
+        </processor>
+
+        <processor state="local-address-error" enableJmx="false">
+            <mailet match="All" class="Bounce">
+                <attachment>none</attachment>
+            </mailet>
+            <mailet match="All" class="ToRepository">
+                <repositoryPath>file://var/mail/address-error/</repositoryPath>
+            </mailet>
+        </processor>
+
+        <processor state="relay-denied" enableJmx="false">
+            <mailet match="All" class="Bounce">
+                <attachment>none</attachment>
+            </mailet>
+            <mailet match="All" class="ToRepository">
+                <repositoryPath>file://var/mail/relay-denied/</repositoryPath>
+                <notice>Warning: You are sending an e-mail to a remote server. You must be authentified to perform such an operation</notice>
+            </mailet>
+        </processor>
+
+        <processor state="bounces" enableJmx="false">
+            <mailet match="All" class="DSNBounce">
+                <passThrough>false</passThrough>
+            </mailet>
+        </processor>
+
+    </processors>
+
+</mailetcontainer>
+
+

http://git-wip-us.apache.org/repos/asf/james-project/blob/d65e484a/server/container/guice/jpa-guice/src/test/resources/mailrepositorystore.xml
----------------------------------------------------------------------
diff --git a/server/container/guice/jpa-guice/src/test/resources/mailrepositorystore.xml b/server/container/guice/jpa-guice/src/test/resources/mailrepositorystore.xml
new file mode 100644
index 0000000..3ca4a1d
--- /dev/null
+++ b/server/container/guice/jpa-guice/src/test/resources/mailrepositorystore.xml
@@ -0,0 +1,31 @@
+<?xml version="1.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.
+ -->
+
+<mailrepositorystore>
+    <mailrepositories>
+        <mailrepository class="org.apache.james.mailrepository.file.FileMailRepository">
+            <protocols>
+                <protocol>file</protocol>
+            </protocols>
+            <config FIFO="false" CACHEKEYS="true"/>
+        </mailrepository>
+    </mailrepositories>
+</mailrepositorystore>

http://git-wip-us.apache.org/repos/asf/james-project/blob/d65e484a/server/container/guice/jpa-guice/src/test/resources/managesieveserver.xml
----------------------------------------------------------------------
diff --git a/server/container/guice/jpa-guice/src/test/resources/managesieveserver.xml b/server/container/guice/jpa-guice/src/test/resources/managesieveserver.xml
new file mode 100644
index 0000000..ec57e09
--- /dev/null
+++ b/server/container/guice/jpa-guice/src/test/resources/managesieveserver.xml
@@ -0,0 +1,65 @@
+<?xml version="1.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.                                           
+ -->
+ 
+<!--
+   This template file can be used as example for James Server configuration
+   DO NOT USE IT AS SUCH AND ADAPT IT TO YOUR NEEDS
+-->
+ 
+<!-- See http://james.apache.org/server/3/config.html for usage -->
+
+<managesieveservers>
+
+   <managesieveserver enabled="true">
+
+     <jmxName>managesieveserver</jmxName>
+
+     <bind>0.0.0.0:4190</bind>
+
+     <connectionBacklog>200</connectionBacklog>
+
+     <tls socketTLS="false" startTLS="false">
+       <!-- To create a new keystore execute:
+        keytool -genkey -alias james -keyalg RSA -keystore /path/to/james/conf/keystore
+         -->
+       <keystore>file://conf/keystore</keystore>
+       <secret>james72laBalle</secret>
+       <provider>org.bouncycastle.jce.provider.BouncyCastleProvider</provider>
+       <!-- The algorithm is optional and only needs to be specified when using something other
+        than the Sun JCE provider - You could use IbmX509 with IBM Java runtime. -->
+       <algorithm>SunX509</algorithm>
+     </tls>
+         
+        <!-- connection timeout in secconds -->
+        <connectiontimeout>360</connectiontimeout>
+
+        <!-- Set the maximum simultaneous incoming connections for this service -->
+        <connectionLimit>0</connectionLimit>
+         
+        <!-- Set the maximum simultaneous incoming connections per IP for this service -->
+        <connectionLimitPerIP>0</connectionLimitPerIP>
+        <maxmessagesize>0</maxmessagesize>
+        <addressBracketsEnforcement>true</addressBracketsEnforcement>
+  
+   </managesieveserver>
+
+</managesieveservers>
+
+


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


[03/29] james-project git commit: JAMES-1842: Update new version of new module

Posted by ad...@apache.org.
JAMES-1842: Update new version of new module


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

Branch: refs/heads/master
Commit: 2ae5e1a1326127a723fc753c2d4bcdd8ee6fa596
Parents: b45667b
Author: Quynh Nguyen <qn...@linagora.com>
Authored: Fri Nov 4 10:56:26 2016 +0700
Committer: Quynh Nguyen <qn...@linagora.com>
Committed: Fri Nov 18 09:25:34 2016 +0700

----------------------------------------------------------------------
 server/container/guice/jpa-guice/pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/2ae5e1a1/server/container/guice/jpa-guice/pom.xml
----------------------------------------------------------------------
diff --git a/server/container/guice/jpa-guice/pom.xml b/server/container/guice/jpa-guice/pom.xml
index 73beb1d..28567a9 100644
--- a/server/container/guice/jpa-guice/pom.xml
+++ b/server/container/guice/jpa-guice/pom.xml
@@ -25,7 +25,7 @@
     <parent>
         <groupId>org.apache.james</groupId>
         <artifactId>james-server-guice</artifactId>
-        <version>3.0.0-beta5-SNAPSHOT</version>
+        <version>3.0.0-beta6-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
 


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


[26/29] james-project git commit: JAMES-1842: Introduce JmapJamesServer interface

Posted by ad...@apache.org.
JAMES-1842: Introduce JmapJamesServer interface


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

Branch: refs/heads/master
Commit: f11fa6140e2c01db4f2b1aaf76dc3ffe6a091a06
Parents: fdb400d
Author: Antoine Duprat <ad...@apache.org>
Authored: Wed Nov 16 10:05:38 2016 +0100
Committer: Quynh Nguyen <qn...@linagora.com>
Committed: Fri Nov 18 09:33:20 2016 +0700

----------------------------------------------------------------------
 .../org/apache/james/CassandraJamesServer.java  |  2 +-
 .../james/AbstractJmapJamesServerTest.java      |  2 +-
 .../java/org/apache/james/JmapJamesServer.java  | 23 ++++++++++++++++++++
 .../org/apache/james/MemoryJamesServer.java     |  2 +-
 4 files changed, 26 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/f11fa614/server/container/guice/cassandra-guice/src/main/java/org/apache/james/CassandraJamesServer.java
----------------------------------------------------------------------
diff --git a/server/container/guice/cassandra-guice/src/main/java/org/apache/james/CassandraJamesServer.java b/server/container/guice/cassandra-guice/src/main/java/org/apache/james/CassandraJamesServer.java
index e4375d4..4ca7c76 100644
--- a/server/container/guice/cassandra-guice/src/main/java/org/apache/james/CassandraJamesServer.java
+++ b/server/container/guice/cassandra-guice/src/main/java/org/apache/james/CassandraJamesServer.java
@@ -27,7 +27,7 @@ import com.google.common.collect.Iterables;
 import com.google.inject.Module;
 import com.google.inject.util.Modules;
 
-public class CassandraJamesServer extends GuiceJamesServerImpl implements JmapServer, WebAdminServer {
+public class CassandraJamesServer extends GuiceJamesServerImpl implements JmapJamesServer {
 
     public CassandraJamesServer() {
         super();

http://git-wip-us.apache.org/repos/asf/james-project/blob/f11fa614/server/container/guice/guice-common/src/test/java/org/apache/james/AbstractJmapJamesServerTest.java
----------------------------------------------------------------------
diff --git a/server/container/guice/guice-common/src/test/java/org/apache/james/AbstractJmapJamesServerTest.java b/server/container/guice/guice-common/src/test/java/org/apache/james/AbstractJmapJamesServerTest.java
index cdfd301..46d8917 100644
--- a/server/container/guice/guice-common/src/test/java/org/apache/james/AbstractJmapJamesServerTest.java
+++ b/server/container/guice/guice-common/src/test/java/org/apache/james/AbstractJmapJamesServerTest.java
@@ -39,7 +39,7 @@ import com.jayway.restassured.RestAssured;
 import com.jayway.restassured.builder.RequestSpecBuilder;
 import com.jayway.restassured.http.ContentType;
 
-public abstract class AbstractJmapJamesServerTest<T extends GuiceJamesServerImpl & JmapServer & WebAdminServer> {
+public abstract class AbstractJmapJamesServerTest<T extends JmapJamesServer> {
 
     private static final int IMAP_PORT = 1143; // You need to be root (superuser) to bind to ports under 1024.
     private static final int IMAP_PORT_SSL = 1993;

http://git-wip-us.apache.org/repos/asf/james-project/blob/f11fa614/server/container/guice/guice-common/src/test/java/org/apache/james/JmapJamesServer.java
----------------------------------------------------------------------
diff --git a/server/container/guice/guice-common/src/test/java/org/apache/james/JmapJamesServer.java b/server/container/guice/guice-common/src/test/java/org/apache/james/JmapJamesServer.java
new file mode 100644
index 0000000..cf374ba
--- /dev/null
+++ b/server/container/guice/guice-common/src/test/java/org/apache/james/JmapJamesServer.java
@@ -0,0 +1,23 @@
+/****************************************************************
+ * 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;
+
+public interface JmapJamesServer extends GuiceJamesServer, JmapServer, WebAdminServer {
+
+}

http://git-wip-us.apache.org/repos/asf/james-project/blob/f11fa614/server/container/guice/memory-guice/src/main/java/org/apache/james/MemoryJamesServer.java
----------------------------------------------------------------------
diff --git a/server/container/guice/memory-guice/src/main/java/org/apache/james/MemoryJamesServer.java b/server/container/guice/memory-guice/src/main/java/org/apache/james/MemoryJamesServer.java
index d65aaa0..ee927af 100644
--- a/server/container/guice/memory-guice/src/main/java/org/apache/james/MemoryJamesServer.java
+++ b/server/container/guice/memory-guice/src/main/java/org/apache/james/MemoryJamesServer.java
@@ -27,7 +27,7 @@ import com.google.common.collect.Iterables;
 import com.google.inject.Module;
 import com.google.inject.util.Modules;
 
-public class MemoryJamesServer extends GuiceJamesServerImpl implements JmapServer, WebAdminServer {
+public class MemoryJamesServer extends GuiceJamesServerImpl implements JmapJamesServer {
     public MemoryJamesServer() {
         super();
     }


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


[04/29] james-project git commit: JAMES-1842: Remove sample-configuration on common and move them to specified module

Posted by ad...@apache.org.
http://git-wip-us.apache.org/repos/asf/james-project/blob/b45667b6/server/container/guice/jpa-guice/sample-configuration/lmtpserver.xml
----------------------------------------------------------------------
diff --git a/server/container/guice/jpa-guice/sample-configuration/lmtpserver.xml b/server/container/guice/jpa-guice/sample-configuration/lmtpserver.xml
new file mode 100644
index 0000000..87a0caa
--- /dev/null
+++ b/server/container/guice/jpa-guice/sample-configuration/lmtpserver.xml
@@ -0,0 +1,41 @@
+<?xml version="1.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.                                           
+ -->
+
+<lmtpservers>
+
+    <lmtpserver enabled="false">
+        <jmxName>lmtpserver</jmxName>
+        <!-- LMTP should not be reachable from outside your network so bind it to loopback-->
+        <bind>127.0.0.1:1024</bind>
+        <connectionBacklog>200</connectionBacklog>
+        <connectiontimeout>1200</connectiontimeout>
+        <!-- Set the maximum simultaneous incoming connections for this service -->
+        <connectionLimit>0</connectionLimit>
+        <!-- Set the maximum simultaneous incoming connections per IP for this service -->
+        <connectionLimitPerIP>0</connectionLimitPerIP>
+        <!--  This sets the maximum allowed message size (in kilobytes) for this -->
+        <!--  LMTP service. If unspecified, the value defaults to 0, which means no limit. -->
+        <maxmessagesize>0</maxmessagesize>
+        <handlerchain>
+            <handler class="org.apache.james.lmtpserver.CoreCmdHandlerLoader"/>
+        </handlerchain>
+    </lmtpserver>
+
+</lmtpservers>

http://git-wip-us.apache.org/repos/asf/james-project/blob/b45667b6/server/container/guice/jpa-guice/sample-configuration/mailetcontainer.xml
----------------------------------------------------------------------
diff --git a/server/container/guice/jpa-guice/sample-configuration/mailetcontainer.xml b/server/container/guice/jpa-guice/sample-configuration/mailetcontainer.xml
new file mode 100644
index 0000000..968b59c
--- /dev/null
+++ b/server/container/guice/jpa-guice/sample-configuration/mailetcontainer.xml
@@ -0,0 +1,137 @@
+<?xml version="1.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.
+ -->
+
+<mailetcontainer enableJmx="true">
+
+    <context>
+        <postmaster>postmaster@james.minet.net</postmaster>
+    </context>
+
+    <spooler>
+        <threads>20</threads>
+    </spooler>
+
+    <processors>
+        <processor state="root" enableJmx="true">
+            <mailet match="All" class="PostmasterAlias"/>
+            <mailet match="RelayLimit=30" class="Null"/>
+            <!-- Hook on sievemanager@james.linagora.com
+                 Mail send to this address will get interpreted with SIEVE Manage -->
+            <mailet match="RecipientIs=sievemanager@james.linagora.com" class="ToProcessor">
+                <processor>sieve-manager-check</processor>
+            </mailet>
+            <mailet match="HasMailAttribute=spamChecked" class="ToProcessor">
+                <processor>transport</processor>
+            </mailet>
+            <mailet match="All" class="SetMailAttribute">
+                <spamChecked>true</spamChecked>
+            </mailet>
+            <mailet match="SMTPAuthSuccessful" class="ToProcessor">
+                <processor>transport</processor>
+            </mailet>
+            <mailet match="InSpammerBlacklist=query.bondedsender.org." class="ToProcessor">
+                <processor>transport</processor>
+            </mailet>
+            <!-- Check for delivery from a known spam server -->
+            <!-- This set of matchers/mailets redirect all emails from known -->
+            <!-- black holes, open relays, and spam servers to the spam processor -->
+            <!-- For this set to function properly, the spam processor must be configured. -->
+            <mailet match="InSpammerBlacklist=dnsbl.njabl.org." class="ToProcessor">
+                <processor>spam</processor>
+                <notice>550 Requested action not taken: rejected - see http://njabl.org/</notice>
+            </mailet>
+            <mailet match="All" class="ToProcessor">
+                <processor>transport</processor>
+            </mailet>
+        </processor>
+
+        <processor state="error" enableJmx="true">
+            <mailet match="All" class="Bounce"/>
+            <mailet match="All" class="ToRepository">
+                <repositoryPath>file://var/mail/error/</repositoryPath>
+            </mailet>
+        </processor>
+
+
+        <processor state="transport" enableJmx="true">
+            <mailet match="SMTPAuthSuccessful" class="SetMimeHeader">
+                <name>X-UserIsAuth</name>
+                <value>true</value>
+            </mailet>
+            <mailet match="HasMailAttribute=org.apache.james.SMIMECheckSignature" class="SetMimeHeader">
+                <name>X-WasSigned</name>
+                <value>true</value>
+            </mailet>
+            <mailet match="All" class="RecipientRewriteTable" />
+            <mailet match="RecipientIsLocal" class="LocalDelivery"/>
+            <mailet match="HostIsLocal" class="ToProcessor">
+                <processor>local-address-error</processor>
+                <notice>550 - Requested action not taken: no such user here</notice>
+            </mailet>
+            <mailet match="SMTPAuthSuccessful" class="RemoteDelivery">
+                <outgoingQueue>outgoing</outgoingQueue>
+                <delayTime>5000, 100000, 500000</delayTime>
+                <maxRetries>25</maxRetries>
+                <maxDnsProblemRetries>0</maxDnsProblemRetries>
+                <deliveryThreads>10</deliveryThreads>
+                <sendpartial>true</sendpartial>
+                <bounceProcessor>bounces</bounceProcessor>
+            </mailet>
+            <mailet match="All" class="ToProcessor">
+                <processor>relay-denied</processor>
+            </mailet>
+        </processor>
+
+        <processor state="spam" enableJmx="true">
+            <mailet match="All" class="ToRepository">
+                <repositoryPath>file://var/mail/spam/</repositoryPath>
+            </mailet>
+        </processor>
+
+        <processor state="local-address-error" enableJmx="true">
+            <mailet match="All" class="Bounce">
+                <attachment>none</attachment>
+            </mailet>
+            <mailet match="All" class="ToRepository">
+                <repositoryPath>file://var/mail/address-error/</repositoryPath>
+            </mailet>
+        </processor>
+
+        <processor state="relay-denied" enableJmx="true">
+            <mailet match="All" class="Bounce">
+                <attachment>none</attachment>
+            </mailet>
+            <mailet match="All" class="ToRepository">
+                <repositoryPath>file://var/mail/relay-denied/</repositoryPath>
+                <notice>Warning: You are sending an e-mail to a remote server. You must be authentified to perform such an operation</notice>
+            </mailet>
+        </processor>
+
+        <processor state="bounces" enableJmx="true">
+            <mailet match="All" class="DSNBounce">
+                <passThrough>false</passThrough>
+            </mailet>
+        </processor>
+    </processors>
+
+</mailetcontainer>
+
+

http://git-wip-us.apache.org/repos/asf/james-project/blob/b45667b6/server/container/guice/jpa-guice/sample-configuration/mailrepositorystore.xml
----------------------------------------------------------------------
diff --git a/server/container/guice/jpa-guice/sample-configuration/mailrepositorystore.xml b/server/container/guice/jpa-guice/sample-configuration/mailrepositorystore.xml
new file mode 100644
index 0000000..acca810
--- /dev/null
+++ b/server/container/guice/jpa-guice/sample-configuration/mailrepositorystore.xml
@@ -0,0 +1,34 @@
+<?xml version="1.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.
+ -->
+
+<mailrepositorystore>
+    <mailrepositories>
+        <!-- File based repositories.  These repositories store all message data -->
+        <!-- in the file system. -->
+        <mailrepository class="org.apache.james.mailrepository.file.FileMailRepository">
+            <protocols>
+                <protocol>file</protocol>
+            </protocols>
+            <!-- Set if the messages should be listed sorted. False by default -->
+            <config FIFO="false" CACHEKEYS="true"/>
+        </mailrepository>
+    </mailrepositories>
+</mailrepositorystore>

http://git-wip-us.apache.org/repos/asf/james-project/blob/b45667b6/server/container/guice/jpa-guice/sample-configuration/pop3server.xml
----------------------------------------------------------------------
diff --git a/server/container/guice/jpa-guice/sample-configuration/pop3server.xml b/server/container/guice/jpa-guice/sample-configuration/pop3server.xml
new file mode 100644
index 0000000..c57c832
--- /dev/null
+++ b/server/container/guice/jpa-guice/sample-configuration/pop3server.xml
@@ -0,0 +1,42 @@
+<?xml version="1.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.                                           
+ -->
+
+
+<pop3servers>
+    <pop3server enabled="false">
+        <jmxName>pop3server</jmxName>
+        <bind>0.0.0.0:1110</bind>
+        <connectionBacklog>200</connectionBacklog>
+        <tls socketTLS="false" startTLS="false">
+            <!-- To create a new keystore execute:
+                  keytool -genkey -alias james -keyalg RSA -keystore /path/to/james/conf/keystore
+             -->
+            <keystore>file://conf/keystore</keystore>
+            <secret>james72laBalle</secret>
+            <provider>org.bouncycastle.jce.provider.BouncyCastleProvider</provider>
+        </tls>
+        <connectiontimeout>1200</connectiontimeout>
+        <connectionLimit>0</connectionLimit>
+        <connectionLimitPerIP>0</connectionLimitPerIP>
+        <handlerchain>
+            <handler class="org.apache.james.pop3server.core.CoreCmdHandlerLoader"/>
+        </handlerchain>
+    </pop3server>
+</pop3servers>

http://git-wip-us.apache.org/repos/asf/james-project/blob/b45667b6/server/container/guice/jpa-guice/sample-configuration/recipientrewritetable.xml
----------------------------------------------------------------------
diff --git a/server/container/guice/jpa-guice/sample-configuration/recipientrewritetable.xml b/server/container/guice/jpa-guice/sample-configuration/recipientrewritetable.xml
new file mode 100644
index 0000000..7e7f586
--- /dev/null
+++ b/server/container/guice/jpa-guice/sample-configuration/recipientrewritetable.xml
@@ -0,0 +1,27 @@
+<?xml version="1.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.                                           
+ -->
+
+<!-- The default table for storing James' RecipientRewriteTable mappings. -->
+<recipientrewritetable class="org.apache.james.rrt.jpa.JPARecipientRewriteTable">
+  <recursiveMapping>true</recursiveMapping>
+  <mappingLimit>10</mappingLimit>
+  <mapping>some@domain=some</mapping>
+</recipientrewritetable>
+

http://git-wip-us.apache.org/repos/asf/james-project/blob/b45667b6/server/container/guice/jpa-guice/sample-configuration/smtpserver.xml
----------------------------------------------------------------------
diff --git a/server/container/guice/jpa-guice/sample-configuration/smtpserver.xml b/server/container/guice/jpa-guice/sample-configuration/smtpserver.xml
new file mode 100644
index 0000000..c34fcd1
--- /dev/null
+++ b/server/container/guice/jpa-guice/sample-configuration/smtpserver.xml
@@ -0,0 +1,105 @@
+<?xml version="1.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.
+ -->
+
+<smtpservers>
+    <smtpserver enabled="true">
+        <jmxName>smtpserver-global</jmxName>
+        <bind>0.0.0.0:1025</bind>
+        <connectionBacklog>200</connectionBacklog>
+        <tls socketTLS="false" startTLS="false">
+            <keystore>file://conf/keystore</keystore>
+            <secret>james72laBalle</secret>
+            <provider>org.bouncycastle.jce.provider.BouncyCastleProvider</provider>
+            <algorithm>SunX509</algorithm>
+        </tls>
+        <connectiontimeout>360</connectiontimeout>
+        <connectionLimit>0</connectionLimit>
+        <connectionLimitPerIP>0</connectionLimitPerIP>
+        <authRequired>false</authRequired>
+        <authorizedAddresses>0.0.0.0/0</authorizedAddresses>
+        <verifyIdentity>true</verifyIdentity>
+        <maxmessagesize>0</maxmessagesize>
+        <addressBracketsEnforcement>true</addressBracketsEnforcement>
+        <smtpGreeting>JAMES Linagora's SMTP awesome Server</smtpGreeting>
+        <handlerchain>
+            <handler class="org.apache.james.smtpserver.fastfail.ValidRcptHandler"/>
+            <handler class="org.apache.james.smtpserver.CoreCmdHandlerLoader"/>
+        </handlerchain>
+    </smtpserver>
+    <smtpserver enabled="true">
+        <jmxName>smtpserver-TLS</jmxName>
+        <bind>0.0.0.0:1465</bind>
+        <connectionBacklog>200</connectionBacklog>
+        <tls socketTLS="true" startTLS="false">
+            <keystore>file://conf/keystore</keystore>
+            <secret>james72laBalle</secret>
+            <provider>org.bouncycastle.jce.provider.BouncyCastleProvider</provider>
+            <algorithm>SunX509</algorithm>
+        </tls>
+        <connectiontimeout>360</connectiontimeout>
+        <connectionLimit>0</connectionLimit>
+        <connectionLimitPerIP>0</connectionLimitPerIP>
+        <!--
+           Authorize only local users
+        -->
+        <authRequired>true</authRequired>
+        <authorizedAddresses>0.0.0.0/0</authorizedAddresses>
+        <!-- Trust authenticated users -->
+        <verifyIdentity>false</verifyIdentity>
+        <maxmessagesize>0</maxmessagesize>
+        <addressBracketsEnforcement>true</addressBracketsEnforcement>
+        <smtpGreeting>JAMES Linagora's SMTP awesome Server</smtpGreeting>
+        <handlerchain>
+            <handler class="org.apache.james.smtpserver.fastfail.ValidRcptHandler"/>
+            <handler class="org.apache.james.smtpserver.CoreCmdHandlerLoader"/>
+        </handlerchain>
+    </smtpserver>
+    <smtpserver enabled="true">
+        <jmxName>smtpserver-authenticated</jmxName>
+        <bind>0.0.0.0:1587</bind>
+        <connectionBacklog>200</connectionBacklog>
+        <tls socketTLS="false" startTLS="true">
+            <keystore>file://conf/keystore</keystore>
+            <secret>james72laBalle</secret>
+            <provider>org.bouncycastle.jce.provider.BouncyCastleProvider</provider>
+            <algorithm>SunX509</algorithm>
+        </tls>
+        <connectiontimeout>360</connectiontimeout>
+        <connectionLimit>0</connectionLimit>
+        <connectionLimitPerIP>0</connectionLimitPerIP>
+        <!--
+           Authorize only local users
+        -->
+        <authRequired>true</authRequired>
+        <authorizedAddresses>0.0.0.0/0</authorizedAddresses>
+        <!-- Trust authenticated users -->
+        <verifyIdentity>false</verifyIdentity>
+        <maxmessagesize>0</maxmessagesize>
+        <addressBracketsEnforcement>true</addressBracketsEnforcement>
+        <smtpGreeting>JAMES Linagora's SMTP awesome Server</smtpGreeting>
+        <handlerchain>
+            <handler class="org.apache.james.smtpserver.fastfail.ValidRcptHandler"/>
+            <handler class="org.apache.james.smtpserver.CoreCmdHandlerLoader"/>
+        </handlerchain>
+    </smtpserver>
+</smtpservers>
+
+

http://git-wip-us.apache.org/repos/asf/james-project/blob/b45667b6/server/container/guice/jpa-guice/sample-configuration/usersrepository.xml
----------------------------------------------------------------------
diff --git a/server/container/guice/jpa-guice/sample-configuration/usersrepository.xml b/server/container/guice/jpa-guice/sample-configuration/usersrepository.xml
new file mode 100644
index 0000000..fc76107
--- /dev/null
+++ b/server/container/guice/jpa-guice/sample-configuration/usersrepository.xml
@@ -0,0 +1,27 @@
+<?xml version="1.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.                                           
+ -->
+
+<usersrepository name="LocalUsers" class="org.apache.james.user.jpa.JPAUsersRepository">
+    <destination URL="file://users/"/>
+    <algorithm>MD5</algorithm>
+    <enableVirtualHosting>true</enableVirtualHosting>
+    <enableForwarding>true</enableForwarding>
+</usersrepository>
+

http://git-wip-us.apache.org/repos/asf/james-project/blob/b45667b6/server/container/guice/memory-guice/sample-configuration/dnsservice.xml
----------------------------------------------------------------------
diff --git a/server/container/guice/memory-guice/sample-configuration/dnsservice.xml b/server/container/guice/memory-guice/sample-configuration/dnsservice.xml
new file mode 100644
index 0000000..0978a00
--- /dev/null
+++ b/server/container/guice/memory-guice/sample-configuration/dnsservice.xml
@@ -0,0 +1,29 @@
+<?xml version="1.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.                                           
+ -->
+
+<dnsservice>
+  <servers>
+    <server>8.8.8.8</server>
+    <server>62.210.16.6</server>
+  </servers>
+  <autodiscover>false</autodiscover>
+  <authoritative>false</authoritative>
+  <maxcachesize>50000</maxcachesize>
+</dnsservice>

http://git-wip-us.apache.org/repos/asf/james-project/blob/b45667b6/server/container/guice/memory-guice/sample-configuration/domainlist.xml
----------------------------------------------------------------------
diff --git a/server/container/guice/memory-guice/sample-configuration/domainlist.xml b/server/container/guice/memory-guice/sample-configuration/domainlist.xml
new file mode 100644
index 0000000..8d00118
--- /dev/null
+++ b/server/container/guice/memory-guice/sample-configuration/domainlist.xml
@@ -0,0 +1,28 @@
+<?xml version="1.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.                                           
+ -->
+
+<domainlist class="org.apache.james.domainlist.jpa.JPADomainList">
+    <domainnames>
+        <domainname>james.apache.org</domainname>
+    </domainnames>
+    <autodetect>true</autodetect>
+    <autodetectIP>true</autodetectIP>
+    <defaultDomain>localhost</defaultDomain>
+</domainlist>

http://git-wip-us.apache.org/repos/asf/james-project/blob/b45667b6/server/container/guice/memory-guice/sample-configuration/imapserver.xml
----------------------------------------------------------------------
diff --git a/server/container/guice/memory-guice/sample-configuration/imapserver.xml b/server/container/guice/memory-guice/sample-configuration/imapserver.xml
new file mode 100644
index 0000000..c03b978
--- /dev/null
+++ b/server/container/guice/memory-guice/sample-configuration/imapserver.xml
@@ -0,0 +1,54 @@
+<?xml version="1.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.
+-->
+
+
+<imapservers>
+	<imapserver enabled="true">
+		<jmxName>imapserver</jmxName>
+		<bind>0.0.0.0:1143</bind>
+		<connectionBacklog>200</connectionBacklog>
+		<tls socketTLS="false" startTLS="true">
+			<!-- To create a new keystore execute:
+            keytool -genkey -alias james -keyalg RSA -keystore /path/to/james/conf/keystore
+              -->
+			<keystore>file://conf/keystore</keystore>
+			<secret>james72laBalle</secret>
+			<provider>org.bouncycastle.jce.provider.BouncyCastleProvider</provider>
+		</tls>
+		<connectionLimit>0</connectionLimit>
+		<connectionLimitPerIP>0</connectionLimitPerIP>
+	</imapserver>
+	<imapserver enabled="true">
+		<jmxName>imapserver-ssl</jmxName>
+		<bind>0.0.0.0:1993</bind>
+		<connectionBacklog>200</connectionBacklog>
+		<tls socketTLS="true" startTLS="false">
+			<!-- To create a new keystore execute:
+              keytool -genkey -alias james -keyalg RSA -keystore /path/to/james/conf/keystore
+             -->
+			<keystore>file://conf/keystore</keystore>
+			<secret>james72laBalle</secret>
+			<provider>org.bouncycastle.jce.provider.BouncyCastleProvider</provider>
+		</tls>
+		<connectionLimit>0</connectionLimit>
+		<connectionLimitPerIP>0</connectionLimitPerIP>
+	</imapserver>
+</imapservers>

http://git-wip-us.apache.org/repos/asf/james-project/blob/b45667b6/server/container/guice/memory-guice/sample-configuration/jmap.properties
----------------------------------------------------------------------
diff --git a/server/container/guice/memory-guice/sample-configuration/jmap.properties b/server/container/guice/memory-guice/sample-configuration/jmap.properties
new file mode 100644
index 0000000..d785ccd
--- /dev/null
+++ b/server/container/guice/memory-guice/sample-configuration/jmap.properties
@@ -0,0 +1,11 @@
+# Configuration file for JMAP
+
+tls.keystoreURL=file://conf/keystore
+tls.secret=james72laBalle
+
+#
+# If you wish to use OAuth authentication, you should provide a valid JWT public key.
+# The following entry specify the link to the URL of the public key file,
+# which should be a PEM format file.
+#
+jwt.publickeypem.url=
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/james-project/blob/b45667b6/server/container/guice/memory-guice/sample-configuration/jmx.properties
----------------------------------------------------------------------
diff --git a/server/container/guice/memory-guice/sample-configuration/jmx.properties b/server/container/guice/memory-guice/sample-configuration/jmx.properties
new file mode 100644
index 0000000..a1dbdf8
--- /dev/null
+++ b/server/container/guice/memory-guice/sample-configuration/jmx.properties
@@ -0,0 +1,28 @@
+#  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.
+#
+
+#  This template file can be used as example for James Server configuration
+#  DO NOT USE IT AS SUCH AND ADAPT IT TO YOUR NEEDS
+
+#  This template file can be used as example for James Server configuration
+#  DO NOT USE IT AS SUCH AND ADAPT IT TO YOUR NEEDS
+
+# See http://james.apache.org/server/3/config.html for usage
+
+jmx.address=127.0.0.1
+jmx.port=9999

http://git-wip-us.apache.org/repos/asf/james-project/blob/b45667b6/server/container/guice/memory-guice/sample-configuration/lmtpserver.xml
----------------------------------------------------------------------
diff --git a/server/container/guice/memory-guice/sample-configuration/lmtpserver.xml b/server/container/guice/memory-guice/sample-configuration/lmtpserver.xml
new file mode 100644
index 0000000..87a0caa
--- /dev/null
+++ b/server/container/guice/memory-guice/sample-configuration/lmtpserver.xml
@@ -0,0 +1,41 @@
+<?xml version="1.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.                                           
+ -->
+
+<lmtpservers>
+
+    <lmtpserver enabled="false">
+        <jmxName>lmtpserver</jmxName>
+        <!-- LMTP should not be reachable from outside your network so bind it to loopback-->
+        <bind>127.0.0.1:1024</bind>
+        <connectionBacklog>200</connectionBacklog>
+        <connectiontimeout>1200</connectiontimeout>
+        <!-- Set the maximum simultaneous incoming connections for this service -->
+        <connectionLimit>0</connectionLimit>
+        <!-- Set the maximum simultaneous incoming connections per IP for this service -->
+        <connectionLimitPerIP>0</connectionLimitPerIP>
+        <!--  This sets the maximum allowed message size (in kilobytes) for this -->
+        <!--  LMTP service. If unspecified, the value defaults to 0, which means no limit. -->
+        <maxmessagesize>0</maxmessagesize>
+        <handlerchain>
+            <handler class="org.apache.james.lmtpserver.CoreCmdHandlerLoader"/>
+        </handlerchain>
+    </lmtpserver>
+
+</lmtpservers>

http://git-wip-us.apache.org/repos/asf/james-project/blob/b45667b6/server/container/guice/memory-guice/sample-configuration/mailetcontainer.xml
----------------------------------------------------------------------
diff --git a/server/container/guice/memory-guice/sample-configuration/mailetcontainer.xml b/server/container/guice/memory-guice/sample-configuration/mailetcontainer.xml
new file mode 100644
index 0000000..968b59c
--- /dev/null
+++ b/server/container/guice/memory-guice/sample-configuration/mailetcontainer.xml
@@ -0,0 +1,137 @@
+<?xml version="1.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.
+ -->
+
+<mailetcontainer enableJmx="true">
+
+    <context>
+        <postmaster>postmaster@james.minet.net</postmaster>
+    </context>
+
+    <spooler>
+        <threads>20</threads>
+    </spooler>
+
+    <processors>
+        <processor state="root" enableJmx="true">
+            <mailet match="All" class="PostmasterAlias"/>
+            <mailet match="RelayLimit=30" class="Null"/>
+            <!-- Hook on sievemanager@james.linagora.com
+                 Mail send to this address will get interpreted with SIEVE Manage -->
+            <mailet match="RecipientIs=sievemanager@james.linagora.com" class="ToProcessor">
+                <processor>sieve-manager-check</processor>
+            </mailet>
+            <mailet match="HasMailAttribute=spamChecked" class="ToProcessor">
+                <processor>transport</processor>
+            </mailet>
+            <mailet match="All" class="SetMailAttribute">
+                <spamChecked>true</spamChecked>
+            </mailet>
+            <mailet match="SMTPAuthSuccessful" class="ToProcessor">
+                <processor>transport</processor>
+            </mailet>
+            <mailet match="InSpammerBlacklist=query.bondedsender.org." class="ToProcessor">
+                <processor>transport</processor>
+            </mailet>
+            <!-- Check for delivery from a known spam server -->
+            <!-- This set of matchers/mailets redirect all emails from known -->
+            <!-- black holes, open relays, and spam servers to the spam processor -->
+            <!-- For this set to function properly, the spam processor must be configured. -->
+            <mailet match="InSpammerBlacklist=dnsbl.njabl.org." class="ToProcessor">
+                <processor>spam</processor>
+                <notice>550 Requested action not taken: rejected - see http://njabl.org/</notice>
+            </mailet>
+            <mailet match="All" class="ToProcessor">
+                <processor>transport</processor>
+            </mailet>
+        </processor>
+
+        <processor state="error" enableJmx="true">
+            <mailet match="All" class="Bounce"/>
+            <mailet match="All" class="ToRepository">
+                <repositoryPath>file://var/mail/error/</repositoryPath>
+            </mailet>
+        </processor>
+
+
+        <processor state="transport" enableJmx="true">
+            <mailet match="SMTPAuthSuccessful" class="SetMimeHeader">
+                <name>X-UserIsAuth</name>
+                <value>true</value>
+            </mailet>
+            <mailet match="HasMailAttribute=org.apache.james.SMIMECheckSignature" class="SetMimeHeader">
+                <name>X-WasSigned</name>
+                <value>true</value>
+            </mailet>
+            <mailet match="All" class="RecipientRewriteTable" />
+            <mailet match="RecipientIsLocal" class="LocalDelivery"/>
+            <mailet match="HostIsLocal" class="ToProcessor">
+                <processor>local-address-error</processor>
+                <notice>550 - Requested action not taken: no such user here</notice>
+            </mailet>
+            <mailet match="SMTPAuthSuccessful" class="RemoteDelivery">
+                <outgoingQueue>outgoing</outgoingQueue>
+                <delayTime>5000, 100000, 500000</delayTime>
+                <maxRetries>25</maxRetries>
+                <maxDnsProblemRetries>0</maxDnsProblemRetries>
+                <deliveryThreads>10</deliveryThreads>
+                <sendpartial>true</sendpartial>
+                <bounceProcessor>bounces</bounceProcessor>
+            </mailet>
+            <mailet match="All" class="ToProcessor">
+                <processor>relay-denied</processor>
+            </mailet>
+        </processor>
+
+        <processor state="spam" enableJmx="true">
+            <mailet match="All" class="ToRepository">
+                <repositoryPath>file://var/mail/spam/</repositoryPath>
+            </mailet>
+        </processor>
+
+        <processor state="local-address-error" enableJmx="true">
+            <mailet match="All" class="Bounce">
+                <attachment>none</attachment>
+            </mailet>
+            <mailet match="All" class="ToRepository">
+                <repositoryPath>file://var/mail/address-error/</repositoryPath>
+            </mailet>
+        </processor>
+
+        <processor state="relay-denied" enableJmx="true">
+            <mailet match="All" class="Bounce">
+                <attachment>none</attachment>
+            </mailet>
+            <mailet match="All" class="ToRepository">
+                <repositoryPath>file://var/mail/relay-denied/</repositoryPath>
+                <notice>Warning: You are sending an e-mail to a remote server. You must be authentified to perform such an operation</notice>
+            </mailet>
+        </processor>
+
+        <processor state="bounces" enableJmx="true">
+            <mailet match="All" class="DSNBounce">
+                <passThrough>false</passThrough>
+            </mailet>
+        </processor>
+    </processors>
+
+</mailetcontainer>
+
+

http://git-wip-us.apache.org/repos/asf/james-project/blob/b45667b6/server/container/guice/memory-guice/sample-configuration/mailrepositorystore.xml
----------------------------------------------------------------------
diff --git a/server/container/guice/memory-guice/sample-configuration/mailrepositorystore.xml b/server/container/guice/memory-guice/sample-configuration/mailrepositorystore.xml
new file mode 100644
index 0000000..acca810
--- /dev/null
+++ b/server/container/guice/memory-guice/sample-configuration/mailrepositorystore.xml
@@ -0,0 +1,34 @@
+<?xml version="1.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.
+ -->
+
+<mailrepositorystore>
+    <mailrepositories>
+        <!-- File based repositories.  These repositories store all message data -->
+        <!-- in the file system. -->
+        <mailrepository class="org.apache.james.mailrepository.file.FileMailRepository">
+            <protocols>
+                <protocol>file</protocol>
+            </protocols>
+            <!-- Set if the messages should be listed sorted. False by default -->
+            <config FIFO="false" CACHEKEYS="true"/>
+        </mailrepository>
+    </mailrepositories>
+</mailrepositorystore>

http://git-wip-us.apache.org/repos/asf/james-project/blob/b45667b6/server/container/guice/memory-guice/sample-configuration/pop3server.xml
----------------------------------------------------------------------
diff --git a/server/container/guice/memory-guice/sample-configuration/pop3server.xml b/server/container/guice/memory-guice/sample-configuration/pop3server.xml
new file mode 100644
index 0000000..c57c832
--- /dev/null
+++ b/server/container/guice/memory-guice/sample-configuration/pop3server.xml
@@ -0,0 +1,42 @@
+<?xml version="1.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.                                           
+ -->
+
+
+<pop3servers>
+    <pop3server enabled="false">
+        <jmxName>pop3server</jmxName>
+        <bind>0.0.0.0:1110</bind>
+        <connectionBacklog>200</connectionBacklog>
+        <tls socketTLS="false" startTLS="false">
+            <!-- To create a new keystore execute:
+                  keytool -genkey -alias james -keyalg RSA -keystore /path/to/james/conf/keystore
+             -->
+            <keystore>file://conf/keystore</keystore>
+            <secret>james72laBalle</secret>
+            <provider>org.bouncycastle.jce.provider.BouncyCastleProvider</provider>
+        </tls>
+        <connectiontimeout>1200</connectiontimeout>
+        <connectionLimit>0</connectionLimit>
+        <connectionLimitPerIP>0</connectionLimitPerIP>
+        <handlerchain>
+            <handler class="org.apache.james.pop3server.core.CoreCmdHandlerLoader"/>
+        </handlerchain>
+    </pop3server>
+</pop3servers>

http://git-wip-us.apache.org/repos/asf/james-project/blob/b45667b6/server/container/guice/memory-guice/sample-configuration/recipientrewritetable.xml
----------------------------------------------------------------------
diff --git a/server/container/guice/memory-guice/sample-configuration/recipientrewritetable.xml b/server/container/guice/memory-guice/sample-configuration/recipientrewritetable.xml
new file mode 100644
index 0000000..7e7f586
--- /dev/null
+++ b/server/container/guice/memory-guice/sample-configuration/recipientrewritetable.xml
@@ -0,0 +1,27 @@
+<?xml version="1.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.                                           
+ -->
+
+<!-- The default table for storing James' RecipientRewriteTable mappings. -->
+<recipientrewritetable class="org.apache.james.rrt.jpa.JPARecipientRewriteTable">
+  <recursiveMapping>true</recursiveMapping>
+  <mappingLimit>10</mappingLimit>
+  <mapping>some@domain=some</mapping>
+</recipientrewritetable>
+

http://git-wip-us.apache.org/repos/asf/james-project/blob/b45667b6/server/container/guice/memory-guice/sample-configuration/smtpserver.xml
----------------------------------------------------------------------
diff --git a/server/container/guice/memory-guice/sample-configuration/smtpserver.xml b/server/container/guice/memory-guice/sample-configuration/smtpserver.xml
new file mode 100644
index 0000000..c34fcd1
--- /dev/null
+++ b/server/container/guice/memory-guice/sample-configuration/smtpserver.xml
@@ -0,0 +1,105 @@
+<?xml version="1.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.
+ -->
+
+<smtpservers>
+    <smtpserver enabled="true">
+        <jmxName>smtpserver-global</jmxName>
+        <bind>0.0.0.0:1025</bind>
+        <connectionBacklog>200</connectionBacklog>
+        <tls socketTLS="false" startTLS="false">
+            <keystore>file://conf/keystore</keystore>
+            <secret>james72laBalle</secret>
+            <provider>org.bouncycastle.jce.provider.BouncyCastleProvider</provider>
+            <algorithm>SunX509</algorithm>
+        </tls>
+        <connectiontimeout>360</connectiontimeout>
+        <connectionLimit>0</connectionLimit>
+        <connectionLimitPerIP>0</connectionLimitPerIP>
+        <authRequired>false</authRequired>
+        <authorizedAddresses>0.0.0.0/0</authorizedAddresses>
+        <verifyIdentity>true</verifyIdentity>
+        <maxmessagesize>0</maxmessagesize>
+        <addressBracketsEnforcement>true</addressBracketsEnforcement>
+        <smtpGreeting>JAMES Linagora's SMTP awesome Server</smtpGreeting>
+        <handlerchain>
+            <handler class="org.apache.james.smtpserver.fastfail.ValidRcptHandler"/>
+            <handler class="org.apache.james.smtpserver.CoreCmdHandlerLoader"/>
+        </handlerchain>
+    </smtpserver>
+    <smtpserver enabled="true">
+        <jmxName>smtpserver-TLS</jmxName>
+        <bind>0.0.0.0:1465</bind>
+        <connectionBacklog>200</connectionBacklog>
+        <tls socketTLS="true" startTLS="false">
+            <keystore>file://conf/keystore</keystore>
+            <secret>james72laBalle</secret>
+            <provider>org.bouncycastle.jce.provider.BouncyCastleProvider</provider>
+            <algorithm>SunX509</algorithm>
+        </tls>
+        <connectiontimeout>360</connectiontimeout>
+        <connectionLimit>0</connectionLimit>
+        <connectionLimitPerIP>0</connectionLimitPerIP>
+        <!--
+           Authorize only local users
+        -->
+        <authRequired>true</authRequired>
+        <authorizedAddresses>0.0.0.0/0</authorizedAddresses>
+        <!-- Trust authenticated users -->
+        <verifyIdentity>false</verifyIdentity>
+        <maxmessagesize>0</maxmessagesize>
+        <addressBracketsEnforcement>true</addressBracketsEnforcement>
+        <smtpGreeting>JAMES Linagora's SMTP awesome Server</smtpGreeting>
+        <handlerchain>
+            <handler class="org.apache.james.smtpserver.fastfail.ValidRcptHandler"/>
+            <handler class="org.apache.james.smtpserver.CoreCmdHandlerLoader"/>
+        </handlerchain>
+    </smtpserver>
+    <smtpserver enabled="true">
+        <jmxName>smtpserver-authenticated</jmxName>
+        <bind>0.0.0.0:1587</bind>
+        <connectionBacklog>200</connectionBacklog>
+        <tls socketTLS="false" startTLS="true">
+            <keystore>file://conf/keystore</keystore>
+            <secret>james72laBalle</secret>
+            <provider>org.bouncycastle.jce.provider.BouncyCastleProvider</provider>
+            <algorithm>SunX509</algorithm>
+        </tls>
+        <connectiontimeout>360</connectiontimeout>
+        <connectionLimit>0</connectionLimit>
+        <connectionLimitPerIP>0</connectionLimitPerIP>
+        <!--
+           Authorize only local users
+        -->
+        <authRequired>true</authRequired>
+        <authorizedAddresses>0.0.0.0/0</authorizedAddresses>
+        <!-- Trust authenticated users -->
+        <verifyIdentity>false</verifyIdentity>
+        <maxmessagesize>0</maxmessagesize>
+        <addressBracketsEnforcement>true</addressBracketsEnforcement>
+        <smtpGreeting>JAMES Linagora's SMTP awesome Server</smtpGreeting>
+        <handlerchain>
+            <handler class="org.apache.james.smtpserver.fastfail.ValidRcptHandler"/>
+            <handler class="org.apache.james.smtpserver.CoreCmdHandlerLoader"/>
+        </handlerchain>
+    </smtpserver>
+</smtpservers>
+
+

http://git-wip-us.apache.org/repos/asf/james-project/blob/b45667b6/server/container/guice/memory-guice/sample-configuration/usersrepository.xml
----------------------------------------------------------------------
diff --git a/server/container/guice/memory-guice/sample-configuration/usersrepository.xml b/server/container/guice/memory-guice/sample-configuration/usersrepository.xml
new file mode 100644
index 0000000..fc76107
--- /dev/null
+++ b/server/container/guice/memory-guice/sample-configuration/usersrepository.xml
@@ -0,0 +1,27 @@
+<?xml version="1.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.                                           
+ -->
+
+<usersrepository name="LocalUsers" class="org.apache.james.user.jpa.JPAUsersRepository">
+    <destination URL="file://users/"/>
+    <algorithm>MD5</algorithm>
+    <enableVirtualHosting>true</enableVirtualHosting>
+    <enableForwarding>true</enableForwarding>
+</usersrepository>
+


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


[13/29] james-project git commit: JAMES-1842: Rename GuiceServerProbe to JmapGuiceServerProbe

Posted by ad...@apache.org.
JAMES-1842: Rename GuiceServerProbe to JmapGuiceServerProbe


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

Branch: refs/heads/master
Commit: 91be31f9b0f3d0838267c7f90fceb83ff9af5b71
Parents: e48ef9d
Author: Quynh Nguyen <qn...@linagora.com>
Authored: Fri Oct 28 16:38:04 2016 +0700
Committer: Quynh Nguyen <qn...@linagora.com>
Committed: Fri Nov 18 09:25:34 2016 +0700

----------------------------------------------------------------------
 .../java/org/apache/james/GuiceJamesServer.java |   6 +-
 .../james/modules/CommonServicesModule.java     |   4 +-
 .../apache/james/utils/GuiceServerProbe.java    | 368 -------------------
 .../james/utils/JmapGuiceServerProbe.java       | 368 +++++++++++++++++++
 4 files changed, 373 insertions(+), 373 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/91be31f9/server/container/guice/guice-common/src/main/java/org/apache/james/GuiceJamesServer.java
----------------------------------------------------------------------
diff --git a/server/container/guice/guice-common/src/main/java/org/apache/james/GuiceJamesServer.java b/server/container/guice/guice-common/src/main/java/org/apache/james/GuiceJamesServer.java
index e9ce3f6..6d0209d 100644
--- a/server/container/guice/guice-common/src/main/java/org/apache/james/GuiceJamesServer.java
+++ b/server/container/guice/guice-common/src/main/java/org/apache/james/GuiceJamesServer.java
@@ -30,7 +30,7 @@ import org.apache.james.modules.ProtocolsModule;
 import org.apache.james.onami.lifecycle.Stager;
 import org.apache.james.utils.ConfigurationsPerformer;
 import org.apache.james.utils.ExtendedJmapServerProbe;
-import org.apache.james.utils.GuiceServerProbe;
+import org.apache.james.utils.JmapGuiceServerProbe;
 import org.apache.james.webadmin.Port;
 import org.apache.james.webadmin.WebAdminServer;
 
@@ -46,7 +46,7 @@ public class GuiceJamesServer {
 
     private final Module module;
     private Stager<PreDestroy> preDestroy;
-    private GuiceServerProbe serverProbe;
+    private JmapGuiceServerProbe serverProbe;
     private Optional<Integer> jmapPort;
     private Optional<Port> webadminPort;
 
@@ -73,7 +73,7 @@ public class GuiceJamesServer {
         Injector injector = Guice.createInjector(module);
         preDestroy = injector.getInstance(Key.get(new TypeLiteral<Stager<PreDestroy>>() {}));
         injector.getInstance(ConfigurationsPerformer.class).initModules();
-        serverProbe = injector.getInstance(GuiceServerProbe.class);
+        serverProbe = injector.getInstance(JmapGuiceServerProbe.class);
         jmapPort = locateJMAPPort(injector);
         webadminPort =locateWebAdminPort(injector);
     }

http://git-wip-us.apache.org/repos/asf/james-project/blob/91be31f9/server/container/guice/guice-common/src/main/java/org/apache/james/modules/CommonServicesModule.java
----------------------------------------------------------------------
diff --git a/server/container/guice/guice-common/src/main/java/org/apache/james/modules/CommonServicesModule.java b/server/container/guice/guice-common/src/main/java/org/apache/james/modules/CommonServicesModule.java
index e79ed7f..10af893 100644
--- a/server/container/guice/guice-common/src/main/java/org/apache/james/modules/CommonServicesModule.java
+++ b/server/container/guice/guice-common/src/main/java/org/apache/james/modules/CommonServicesModule.java
@@ -33,7 +33,7 @@ import org.apache.james.modules.server.AsyncTasksExecutorModule;
 import org.apache.james.modules.server.ConfigurationProviderModule;
 import org.apache.james.modules.server.DNSServiceModule;
 import org.apache.james.onami.lifecycle.PreDestroyModule;
-import org.apache.james.utils.GuiceServerProbe;
+import org.apache.james.utils.JmapGuiceServerProbe;
 
 import com.google.inject.AbstractModule;
 import com.google.inject.Provides;
@@ -55,7 +55,7 @@ public class CommonServicesModule extends AbstractModule {
         install(new AsyncTasksExecutorModule());
 
         bind(FileSystemImpl.class).in(Scopes.SINGLETON);
-        bind(GuiceServerProbe.class).in(Scopes.SINGLETON);
+        bind(JmapGuiceServerProbe.class).in(Scopes.SINGLETON);
 
         bind(FileSystem.class).to(FileSystemImpl.class);
     }

http://git-wip-us.apache.org/repos/asf/james-project/blob/91be31f9/server/container/guice/guice-common/src/main/java/org/apache/james/utils/GuiceServerProbe.java
----------------------------------------------------------------------
diff --git a/server/container/guice/guice-common/src/main/java/org/apache/james/utils/GuiceServerProbe.java b/server/container/guice/guice-common/src/main/java/org/apache/james/utils/GuiceServerProbe.java
deleted file mode 100644
index cbc7f81..0000000
--- a/server/container/guice/guice-common/src/main/java/org/apache/james/utils/GuiceServerProbe.java
+++ /dev/null
@@ -1,368 +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.utils;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Collection;
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
-import java.util.stream.Collectors;
-
-import javax.inject.Inject;
-import javax.mail.Flags;
-
-import org.apache.commons.lang.NotImplementedException;
-import org.apache.james.adapter.mailbox.SerializableQuota;
-import org.apache.james.domainlist.api.DomainList;
-import org.apache.james.jmap.api.vacation.AccountId;
-import org.apache.james.jmap.api.vacation.Vacation;
-import org.apache.james.jmap.api.vacation.VacationPatch;
-import org.apache.james.jmap.api.vacation.VacationRepository;
-import org.apache.james.mailbox.MailboxManager;
-import org.apache.james.mailbox.MailboxSession;
-import org.apache.james.mailbox.MessageManager;
-import org.apache.james.mailbox.exception.MailboxException;
-import org.apache.james.mailbox.model.MailboxConstants;
-import org.apache.james.mailbox.model.MailboxMetaData;
-import org.apache.james.mailbox.model.MailboxPath;
-import org.apache.james.mailbox.model.MailboxQuery;
-import org.apache.james.mailbox.store.mail.MailboxMapper;
-import org.apache.james.mailbox.store.mail.MailboxMapperFactory;
-import org.apache.james.mailbox.store.mail.model.Mailbox;
-import org.apache.james.rrt.api.RecipientRewriteTable;
-import org.apache.james.rrt.lib.Mappings;
-import org.apache.james.sieverepository.api.SieveRepository;
-import org.apache.james.user.api.UsersRepository;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import com.google.common.base.Throwables;
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.Iterables;
-
-public class GuiceServerProbe implements ExtendedJmapServerProbe {
-
-    private static final Logger LOGGER = LoggerFactory.getLogger(GuiceServerProbe.class);
-
-    private final MailboxManager mailboxManager;
-    private final MailboxMapperFactory mailboxMapperFactory;
-    private final DomainList domainList;
-    private final UsersRepository usersRepository;
-    private final SieveRepository sieveRepository;
-    private final RecipientRewriteTable recipientRewriteTable;
-    private final VacationRepository vacationRepository;
-
-    @Inject
-    private GuiceServerProbe(MailboxManager mailboxManager, MailboxMapperFactory mailboxMapperFactory,
-                             DomainList domainList, UsersRepository usersRepository, SieveRepository sieveRepository,
-                             RecipientRewriteTable recipientRewriteTable, VacationRepository vacationRepository) {
-        this.mailboxManager = mailboxManager;
-        this.mailboxMapperFactory = mailboxMapperFactory;
-        this.domainList = domainList;
-        this.usersRepository = usersRepository;
-        this.sieveRepository = sieveRepository;
-        this.recipientRewriteTable = recipientRewriteTable;
-        this.vacationRepository = vacationRepository;
-    }
-
-    @Override
-    public void close() throws IOException {
-    }
-
-    @Override
-    public void addUser(String userName, String password) throws Exception {
-        usersRepository.addUser(userName, password);
-    }
-
-    @Override
-    public void removeUser(String username) throws Exception {
-        usersRepository.removeUser(username);
-    }
-
-    @Override
-    public String[] listUsers() throws Exception {
-        return Iterables.toArray(ImmutableList.copyOf(usersRepository.list()), String.class);
-    }
-
-    @Override
-    public void setPassword(String userName, String password) throws Exception {
-        throw new NotImplementedException();
-    }
-
-    @Override
-    public void addDomain(String domain) throws Exception {
-        domainList.addDomain(domain);
-    }
-
-    @Override
-    public boolean containsDomain(String domain) throws Exception {
-        return domainList.containsDomain(domain);
-    }
-
-    @Override
-    public String getDefaultDomain() throws Exception {
-        return domainList.getDefaultDomain();
-    }
-
-    @Override
-    public void removeDomain(String domain) throws Exception {
-        domainList.removeDomain(domain);
-    }
-
-    @Override
-    public List<String> listDomains() throws Exception {
-        return domainList.getDomains();
-    }
-
-    @Override
-    public Map<String, Mappings> listMappings() throws Exception {
-        return recipientRewriteTable.getAllMappings();
-    }
-
-    @Override
-    public void addAddressMapping(String user, String domain, String toAddress) throws Exception {
-        recipientRewriteTable.addAddressMapping(user, domain, toAddress);
-    }
-
-    @Override
-    public void removeAddressMapping(String user, String domain, String fromAddress) throws Exception {
-        recipientRewriteTable.removeAddressMapping(user, domain, fromAddress);
-    }
-
-    @Override
-    public Mappings listUserDomainMappings(String user, String domain) throws Exception {
-        throw new NotImplementedException();
-    }
-
-    @Override
-    public void addRegexMapping(String user, String domain, String regex) throws Exception {
-        recipientRewriteTable.addRegexMapping(user, domain, regex);
-    }
-
-    @Override
-    public void removeRegexMapping(String user, String domain, String regex) throws Exception {
-        recipientRewriteTable.removeRegexMapping(user, domain, regex);
-    }
-
-    @Override
-    public void copyMailbox(String srcBean, String dstBean) throws Exception {
-        throw new NotImplementedException();
-    }
-
-    @Override
-    public void deleteUserMailboxesNames(String user) throws Exception {
-        throw new NotImplementedException();
-    }
-
-    @Override
-    public void createMailbox(String namespace, String user, String name) {
-        MailboxSession mailboxSession = null;
-        try {
-            mailboxSession = mailboxManager.createSystemSession(user, LOGGER);
-            mailboxManager.startProcessingRequest(mailboxSession);
-            mailboxManager.createMailbox(new MailboxPath(namespace, user, name), mailboxSession);
-        } catch (MailboxException e) {
-            throw Throwables.propagate(e);
-        } finally {
-            closeSession(mailboxSession);
-        }
-    }
-
-    @Override
-    public Mailbox getMailbox(String namespace, String user, String name) {
-        MailboxSession mailboxSession = null;
-        try {
-            mailboxSession = mailboxManager.createSystemSession(user, LOGGER);
-            MailboxMapper mailboxMapper = mailboxMapperFactory.getMailboxMapper(mailboxSession);
-            return mailboxMapper.findMailboxByPath(new MailboxPath(namespace, user, name));
-        } catch (MailboxException e) {
-            throw Throwables.propagate(e);
-        } finally {
-            closeSession(mailboxSession);
-        }
-    }
-
-    private void closeSession(MailboxSession session) {
-        if (session != null) {
-            mailboxManager.endProcessingRequest(session);
-            try {
-                mailboxManager.logout(session, true);
-            } catch (MailboxException e) {
-                throw Throwables.propagate(e);
-            }
-        }
-    }
-
-    @Override
-    public Collection<String> listUserMailboxes(String user) {
-        MailboxSession mailboxSession = null;
-        try {
-            mailboxSession = mailboxManager.createSystemSession(user, LOGGER);
-            mailboxManager.startProcessingRequest(mailboxSession);
-            return searchUserMailboxes(user, mailboxSession)
-                    .stream()
-                    .map(MailboxMetaData::getPath)
-                    .map(MailboxPath::getName)
-                    .collect(Collectors.toList());
-        } catch (MailboxException e) {
-            throw Throwables.propagate(e);
-        } finally {
-            closeSession(mailboxSession);
-        }
-    }
-
-    private List<MailboxMetaData> searchUserMailboxes(String username, MailboxSession session) throws MailboxException {
-        return mailboxManager.search(
-            new MailboxQuery(new MailboxPath(MailboxConstants.USER_NAMESPACE, username, ""),
-                "*",
-                session.getPathDelimiter()),
-            session);
-    }
-
-    @Override
-    public void deleteMailbox(String namespace, String user, String name) {
-        MailboxSession mailboxSession = null;
-        try {
-            mailboxSession = mailboxManager.createSystemSession(user, LOGGER);
-            mailboxManager.startProcessingRequest(mailboxSession);
-            mailboxManager.deleteMailbox(new MailboxPath(namespace, user, name), mailboxSession);
-        } catch (MailboxException e) {
-            throw Throwables.propagate(e);
-        } finally {
-            closeSession(mailboxSession);
-        }
-    }
-
-    @Override
-    public String getQuotaRoot(String namespace, String user, String name) throws MailboxException {
-        throw new NotImplementedException();
-    }
-
-    @Override
-    public SerializableQuota getMessageCountQuota(String quotaRoot) throws MailboxException {
-        throw new NotImplementedException();
-    }
-
-    @Override
-    public SerializableQuota getStorageQuota(String quotaRoot) throws MailboxException {
-        throw new NotImplementedException();
-    }
-
-    @Override
-    public long getMaxMessageCount(String quotaRoot) throws MailboxException {
-        throw new NotImplementedException();
-    }
-
-    @Override
-    public long getMaxStorage(String quotaRoot) throws MailboxException {
-        throw new NotImplementedException();
-    }
-
-    @Override
-    public long getDefaultMaxMessageCount() throws MailboxException {
-        throw new NotImplementedException();
-    }
-
-    @Override
-    public long getDefaultMaxStorage() throws MailboxException {
-        throw new NotImplementedException();
-    }
-
-    @Override
-    public void setMaxMessageCount(String quotaRoot, long maxMessageCount) throws MailboxException {
-        throw new NotImplementedException();
-    }
-
-    @Override
-    public void setMaxStorage(String quotaRoot, long maxSize) throws MailboxException {
-        throw new NotImplementedException();
-    }
-
-    @Override
-    public void setDefaultMaxMessageCount(long maxDefaultMessageCount) throws MailboxException {
-        throw new NotImplementedException();
-    }
-
-    @Override
-    public void setDefaultMaxStorage(long maxDefaultSize) throws MailboxException {
-        throw new NotImplementedException();
-    }
-
-    @Override
-    public void appendMessage(String username, MailboxPath mailboxPath, InputStream message, Date internalDate, boolean isRecent, Flags flags) 
-            throws MailboxException {
-        
-        MailboxSession mailboxSession = mailboxManager.createSystemSession(username, LOGGER);
-        MessageManager messageManager = mailboxManager.getMailbox(mailboxPath, mailboxSession);
-        messageManager.appendMessage(message, internalDate, mailboxSession, isRecent, flags);
-    }
-
-    @Override
-    public void reIndexMailbox(String namespace, String user, String name) throws Exception {
-        throw new NotImplementedException();
-    }
-
-    @Override
-    public void reIndexAll() throws Exception {
-        throw new NotImplementedException();
-    }
-
-    @Override
-    public long getSieveQuota() throws Exception {
-        return sieveRepository.getQuota();
-    }
-
-    @Override
-    public void setSieveQuota(long quota) throws Exception {
-        sieveRepository.setQuota(quota);
-    }
-
-    @Override
-    public void removeSieveQuota() throws Exception {
-        sieveRepository.removeQuota();
-    }
-
-    @Override
-    public long getSieveQuota(String user) throws Exception {
-        return sieveRepository.getQuota(user);
-    }
-
-    @Override
-    public void setSieveQuota(String user, long quota) throws Exception {
-        sieveRepository.setQuota(user, quota);
-    }
-
-    @Override
-    public void removeSieveQuota(String user) throws Exception {
-        sieveRepository.removeQuota(user);
-    }
-
-    @Override
-    public void modifyVacation(AccountId accountId, VacationPatch vacationPatch) {
-        vacationRepository.modifyVacation(accountId, vacationPatch).join();
-    }
-
-    @Override
-    public Vacation retrieveVacation(AccountId accountId) {
-        return vacationRepository.retrieveVacation(accountId).join();
-    }
-}

http://git-wip-us.apache.org/repos/asf/james-project/blob/91be31f9/server/container/guice/guice-common/src/main/java/org/apache/james/utils/JmapGuiceServerProbe.java
----------------------------------------------------------------------
diff --git a/server/container/guice/guice-common/src/main/java/org/apache/james/utils/JmapGuiceServerProbe.java b/server/container/guice/guice-common/src/main/java/org/apache/james/utils/JmapGuiceServerProbe.java
new file mode 100644
index 0000000..b2ca5d5
--- /dev/null
+++ b/server/container/guice/guice-common/src/main/java/org/apache/james/utils/JmapGuiceServerProbe.java
@@ -0,0 +1,368 @@
+/****************************************************************
+ * 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.utils;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Collection;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+import javax.inject.Inject;
+import javax.mail.Flags;
+
+import org.apache.commons.lang.NotImplementedException;
+import org.apache.james.adapter.mailbox.SerializableQuota;
+import org.apache.james.domainlist.api.DomainList;
+import org.apache.james.jmap.api.vacation.AccountId;
+import org.apache.james.jmap.api.vacation.Vacation;
+import org.apache.james.jmap.api.vacation.VacationPatch;
+import org.apache.james.jmap.api.vacation.VacationRepository;
+import org.apache.james.mailbox.MailboxManager;
+import org.apache.james.mailbox.MailboxSession;
+import org.apache.james.mailbox.MessageManager;
+import org.apache.james.mailbox.exception.MailboxException;
+import org.apache.james.mailbox.model.MailboxConstants;
+import org.apache.james.mailbox.model.MailboxMetaData;
+import org.apache.james.mailbox.model.MailboxPath;
+import org.apache.james.mailbox.model.MailboxQuery;
+import org.apache.james.mailbox.store.mail.MailboxMapper;
+import org.apache.james.mailbox.store.mail.MailboxMapperFactory;
+import org.apache.james.mailbox.store.mail.model.Mailbox;
+import org.apache.james.rrt.api.RecipientRewriteTable;
+import org.apache.james.rrt.lib.Mappings;
+import org.apache.james.sieverepository.api.SieveRepository;
+import org.apache.james.user.api.UsersRepository;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.google.common.base.Throwables;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.Iterables;
+
+public class JmapGuiceServerProbe implements ExtendedJmapServerProbe {
+
+    private static final Logger LOGGER = LoggerFactory.getLogger(JmapGuiceServerProbe.class);
+
+    private final MailboxManager mailboxManager;
+    private final MailboxMapperFactory mailboxMapperFactory;
+    private final DomainList domainList;
+    private final UsersRepository usersRepository;
+    private final SieveRepository sieveRepository;
+    private final RecipientRewriteTable recipientRewriteTable;
+    private final VacationRepository vacationRepository;
+
+    @Inject
+    private JmapGuiceServerProbe(MailboxManager mailboxManager, MailboxMapperFactory mailboxMapperFactory,
+                             DomainList domainList, UsersRepository usersRepository, SieveRepository sieveRepository,
+                             RecipientRewriteTable recipientRewriteTable, VacationRepository vacationRepository) {
+        this.mailboxManager = mailboxManager;
+        this.mailboxMapperFactory = mailboxMapperFactory;
+        this.domainList = domainList;
+        this.usersRepository = usersRepository;
+        this.sieveRepository = sieveRepository;
+        this.recipientRewriteTable = recipientRewriteTable;
+        this.vacationRepository = vacationRepository;
+    }
+
+    @Override
+    public void close() throws IOException {
+    }
+
+    @Override
+    public void addUser(String userName, String password) throws Exception {
+        usersRepository.addUser(userName, password);
+    }
+
+    @Override
+    public void removeUser(String username) throws Exception {
+        usersRepository.removeUser(username);
+    }
+
+    @Override
+    public String[] listUsers() throws Exception {
+        return Iterables.toArray(ImmutableList.copyOf(usersRepository.list()), String.class);
+    }
+
+    @Override
+    public void setPassword(String userName, String password) throws Exception {
+        throw new NotImplementedException();
+    }
+
+    @Override
+    public void addDomain(String domain) throws Exception {
+        domainList.addDomain(domain);
+    }
+
+    @Override
+    public boolean containsDomain(String domain) throws Exception {
+        return domainList.containsDomain(domain);
+    }
+
+    @Override
+    public String getDefaultDomain() throws Exception {
+        return domainList.getDefaultDomain();
+    }
+
+    @Override
+    public void removeDomain(String domain) throws Exception {
+        domainList.removeDomain(domain);
+    }
+
+    @Override
+    public List<String> listDomains() throws Exception {
+        return domainList.getDomains();
+    }
+
+    @Override
+    public Map<String, Mappings> listMappings() throws Exception {
+        return recipientRewriteTable.getAllMappings();
+    }
+
+    @Override
+    public void addAddressMapping(String user, String domain, String toAddress) throws Exception {
+        recipientRewriteTable.addAddressMapping(user, domain, toAddress);
+    }
+
+    @Override
+    public void removeAddressMapping(String user, String domain, String fromAddress) throws Exception {
+        recipientRewriteTable.removeAddressMapping(user, domain, fromAddress);
+    }
+
+    @Override
+    public Mappings listUserDomainMappings(String user, String domain) throws Exception {
+        throw new NotImplementedException();
+    }
+
+    @Override
+    public void addRegexMapping(String user, String domain, String regex) throws Exception {
+        recipientRewriteTable.addRegexMapping(user, domain, regex);
+    }
+
+    @Override
+    public void removeRegexMapping(String user, String domain, String regex) throws Exception {
+        recipientRewriteTable.removeRegexMapping(user, domain, regex);
+    }
+
+    @Override
+    public void copyMailbox(String srcBean, String dstBean) throws Exception {
+        throw new NotImplementedException();
+    }
+
+    @Override
+    public void deleteUserMailboxesNames(String user) throws Exception {
+        throw new NotImplementedException();
+    }
+
+    @Override
+    public void createMailbox(String namespace, String user, String name) {
+        MailboxSession mailboxSession = null;
+        try {
+            mailboxSession = mailboxManager.createSystemSession(user, LOGGER);
+            mailboxManager.startProcessingRequest(mailboxSession);
+            mailboxManager.createMailbox(new MailboxPath(namespace, user, name), mailboxSession);
+        } catch (MailboxException e) {
+            throw Throwables.propagate(e);
+        } finally {
+            closeSession(mailboxSession);
+        }
+    }
+
+    @Override
+    public Mailbox getMailbox(String namespace, String user, String name) {
+        MailboxSession mailboxSession = null;
+        try {
+            mailboxSession = mailboxManager.createSystemSession(user, LOGGER);
+            MailboxMapper mailboxMapper = mailboxMapperFactory.getMailboxMapper(mailboxSession);
+            return mailboxMapper.findMailboxByPath(new MailboxPath(namespace, user, name));
+        } catch (MailboxException e) {
+            throw Throwables.propagate(e);
+        } finally {
+            closeSession(mailboxSession);
+        }
+    }
+
+    private void closeSession(MailboxSession session) {
+        if (session != null) {
+            mailboxManager.endProcessingRequest(session);
+            try {
+                mailboxManager.logout(session, true);
+            } catch (MailboxException e) {
+                throw Throwables.propagate(e);
+            }
+        }
+    }
+
+    @Override
+    public Collection<String> listUserMailboxes(String user) {
+        MailboxSession mailboxSession = null;
+        try {
+            mailboxSession = mailboxManager.createSystemSession(user, LOGGER);
+            mailboxManager.startProcessingRequest(mailboxSession);
+            return searchUserMailboxes(user, mailboxSession)
+                    .stream()
+                    .map(MailboxMetaData::getPath)
+                    .map(MailboxPath::getName)
+                    .collect(Collectors.toList());
+        } catch (MailboxException e) {
+            throw Throwables.propagate(e);
+        } finally {
+            closeSession(mailboxSession);
+        }
+    }
+
+    private List<MailboxMetaData> searchUserMailboxes(String username, MailboxSession session) throws MailboxException {
+        return mailboxManager.search(
+            new MailboxQuery(new MailboxPath(MailboxConstants.USER_NAMESPACE, username, ""),
+                "*",
+                session.getPathDelimiter()),
+            session);
+    }
+
+    @Override
+    public void deleteMailbox(String namespace, String user, String name) {
+        MailboxSession mailboxSession = null;
+        try {
+            mailboxSession = mailboxManager.createSystemSession(user, LOGGER);
+            mailboxManager.startProcessingRequest(mailboxSession);
+            mailboxManager.deleteMailbox(new MailboxPath(namespace, user, name), mailboxSession);
+        } catch (MailboxException e) {
+            throw Throwables.propagate(e);
+        } finally {
+            closeSession(mailboxSession);
+        }
+    }
+
+    @Override
+    public String getQuotaRoot(String namespace, String user, String name) throws MailboxException {
+        throw new NotImplementedException();
+    }
+
+    @Override
+    public SerializableQuota getMessageCountQuota(String quotaRoot) throws MailboxException {
+        throw new NotImplementedException();
+    }
+
+    @Override
+    public SerializableQuota getStorageQuota(String quotaRoot) throws MailboxException {
+        throw new NotImplementedException();
+    }
+
+    @Override
+    public long getMaxMessageCount(String quotaRoot) throws MailboxException {
+        throw new NotImplementedException();
+    }
+
+    @Override
+    public long getMaxStorage(String quotaRoot) throws MailboxException {
+        throw new NotImplementedException();
+    }
+
+    @Override
+    public long getDefaultMaxMessageCount() throws MailboxException {
+        throw new NotImplementedException();
+    }
+
+    @Override
+    public long getDefaultMaxStorage() throws MailboxException {
+        throw new NotImplementedException();
+    }
+
+    @Override
+    public void setMaxMessageCount(String quotaRoot, long maxMessageCount) throws MailboxException {
+        throw new NotImplementedException();
+    }
+
+    @Override
+    public void setMaxStorage(String quotaRoot, long maxSize) throws MailboxException {
+        throw new NotImplementedException();
+    }
+
+    @Override
+    public void setDefaultMaxMessageCount(long maxDefaultMessageCount) throws MailboxException {
+        throw new NotImplementedException();
+    }
+
+    @Override
+    public void setDefaultMaxStorage(long maxDefaultSize) throws MailboxException {
+        throw new NotImplementedException();
+    }
+
+    @Override
+    public void appendMessage(String username, MailboxPath mailboxPath, InputStream message, Date internalDate, boolean isRecent, Flags flags) 
+            throws MailboxException {
+        
+        MailboxSession mailboxSession = mailboxManager.createSystemSession(username, LOGGER);
+        MessageManager messageManager = mailboxManager.getMailbox(mailboxPath, mailboxSession);
+        messageManager.appendMessage(message, internalDate, mailboxSession, isRecent, flags);
+    }
+
+    @Override
+    public void reIndexMailbox(String namespace, String user, String name) throws Exception {
+        throw new NotImplementedException();
+    }
+
+    @Override
+    public void reIndexAll() throws Exception {
+        throw new NotImplementedException();
+    }
+
+    @Override
+    public long getSieveQuota() throws Exception {
+        return sieveRepository.getQuota();
+    }
+
+    @Override
+    public void setSieveQuota(long quota) throws Exception {
+        sieveRepository.setQuota(quota);
+    }
+
+    @Override
+    public void removeSieveQuota() throws Exception {
+        sieveRepository.removeQuota();
+    }
+
+    @Override
+    public long getSieveQuota(String user) throws Exception {
+        return sieveRepository.getQuota(user);
+    }
+
+    @Override
+    public void setSieveQuota(String user, long quota) throws Exception {
+        sieveRepository.setQuota(user, quota);
+    }
+
+    @Override
+    public void removeSieveQuota(String user) throws Exception {
+        sieveRepository.removeQuota(user);
+    }
+
+    @Override
+    public void modifyVacation(AccountId accountId, VacationPatch vacationPatch) {
+        vacationRepository.modifyVacation(accountId, vacationPatch).join();
+    }
+
+    @Override
+    public Vacation retrieveVacation(AccountId accountId) {
+        return vacationRepository.retrieveVacation(accountId).join();
+    }
+}


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


[27/29] james-project git commit: JAMES-1842: Remove Generics on Cucumber stuffs

Posted by ad...@apache.org.
JAMES-1842: Remove Generics on Cucumber stuffs


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

Branch: refs/heads/master
Commit: e849d6ed84b8a08222ec03d7f098ec61382ea532
Parents: f11fa61
Author: Antoine Duprat <ad...@apache.org>
Authored: Wed Nov 16 10:21:24 2016 +0100
Committer: Quynh Nguyen <qn...@linagora.com>
Committed: Fri Nov 18 09:33:20 2016 +0700

----------------------------------------------------------------------
 .../james/jmap/cassandra/cucumber/CassandraStepdefs.java |  4 ++--
 .../methods/integration/cucumber/DownloadStepdefs.java   | 11 ++++-------
 .../integration/cucumber/GetMessagesMethodStepdefs.java  | 11 ++++-------
 .../jmap/methods/integration/cucumber/MainStepdefs.java  |  8 +++-----
 .../integration/cucumber/SetMailboxesMethodStepdefs.java | 11 ++++-------
 .../methods/integration/cucumber/UploadStepdefs.java     | 11 ++++-------
 .../jmap/methods/integration/cucumber/UserStepdefs.java  |  9 +++------
 .../james/jmap/memory/cucumber/MemoryStepdefs.java       |  4 ++--
 8 files changed, 26 insertions(+), 43 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/e849d6ed/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 2e3ea82..39f4b65 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
@@ -40,13 +40,13 @@ import cucumber.runtime.java.guice.ScenarioScoped;
 @ScenarioScoped
 public class CassandraStepdefs {
 
-    private final MainStepdefs<CassandraJamesServer> mainStepdefs;
+    private final MainStepdefs mainStepdefs;
     private TemporaryFolder temporaryFolder = new TemporaryFolder();
     private EmbeddedElasticSearch embeddedElasticSearch = new EmbeddedElasticSearch(temporaryFolder);
     private EmbeddedCassandra cassandra = EmbeddedCassandra.createStartServer();
 
     @Inject
-    private CassandraStepdefs(MainStepdefs<CassandraJamesServer> mainStepdefs) {
+    private CassandraStepdefs(MainStepdefs mainStepdefs) {
         this.mainStepdefs = mainStepdefs;
     }
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/e849d6ed/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/DownloadStepdefs.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/DownloadStepdefs.java b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/DownloadStepdefs.java
index 50fbe6a..d000bb3 100644
--- a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/DownloadStepdefs.java
+++ b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/DownloadStepdefs.java
@@ -37,9 +37,6 @@ import org.apache.http.HttpResponse;
 import org.apache.http.client.fluent.Request;
 import org.apache.http.client.fluent.Response;
 import org.apache.http.client.utils.URIBuilder;
-import org.apache.james.GuiceJamesServerImpl;
-import org.apache.james.JmapServer;
-import org.apache.james.WebAdminServer;
 import org.apache.james.jmap.api.access.AccessToken;
 import org.apache.james.jmap.model.AttachmentAccessToken;
 import org.apache.james.mailbox.model.MailboxConstants;
@@ -59,7 +56,7 @@ import cucumber.api.java.en.When;
 import cucumber.runtime.java.guice.ScenarioScoped;
 
 @ScenarioScoped
-public class DownloadStepdefs <T extends GuiceJamesServerImpl & JmapServer & WebAdminServer> {
+public class DownloadStepdefs {
 
     private static final String ONE_ATTACHMENT_EML_ATTACHEMENT_BLOB_ID = "4000c5145f633410b80be368c44e1c394bff9437";
     private static final String EXPIRED_ATTACHMENT_TOKEN = "usera@domain.tld_"
@@ -70,15 +67,15 @@ public class DownloadStepdefs <T extends GuiceJamesServerImpl & JmapServer & Web
             + "DiZa0O14MjLWrAA8P6MG35Gt5CBp7mt5U1EH/M++rIoZK7nlGJ4dPW0dvZD7h4m3o5b/Yd8DXU5x2x4+s0HOOKzD7X0RMlsU7JHJMNLvTvRGWF/C+MUyC8Zce7DtnRVPEQX2uAZhL2PBABV07Vpa8kH+NxoS9CL955Bc1Obr4G+KN2JorADlocFQA6ElXryF5YS/HPZSvq1MTC6aJIP0ku8WRpRnbwgwJnn26YpcHXcJjbkCBtd9/BhlMV6xNd2hTBkfZmYdoNo+UKBaXWzLxAlbLuxjpxwvDNJfOEyWFPgHDoRvzP+G7KzhVWjanHAHrhF0GilEa/MKpOI1qHBSwA==";
     private static final String UTF8_CONTENT_DIPOSITION_START = "Content-Disposition: attachment; filename*=\"";
 
-    private final UserStepdefs<T> userStepdefs;
-    private final MainStepdefs<T> mainStepdefs;
+    private final UserStepdefs userStepdefs;
+    private final MainStepdefs mainStepdefs;
     private HttpResponse response;
     private Multimap<String, String> attachmentsByMessageId;
     private Map<String, String> blobIdByAttachmentId;
     private Map<AttachmentAccessTokenKey, AttachmentAccessToken> attachmentAccessTokens;
 
     @Inject
-    private DownloadStepdefs(MainStepdefs<T> mainStepdefs, UserStepdefs<T> userStepdefs) {
+    private DownloadStepdefs(MainStepdefs mainStepdefs, UserStepdefs userStepdefs) {
         this.mainStepdefs = mainStepdefs;
         this.userStepdefs = userStepdefs;
         this.attachmentsByMessageId = ArrayListMultimap.create();

http://git-wip-us.apache.org/repos/asf/james-project/blob/e849d6ed/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/GetMessagesMethodStepdefs.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/GetMessagesMethodStepdefs.java b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/GetMessagesMethodStepdefs.java
index 07e28ff..5bbc254 100644
--- a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/GetMessagesMethodStepdefs.java
+++ b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/GetMessagesMethodStepdefs.java
@@ -38,9 +38,6 @@ import javax.mail.Flags;
 import org.apache.commons.lang3.StringEscapeUtils;
 import org.apache.http.HttpResponse;
 import org.apache.http.client.fluent.Request;
-import org.apache.james.GuiceJamesServerImpl;
-import org.apache.james.JmapServer;
-import org.apache.james.WebAdminServer;
 import org.apache.james.jmap.methods.integration.cucumber.util.TableRow;
 import org.apache.james.mailbox.model.MailboxConstants;
 import org.apache.james.mailbox.model.MailboxPath;
@@ -60,7 +57,7 @@ import cucumber.api.java.en.When;
 import cucumber.runtime.java.guice.ScenarioScoped;
 
 @ScenarioScoped
-public class GetMessagesMethodStepdefs <T extends GuiceJamesServerImpl & JmapServer & WebAdminServer> {
+public class GetMessagesMethodStepdefs {
 
     private static final Optional<Map<String, String>> NO_HEADERS = Optional.empty();
     private static final String NAME = "[0][0]";
@@ -71,14 +68,14 @@ public class GetMessagesMethodStepdefs <T extends GuiceJamesServerImpl & JmapSer
     private static final String SECOND_ATTACHMENT = ATTACHMENTS + "[1]";
 
 
-    private final MainStepdefs<T> mainStepdefs;
-    private final UserStepdefs<T> userStepdefs;
+    private final MainStepdefs mainStepdefs;
+    private final UserStepdefs userStepdefs;
 
     private HttpResponse response;
     private DocumentContext jsonPath;
 
     @Inject
-    private GetMessagesMethodStepdefs(MainStepdefs<T> mainStepdefs, UserStepdefs<T> userStepdefs) {
+    private GetMessagesMethodStepdefs(MainStepdefs mainStepdefs, UserStepdefs userStepdefs) {
         this.mainStepdefs = mainStepdefs;
         this.userStepdefs = userStepdefs;
     }

http://git-wip-us.apache.org/repos/asf/james-project/blob/e849d6ed/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/MainStepdefs.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/MainStepdefs.java b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/MainStepdefs.java
index e4e4959..7f70ef2 100644
--- a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/MainStepdefs.java
+++ b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/MainStepdefs.java
@@ -20,18 +20,16 @@
 package org.apache.james.jmap.methods.integration.cucumber;
 
 import org.apache.http.client.utils.URIBuilder;
-import org.apache.james.GuiceJamesServerImpl;
-import org.apache.james.JmapServer;
-import org.apache.james.WebAdminServer;
+import org.apache.james.JmapJamesServer;
 
 import com.google.common.base.Charsets;
 
 import cucumber.runtime.java.guice.ScenarioScoped;
 
 @ScenarioScoped
-public class MainStepdefs<T extends GuiceJamesServerImpl & JmapServer & WebAdminServer> {
+public class MainStepdefs {
 
-    public T jmapServer;
+    public JmapJamesServer jmapServer;
     public Runnable awaitMethod = () -> {};
 
     public void init() throws Exception {

http://git-wip-us.apache.org/repos/asf/james-project/blob/e849d6ed/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/SetMailboxesMethodStepdefs.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/SetMailboxesMethodStepdefs.java b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/SetMailboxesMethodStepdefs.java
index a8dc46e..b2fed83 100644
--- a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/SetMailboxesMethodStepdefs.java
+++ b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/SetMailboxesMethodStepdefs.java
@@ -32,9 +32,6 @@ import javax.mail.Flags;
 import org.apache.http.HttpResponse;
 import org.apache.http.client.fluent.Request;
 import org.apache.http.entity.ContentType;
-import org.apache.james.GuiceJamesServerImpl;
-import org.apache.james.JmapServer;
-import org.apache.james.WebAdminServer;
 import org.apache.james.mailbox.exception.MailboxException;
 import org.apache.james.mailbox.model.MailboxConstants;
 import org.apache.james.mailbox.model.MailboxPath;
@@ -50,16 +47,16 @@ import cucumber.api.java.en.When;
 import cucumber.runtime.java.guice.ScenarioScoped;
 
 @ScenarioScoped
-public class SetMailboxesMethodStepdefs <T extends GuiceJamesServerImpl & JmapServer & WebAdminServer> {
+public class SetMailboxesMethodStepdefs {
 
     private static final String NAME = "[0][0]";
     private static final String ARGUMENTS = "[0][1]";
 
-    private final MainStepdefs<T> mainStepdefs;
-    private final UserStepdefs<T> userStepdefs;
+    private final MainStepdefs mainStepdefs;
+    private final UserStepdefs userStepdefs;
 
     @Inject
-    private SetMailboxesMethodStepdefs(MainStepdefs<T> mainStepdefs, UserStepdefs<T> userStepdefs) {
+    private SetMailboxesMethodStepdefs(MainStepdefs mainStepdefs, UserStepdefs userStepdefs) {
         this.mainStepdefs = mainStepdefs;
         this.userStepdefs = userStepdefs;
     }

http://git-wip-us.apache.org/repos/asf/james-project/blob/e849d6ed/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/UploadStepdefs.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/UploadStepdefs.java b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/UploadStepdefs.java
index d1e26bd..8bcfca2 100644
--- a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/UploadStepdefs.java
+++ b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/UploadStepdefs.java
@@ -32,9 +32,6 @@ import org.apache.http.HttpResponse;
 import org.apache.http.client.fluent.Executor;
 import org.apache.http.client.fluent.Request;
 import org.apache.http.impl.client.HttpClientBuilder;
-import org.apache.james.GuiceJamesServerImpl;
-import org.apache.james.JmapServer;
-import org.apache.james.WebAdminServer;
 import org.apache.james.jmap.api.access.AccessToken;
 import org.apache.james.util.ZeroedInputStream;
 
@@ -47,18 +44,18 @@ import cucumber.api.java.en.When;
 import cucumber.runtime.java.guice.ScenarioScoped;
 
 @ScenarioScoped
-public class UploadStepdefs <T extends GuiceJamesServerImpl & JmapServer & WebAdminServer>{
+public class UploadStepdefs {
     private static final String _1M_ZEROED_FILE_BLOB_ID = "3b71f43ff30f4b15b5cd85dd9e95ebc7e84eb5a3";
     private static final int _1M = 1024 * 1024;
     private static final int _10M = 10 * _1M;
 
-    private final UserStepdefs<T> userStepdefs;
-    private final MainStepdefs<T> mainStepdefs;
+    private final UserStepdefs userStepdefs;
+    private final MainStepdefs mainStepdefs;
     private final URI uploadUri;
     private HttpResponse response;
 
     @Inject
-    private UploadStepdefs(UserStepdefs<T> userStepdefs, MainStepdefs<T> mainStepdefs) throws URISyntaxException {
+    private UploadStepdefs(UserStepdefs userStepdefs, MainStepdefs mainStepdefs) throws URISyntaxException {
         this.userStepdefs = userStepdefs;
         this.mainStepdefs = mainStepdefs;
         uploadUri = mainStepdefs.baseUri().setPath("/upload").build();

http://git-wip-us.apache.org/repos/asf/james-project/blob/e849d6ed/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/UserStepdefs.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/UserStepdefs.java b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/UserStepdefs.java
index 7fae1db..c805105 100644
--- a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/UserStepdefs.java
+++ b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/UserStepdefs.java
@@ -27,9 +27,6 @@ import java.util.Set;
 
 import javax.inject.Inject;
 
-import org.apache.james.GuiceJamesServerImpl;
-import org.apache.james.JmapServer;
-import org.apache.james.WebAdminServer;
 import org.apache.james.jmap.HttpJmapAuthentication;
 import org.apache.james.jmap.api.access.AccessToken;
 import org.apache.james.mailbox.model.MailboxConstants;
@@ -44,9 +41,9 @@ import cucumber.api.java.en.Given;
 import cucumber.runtime.java.guice.ScenarioScoped;
 
 @ScenarioScoped
-public class UserStepdefs <T extends GuiceJamesServerImpl & JmapServer & WebAdminServer>{
+public class UserStepdefs {
 
-    private final MainStepdefs<T> mainStepdefs;
+    private final MainStepdefs mainStepdefs;
     
     protected Map<String, String> passwordByUser;
     protected Set<String> domains;
@@ -54,7 +51,7 @@ public class UserStepdefs <T extends GuiceJamesServerImpl & JmapServer & WebAdmi
     protected String lastConnectedUser;
     
     @Inject
-    private UserStepdefs(MainStepdefs<T> mainStepdefs) {
+    private UserStepdefs(MainStepdefs mainStepdefs) {
         this.mainStepdefs = mainStepdefs;
         this.domains = new HashSet<>();
         this.passwordByUser = new HashMap<>();

http://git-wip-us.apache.org/repos/asf/james-project/blob/e849d6ed/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/cucumber/MemoryStepdefs.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/cucumber/MemoryStepdefs.java b/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/cucumber/MemoryStepdefs.java
index da4c95e..fc36fc7 100644
--- a/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/cucumber/MemoryStepdefs.java
+++ b/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/cucumber/MemoryStepdefs.java
@@ -34,11 +34,11 @@ import cucumber.runtime.java.guice.ScenarioScoped;
 @ScenarioScoped
 public class MemoryStepdefs {
 
-    private final MainStepdefs<MemoryJamesServer> mainStepdefs;
+    private final MainStepdefs mainStepdefs;
     private final TemporaryFolder temporaryFolder;
 
     @Inject
-    private MemoryStepdefs(MainStepdefs<MemoryJamesServer> mainStepdefs) {
+    private MemoryStepdefs(MainStepdefs mainStepdefs) {
         this.mainStepdefs = mainStepdefs;
         this.temporaryFolder = new TemporaryFolder();
     }


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


[12/29] james-project git commit: JAMES-1842: James server supports JPA, enrich persistence file

Posted by ad...@apache.org.
JAMES-1842: James server supports JPA, enrich persistence file


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

Branch: refs/heads/master
Commit: 4bc564df7cff035b86344829a23c9c1cff55cd89
Parents: 3ed07d6
Author: Quynh Nguyen <qn...@linagora.com>
Authored: Fri Oct 28 12:20:20 2016 +0700
Committer: Quynh Nguyen <qn...@linagora.com>
Committed: Fri Nov 18 09:25:34 2016 +0700

----------------------------------------------------------------------
 .../jpa/src/main/resources/META-INF/persistence.xml    |  3 +++
 .../src/main/resources/META-INF/persistence.xml        |  6 ++++++
 server/pom.xml                                         | 13 ++++++++++++-
 3 files changed, 21 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/4bc564df/mailbox/jpa/src/main/resources/META-INF/persistence.xml
----------------------------------------------------------------------
diff --git a/mailbox/jpa/src/main/resources/META-INF/persistence.xml b/mailbox/jpa/src/main/resources/META-INF/persistence.xml
index 3ec5f22..a9cbc68 100644
--- a/mailbox/jpa/src/main/resources/META-INF/persistence.xml
+++ b/mailbox/jpa/src/main/resources/META-INF/persistence.xml
@@ -30,6 +30,9 @@
         <class>org.apache.james.mailbox.jpa.mail.model.openjpa.JPAMailboxMessage</class>
         <class>org.apache.james.mailbox.jpa.mail.model.JPAProperty</class>
         <class>org.apache.james.mailbox.jpa.user.model.JPASubscription</class>
+        <class>org.apache.james.domainlist.jpa.model.JPADomain</class>
+        <class>org.apache.james.user.jpa.model.JPAUser</class>
+        <class>org.apache.james.rrt.jpa.model.JPARecipientRewrite</class>
         <properties>
             <property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema(ForeignKeys=true)"/>
             <property name="openjpa.jdbc.MappingDefaults" value="ForeignKeyDeleteAction=cascade, JoinForeignKeyDeleteAction=cascade"/>

http://git-wip-us.apache.org/repos/asf/james-project/blob/4bc564df/server/data/data-jpa/src/main/resources/META-INF/persistence.xml
----------------------------------------------------------------------
diff --git a/server/data/data-jpa/src/main/resources/META-INF/persistence.xml b/server/data/data-jpa/src/main/resources/META-INF/persistence.xml
index 14a6a4f..9e7bdf9 100644
--- a/server/data/data-jpa/src/main/resources/META-INF/persistence.xml
+++ b/server/data/data-jpa/src/main/resources/META-INF/persistence.xml
@@ -26,6 +26,12 @@
     <persistence-unit name="James" transaction-type="JTA">
        <provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>
         <jta-data-source>osgi:service/javax.sql.DataSource/(osgi.jndi.service.name=jdbc/james)</jta-data-source>
+        <class>org.apache.james.mailbox.jpa.mail.model.JPAMailbox</class>
+        <class>org.apache.james.mailbox.jpa.mail.model.JPAUserFlag</class>
+        <class>org.apache.james.mailbox.jpa.mail.model.openjpa.AbstractJPAMailboxMessage</class>
+        <class>org.apache.james.mailbox.jpa.mail.model.openjpa.JPAMailboxMessage</class>
+        <class>org.apache.james.mailbox.jpa.mail.model.JPAProperty</class>
+        <class>org.apache.james.mailbox.jpa.user.model.JPASubscription</class>
         <class>org.apache.james.domainlist.jpa.model.JPADomain</class>
         <class>org.apache.james.user.jpa.model.JPAUser</class>
         <class>org.apache.james.rrt.jpa.model.JPARecipientRewrite</class>

http://git-wip-us.apache.org/repos/asf/james-project/blob/4bc564df/server/pom.xml
----------------------------------------------------------------------
diff --git a/server/pom.xml b/server/pom.xml
index cb25e8f..efd8a5d 100644
--- a/server/pom.xml
+++ b/server/pom.xml
@@ -703,6 +703,12 @@
                 <version>${project.version}</version>
             </dependency>
             <dependency>
+                <groupId>org.apache.james</groupId>
+                <artifactId>apache-james-mailbox-lucene</artifactId>
+                <version>${project.version}</version>
+                <type>test-jar</type>
+            </dependency>
+            <dependency>
                 <groupId>org.apache.james.protocols</groupId>
                 <artifactId>protocols-imap</artifactId>
                 <version>${project.version}</version>
@@ -785,6 +791,12 @@
             </dependency>
             <dependency>
                 <groupId>org.apache.james</groupId>
+                <artifactId>apache-james-mailbox-jpa</artifactId>
+                <version>${project.version}</version>
+                <type>test-jar</type>
+            </dependency>
+            <dependency>
+                <groupId>org.apache.james</groupId>
                 <artifactId>apache-james-mailbox-tool</artifactId>
                 <version>${project.version}</version>
             </dependency>
@@ -1185,7 +1197,6 @@
                 <groupId>org.apache.openjpa</groupId>
                 <artifactId>openjpa</artifactId>
                 <version>${openjpa.version}</version>
-                <scope>runtime</scope>
             </dependency>
             <dependency>
                 <groupId>org.apache.geronimo.specs</groupId>


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