james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From adup...@apache.org
Subject [03/13] james-project git commit: JAMES-1733 Remove generics from mailbox API
Date Tue, 17 May 2016 08:14:49 GMT
http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/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 aeff7a4..e6ffe4f 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
@@ -23,8 +23,8 @@ import org.apache.james.CassandraJamesServerMain;
 import org.apache.james.GuiceJamesServer;
 import org.apache.james.backends.cassandra.EmbeddedCassandra;
 import org.apache.james.jmap.methods.integration.SetMailboxesMethodTest;
-import org.apache.james.modules.CassandraJmapServerModule;
 import org.apache.james.mailbox.elasticsearch.EmbeddedElasticSearch;
+import org.apache.james.modules.CassandraJmapServerModule;
 import org.junit.Rule;
 import org.junit.rules.RuleChain;
 import org.junit.rules.TemporaryFolder;
@@ -41,8 +41,8 @@ public class CassandraSetMailboxesMethodTest extends SetMailboxesMethodTest {
         .around(embeddedElasticSearch);
 
     @Override
-    protected GuiceJamesServer<?> createJmapServer() {
-        return new GuiceJamesServer<>(CassandraJamesServerMain.cassandraId)
+    protected GuiceJamesServer createJmapServer() {
+        return new GuiceJamesServer()
                     .combineWith(CassandraJamesServerMain.cassandraServerModule)
                     .overrideWith(new CassandraJmapServerModule(temporaryFolder, embeddedElasticSearch, cassandra));
     }

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/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 3c9a1d8..446d41a 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
@@ -23,8 +23,8 @@ import org.apache.james.CassandraJamesServerMain;
 import org.apache.james.GuiceJamesServer;
 import org.apache.james.backends.cassandra.EmbeddedCassandra;
 import org.apache.james.jmap.methods.integration.SetMessagesMethodTest;
-import org.apache.james.modules.CassandraJmapServerModule;
 import org.apache.james.mailbox.elasticsearch.EmbeddedElasticSearch;
+import org.apache.james.modules.CassandraJmapServerModule;
 import org.junit.Rule;
 import org.junit.rules.RuleChain;
 import org.junit.rules.TemporaryFolder;
@@ -41,8 +41,8 @@ public class CassandraSetMessagesMethodTest extends SetMessagesMethodTest {
         .around(embeddedElasticSearch);
 
     @Override
-    protected GuiceJamesServer<?> createJmapServer() {
-        return new GuiceJamesServer<>(CassandraJamesServerMain.cassandraId)
+    protected GuiceJamesServer createJmapServer() {
+        return new GuiceJamesServer()
                     .combineWith(CassandraJamesServerMain.cassandraServerModule)
                     .overrideWith(new CassandraJmapServerModule(temporaryFolder, embeddedElasticSearch, cassandra));
     }

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/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 dc5e4a0..e4efd42 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
@@ -23,8 +23,8 @@ import org.apache.james.CassandraJamesServerMain;
 import org.apache.james.GuiceJamesServer;
 import org.apache.james.backends.cassandra.EmbeddedCassandra;
 import org.apache.james.jmap.methods.integration.SetVacationResponseTest;
-import org.apache.james.modules.CassandraJmapServerModule;
 import org.apache.james.mailbox.elasticsearch.EmbeddedElasticSearch;
+import org.apache.james.modules.CassandraJmapServerModule;
 import org.junit.Rule;
 import org.junit.rules.RuleChain;
 import org.junit.rules.TemporaryFolder;
@@ -41,8 +41,8 @@ public class CassandraSetVacationResponseTest extends SetVacationResponseTest {
         .around(embeddedElasticSearch);
 
     @Override
-    protected GuiceJamesServer<?> createJmapServer() {
-        return new GuiceJamesServer<>(CassandraJamesServerMain.cassandraId)
+    protected GuiceJamesServer createJmapServer() {
+        return new GuiceJamesServer()
                     .combineWith(CassandraJamesServerMain.cassandraServerModule)
                     .overrideWith(new CassandraJmapServerModule(temporaryFolder, embeddedElasticSearch, cassandra));
     }

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/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 e7ad88b..4671d6c 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
@@ -22,7 +22,6 @@ import static com.jayway.restassured.RestAssured.given;
 import static com.jayway.restassured.RestAssured.with;
 import static com.jayway.restassured.config.EncoderConfig.encoderConfig;
 import static com.jayway.restassured.config.RestAssuredConfig.newConfig;
-
 import static org.hamcrest.Matchers.both;
 import static org.hamcrest.Matchers.equalTo;
 import static org.hamcrest.Matchers.hasItem;
@@ -49,11 +48,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 GuiceJamesServer createJmapServer(FixedDateZonedDateTimeProvider zonedDateTimeProvider);
 
     private UserCredentials userCredentials;
     private FixedDateZonedDateTimeProvider zonedDateTimeProvider;
-    private GuiceJamesServer<?> jmapServer;
+    private GuiceJamesServer jmapServer;
 
     @Before
     public void setup() throws Throwable {

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/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 dfafe9f..9ea515b 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
@@ -53,11 +53,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 GuiceJamesServer createJmapServer();
 
     private AccessToken accessToken;
     private String username;
-    private GuiceJamesServer<?> jmapServer;
+    private GuiceJamesServer jmapServer;
 
     @Before
     public void setup() throws Throwable {
@@ -116,8 +116,8 @@ public abstract class GetMailboxesMethodTest {
         jmapServer.serverProbe().createMailbox(MailboxConstants.USER_NAMESPACE, username, "INBOX");
         jmapServer.serverProbe().createMailbox(MailboxConstants.USER_NAMESPACE, username, "myMailbox");
 
-        Mailbox<?> mailbox = jmapServer.serverProbe().getMailbox(MailboxConstants.USER_NAMESPACE, username, "INBOX");
-        Mailbox<?> mailbox2 = jmapServer.serverProbe().getMailbox(MailboxConstants.USER_NAMESPACE, username, "myMailbox");
+        Mailbox mailbox = jmapServer.serverProbe().getMailbox(MailboxConstants.USER_NAMESPACE, username, "INBOX");
+        Mailbox mailbox2 = jmapServer.serverProbe().getMailbox(MailboxConstants.USER_NAMESPACE, username, "myMailbox");
 
         String mailboxId = mailbox.getMailboxId().serialize();
         String mailboxId2 = mailbox2.getMailboxId().serialize();
@@ -142,7 +142,7 @@ public abstract class GetMailboxesMethodTest {
         jmapServer.serverProbe().createMailbox(MailboxConstants.USER_NAMESPACE, username, "INBOX");
         jmapServer.serverProbe().createMailbox(MailboxConstants.USER_NAMESPACE, username, "myMailbox");
 
-        Mailbox<?> mailbox = jmapServer.serverProbe().getMailbox(MailboxConstants.USER_NAMESPACE, username, "INBOX");
+        Mailbox mailbox = jmapServer.serverProbe().getMailbox(MailboxConstants.USER_NAMESPACE, username, "INBOX");
 
         String mailboxId = mailbox.getMailboxId().serialize();
 
@@ -182,8 +182,8 @@ public abstract class GetMailboxesMethodTest {
         jmapServer.serverProbe().createMailbox(MailboxConstants.USER_NAMESPACE, username, "INBOX");
         jmapServer.serverProbe().createMailbox(MailboxConstants.USER_NAMESPACE, username, "myMailbox");
 
-        Mailbox<?> mailbox = jmapServer.serverProbe().getMailbox(MailboxConstants.USER_NAMESPACE, username, "INBOX");
-        Mailbox<?> mailbox2 = jmapServer.serverProbe().getMailbox(MailboxConstants.USER_NAMESPACE, username, "myMailbox");
+        Mailbox mailbox = jmapServer.serverProbe().getMailbox(MailboxConstants.USER_NAMESPACE, username, "INBOX");
+        Mailbox mailbox2 = jmapServer.serverProbe().getMailbox(MailboxConstants.USER_NAMESPACE, username, "myMailbox");
 
         String mailboxId = mailbox.getMailboxId().serialize();
         String mailboxId2 = mailbox2.getMailboxId().serialize();

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/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 da9cf03..566280f 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
@@ -53,14 +53,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 GuiceJamesServer createJmapServer();
 
     protected abstract void await();
 
     private AccessToken accessToken;
     private String username;
     private String domain;
-    private GuiceJamesServer<?> jmapServer;
+    private GuiceJamesServer jmapServer;
 
     @Before
     public void setup() throws Throwable {

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetMessagesMethodTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetMessagesMethodTest.java b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetMessagesMethodTest.java
index 23a06a0..b013c3e 100644
--- a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetMessagesMethodTest.java
+++ b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetMessagesMethodTest.java
@@ -52,13 +52,13 @@ public abstract class GetMessagesMethodTest {
     private static final String NAME = "[0][0]";
     private static final String ARGUMENTS = "[0][1]";
 
-    protected abstract GuiceJamesServer<?> createJmapServer();
+    protected abstract GuiceJamesServer createJmapServer();
 
     protected abstract void await();
 
     private AccessToken accessToken;
     private String username;
-    private GuiceJamesServer<?> jmapServer;
+    private GuiceJamesServer jmapServer;
 
     @Before
     public void setup() throws Throwable {

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/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 de29aed..f2a5498 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
@@ -22,9 +22,9 @@ package org.apache.james.jmap.methods.integration;
 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.core.IsNull.nullValue;
 import static org.hamcrest.Matchers.equalTo;
 import static org.hamcrest.Matchers.hasSize;
+import static org.hamcrest.core.IsNull.nullValue;
 
 import java.time.ZonedDateTime;
 import java.util.Optional;
@@ -50,12 +50,12 @@ public abstract class GetVacationResponseTest {
     public static final String USER = "username@" + USERS_DOMAIN;
     public static final String PASSWORD = "password";
 
-    protected abstract GuiceJamesServer<?> createJmapServer();
+    protected abstract GuiceJamesServer createJmapServer();
 
     protected abstract void await();
 
     private AccessToken accessToken;
-    private GuiceJamesServer<?> jmapServer;
+    private GuiceJamesServer jmapServer;
 
     @Before
     public void setup() throws Throwable {

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/SetMailboxesMethodStepdefs.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/SetMailboxesMethodStepdefs.java b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/SetMailboxesMethodStepdefs.java
index 6782d4d..6b6fa58 100644
--- a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/SetMailboxesMethodStepdefs.java
+++ b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/SetMailboxesMethodStepdefs.java
@@ -53,7 +53,7 @@ public class SetMailboxesMethodStepdefs {
     private static final String NAME = "[0][0]";
     private static final String ARGUMENTS = "[0][1]";
 
-    public GuiceJamesServer<?> jmapServer;
+    public GuiceJamesServer jmapServer;
     public Runnable awaitMethod = () -> {};
 
     private AccessToken accessToken;
@@ -102,7 +102,7 @@ public class SetMailboxesMethodStepdefs {
 
     @When("^renaming mailbox \"([^\"]*)\" to \"([^\"]*)\"")
     public void renamingMailbox(String actualMailboxName, String newMailboxName) throws Throwable {
-        Mailbox<?> mailbox = jmapServer.serverProbe().getMailbox("#private", username, actualMailboxName);
+        Mailbox mailbox = jmapServer.serverProbe().getMailbox("#private", username, actualMailboxName);
         String mailboxId = mailbox.getMailboxId().serialize();
         String requestBody =
                 "[" +
@@ -128,9 +128,9 @@ public class SetMailboxesMethodStepdefs {
 
     @When("^moving mailbox \"([^\"]*)\" to \"([^\"]*)\"$")
     public void movingMailbox(String actualMailboxPath, String newParentMailboxPath) throws Throwable {
-        Mailbox<?> mailbox = jmapServer.serverProbe().getMailbox("#private", username, actualMailboxPath);
+        Mailbox mailbox = jmapServer.serverProbe().getMailbox("#private", username, actualMailboxPath);
         String mailboxId = mailbox.getMailboxId().serialize();
-        Mailbox<?> parent = jmapServer.serverProbe().getMailbox("#private", username, newParentMailboxPath);
+        Mailbox parent = jmapServer.serverProbe().getMailbox("#private", username, newParentMailboxPath);
         String parentId = parent.getMailboxId().serialize();
 
         String requestBody =
@@ -157,7 +157,7 @@ public class SetMailboxesMethodStepdefs {
 
     @Then("^mailbox \"([^\"]*)\" contains (\\d+) messages$")
     public void mailboxContainsMessages(String mailboxName, int messageCount) throws Throwable {
-        Mailbox<?> mailbox = jmapServer.serverProbe().getMailbox("#private", username, mailboxName);
+        Mailbox mailbox = jmapServer.serverProbe().getMailbox("#private", username, mailboxName);
         String mailboxId = mailbox.getMailboxId().serialize();
         given()
             .accept(ContentType.JSON)

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/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 2ef33ca..007909c 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
@@ -24,8 +24,8 @@ import static com.jayway.restassured.RestAssured.with;
 import static com.jayway.restassured.config.EncoderConfig.encoderConfig;
 import static com.jayway.restassured.config.RestAssuredConfig.newConfig;
 import static org.hamcrest.Matchers.contains;
-import static org.hamcrest.Matchers.containsString;
 import static org.hamcrest.Matchers.containsInAnyOrder;
+import static org.hamcrest.Matchers.containsString;
 import static org.hamcrest.Matchers.equalTo;
 import static org.hamcrest.Matchers.hasEntry;
 import static org.hamcrest.Matchers.hasItems;
@@ -55,13 +55,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 GuiceJamesServer createJmapServer();
 
     protected abstract void await();
 
     private AccessToken accessToken;
     private String username;
-    private GuiceJamesServer<?> jmapServer;
+    private GuiceJamesServer jmapServer;
 
     @Before
     public void setup() throws Throwable {
@@ -532,7 +532,7 @@ public abstract class SetMailboxesMethodTest {
 
     public void setMailboxesShouldReturnDestroyedMailbox() {
         jmapServer.serverProbe().createMailbox("#private", username, "myBox");
-        Mailbox<?> mailbox = jmapServer.serverProbe().getMailbox("#private", username, "myBox");
+        Mailbox mailbox = jmapServer.serverProbe().getMailbox("#private", username, "myBox");
         String mailboxId = mailbox.getMailboxId().serialize();
         String requestBody =
             "[" +
@@ -560,7 +560,7 @@ public abstract class SetMailboxesMethodTest {
     @Test
     public void setMailboxesShouldDestroyMailbox() {
         jmapServer.serverProbe().createMailbox("#private", username, "myBox");
-        Mailbox<?> mailbox = jmapServer.serverProbe().getMailbox("#private", username, "myBox");
+        Mailbox mailbox = jmapServer.serverProbe().getMailbox("#private", username, "myBox");
         String requestBody =
             "[" +
                 "  [ \"setMailboxes\"," +
@@ -626,7 +626,7 @@ public abstract class SetMailboxesMethodTest {
     public void setMailboxesShouldReturnNotDestroyedWhenMailboxHasChild() {
         jmapServer.serverProbe().createMailbox("#private", username, "myBox");
         jmapServer.serverProbe().createMailbox("#private", username, "myBox.child");
-        Mailbox<?> mailbox = jmapServer.serverProbe().getMailbox("#private", username, "myBox");
+        Mailbox mailbox = jmapServer.serverProbe().getMailbox("#private", username, "myBox");
         String mailboxId = mailbox.getMailboxId().serialize();
         String requestBody =
             "[" +
@@ -656,7 +656,7 @@ public abstract class SetMailboxesMethodTest {
 
     @Test
     public void setMailboxesShouldReturnNotDestroyedWhenSystemMailbox() {
-        Mailbox<?> mailbox = jmapServer.serverProbe().getMailbox("#private", username, "inbox");
+        Mailbox mailbox = jmapServer.serverProbe().getMailbox("#private", username, "inbox");
         String mailboxId = mailbox.getMailboxId().serialize();
         String requestBody =
             "[" +
@@ -687,10 +687,10 @@ public abstract class SetMailboxesMethodTest {
     @Test
     public void setMailboxesShouldReturnDestroyedWhenParentThenChildMailboxes() {
         jmapServer.serverProbe().createMailbox("#private", username, "parent");
-        Mailbox<?> parentMailbox = jmapServer.serverProbe().getMailbox("#private", username, "parent");
+        Mailbox parentMailbox = jmapServer.serverProbe().getMailbox("#private", username, "parent");
         String parentMailboxId = parentMailbox.getMailboxId().serialize();
         jmapServer.serverProbe().createMailbox("#private", username, "parent.child");
-        Mailbox<?> childMailbox = jmapServer.serverProbe().getMailbox("#private", username, "parent.child");
+        Mailbox childMailbox = jmapServer.serverProbe().getMailbox("#private", username, "parent.child");
         String childMailboxId = childMailbox.getMailboxId().serialize();
         String requestBody =
             "[" +
@@ -718,10 +718,10 @@ public abstract class SetMailboxesMethodTest {
     @Test
     public void setMailboxesShouldReturnDestroyedWhenChildThenParentMailboxes() {
         jmapServer.serverProbe().createMailbox("#private", username, "parent");
-        Mailbox<?> parentMailbox = jmapServer.serverProbe().getMailbox("#private", username, "parent");
+        Mailbox parentMailbox = jmapServer.serverProbe().getMailbox("#private", username, "parent");
         String parentMailboxId = parentMailbox.getMailboxId().serialize();
         jmapServer.serverProbe().createMailbox("#private", username, "parent.child");
-        Mailbox<?> childMailbox = jmapServer.serverProbe().getMailbox("#private", username, "parent.child");
+        Mailbox childMailbox = jmapServer.serverProbe().getMailbox("#private", username, "parent.child");
         String childMailboxId = childMailbox.getMailboxId().serialize();
         String requestBody =
             "[" +
@@ -780,7 +780,7 @@ public abstract class SetMailboxesMethodTest {
     @Test
     public void setMailboxesShouldReturnUpdatedMailboxIdWhenNoUpdateAskedOnExistingMailbox() {
         jmapServer.serverProbe().createMailbox("#private", username, "myBox");
-        Mailbox<?> mailbox = jmapServer.serverProbe().getMailbox("#private", username, "myBox");
+        Mailbox mailbox = jmapServer.serverProbe().getMailbox("#private", username, "myBox");
         String mailboxId = mailbox.getMailboxId().serialize();
         String requestBody =
                 "[" +
@@ -811,7 +811,7 @@ public abstract class SetMailboxesMethodTest {
     @Test
     public void setMailboxesShouldReturnUpdatedWhenNameUpdateAskedOnExistingMailbox() {
         jmapServer.serverProbe().createMailbox("#private", username, "myBox");
-        Mailbox<?> mailbox = jmapServer.serverProbe().getMailbox("#private", username, "myBox");
+        Mailbox mailbox = jmapServer.serverProbe().getMailbox("#private", username, "myBox");
         String mailboxId = mailbox.getMailboxId().serialize();
         String requestBody =
                 "[" +
@@ -843,7 +843,7 @@ public abstract class SetMailboxesMethodTest {
     @Test
     public void setMailboxesShouldUpdateMailboxNameWhenNameUpdateAskedOnExistingMailbox() {
         jmapServer.serverProbe().createMailbox("#private", username, "myBox");
-        Mailbox<?> mailbox = jmapServer.serverProbe().getMailbox("#private", username, "myBox");
+        Mailbox mailbox = jmapServer.serverProbe().getMailbox("#private", username, "myBox");
         String mailboxId = mailbox.getMailboxId().serialize();
         String requestBody =
                 "[" +
@@ -883,11 +883,11 @@ public abstract class SetMailboxesMethodTest {
     @Test
     public void setMailboxesShouldReturnMailboxIdWhenMovingToAnotherParentMailbox() {
         jmapServer.serverProbe().createMailbox("#private", username, "myBox");
-        Mailbox<?> mailbox = jmapServer.serverProbe().getMailbox("#private", username, "myBox");
+        Mailbox mailbox = jmapServer.serverProbe().getMailbox("#private", username, "myBox");
         String mailboxId = mailbox.getMailboxId().serialize();
 
         jmapServer.serverProbe().createMailbox("#private", username, "myChosenParentBox");
-        Mailbox<?> chosenMailboxParent = jmapServer.serverProbe().getMailbox("#private", username, "myChosenParentBox");
+        Mailbox chosenMailboxParent = jmapServer.serverProbe().getMailbox("#private", username, "myChosenParentBox");
         String chosenMailboxParentId = chosenMailboxParent.getMailboxId().serialize();
         
         String requestBody =
@@ -920,11 +920,11 @@ public abstract class SetMailboxesMethodTest {
     @Test
     public void setMailboxesShouldUpdateMailboxParentIdWhenMovingToAnotherParentMailbox() {
         jmapServer.serverProbe().createMailbox("#private", username, "myPreviousParentBox.myBox");
-        Mailbox<?> mailbox = jmapServer.serverProbe().getMailbox("#private", username, "myPreviousParentBox.myBox");
+        Mailbox mailbox = jmapServer.serverProbe().getMailbox("#private", username, "myPreviousParentBox.myBox");
         String mailboxId = mailbox.getMailboxId().serialize();
         
         jmapServer.serverProbe().createMailbox("#private", username, "myNewParentBox");
-        Mailbox<?> newParentMailbox = jmapServer.serverProbe().getMailbox("#private", username, "myNewParentBox");
+        Mailbox newParentMailbox = jmapServer.serverProbe().getMailbox("#private", username, "myNewParentBox");
         String newParentMailboxId = newParentMailbox.getMailboxId().serialize();
 
         String requestBody =
@@ -967,11 +967,11 @@ public abstract class SetMailboxesMethodTest {
         jmapServer.serverProbe().createMailbox("#private", username, "myPreviousParentBox");
 
         jmapServer.serverProbe().createMailbox("#private", username, "myPreviousParentBox.myBox");
-        Mailbox<?> mailbox = jmapServer.serverProbe().getMailbox("#private", username, "myPreviousParentBox.myBox");
+        Mailbox mailbox = jmapServer.serverProbe().getMailbox("#private", username, "myPreviousParentBox.myBox");
         String mailboxId = mailbox.getMailboxId().serialize();
         
         jmapServer.serverProbe().createMailbox("#private", username, "myNewParentBox");
-        Mailbox<?> newParentMailbox = jmapServer.serverProbe().getMailbox("#private", username, "myNewParentBox");
+        Mailbox newParentMailbox = jmapServer.serverProbe().getMailbox("#private", username, "myNewParentBox");
         String newParentMailboxId = newParentMailbox.getMailboxId().serialize();
 
         String requestBody =
@@ -1006,11 +1006,11 @@ public abstract class SetMailboxesMethodTest {
         jmapServer.serverProbe().createMailbox("#private", username, "myPreviousParentBox");
 
         jmapServer.serverProbe().createMailbox("#private", username, "myPreviousParentBox.myBox");
-        Mailbox<?> mailbox = jmapServer.serverProbe().getMailbox("#private", username, "myPreviousParentBox.myBox");
+        Mailbox mailbox = jmapServer.serverProbe().getMailbox("#private", username, "myPreviousParentBox.myBox");
         String mailboxId = mailbox.getMailboxId().serialize();
         
         jmapServer.serverProbe().createMailbox("#private", username, "myNewParentBox");
-        Mailbox<?> newParentMailbox = jmapServer.serverProbe().getMailbox("#private", username, "myNewParentBox");
+        Mailbox newParentMailbox = jmapServer.serverProbe().getMailbox("#private", username, "myNewParentBox");
         String newParentMailboxId = newParentMailbox.getMailboxId().serialize();
 
         String requestBody =
@@ -1053,7 +1053,7 @@ public abstract class SetMailboxesMethodTest {
         jmapServer.serverProbe().createMailbox("#private", username, "myPreviousParentBox");
 
         jmapServer.serverProbe().createMailbox("#private", username, "myPreviousParentBox.myBox");
-        Mailbox<?> mailbox = jmapServer.serverProbe().getMailbox("#private", username, "myPreviousParentBox.myBox");
+        Mailbox mailbox = jmapServer.serverProbe().getMailbox("#private", username, "myPreviousParentBox.myBox");
         String mailboxId = mailbox.getMailboxId().serialize();
 
         String requestBody =
@@ -1088,7 +1088,7 @@ public abstract class SetMailboxesMethodTest {
         jmapServer.serverProbe().createMailbox("#private", username, "myPreviousParentBox");
 
         jmapServer.serverProbe().createMailbox("#private", username, "myPreviousParentBox.myBox");
-        Mailbox<?> mailbox = jmapServer.serverProbe().getMailbox("#private", username, "myPreviousParentBox.myBox");
+        Mailbox mailbox = jmapServer.serverProbe().getMailbox("#private", username, "myPreviousParentBox.myBox");
         String mailboxId = mailbox.getMailboxId().serialize();
 
         String requestBody =
@@ -1131,11 +1131,11 @@ public abstract class SetMailboxesMethodTest {
         jmapServer.serverProbe().createMailbox("#private", username, "myPreviousParentBox");
 
         jmapServer.serverProbe().createMailbox("#private", username, "myPreviousParentBox.myBox");
-        Mailbox<?> mailbox = jmapServer.serverProbe().getMailbox("#private", username, "myPreviousParentBox.myBox");
+        Mailbox mailbox = jmapServer.serverProbe().getMailbox("#private", username, "myPreviousParentBox.myBox");
         String mailboxId = mailbox.getMailboxId().serialize();
 
         jmapServer.serverProbe().createMailbox("#private", username, "myNewParentBox");
-        Mailbox<?> newParentMailbox = jmapServer.serverProbe().getMailbox("#private", username, "myNewParentBox");
+        Mailbox newParentMailbox = jmapServer.serverProbe().getMailbox("#private", username, "myNewParentBox");
         String newParentMailboxId = newParentMailbox.getMailboxId().serialize();
 
         String requestBody =
@@ -1171,11 +1171,11 @@ public abstract class SetMailboxesMethodTest {
         jmapServer.serverProbe().createMailbox("#private", username, "myPreviousParentBox");
 
         jmapServer.serverProbe().createMailbox("#private", username, "myPreviousParentBox.myBox");
-        Mailbox<?> mailbox = jmapServer.serverProbe().getMailbox("#private", username, "myPreviousParentBox.myBox");
+        Mailbox mailbox = jmapServer.serverProbe().getMailbox("#private", username, "myPreviousParentBox.myBox");
         String mailboxId = mailbox.getMailboxId().serialize();
 
         jmapServer.serverProbe().createMailbox("#private", username, "myNewParentBox");
-        Mailbox<?> newParentMailbox = jmapServer.serverProbe().getMailbox("#private", username, "myNewParentBox");
+        Mailbox newParentMailbox = jmapServer.serverProbe().getMailbox("#private", username, "myNewParentBox");
         String newParentMailboxId = newParentMailbox.getMailboxId().serialize();
 
         String requestBody =
@@ -1218,7 +1218,7 @@ public abstract class SetMailboxesMethodTest {
     @Test
     public void setMailboxesShouldReturnNotUpdatedWhenNameContainsPathDelimiter() {
         jmapServer.serverProbe().createMailbox("#private", username, "myBox");
-        Mailbox<?> mailbox = jmapServer.serverProbe().getMailbox("#private", username, "myBox");
+        Mailbox mailbox = jmapServer.serverProbe().getMailbox("#private", username, "myBox");
         String mailboxId = mailbox.getMailboxId().serialize();
         String requestBody =
                 "[" +
@@ -1252,7 +1252,7 @@ public abstract class SetMailboxesMethodTest {
     @Test
     public void setMailboxesShouldReturnNotUpdatedWhenNewParentDoesntExist() {
         jmapServer.serverProbe().createMailbox("#private", username, "myBox");
-        Mailbox<?> mailbox = jmapServer.serverProbe().getMailbox("#private", username, "myBox");
+        Mailbox mailbox = jmapServer.serverProbe().getMailbox("#private", username, "myBox");
         String mailboxId = mailbox.getMailboxId().serialize();
         String requestBody =
                 "[" +
@@ -1288,13 +1288,13 @@ public abstract class SetMailboxesMethodTest {
         jmapServer.serverProbe().createMailbox("#private", username, "root");
 
         jmapServer.serverProbe().createMailbox("#private", username, "root.myBox");
-        Mailbox<?> mailbox = jmapServer.serverProbe().getMailbox("#private", username, "root.myBox");
+        Mailbox mailbox = jmapServer.serverProbe().getMailbox("#private", username, "root.myBox");
         String mailboxId = mailbox.getMailboxId().serialize();
 
         jmapServer.serverProbe().createMailbox("#private", username, "root.myBox.child");
 
         jmapServer.serverProbe().createMailbox("#private", username, "myNewParentBox");
-        Mailbox<?> newParentMailbox = jmapServer.serverProbe().getMailbox("#private", username, "myNewParentBox");
+        Mailbox newParentMailbox = jmapServer.serverProbe().getMailbox("#private", username, "myNewParentBox");
         String newParentMailboxId = newParentMailbox.getMailboxId().serialize();
 
 
@@ -1330,7 +1330,7 @@ public abstract class SetMailboxesMethodTest {
     @Test
     public void setMailboxesShouldReturnNotUpdatedWhenRenamingAMailboxToAnAlreadyExistingMailbox() {
         jmapServer.serverProbe().createMailbox("#private", username, "myBox");
-        Mailbox<?> mailbox = jmapServer.serverProbe().getMailbox("#private", username, "myBox");
+        Mailbox mailbox = jmapServer.serverProbe().getMailbox("#private", username, "myBox");
         String mailboxId = mailbox.getMailboxId().serialize();
 
         jmapServer.serverProbe().createMailbox("#private", username, "mySecondBox");
@@ -1369,7 +1369,7 @@ public abstract class SetMailboxesMethodTest {
         jmapServer.serverProbe().createMailbox("#private", username, "root");
 
         jmapServer.serverProbe().createMailbox("#private", username, "root.myBox");
-        Mailbox<?> mailbox = jmapServer.serverProbe().getMailbox("#private", username, "root.myBox");
+        Mailbox mailbox = jmapServer.serverProbe().getMailbox("#private", username, "root.myBox");
         String mailboxId = mailbox.getMailboxId().serialize();
 
         String requestBody =
@@ -1404,7 +1404,7 @@ public abstract class SetMailboxesMethodTest {
         jmapServer.serverProbe().createMailbox("#private", username, "root");
 
         jmapServer.serverProbe().createMailbox("#private", username, "root.myBox");
-        Mailbox<?> mailbox = jmapServer.serverProbe().getMailbox("#private", username, "root.myBox");
+        Mailbox mailbox = jmapServer.serverProbe().getMailbox("#private", username, "root.myBox");
         String mailboxId = mailbox.getMailboxId().serialize();
 
         String requestBody =
@@ -1445,7 +1445,7 @@ public abstract class SetMailboxesMethodTest {
     @Test
     public void setMailboxesShouldReturnNotUpdatedWhenRenamingSystemMailbox() {
 
-        Mailbox<?> mailbox = jmapServer.serverProbe().getMailbox("#private", username, "inbox");
+        Mailbox mailbox = jmapServer.serverProbe().getMailbox("#private", username, "inbox");
         String mailboxId = mailbox.getMailboxId().serialize();
 
         String requestBody =
@@ -1481,7 +1481,7 @@ public abstract class SetMailboxesMethodTest {
     public void setMailboxesShouldReturnNotUpdatedWhenRenameToSystemMailboxName() {
 
         jmapServer.serverProbe().createMailbox("#private", username, "myBox");
-        Mailbox<?> mailboxMyBox = jmapServer.serverProbe().getMailbox("#private", username, "myBox");
+        Mailbox mailboxMyBox = jmapServer.serverProbe().getMailbox("#private", username, "myBox");
         String mailboxIdMyBox = mailboxMyBox.getMailboxId().serialize();
 
         String requestBody =
@@ -1517,14 +1517,14 @@ public abstract class SetMailboxesMethodTest {
     public void setMailboxesShouldReturnNotUpdatedErrorWhenMovingMailboxTriggersNameConflict() {
 
         jmapServer.serverProbe().createMailbox("#private", username, "A");
-        Mailbox<?> mailboxRootA = jmapServer.serverProbe().getMailbox("#private", username, "A");
+        Mailbox mailboxRootA = jmapServer.serverProbe().getMailbox("#private", username, "A");
         String mailboxRootAId = mailboxRootA.getMailboxId().serialize();
 
         jmapServer.serverProbe().createMailbox("#private", username, "A.B");
         jmapServer.serverProbe().createMailbox("#private", username, "A.C");
 
         jmapServer.serverProbe().createMailbox("#private", username, "A.B.C");
-        Mailbox<?> mailboxChildToMoveC = jmapServer.serverProbe().getMailbox("#private", username, "A.B.C");
+        Mailbox mailboxChildToMoveC = jmapServer.serverProbe().getMailbox("#private", username, "A.B.C");
         String mailboxChildToMoveCId = mailboxChildToMoveC.getMailboxId().serialize();
 
         String requestBody =

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/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 a90ae83..8f4d6eb 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
@@ -74,13 +74,13 @@ public abstract class SetMessagesMethodTest {
 
     private ConditionFactory calmlyAwait;
 
-    protected abstract GuiceJamesServer<?> createJmapServer();
+    protected abstract GuiceJamesServer createJmapServer();
 
     protected abstract void await();
 
     private AccessToken accessToken;
     private String username;
-    private GuiceJamesServer<?> jmapServer;
+    private GuiceJamesServer jmapServer;
 
     @Before
     public void setup() throws Throwable {

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/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 6ad7afb..d74526e 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
@@ -49,12 +49,12 @@ public abstract class SetVacationResponseTest {
     public static final String USER = "username@" + USERS_DOMAIN;
     public static final String PASSWORD = "password";
 
-    protected abstract GuiceJamesServer<?> createJmapServer();
+    protected abstract GuiceJamesServer createJmapServer();
 
     protected abstract void await();
 
     private AccessToken accessToken;
-    private GuiceJamesServer<?> jmapServer;
+    private GuiceJamesServer jmapServer;
 
     @Before
     public void setup() throws Throwable {

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/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 6c01766..b929d53 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
@@ -32,8 +32,8 @@ public class MemoryGetMailboxesMethodTest extends GetMailboxesMethodTest {
     public TemporaryFolder temporaryFolder = new TemporaryFolder();
 
     @Override
-    protected GuiceJamesServer<?> createJmapServer() {
-        return new GuiceJamesServer<>(MemoryJamesServerMain.inMemoryId)
+    protected GuiceJamesServer createJmapServer() {
+        return new GuiceJamesServer()
                 .combineWith(MemoryJamesServerMain.inMemoryServerModule)
                 .overrideWith(new MemoryJmapServerModule(temporaryFolder));
     }

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/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 2a9e07a..10991ad 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
@@ -32,8 +32,8 @@ public class MemoryGetMessageListMethodTest extends GetMessageListMethodTest {
     public TemporaryFolder temporaryFolder = new TemporaryFolder();
 
     @Override
-    protected GuiceJamesServer<?> createJmapServer() {
-        return new GuiceJamesServer<>(MemoryJamesServerMain.inMemoryId)
+    protected GuiceJamesServer createJmapServer() {
+        return new GuiceJamesServer()
                     .combineWith(MemoryJamesServerMain.inMemoryServerModule)
                     .overrideWith(new MemoryJmapServerModule(temporaryFolder));
     }

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/MemoryGetMessagesMethodTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/MemoryGetMessagesMethodTest.java b/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/MemoryGetMessagesMethodTest.java
index 5970c82..3451dd3 100644
--- a/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/MemoryGetMessagesMethodTest.java
+++ b/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/MemoryGetMessagesMethodTest.java
@@ -32,8 +32,8 @@ public class MemoryGetMessagesMethodTest extends GetMessagesMethodTest {
     public TemporaryFolder temporaryFolder = new TemporaryFolder();
 
     @Override
-    protected GuiceJamesServer<?> createJmapServer() {
-        return new GuiceJamesServer<>(MemoryJamesServerMain.inMemoryId)
+    protected GuiceJamesServer createJmapServer() {
+        return new GuiceJamesServer()
                     .combineWith(MemoryJamesServerMain.inMemoryServerModule)
                     .overrideWith(new MemoryJmapServerModule(temporaryFolder));
     }

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/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 b0356bb..69e0d2b 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
@@ -32,8 +32,8 @@ public class MemoryGetVacationResponseMethodTest extends GetVacationResponseTest
     public TemporaryFolder temporaryFolder = new TemporaryFolder();
 
     @Override
-    protected GuiceJamesServer<?> createJmapServer() {
-        return new GuiceJamesServer<>(MemoryJamesServerMain.inMemoryId)
+    protected GuiceJamesServer createJmapServer() {
+        return new GuiceJamesServer()
                     .combineWith(MemoryJamesServerMain.inMemoryServerModule)
                     .overrideWith(new MemoryJmapServerModule(temporaryFolder));
     }

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/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 ec2ed06..8634962 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
@@ -34,8 +34,8 @@ public class MemoryJmapAuthenticationTest extends JMAPAuthenticationTest {
     public TemporaryFolder temporaryFolder = new TemporaryFolder();
 
     @Override
-    protected GuiceJamesServer<?> createJmapServer(FixedDateZonedDateTimeProvider zonedDateTimeProvider) {
-        return new GuiceJamesServer<>(MemoryJamesServerMain.inMemoryId)
+    protected GuiceJamesServer createJmapServer(FixedDateZonedDateTimeProvider zonedDateTimeProvider) {
+        return new GuiceJamesServer()
                 .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/7015d946/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/MemorySetMailboxesMethodStepdefs.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/MemorySetMailboxesMethodStepdefs.java b/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/MemorySetMailboxesMethodStepdefs.java
index ecd21aa..cbdca46 100644
--- a/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/MemorySetMailboxesMethodStepdefs.java
+++ b/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/MemorySetMailboxesMethodStepdefs.java
@@ -40,7 +40,7 @@ public class MemorySetMailboxesMethodStepdefs {
     @Before
     public void init() throws Exception {
         temporaryFolder.create();
-        mainStepdefs.jmapServer = new GuiceJamesServer<>(MemoryJamesServerMain.inMemoryId)
+        mainStepdefs.jmapServer = new GuiceJamesServer()
                 .combineWith(MemoryJamesServerMain.inMemoryServerModule)
                 .overrideWith(new MemoryJmapServerModule(temporaryFolder));
         mainStepdefs.init();

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/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 2d85a6a..474a492 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
@@ -32,8 +32,8 @@ public class MemorySetMailboxesMethodTest extends SetMailboxesMethodTest {
     public TemporaryFolder temporaryFolder = new TemporaryFolder();
 
     @Override
-    protected GuiceJamesServer<?> createJmapServer() {
-        return new GuiceJamesServer<>(MemoryJamesServerMain.inMemoryId)
+    protected GuiceJamesServer createJmapServer() {
+        return new GuiceJamesServer()
                     .combineWith(MemoryJamesServerMain.inMemoryServerModule)
                     .overrideWith(new MemoryJmapServerModule(temporaryFolder));
     }

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/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 8597cdc..2d0b43d 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
@@ -32,8 +32,8 @@ public class MemorySetMessagesMethodTest extends SetMessagesMethodTest {
     public TemporaryFolder temporaryFolder = new TemporaryFolder();
 
     @Override
-    protected GuiceJamesServer<?> createJmapServer() {
-        return new GuiceJamesServer<>(MemoryJamesServerMain.inMemoryId)
+    protected GuiceJamesServer createJmapServer() {
+        return new GuiceJamesServer()
                     .combineWith(MemoryJamesServerMain.inMemoryServerModule)
                     .overrideWith(new MemoryJmapServerModule(temporaryFolder));
     }

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/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 3f42f7e..bcd5a85 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
@@ -32,8 +32,8 @@ public class MemorySetVacationResponseMethodTest extends SetVacationResponseTest
     public TemporaryFolder temporaryFolder = new TemporaryFolder();
 
     @Override
-    protected GuiceJamesServer<?> createJmapServer() {
-        return new GuiceJamesServer<>(MemoryJamesServerMain.inMemoryId)
+    protected GuiceJamesServer createJmapServer() {
+        return new GuiceJamesServer()
                     .combineWith(MemoryJamesServerMain.inMemoryServerModule)
                     .overrideWith(new MemoryJmapServerModule(temporaryFolder));
     }

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/server/protocols/jmap/src/main/java/org/apache/james/jmap/methods/GetMailboxesMethod.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap/src/main/java/org/apache/james/jmap/methods/GetMailboxesMethod.java b/server/protocols/jmap/src/main/java/org/apache/james/jmap/methods/GetMailboxesMethod.java
index d5f63b6..7a4e2ed 100644
--- a/server/protocols/jmap/src/main/java/org/apache/james/jmap/methods/GetMailboxesMethod.java
+++ b/server/protocols/jmap/src/main/java/org/apache/james/jmap/methods/GetMailboxesMethod.java
@@ -38,7 +38,6 @@ import org.apache.james.mailbox.MailboxSession;
 import org.apache.james.mailbox.exception.MailboxException;
 import org.apache.james.mailbox.model.MailboxMetaData;
 import org.apache.james.mailbox.model.MailboxQuery;
-import org.apache.james.mailbox.store.mail.model.MailboxId;
 
 import com.google.common.annotations.VisibleForTesting;
 import com.google.common.base.Preconditions;
@@ -47,16 +46,16 @@ import com.google.common.collect.ImmutableList;
 import com.google.common.collect.ImmutableSet;
 import com.google.common.collect.Sets;
 
-public class GetMailboxesMethod<Id extends MailboxId> implements Method {
+public class GetMailboxesMethod implements Method {
 
     private static final Method.Request.Name METHOD_NAME = Method.Request.name("getMailboxes");
     private static final Method.Response.Name RESPONSE_NAME = Method.Response.name("mailboxes");
 
     private final MailboxManager mailboxManager; 
-    private final MailboxUtils<Id> mailboxUtils;
+    private final MailboxUtils mailboxUtils;
 
     @Inject
-    @VisibleForTesting public GetMailboxesMethod(MailboxManager mailboxManager, MailboxUtils<Id> mailboxUtils) {
+    @VisibleForTesting public GetMailboxesMethod(MailboxManager mailboxManager, MailboxUtils mailboxUtils) {
         this.mailboxManager = mailboxManager;
         this.mailboxUtils = mailboxUtils;
     }

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/server/protocols/jmap/src/main/java/org/apache/james/jmap/methods/GetMessageListMethod.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap/src/main/java/org/apache/james/jmap/methods/GetMessageListMethod.java b/server/protocols/jmap/src/main/java/org/apache/james/jmap/methods/GetMessageListMethod.java
index 621f630..50b37a2 100644
--- a/server/protocols/jmap/src/main/java/org/apache/james/jmap/methods/GetMessageListMethod.java
+++ b/server/protocols/jmap/src/main/java/org/apache/james/jmap/methods/GetMessageListMethod.java
@@ -49,7 +49,6 @@ import org.apache.james.mailbox.store.StoreMailboxPath;
 import org.apache.james.mailbox.store.mail.MessageMapper;
 import org.apache.james.mailbox.store.mail.MessageMapper.FetchType;
 import org.apache.james.mailbox.store.mail.model.Mailbox;
-import org.apache.james.mailbox.store.mail.model.MailboxId;
 import org.apache.james.mailbox.store.mail.model.MailboxMessage;
 import org.apache.james.util.streams.Collectors;
 import org.slf4j.Logger;
@@ -63,7 +62,7 @@ import com.google.common.collect.ImmutableList;
 import com.google.common.collect.ImmutableSet;
 import com.google.common.collect.Sets;
 
-public class GetMessageListMethod<Id extends MailboxId> implements Method {
+public class GetMessageListMethod implements Method {
 
     public static final String MAXIMUM_LIMIT = "maximumLimit";
     public static final int DEFAULT_MAXIMUM_LIMIT = 256;
@@ -74,13 +73,13 @@ public class GetMessageListMethod<Id extends MailboxId> implements Method {
     private static final int NO_LIMIT = -1;
 
     private final MailboxManager mailboxManager;
-    private final MailboxSessionMapperFactory<Id> mailboxSessionMapperFactory;
+    private final MailboxSessionMapperFactory mailboxSessionMapperFactory;
     private final int maximumLimit;
-    private final GetMessagesMethod<Id> getMessagesMethod;
+    private final GetMessagesMethod getMessagesMethod;
 
     @Inject
-    @VisibleForTesting public GetMessageListMethod(MailboxManager mailboxManager, MailboxSessionMapperFactory<Id> mailboxSessionMapperFactory,
-            @Named(MAXIMUM_LIMIT) int maximumLimit, GetMessagesMethod<Id> getMessagesMethod) {
+    @VisibleForTesting public GetMessageListMethod(MailboxManager mailboxManager, MailboxSessionMapperFactory mailboxSessionMapperFactory,
+            @Named(MAXIMUM_LIMIT) int maximumLimit, GetMessagesMethod getMessagesMethod) {
 
         this.mailboxManager = mailboxManager;
         this.mailboxSessionMapperFactory = mailboxSessionMapperFactory;
@@ -166,7 +165,7 @@ public class GetMessageListMethod<Id extends MailboxId> implements Method {
         return limit.orElse(maximumLimit);
     }
 
-    private Comparator<MailboxMessage<Id>> comparatorFor(GetMessageListRequest messageListRequest) {
+    private Comparator<MailboxMessage> comparatorFor(GetMessageListRequest messageListRequest) {
         return SortToComparatorConvertor.comparatorFor(messageListRequest.getSort());
     }
 
@@ -186,7 +185,7 @@ public class GetMessageListMethod<Id extends MailboxId> implements Method {
         return mailboxSessionMapperFactory.createMailboxMapper(session).list()
                 .stream()
                 .filter(mailbox -> mailboxIdSet.contains(mailbox.getMailboxId().serialize()))
-                .map(mailbox -> new StoreMailboxPath<>(mailbox))
+                .map(mailbox -> new StoreMailboxPath(mailbox))
                 .collect(Collectors.toImmutableSet());
     }
     
@@ -199,11 +198,11 @@ public class GetMessageListMethod<Id extends MailboxId> implements Method {
         }
     }
 
-    private List<MailboxMessage<Id>> getMessages(MailboxPath mailboxPath, MailboxSession mailboxSession) {
+    private List<MailboxMessage> getMessages(MailboxPath mailboxPath, MailboxSession mailboxSession) {
         SearchQuery searchQuery = new SearchQuery();
         searchQuery.andCriteria(SearchQuery.all());
         try {
-            MessageMapper<Id> messageMapper = mailboxSessionMapperFactory.getMessageMapper(mailboxSession);
+            MessageMapper messageMapper = mailboxSessionMapperFactory.getMessageMapper(mailboxSession);
             Optional<MessageManager> messageManager = getMessageManager(mailboxPath, mailboxSession);
             return ImmutableList.copyOf(messageManager.get().search(searchQuery, mailboxSession))
                     .stream()
@@ -215,7 +214,7 @@ public class GetMessageListMethod<Id extends MailboxId> implements Method {
         }
     }
 
-    private MailboxMessage<Id> getMessage(MailboxPath mailboxPath, MailboxSession mailboxSession, MessageMapper<Id> messageMapper, long messageId) throws MailboxException {
+    private MailboxMessage getMessage(MailboxPath mailboxPath, MailboxSession mailboxSession, MessageMapper messageMapper, long messageId) throws MailboxException {
         try {
             return ImmutableList.copyOf(messageMapper.findInMailbox(
                         getMailbox(mailboxPath, mailboxSession).get(), 
@@ -231,7 +230,7 @@ public class GetMessageListMethod<Id extends MailboxId> implements Method {
         }
     }
 
-    private Optional<Mailbox<Id>> getMailbox(MailboxPath mailboxPath, MailboxSession mailboxSession) {
+    private Optional<Mailbox> getMailbox(MailboxPath mailboxPath, MailboxSession mailboxSession) {
         try {
             return Optional.of(mailboxSessionMapperFactory.getMailboxMapper(mailboxSession)
                     .findMailboxByPath(mailboxPath));

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/server/protocols/jmap/src/main/java/org/apache/james/jmap/methods/GetMessagesMethod.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap/src/main/java/org/apache/james/jmap/methods/GetMessagesMethod.java b/server/protocols/jmap/src/main/java/org/apache/james/jmap/methods/GetMessagesMethod.java
index 08b4de6..b490ad7 100644
--- a/server/protocols/jmap/src/main/java/org/apache/james/jmap/methods/GetMessagesMethod.java
+++ b/server/protocols/jmap/src/main/java/org/apache/james/jmap/methods/GetMessagesMethod.java
@@ -44,7 +44,6 @@ import org.apache.james.mailbox.store.mail.MailboxMapperFactory;
 import org.apache.james.mailbox.store.mail.MessageMapper;
 import org.apache.james.mailbox.store.mail.MessageMapperFactory;
 import org.apache.james.mailbox.store.mail.model.Mailbox;
-import org.apache.james.mailbox.store.mail.model.MailboxId;
 import org.apache.james.mailbox.store.mail.model.MailboxMessage;
 import org.apache.james.util.streams.Collectors;
 import org.javatuples.Pair;
@@ -56,18 +55,18 @@ import com.google.common.annotations.VisibleForTesting;
 import com.google.common.base.Preconditions;
 import com.google.common.collect.ImmutableSet;
 
-public class GetMessagesMethod<Id extends MailboxId> implements Method {
+public class GetMessagesMethod implements Method {
 
     public static final String HEADERS_FILTER = "headersFilter";
     private static final Method.Request.Name METHOD_NAME = Method.Request.name("getMessages");
     private static final Method.Response.Name RESPONSE_NAME = Method.Response.name("messages");
-    private final MessageMapperFactory<Id> messageMapperFactory;
-    private final MailboxMapperFactory<Id> mailboxMapperFactory;
+    private final MessageMapperFactory messageMapperFactory;
+    private final MailboxMapperFactory mailboxMapperFactory;
 
     @Inject
     @VisibleForTesting GetMessagesMethod(
-            MessageMapperFactory<Id> messageMapperFactory, 
-            MailboxMapperFactory<Id> mailboxMapperFactory) {
+            MessageMapperFactory messageMapperFactory, 
+            MailboxMapperFactory mailboxMapperFactory) {
         this.messageMapperFactory = messageMapperFactory;
         this.mailboxMapperFactory = mailboxMapperFactory;
     }
@@ -111,8 +110,8 @@ public class GetMessagesMethod<Id extends MailboxId> implements Method {
     private GetMessagesResponse getMessagesResponse(MailboxSession mailboxSession, GetMessagesRequest getMessagesRequest) {
         getMessagesRequest.getAccountId().ifPresent(GetMessagesMethod::notImplemented);
         
-        Function<MessageId, Stream<Pair<MailboxMessage<Id>, MailboxPath>>> loadMessages = loadMessage(mailboxSession);
-        Function<Pair<MailboxMessage<Id>, MailboxPath>, Message> convertToJmapMessage = toJmapMessage(mailboxSession);
+        Function<MessageId, Stream<Pair<MailboxMessage, MailboxPath>>> loadMessages = loadMessage(mailboxSession);
+        Function<Pair<MailboxMessage, MailboxPath>, Message> convertToJmapMessage = toJmapMessage(mailboxSession);
         
         List<Message> result = getMessagesRequest.getIds().stream()
             .flatMap(loadMessages)
@@ -127,24 +126,24 @@ public class GetMessagesMethod<Id extends MailboxId> implements Method {
     }
 
     
-    private Function<Pair<MailboxMessage<Id>, MailboxPath>, Message> toJmapMessage(MailboxSession mailboxSession) {
+    private Function<Pair<MailboxMessage, MailboxPath>, Message> toJmapMessage(MailboxSession mailboxSession) {
         return (value) -> {
-            MailboxMessage<Id> messageResult = value.getValue0();
+            MailboxMessage messageResult = value.getValue0();
             MailboxPath mailboxPath = value.getValue1();
             return Message.fromMailboxMessage(messageResult, uid -> new MessageId(mailboxSession.getUser(), mailboxPath , uid));
         };
     }
 
     private Function<MessageId, Stream<
-                                    Pair<MailboxMessage<Id>,
+                                    Pair<MailboxMessage,
                                          MailboxPath>>> 
                 loadMessage(MailboxSession mailboxSession) {
 
         return Throwing
                 .function((MessageId messageId) -> {
                      MailboxPath mailboxPath = messageId.getMailboxPath();
-                     MessageMapper<Id> messageMapper = messageMapperFactory.getMessageMapper(mailboxSession);
-                     Mailbox<Id> mailbox = mailboxMapperFactory.getMailboxMapper(mailboxSession).findMailboxByPath(mailboxPath);
+                     MessageMapper messageMapper = messageMapperFactory.getMessageMapper(mailboxSession);
+                     Mailbox mailbox = mailboxMapperFactory.getMailboxMapper(mailboxSession).findMailboxByPath(mailboxPath);
                      return Pair.with(
                              messageMapper.findInMailbox(mailbox, MessageRange.one(messageId.getUid()), MessageMapper.FetchType.Full, 1),
                              mailboxPath
@@ -153,9 +152,9 @@ public class GetMessagesMethod<Id extends MailboxId> implements Method {
                 .andThen(this::iteratorToStream);
     }
     
-    private Stream<Pair<MailboxMessage<Id>, MailboxPath>> iteratorToStream(Pair<Iterator<MailboxMessage<Id>>, MailboxPath> value) {
-        Iterable<MailboxMessage<Id>> iterable = () -> value.getValue0();
-        Stream<MailboxMessage<Id>> targetStream = StreamSupport.stream(iterable.spliterator(), false);
+    private Stream<Pair<MailboxMessage, MailboxPath>> iteratorToStream(Pair<Iterator<MailboxMessage>, MailboxPath> value) {
+        Iterable<MailboxMessage> iterable = () -> value.getValue0();
+        Stream<MailboxMessage> targetStream = StreamSupport.stream(iterable.spliterator(), false);
         
         MailboxPath mailboxPath = value.getValue1();
         return targetStream.map(x -> Pair.with(x, mailboxPath));

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/server/protocols/jmap/src/main/java/org/apache/james/jmap/methods/SetMailboxesCreationProcessor.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap/src/main/java/org/apache/james/jmap/methods/SetMailboxesCreationProcessor.java b/server/protocols/jmap/src/main/java/org/apache/james/jmap/methods/SetMailboxesCreationProcessor.java
index 6ca69f5..06c0605 100644
--- a/server/protocols/jmap/src/main/java/org/apache/james/jmap/methods/SetMailboxesCreationProcessor.java
+++ b/server/protocols/jmap/src/main/java/org/apache/james/jmap/methods/SetMailboxesCreationProcessor.java
@@ -33,32 +33,31 @@ import org.apache.james.jmap.model.SetMailboxesRequest;
 import org.apache.james.jmap.model.SetMailboxesResponse;
 import org.apache.james.jmap.model.mailbox.Mailbox;
 import org.apache.james.jmap.model.mailbox.MailboxCreateRequest;
-import org.apache.james.jmap.utils.SortingHierarchicalCollections;
 import org.apache.james.jmap.utils.DependencyGraph.CycleDetectedException;
 import org.apache.james.jmap.utils.MailboxUtils;
+import org.apache.james.jmap.utils.SortingHierarchicalCollections;
 import org.apache.james.mailbox.MailboxManager;
 import org.apache.james.mailbox.MailboxSession;
 import org.apache.james.mailbox.exception.MailboxException;
 import org.apache.james.mailbox.exception.MailboxExistsException;
 import org.apache.james.mailbox.model.MailboxPath;
-import org.apache.james.mailbox.store.mail.model.MailboxId;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import com.github.fge.lambdas.Throwing;
 import com.google.common.annotations.VisibleForTesting;
 
-public class SetMailboxesCreationProcessor<Id extends MailboxId> implements SetMailboxesProcessor<Id> {
+public class SetMailboxesCreationProcessor implements SetMailboxesProcessor {
 
     private static final Logger LOGGER = LoggerFactory.getLogger(SetMailboxesCreationProcessor.class);
 
     private final MailboxManager mailboxManager;
     private final SortingHierarchicalCollections<Map.Entry<MailboxCreationId, MailboxCreateRequest>, String> sortingHierarchicalCollections;
-    private final MailboxUtils<Id> mailboxUtils;
+    private final MailboxUtils mailboxUtils;
 
     @Inject
     @VisibleForTesting
-    SetMailboxesCreationProcessor(MailboxManager mailboxManager, MailboxUtils<Id> mailboxUtils) {
+    SetMailboxesCreationProcessor(MailboxManager mailboxManager, MailboxUtils mailboxUtils) {
         this.mailboxManager = mailboxManager;
         this.sortingHierarchicalCollections =
             new SortingHierarchicalCollections<>(

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/server/protocols/jmap/src/main/java/org/apache/james/jmap/methods/SetMailboxesDestructionProcessor.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap/src/main/java/org/apache/james/jmap/methods/SetMailboxesDestructionProcessor.java b/server/protocols/jmap/src/main/java/org/apache/james/jmap/methods/SetMailboxesDestructionProcessor.java
index 5fdc8d9..f6e225a 100644
--- a/server/protocols/jmap/src/main/java/org/apache/james/jmap/methods/SetMailboxesDestructionProcessor.java
+++ b/server/protocols/jmap/src/main/java/org/apache/james/jmap/methods/SetMailboxesDestructionProcessor.java
@@ -38,24 +38,23 @@ import org.apache.james.jmap.utils.SortingHierarchicalCollections;
 import org.apache.james.mailbox.MailboxManager;
 import org.apache.james.mailbox.MailboxSession;
 import org.apache.james.mailbox.exception.MailboxException;
-import org.apache.james.mailbox.store.mail.model.MailboxId;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import com.google.common.annotations.VisibleForTesting;
 import com.google.common.collect.ImmutableMap;
 
-public class SetMailboxesDestructionProcessor<Id extends MailboxId> implements SetMailboxesProcessor<Id> {
+public class SetMailboxesDestructionProcessor implements SetMailboxesProcessor {
 
     private static final Logger LOGGER = LoggerFactory.getLogger(SetMailboxesDestructionProcessor.class);
 
     private final MailboxManager mailboxManager;
     private final SortingHierarchicalCollections<Map.Entry<String, Mailbox>, String> sortingHierarchicalCollections;
-    private final MailboxUtils<Id> mailboxUtils;
+    private final MailboxUtils mailboxUtils;
 
     @Inject
     @VisibleForTesting
-    SetMailboxesDestructionProcessor(MailboxManager mailboxManager, MailboxUtils<Id> mailboxUtils) {
+    SetMailboxesDestructionProcessor(MailboxManager mailboxManager, MailboxUtils mailboxUtils) {
         this.mailboxManager = mailboxManager;
         this.sortingHierarchicalCollections =
             new SortingHierarchicalCollections<>(

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/server/protocols/jmap/src/main/java/org/apache/james/jmap/methods/SetMailboxesMethod.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap/src/main/java/org/apache/james/jmap/methods/SetMailboxesMethod.java b/server/protocols/jmap/src/main/java/org/apache/james/jmap/methods/SetMailboxesMethod.java
index f454bff..9566c8c 100644
--- a/server/protocols/jmap/src/main/java/org/apache/james/jmap/methods/SetMailboxesMethod.java
+++ b/server/protocols/jmap/src/main/java/org/apache/james/jmap/methods/SetMailboxesMethod.java
@@ -28,20 +28,19 @@ import org.apache.james.jmap.model.ClientId;
 import org.apache.james.jmap.model.SetMailboxesRequest;
 import org.apache.james.jmap.model.SetMailboxesResponse;
 import org.apache.james.mailbox.MailboxSession;
-import org.apache.james.mailbox.store.mail.model.MailboxId;
 
 import com.google.common.annotations.VisibleForTesting;
 import com.google.common.base.Preconditions;
 
-public class SetMailboxesMethod<Id extends MailboxId> implements Method {
+public class SetMailboxesMethod implements Method {
 
     private static final Request.Name METHOD_NAME = Request.name("setMailboxes");
     @VisibleForTesting static final Response.Name RESPONSE_NAME = Response.name("mailboxesSet");
 
-    private final Set<SetMailboxesProcessor<Id>> processors;
+    private final Set<SetMailboxesProcessor> processors;
 
     @Inject
-    public SetMailboxesMethod(Set<SetMailboxesProcessor<Id>> processors) {
+    public SetMailboxesMethod(Set<SetMailboxesProcessor> processors) {
         this.processors = processors;
     }
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/server/protocols/jmap/src/main/java/org/apache/james/jmap/methods/SetMailboxesProcessor.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap/src/main/java/org/apache/james/jmap/methods/SetMailboxesProcessor.java b/server/protocols/jmap/src/main/java/org/apache/james/jmap/methods/SetMailboxesProcessor.java
index 80f960e..6b28cbd 100644
--- a/server/protocols/jmap/src/main/java/org/apache/james/jmap/methods/SetMailboxesProcessor.java
+++ b/server/protocols/jmap/src/main/java/org/apache/james/jmap/methods/SetMailboxesProcessor.java
@@ -22,9 +22,8 @@ package org.apache.james.jmap.methods;
 import org.apache.james.jmap.model.SetMailboxesRequest;
 import org.apache.james.jmap.model.SetMailboxesResponse;
 import org.apache.james.mailbox.MailboxSession;
-import org.apache.james.mailbox.store.mail.model.MailboxId;
 
-public interface SetMailboxesProcessor<Id extends MailboxId> {
+public interface SetMailboxesProcessor {
 
     SetMailboxesResponse process(SetMailboxesRequest request, MailboxSession mailboxSession);
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/server/protocols/jmap/src/main/java/org/apache/james/jmap/methods/SetMailboxesUpdateProcessor.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap/src/main/java/org/apache/james/jmap/methods/SetMailboxesUpdateProcessor.java b/server/protocols/jmap/src/main/java/org/apache/james/jmap/methods/SetMailboxesUpdateProcessor.java
index 29efbe2..673e918 100644
--- a/server/protocols/jmap/src/main/java/org/apache/james/jmap/methods/SetMailboxesUpdateProcessor.java
+++ b/server/protocols/jmap/src/main/java/org/apache/james/jmap/methods/SetMailboxesUpdateProcessor.java
@@ -41,20 +41,19 @@ import org.apache.james.mailbox.exception.MailboxException;
 import org.apache.james.mailbox.exception.MailboxExistsException;
 import org.apache.james.mailbox.exception.MailboxNotFoundException;
 import org.apache.james.mailbox.model.MailboxPath;
-import org.apache.james.mailbox.store.mail.model.MailboxId;
 
 import com.google.common.annotations.VisibleForTesting;
 import com.google.common.base.Splitter;
 import com.google.common.collect.Iterables;
 
-public class SetMailboxesUpdateProcessor<Id extends MailboxId> implements SetMailboxesProcessor<Id> {
+public class SetMailboxesUpdateProcessor implements SetMailboxesProcessor {
 
-    private final MailboxUtils<Id> mailboxUtils;
+    private final MailboxUtils mailboxUtils;
     private final MailboxManager mailboxManager;
 
     @Inject
     @VisibleForTesting
-    SetMailboxesUpdateProcessor(MailboxUtils<Id> mailboxUtils, MailboxManager mailboxManager) {
+    SetMailboxesUpdateProcessor(MailboxUtils mailboxUtils, MailboxManager mailboxManager) {
         this.mailboxUtils = mailboxUtils;
         this.mailboxManager = mailboxManager;
     }

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/server/protocols/jmap/src/main/java/org/apache/james/jmap/methods/SetMessagesCreationProcessor.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap/src/main/java/org/apache/james/jmap/methods/SetMessagesCreationProcessor.java b/server/protocols/jmap/src/main/java/org/apache/james/jmap/methods/SetMessagesCreationProcessor.java
index da871a2..ff89bb1 100644
--- a/server/protocols/jmap/src/main/java/org/apache/james/jmap/methods/SetMessagesCreationProcessor.java
+++ b/server/protocols/jmap/src/main/java/org/apache/james/jmap/methods/SetMessagesCreationProcessor.java
@@ -74,25 +74,25 @@ import com.google.common.base.Splitter;
 import com.google.common.base.Throwables;
 import com.google.common.collect.ImmutableMap;
 
-public class SetMessagesCreationProcessor<Id extends MailboxId> implements SetMessagesProcessor<Id> {
+public class SetMessagesCreationProcessor implements SetMessagesProcessor {
 
     private static final Logger LOGGER = LoggerFactory.getLogger(SetMessagesCreationProcessor.class);
 
-    private final MailboxMapperFactory<Id> mailboxMapperFactory;
+    private final MailboxMapperFactory mailboxMapperFactory;
     private final MailboxManager mailboxManager;
-    private final MailboxSessionMapperFactory<Id> mailboxSessionMapperFactory;
+    private final MailboxSessionMapperFactory mailboxSessionMapperFactory;
     private final MIMEMessageConverter mimeMessageConverter;
     private final MailSpool mailSpool;
-    private final MailFactory<Id> mailFactory;
+    private final MailFactory mailFactory;
 
     @Inject
     @VisibleForTesting
-    SetMessagesCreationProcessor(MailboxMapperFactory<Id> mailboxMapperFactory,
+    SetMessagesCreationProcessor(MailboxMapperFactory mailboxMapperFactory,
                                  MailboxManager mailboxManager,
-                                 MailboxSessionMapperFactory<Id> mailboxSessionMapperFactory,
+                                 MailboxSessionMapperFactory mailboxSessionMapperFactory,
                                  MIMEMessageConverter mimeMessageConverter,
                                  MailSpool mailSpool,
-                                 MailFactory<Id> mailFactory) {
+                                 MailFactory mailFactory) {
         this.mailboxMapperFactory = mailboxMapperFactory;
         this.mailboxManager = mailboxManager;
         this.mailboxSessionMapperFactory = mailboxSessionMapperFactory;
@@ -103,7 +103,7 @@ public class SetMessagesCreationProcessor<Id extends MailboxId> implements SetMe
 
     @Override
     public SetMessagesResponse process(SetMessagesRequest request, MailboxSession mailboxSession) {
-        Mailbox<Id> outbox;
+        Mailbox outbox;
         try {
             outbox = getOutbox(mailboxSession).orElseThrow(() -> new MailboxRoleNotFoundException(Role.OUTBOX));
         } catch (MailboxException | MailboxRoleNotFoundException e) {
@@ -153,10 +153,10 @@ public class SetMessagesCreationProcessor<Id extends MailboxId> implements SetMe
     @VisibleForTesting
     protected MessageWithId<Message> createMessageInOutboxAndSend(MessageWithId.CreationMessageEntry createdEntry,
                                                            MailboxSession session,
-                                                           Mailbox<Id> outbox, Function<Long, MessageId> buildMessageIdFromUid) {
+                                                           Mailbox outbox, Function<Long, MessageId> buildMessageIdFromUid) {
         try {
-            MessageMapper<Id> messageMapper = mailboxSessionMapperFactory.createMessageMapper(session);
-            MailboxMessage<Id> newMailboxMessage = buildMailboxMessage(createdEntry, outbox);
+            MessageMapper messageMapper = mailboxSessionMapperFactory.createMessageMapper(session);
+            MailboxMessage newMailboxMessage = buildMailboxMessage(createdEntry, outbox);
             messageMapper.add(outbox, newMailboxMessage);
             Message jmapMessage = Message.fromMailboxMessage(newMailboxMessage, buildMessageIdFromUid);
             sendMessage(newMailboxMessage, jmapMessage, session);
@@ -169,12 +169,12 @@ public class SetMessagesCreationProcessor<Id extends MailboxId> implements SetMe
         }
     }
 
-    private Function<Long, MessageId> buildMessageIdFunc(MailboxSession session, Mailbox<Id> outbox) {
+    private Function<Long, MessageId> buildMessageIdFunc(MailboxSession session, Mailbox outbox) {
         MailboxPath outboxPath = new MailboxPath(session.getPersonalSpace(), session.getUser().getUserName(), outbox.getName());
         return uid -> new MessageId(session.getUser(), outboxPath, uid);
     }
 
-    private MailboxMessage<Id> buildMailboxMessage(MessageWithId.CreationMessageEntry createdEntry, Mailbox<Id> outbox) {
+    private MailboxMessage buildMailboxMessage(MessageWithId.CreationMessageEntry createdEntry, Mailbox outbox) {
         byte[] messageContent = mimeMessageConverter.convert(createdEntry);
         SharedInputStream content = new SharedByteArrayInputStream(messageContent);
         long size = messageContent.length;
@@ -182,15 +182,15 @@ public class SetMessagesCreationProcessor<Id extends MailboxId> implements SetMe
 
         Flags flags = getMessageFlags(createdEntry.getMessage());
         PropertyBuilder propertyBuilder = buildPropertyBuilder();
-        Id mailboxId = outbox.getMailboxId();
+        MailboxId mailboxId = outbox.getMailboxId();
         Date internalDate = Date.from(createdEntry.getMessage().getDate().toInstant());
 
-        return new SimpleMailboxMessage<>(internalDate, size,
+        return new SimpleMailboxMessage(internalDate, size,
                 bodyStartOctet, content, flags, propertyBuilder, mailboxId);
     }
 
     @VisibleForTesting
-    protected Optional<Mailbox<Id>> getOutbox(MailboxSession session) throws MailboxException {
+    protected Optional<Mailbox> getOutbox(MailboxSession session) throws MailboxException {
         return mailboxManager.search(MailboxQuery.builder(session)
                 .privateUserMailboxes().build(), session).stream()
             .map(MailboxMetaData::getPath)
@@ -205,7 +205,7 @@ public class SetMessagesCreationProcessor<Id extends MailboxId> implements SetMe
                 .orElse(false);
     }
 
-    private ThrowingFunction<MailboxPath, Mailbox<Id>> loadMailbox(MailboxSession session) {
+    private ThrowingFunction<MailboxPath, Mailbox> loadMailbox(MailboxSession session) {
         return path -> mailboxMapperFactory.getMailboxMapper(session).findMailboxByPath(path);
     }
 
@@ -230,7 +230,7 @@ public class SetMessagesCreationProcessor<Id extends MailboxId> implements SetMe
         return result;
     }
 
-    private void sendMessage(MailboxMessage<Id> mailboxMessage, Message jmapMessage, MailboxSession session) throws MessagingException, IOException {
+    private void sendMessage(MailboxMessage mailboxMessage, Message jmapMessage, MailboxSession session) throws MessagingException, IOException {
         Mail mail = mailFactory.build(mailboxMessage, jmapMessage);
         MailMetadata metadata = new MailMetadata(jmapMessage.getId(), session.getUser().getUserName());
         mailSpool.send(mail, metadata);


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


Mime
View raw message