james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From adup...@apache.org
Subject [08/13] james-project git commit: JAMES-1733 Remove generics from mailbox API
Date Tue, 17 May 2016 08:14:54 GMT
http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/memory/src/test/java/org/apache/james/mailbox/inmemory/InMemoryMailboxMapperTest.java
----------------------------------------------------------------------
diff --git a/mailbox/memory/src/test/java/org/apache/james/mailbox/inmemory/InMemoryMailboxMapperTest.java b/mailbox/memory/src/test/java/org/apache/james/mailbox/inmemory/InMemoryMailboxMapperTest.java
index ad0b4a3..043a394 100644
--- a/mailbox/memory/src/test/java/org/apache/james/mailbox/inmemory/InMemoryMailboxMapperTest.java
+++ b/mailbox/memory/src/test/java/org/apache/james/mailbox/inmemory/InMemoryMailboxMapperTest.java
@@ -40,11 +40,11 @@ public class InMemoryMailboxMapperTest {
     private MailboxPath user2OtherBoxPath;
     private MailboxPath user1OtherNamespacePath;
 
-    private Mailbox<InMemoryId> user1Inbox;
-    private Mailbox<InMemoryId> user1SubMailbox1;
-    private Mailbox<InMemoryId> user1SubMailbox2;
+    private Mailbox user1Inbox;
+    private Mailbox user1SubMailbox1;
+    private Mailbox user1SubMailbox2;
 
-    private MailboxMapper<InMemoryId> mapper;
+    private MailboxMapper mapper;
 
     @Before
     public void setUp() throws MailboxException {
@@ -53,32 +53,29 @@ public class InMemoryMailboxMapperTest {
         user1SubMailbox2Path = new MailboxPath("#private", "user1", "INBOX.sub2");
         user2OtherBoxPath = new MailboxPath("#private", "user2", "other.user");
         user1OtherNamespacePath = new MailboxPath("#namspace", "user1", "other.namespace");
-        user1Inbox = new SimpleMailbox<InMemoryId>(user1InboxPath, UID_VALIDITY);
-        user1SubMailbox1 = new SimpleMailbox<InMemoryId>(user1SubMailbox1Path, UID_VALIDITY);
-        user1SubMailbox2 = new SimpleMailbox<InMemoryId>(user1SubMailbox2Path, UID_VALIDITY);
+        user1Inbox = new SimpleMailbox(user1InboxPath, UID_VALIDITY);
+        user1SubMailbox1 = new SimpleMailbox(user1SubMailbox1Path, UID_VALIDITY);
+        user1SubMailbox2 = new SimpleMailbox(user1SubMailbox2Path, UID_VALIDITY);
         mapper = new InMemoryMailboxSessionMapperFactory().createMailboxMapper(new MockMailboxSession("user"));
         mapper.save(user1Inbox);
         mapper.save(user1SubMailbox1);
         mapper.save(user1SubMailbox2);
-        mapper.save(new SimpleMailbox<InMemoryId>(user2OtherBoxPath, UID_VALIDITY));
-        mapper.save(new SimpleMailbox<InMemoryId>(user1OtherNamespacePath, UID_VALIDITY));
+        mapper.save(new SimpleMailbox(user2OtherBoxPath, UID_VALIDITY));
+        mapper.save(new SimpleMailbox(user1OtherNamespacePath, UID_VALIDITY));
     }
 
-    @SuppressWarnings("unchecked")
     @Test
     public void findMailboxWithPatchLikeOnAllMaillboxesShouldReturnMailboxesBelongingToThisNamespaceAndUser() throws MailboxException{
         assertThat(mapper.findMailboxWithPathLike(new MailboxPath("#private", "user1", "%")))
             .containsOnly(user1Inbox, user1SubMailbox1, user1SubMailbox2);
     }
 
-    @SuppressWarnings("unchecked")
     @Test
     public void findMailboxWithPatchLikeBasedOnInboxShouldReturnItsChildren() throws MailboxException{
         assertThat(mapper.findMailboxWithPathLike(new MailboxPath("#private", "user1", "INBOX.%")))
             .containsOnly(user1SubMailbox1, user1SubMailbox2);
     }
 
-    @SuppressWarnings("unchecked")
     @Test
     public void findMailboxWithPatchLikeBasedOnAStringShouldReturnMailboxesStartingWithThisString() throws MailboxException{
         assertThat(mapper.findMailboxWithPathLike(new MailboxPath("#private", "user1", "IN%")))

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/memory/src/test/java/org/apache/james/mailbox/inmemory/mail/InMemoryMailboxMapperTest.java
----------------------------------------------------------------------
diff --git a/mailbox/memory/src/test/java/org/apache/james/mailbox/inmemory/mail/InMemoryMailboxMapperTest.java b/mailbox/memory/src/test/java/org/apache/james/mailbox/inmemory/mail/InMemoryMailboxMapperTest.java
index fc1711d..8abdae8 100644
--- a/mailbox/memory/src/test/java/org/apache/james/mailbox/inmemory/mail/InMemoryMailboxMapperTest.java
+++ b/mailbox/memory/src/test/java/org/apache/james/mailbox/inmemory/mail/InMemoryMailboxMapperTest.java
@@ -19,10 +19,9 @@
 
 package org.apache.james.mailbox.inmemory.mail;
 
-import org.apache.james.mailbox.inmemory.InMemoryId;
 import org.apache.james.mailbox.store.mail.model.AbstractMailboxMapperTest;
 
-public class InMemoryMailboxMapperTest extends AbstractMailboxMapperTest<InMemoryId> {
+public class InMemoryMailboxMapperTest extends AbstractMailboxMapperTest {
 
     public InMemoryMailboxMapperTest() {
         super(new InMemoryMapperProvider());

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/memory/src/test/java/org/apache/james/mailbox/inmemory/mail/InMemoryMapperProvider.java
----------------------------------------------------------------------
diff --git a/mailbox/memory/src/test/java/org/apache/james/mailbox/inmemory/mail/InMemoryMapperProvider.java b/mailbox/memory/src/test/java/org/apache/james/mailbox/inmemory/mail/InMemoryMapperProvider.java
index c0ce7fb..50114a4 100644
--- a/mailbox/memory/src/test/java/org/apache/james/mailbox/inmemory/mail/InMemoryMapperProvider.java
+++ b/mailbox/memory/src/test/java/org/apache/james/mailbox/inmemory/mail/InMemoryMapperProvider.java
@@ -10,7 +10,7 @@ import org.apache.james.mailbox.store.mail.MailboxMapper;
 import org.apache.james.mailbox.store.mail.MessageMapper;
 import org.apache.james.mailbox.store.mail.model.MapperProvider;
 
-public class InMemoryMapperProvider implements MapperProvider<InMemoryId> {
+public class InMemoryMapperProvider implements MapperProvider {
 
     private final Random random;
 
@@ -19,12 +19,12 @@ public class InMemoryMapperProvider implements MapperProvider<InMemoryId> {
     }
 
     @Override
-    public MailboxMapper<InMemoryId> createMailboxMapper() throws MailboxException {
+    public MailboxMapper createMailboxMapper() throws MailboxException {
         return new InMemoryMailboxSessionMapperFactory().createMailboxMapper(new MockMailboxSession("user"));
     }
 
     @Override
-    public MessageMapper<InMemoryId> createMessageMapper() throws MailboxException {
+    public MessageMapper createMessageMapper() throws MailboxException {
         return new InMemoryMailboxSessionMapperFactory().createMessageMapper(new MockMailboxSession("user"));
     }
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/memory/src/test/java/org/apache/james/mailbox/inmemory/mail/InMemoryMessageMapperTest.java
----------------------------------------------------------------------
diff --git a/mailbox/memory/src/test/java/org/apache/james/mailbox/inmemory/mail/InMemoryMessageMapperTest.java b/mailbox/memory/src/test/java/org/apache/james/mailbox/inmemory/mail/InMemoryMessageMapperTest.java
index 6d70e8f..8ab4df2 100644
--- a/mailbox/memory/src/test/java/org/apache/james/mailbox/inmemory/mail/InMemoryMessageMapperTest.java
+++ b/mailbox/memory/src/test/java/org/apache/james/mailbox/inmemory/mail/InMemoryMessageMapperTest.java
@@ -19,10 +19,9 @@
 
 package org.apache.james.mailbox.inmemory.mail;
 
-import org.apache.james.mailbox.inmemory.InMemoryId;
 import org.apache.james.mailbox.store.mail.model.AbstractMessageMapperTest;
 
-public class InMemoryMessageMapperTest extends AbstractMessageMapperTest<InMemoryId> {
+public class InMemoryMessageMapperTest extends AbstractMessageMapperTest {
 
     public InMemoryMessageMapperTest() {
         super(new InMemoryMapperProvider());

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/memory/src/test/java/org/apache/james/mailbox/inmemory/mail/InMemoryMessageMoveTest.java
----------------------------------------------------------------------
diff --git a/mailbox/memory/src/test/java/org/apache/james/mailbox/inmemory/mail/InMemoryMessageMoveTest.java b/mailbox/memory/src/test/java/org/apache/james/mailbox/inmemory/mail/InMemoryMessageMoveTest.java
index 0a1aaa3..8244bcb 100644
--- a/mailbox/memory/src/test/java/org/apache/james/mailbox/inmemory/mail/InMemoryMessageMoveTest.java
+++ b/mailbox/memory/src/test/java/org/apache/james/mailbox/inmemory/mail/InMemoryMessageMoveTest.java
@@ -19,10 +19,9 @@
 
 package org.apache.james.mailbox.inmemory.mail;
 
-import org.apache.james.mailbox.inmemory.InMemoryId;
 import org.apache.james.mailbox.store.mail.model.AbstractMessageMoveTest;
 
-public class InMemoryMessageMoveTest extends AbstractMessageMoveTest<InMemoryId> {
+public class InMemoryMessageMoveTest extends AbstractMessageMoveTest {
 
     public InMemoryMessageMoveTest() {
         super(new InMemoryMapperProvider());

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/memory/src/test/java/org/apache/james/mailbox/inmemory/manager/InMemoryIntegrationResources.java
----------------------------------------------------------------------
diff --git a/mailbox/memory/src/test/java/org/apache/james/mailbox/inmemory/manager/InMemoryIntegrationResources.java b/mailbox/memory/src/test/java/org/apache/james/mailbox/inmemory/manager/InMemoryIntegrationResources.java
index 52fe81d..89d4ce8 100644
--- a/mailbox/memory/src/test/java/org/apache/james/mailbox/inmemory/manager/InMemoryIntegrationResources.java
+++ b/mailbox/memory/src/test/java/org/apache/james/mailbox/inmemory/manager/InMemoryIntegrationResources.java
@@ -24,7 +24,6 @@ import org.apache.james.mailbox.acl.GroupMembershipResolver;
 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.inmemory.InMemoryId;
 import org.apache.james.mailbox.inmemory.InMemoryMailboxManager;
 import org.apache.james.mailbox.inmemory.InMemoryMailboxSessionMapperFactory;
 import org.apache.james.mailbox.inmemory.quota.InMemoryCurrentQuotaManager;
@@ -52,7 +51,7 @@ public class InMemoryIntegrationResources implements IntegrationResources {
         MockAuthenticator mockAuthenticator = new MockAuthenticator();
         mockAuthenticator.addUser(ManagerTestResources.USER, ManagerTestResources.USER_PASS);
         InMemoryMailboxSessionMapperFactory mailboxSessionMapperFactory = new InMemoryMailboxSessionMapperFactory();
-        final StoreMailboxManager<InMemoryId> manager = new InMemoryMailboxManager(
+        final StoreMailboxManager manager = new InMemoryMailboxManager(
             mailboxSessionMapperFactory,
             mockAuthenticator,
             new NoMailboxPathLocker(),
@@ -62,7 +61,6 @@ public class InMemoryIntegrationResources implements IntegrationResources {
         return manager;
     }
 
-    @SuppressWarnings("unchecked")
     @Override
     public QuotaManager createQuotaManager(MaxQuotaManager maxQuotaManager, MailboxManager mailboxManager) throws Exception {
         StoreQuotaManager quotaManager = new StoreQuotaManager();
@@ -71,7 +69,7 @@ public class InMemoryIntegrationResources implements IntegrationResources {
         QuotaRootResolver quotaRootResolver =  createQuotaRootResolver(mailboxManager);
 
         InMemoryCurrentQuotaManager currentQuotaManager = new InMemoryCurrentQuotaManager(
-            new CurrentQuotaCalculator<InMemoryId>(((StoreMailboxManager<InMemoryId>)mailboxManager).getMapperFactory(), quotaRootResolver),
+            new CurrentQuotaCalculator(((StoreMailboxManager)mailboxManager).getMapperFactory(), quotaRootResolver),
             mailboxManager
         );
 
@@ -81,7 +79,7 @@ public class InMemoryIntegrationResources implements IntegrationResources {
 
         quotaManager.setCurrentQuotaManager(currentQuotaManager);
         quotaManager.setMaxQuotaManager(maxQuotaManager);
-        ((StoreMailboxManager<InMemoryId>) mailboxManager).setQuotaManager(quotaManager);
+        ((StoreMailboxManager) mailboxManager).setQuotaManager(quotaManager);
         mailboxManager.addGlobalListener(listeningCurrentQuotaUpdater, null);
         return quotaManager;
     }
@@ -97,11 +95,10 @@ public class InMemoryIntegrationResources implements IntegrationResources {
         return groupMembershipResolver;
     }
 
-    @SuppressWarnings("unchecked")
     @Override
     public DefaultQuotaRootResolver createQuotaRootResolver(MailboxManager mailboxManager) throws Exception {
         if (quotaRootResolver == null) {
-            quotaRootResolver = new DefaultQuotaRootResolver(((StoreMailboxManager<InMemoryId>) mailboxManager).getMapperFactory());
+            quotaRootResolver = new DefaultQuotaRootResolver(((StoreMailboxManager) mailboxManager).getMapperFactory());
         }
         return quotaRootResolver;
     }

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/memory/src/test/java/org/apache/james/mailbox/inmemory/quota/InMemoryCurrentQuotaManagerTest.java
----------------------------------------------------------------------
diff --git a/mailbox/memory/src/test/java/org/apache/james/mailbox/inmemory/quota/InMemoryCurrentQuotaManagerTest.java b/mailbox/memory/src/test/java/org/apache/james/mailbox/inmemory/quota/InMemoryCurrentQuotaManagerTest.java
index 2e15eed..524ee1e 100644
--- a/mailbox/memory/src/test/java/org/apache/james/mailbox/inmemory/quota/InMemoryCurrentQuotaManagerTest.java
+++ b/mailbox/memory/src/test/java/org/apache/james/mailbox/inmemory/quota/InMemoryCurrentQuotaManagerTest.java
@@ -20,12 +20,10 @@
 package org.apache.james.mailbox.inmemory.quota;
 
 import static org.assertj.core.api.Assertions.assertThat;
-
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
 
 import org.apache.james.mailbox.MailboxManager;
-import org.apache.james.mailbox.inmemory.InMemoryId;
 import org.apache.james.mailbox.model.QuotaRoot;
 import org.apache.james.mailbox.store.quota.CurrentQuotaCalculator;
 import org.apache.james.mailbox.store.quota.QuotaRootImpl;
@@ -39,9 +37,8 @@ public class InMemoryCurrentQuotaManagerTest {
     public static final QuotaRoot QUOTA_ROOT = QuotaRootImpl.quotaRoot("benwa");
 
     private InMemoryCurrentQuotaManager testee;
-    private CurrentQuotaCalculator<InMemoryId> mockedCurrentQuotaCalculator;
+    private CurrentQuotaCalculator mockedCurrentQuotaCalculator;
 
-    @SuppressWarnings("unchecked")
     @Before
     public void setUp() throws Exception {
         mockedCurrentQuotaCalculator = mock(CurrentQuotaCalculator.class);

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/store/src/main/java/org/apache/james/mailbox/store/GroupFolderResolver.java
----------------------------------------------------------------------
diff --git a/mailbox/store/src/main/java/org/apache/james/mailbox/store/GroupFolderResolver.java b/mailbox/store/src/main/java/org/apache/james/mailbox/store/GroupFolderResolver.java
index 73d79cb..7be235d 100644
--- a/mailbox/store/src/main/java/org/apache/james/mailbox/store/GroupFolderResolver.java
+++ b/mailbox/store/src/main/java/org/apache/james/mailbox/store/GroupFolderResolver.java
@@ -31,7 +31,7 @@ public class GroupFolderResolver {
         this.mailboxSession = mailboxSession;
     }
 
-    public boolean isGroupFolder(Mailbox<?> mailbox) {
+    public boolean isGroupFolder(Mailbox mailbox) {
         String namespace = mailbox.getNamespace();
         return namespace == null || 
                 (!namespace.equals(mailboxSession.getPersonalSpace())

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/store/src/main/java/org/apache/james/mailbox/store/MailboxSessionMapperFactory.java
----------------------------------------------------------------------
diff --git a/mailbox/store/src/main/java/org/apache/james/mailbox/store/MailboxSessionMapperFactory.java b/mailbox/store/src/main/java/org/apache/james/mailbox/store/MailboxSessionMapperFactory.java
index 34b18d8..3069eae 100644
--- a/mailbox/store/src/main/java/org/apache/james/mailbox/store/MailboxSessionMapperFactory.java
+++ b/mailbox/store/src/main/java/org/apache/james/mailbox/store/MailboxSessionMapperFactory.java
@@ -26,7 +26,6 @@ import org.apache.james.mailbox.store.mail.MailboxMapper;
 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.MailboxId;
 import org.apache.james.mailbox.store.transaction.Mapper;
 import org.apache.james.mailbox.store.user.SubscriptionMapper;
 import org.apache.james.mailbox.store.user.SubscriptionMapperFactory;
@@ -35,7 +34,7 @@ import org.apache.james.mailbox.store.user.SubscriptionMapperFactory;
  * Maintain mapper instances by {@link MailboxSession}. So only one mapper instance is used
  * in a {@link MailboxSession}
  */
-public abstract class MailboxSessionMapperFactory<Id extends MailboxId> implements RequestAware, MailboxMapperFactory<Id>, MessageMapperFactory<Id>, SubscriptionMapperFactory{
+public abstract class MailboxSessionMapperFactory implements RequestAware, MailboxMapperFactory, MessageMapperFactory, SubscriptionMapperFactory{
 
     protected final static String MESSAGEMAPPER ="MESSAGEMAPPER";
     protected final static String MAILBOXMAPPER ="MAILBOXMAPPER";
@@ -46,9 +45,8 @@ public abstract class MailboxSessionMapperFactory<Id extends MailboxId> implemen
     /**
      * @see org.apache.james.mailbox.store.mail.MessageMapperFactory#getMessageMapper(MailboxSession)
      */
-    @SuppressWarnings("unchecked")
-    public MessageMapper<Id> getMessageMapper(MailboxSession session) throws MailboxException {
-        MessageMapper<Id> mapper = (MessageMapper<Id>) session.getAttributes().get(MESSAGEMAPPER);
+    public MessageMapper getMessageMapper(MailboxSession session) throws MailboxException {
+        MessageMapper mapper = (MessageMapper) session.getAttributes().get(MESSAGEMAPPER);
         if (mapper == null) {
             mapper = createMessageMapper(session);
             session.getAttributes().put(MESSAGEMAPPER, mapper);
@@ -63,15 +61,14 @@ public abstract class MailboxSessionMapperFactory<Id extends MailboxId> implemen
      * @return messageMapper
      * @throws MailboxException
      */
-    public abstract MessageMapper<Id> createMessageMapper(MailboxSession session) throws MailboxException;
+    public abstract MessageMapper createMessageMapper(MailboxSession session) throws MailboxException;
 
 
     /**
      * @see org.apache.james.mailbox.store.mail.MailboxMapperFactory#getMailboxMapper(MailboxSession)
      */
-    @SuppressWarnings("unchecked")
-    public MailboxMapper<Id> getMailboxMapper(MailboxSession session) throws MailboxException {
-        MailboxMapper<Id> mapper = (MailboxMapper<Id>) session.getAttributes().get(MAILBOXMAPPER);
+    public MailboxMapper getMailboxMapper(MailboxSession session) throws MailboxException {
+        MailboxMapper mapper = (MailboxMapper) session.getAttributes().get(MAILBOXMAPPER);
         if (mapper == null) {
             mapper = createMailboxMapper(session);
             session.getAttributes().put(MAILBOXMAPPER, mapper);
@@ -86,7 +83,7 @@ public abstract class MailboxSessionMapperFactory<Id extends MailboxId> implemen
      * @return mailboxMapper
      * @throws MailboxException
      */
-    public abstract MailboxMapper<Id> createMailboxMapper(MailboxSession session) throws MailboxException;
+    public abstract MailboxMapper createMailboxMapper(MailboxSession session) throws MailboxException;
 
     /**
      * Create a {@link SubscriptionMapper} instance or return the one which exists for the {@link MailboxSession} already
@@ -116,11 +113,10 @@ public abstract class MailboxSessionMapperFactory<Id extends MailboxId> implemen
      * 
      * @param session
      */
-    @SuppressWarnings("unchecked")
     public void endProcessingRequest(MailboxSession session) {
         if (session == null) return;
-        MessageMapper<Id> messageMapper = (MessageMapper<Id>) session.getAttributes().get(MESSAGEMAPPER);
-        MailboxMapper<Id> mailboxMapper = (MailboxMapper<Id>) session.getAttributes().get(MAILBOXMAPPER);
+        MessageMapper messageMapper = (MessageMapper) session.getAttributes().get(MESSAGEMAPPER);
+        MailboxMapper mailboxMapper = (MailboxMapper) session.getAttributes().get(MAILBOXMAPPER);
         SubscriptionMapper subscriptionMapper = (SubscriptionMapper) session.getAttributes().get(SUBSCRIPTIONMAPPER);
         if (messageMapper != null)
             messageMapper.endRequest();

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/store/src/main/java/org/apache/james/mailbox/store/MessageResultImpl.java
----------------------------------------------------------------------
diff --git a/mailbox/store/src/main/java/org/apache/james/mailbox/store/MessageResultImpl.java b/mailbox/store/src/main/java/org/apache/james/mailbox/store/MessageResultImpl.java
index da74eb3..35f6ea2 100644
--- a/mailbox/store/src/main/java/org/apache/james/mailbox/store/MessageResultImpl.java
+++ b/mailbox/store/src/main/java/org/apache/james/mailbox/store/MessageResultImpl.java
@@ -49,14 +49,14 @@ public class MessageResultImpl implements MessageResult {
 
     private MimeDescriptor mimeDescriptor;
 
-	private final MailboxMessage<?> message;
+	private final MailboxMessage message;
 
     private HeadersImpl headers;
     private Content fullContent;
     private Content bodyContent;
 
     
-    public MessageResultImpl(MailboxMessage<?> message) throws IOException {
+    public MessageResultImpl(MailboxMessage message) throws IOException {
         this.message = message;
         this.headers = new HeadersImpl(message);
         

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/store/src/main/java/org/apache/james/mailbox/store/ResultUtils.java
----------------------------------------------------------------------
diff --git a/mailbox/store/src/main/java/org/apache/james/mailbox/store/ResultUtils.java b/mailbox/store/src/main/java/org/apache/james/mailbox/store/ResultUtils.java
index bebd213..c436585 100644
--- a/mailbox/store/src/main/java/org/apache/james/mailbox/store/ResultUtils.java
+++ b/mailbox/store/src/main/java/org/apache/james/mailbox/store/ResultUtils.java
@@ -53,7 +53,7 @@ public class ResultUtils {
 
     static final Charset US_ASCII = Charset.forName("US-ASCII");
 
-    public static List<MessageResult.Header> createHeaders(MailboxMessage<?> document) throws IOException {
+    public static List<MessageResult.Header> createHeaders(MailboxMessage document) throws IOException {
         final List<MessageResult.Header> results = new ArrayList<MessageResult.Header>();
         MimeConfig config = MimeConfig.custom().setMaxLineLen(-1).setMaxHeaderLen(-1).build();
         final MimeStreamParser parser = new MimeStreamParser(config);
@@ -106,7 +106,7 @@ public class ResultUtils {
      * @return result
      * @throws MailboxException
      */
-    public static MessageResult loadMessageResult(MailboxMessage<?> message, FetchGroup fetchGroup) throws MailboxException {
+    public static MessageResult loadMessageResult(MailboxMessage message, FetchGroup fetchGroup) throws MailboxException {
         try {
 
             MessageResultImpl messageResult = new MessageResultImpl(message);
@@ -142,7 +142,7 @@ public class ResultUtils {
     }
 
     private static void addPartContent(FetchGroup fetchGroup,
-                                       MailboxMessage<?> message, MessageResultImpl messageResult)
+                                       MailboxMessage message, MessageResultImpl messageResult)
             throws MailboxException, IOException,
             MimeException {
         Collection<FetchGroup.PartContentDescriptor> partContent = fetchGroup.getPartContentDescriptors();
@@ -154,7 +154,7 @@ public class ResultUtils {
     }
 
     private static void addPartContent(
-            FetchGroup.PartContentDescriptor descriptor, MailboxMessage<?> message,
+            FetchGroup.PartContentDescriptor descriptor, MailboxMessage message,
             MessageResultImpl messageResult) throws 
             MailboxException, IOException, MimeException {
         final MimePath mimePath = descriptor.path();
@@ -176,7 +176,7 @@ public class ResultUtils {
         }
     }
 
-    private static PartContentBuilder build(int[] path, MailboxMessage<?> message)
+    private static PartContentBuilder build(int[] path, MailboxMessage message)
             throws IOException, MimeException {
         final InputStream stream = message.getFullContent();
         PartContentBuilder result = new PartContentBuilder();
@@ -205,7 +205,7 @@ public class ResultUtils {
         return result;
     }
 
-    private static void addHeaders(MailboxMessage<?> message,
+    private static void addHeaders(MailboxMessage message,
             MessageResultImpl messageResult, MimePath mimePath)
             throws IOException, MimeException {
         final int[] path = path(mimePath);
@@ -217,7 +217,7 @@ public class ResultUtils {
         }
     }
 
-    private static void addMimeHeaders(MailboxMessage<?> message,
+    private static void addMimeHeaders(MailboxMessage message,
             MessageResultImpl messageResult, MimePath mimePath)
             throws IOException, MimeException {
         final int[] path = path(mimePath);
@@ -228,7 +228,7 @@ public class ResultUtils {
         }
     }
 
-    private static void addBodyContent(MailboxMessage<?> message,
+    private static void addBodyContent(MailboxMessage message,
             MessageResultImpl messageResult, MimePath mimePath) throws IOException, MimeException {
         final int[] path = path(mimePath);
         if (path != null) {
@@ -238,7 +238,7 @@ public class ResultUtils {
         }
     }
 
-    private static void addMimeBodyContent(MailboxMessage<?> message,
+    private static void addMimeBodyContent(MailboxMessage message,
             MessageResultImpl messageResult, MimePath mimePath)
             throws IOException, MimeException {
         final int[] path = path(mimePath);
@@ -247,7 +247,7 @@ public class ResultUtils {
         messageResult.setMimeBodyContent(mimePath, content);
     }
 
-    private static void addFullContent(MailboxMessage<?> message,
+    private static void addFullContent(MailboxMessage message,
             MessageResultImpl messageResult, MimePath mimePath)
             throws MailboxException, IOException,
             MimeException {

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/store/src/main/java/org/apache/james/mailbox/store/SimpleMessageMetaData.java
----------------------------------------------------------------------
diff --git a/mailbox/store/src/main/java/org/apache/james/mailbox/store/SimpleMessageMetaData.java b/mailbox/store/src/main/java/org/apache/james/mailbox/store/SimpleMessageMetaData.java
index e443173..5c88a13 100644
--- a/mailbox/store/src/main/java/org/apache/james/mailbox/store/SimpleMessageMetaData.java
+++ b/mailbox/store/src/main/java/org/apache/james/mailbox/store/SimpleMessageMetaData.java
@@ -42,7 +42,7 @@ public class SimpleMessageMetaData implements MessageMetaData{
         this.internalDate = internalDate;
     }
     
-    public SimpleMessageMetaData(MailboxMessage<?> message) {
+    public SimpleMessageMetaData(MailboxMessage message) {
         this(message.getUid(), message.getModSeq(), message.createFlags(), message.getFullContentOctets(), message.getInternalDate());
     }
     

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/store/src/main/java/org/apache/james/mailbox/store/StoreMailboxManager.java
----------------------------------------------------------------------
diff --git a/mailbox/store/src/main/java/org/apache/james/mailbox/store/StoreMailboxManager.java b/mailbox/store/src/main/java/org/apache/james/mailbox/store/StoreMailboxManager.java
index 4d7f463..462f170 100644
--- a/mailbox/store/src/main/java/org/apache/james/mailbox/store/StoreMailboxManager.java
+++ b/mailbox/store/src/main/java/org/apache/james/mailbox/store/StoreMailboxManager.java
@@ -54,12 +54,11 @@ import org.apache.james.mailbox.model.MessageRange;
 import org.apache.james.mailbox.model.SimpleMailboxACL;
 import org.apache.james.mailbox.quota.QuotaManager;
 import org.apache.james.mailbox.quota.QuotaRootResolver;
-import org.apache.james.mailbox.store.event.DelegatingMailboxListener;
 import org.apache.james.mailbox.store.event.DefaultDelegatingMailboxListener;
+import org.apache.james.mailbox.store.event.DelegatingMailboxListener;
 import org.apache.james.mailbox.store.event.MailboxEventDispatcher;
 import org.apache.james.mailbox.store.mail.MailboxMapper;
 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.impl.SimpleMailbox;
 import org.apache.james.mailbox.store.quota.DefaultQuotaRootResolver;
 import org.apache.james.mailbox.store.quota.NoQuotaManager;
@@ -80,17 +79,16 @@ import com.google.common.collect.Lists;
  * <p/>
  * If you need a more low-level api just implement {@link MailboxManager} directly
  *
- * @param <Id>
  */
 @Singleton
-public class StoreMailboxManager<Id extends MailboxId> implements MailboxManager {
+public class StoreMailboxManager implements MailboxManager {
 
     public static final char SQL_WILDCARD_CHAR = '%';
     public static final int DEFAULT_FETCH_BATCH_SIZE = 200;
 
-    private MailboxEventDispatcher<Id> dispatcher;
+    private MailboxEventDispatcher dispatcher;
     private DelegatingMailboxListener delegatingListener = null;
-    private final MailboxSessionMapperFactory<Id> mailboxSessionMapperFactory;
+    private final MailboxSessionMapperFactory mailboxSessionMapperFactory;
 
     private final Authenticator authenticator;
 
@@ -106,7 +104,7 @@ public class StoreMailboxManager<Id extends MailboxId> implements MailboxManager
 
     private final MailboxPathLocker locker;
 
-    private MessageSearchIndex<Id> index;
+    private MessageSearchIndex index;
 
     private MailboxSessionIdGenerator idGenerator;
 
@@ -120,7 +118,7 @@ public class StoreMailboxManager<Id extends MailboxId> implements MailboxManager
 
 
     @Inject
-    public StoreMailboxManager(MailboxSessionMapperFactory<Id> mailboxSessionMapperFactory, Authenticator authenticator, MailboxPathLocker locker, MailboxACLResolver aclResolver, GroupMembershipResolver groupMembershipResolver) {
+    public StoreMailboxManager(MailboxSessionMapperFactory mailboxSessionMapperFactory, Authenticator authenticator, MailboxPathLocker locker, MailboxACLResolver aclResolver, GroupMembershipResolver groupMembershipResolver) {
         this.authenticator = authenticator;
         this.locker = locker;
         this.mailboxSessionMapperFactory = mailboxSessionMapperFactory;
@@ -128,7 +126,7 @@ public class StoreMailboxManager<Id extends MailboxId> implements MailboxManager
         this.groupMembershipResolver = groupMembershipResolver;
     }
 
-    public StoreMailboxManager(MailboxSessionMapperFactory<Id> mailboxSessionMapperFactory, Authenticator authenticator, MailboxACLResolver aclResolver, GroupMembershipResolver groupMembershipResolver) {
+    public StoreMailboxManager(MailboxSessionMapperFactory mailboxSessionMapperFactory, Authenticator authenticator, MailboxACLResolver aclResolver, GroupMembershipResolver groupMembershipResolver) {
         this(mailboxSessionMapperFactory, authenticator, new JVMMailboxPathLocker(), aclResolver, groupMembershipResolver);
     }
 
@@ -169,10 +167,10 @@ public class StoreMailboxManager<Id extends MailboxId> implements MailboxManager
     @PostConstruct
     public void init() throws MailboxException {
         // The dispatcher need to have the delegating listener added
-        dispatcher = new MailboxEventDispatcher<Id>(getDelegationListener());
+        dispatcher = new MailboxEventDispatcher(getDelegationListener());
 
         if (index == null) {
-            index = new SimpleMessageSearchIndex<Id>(mailboxSessionMapperFactory);
+            index = new SimpleMessageSearchIndex(mailboxSessionMapperFactory);
         }
         if (index instanceof ListeningMessageSearchIndex) {
             this.addGlobalListener((MailboxListener) index, null);
@@ -221,7 +219,7 @@ public class StoreMailboxManager<Id extends MailboxId> implements MailboxManager
      *
      * @return index
      */
-    public MessageSearchIndex<Id> getMessageSearchIndex() {
+    public MessageSearchIndex getMessageSearchIndex() {
         return index;
     }
 
@@ -238,7 +236,7 @@ public class StoreMailboxManager<Id extends MailboxId> implements MailboxManager
      *
      * @return dispatcher
      */
-    public MailboxEventDispatcher<Id> getEventDispatcher() {
+    public MailboxEventDispatcher getEventDispatcher() {
         return dispatcher;
     }
 
@@ -247,7 +245,7 @@ public class StoreMailboxManager<Id extends MailboxId> implements MailboxManager
      *
      * @return mailboxSessionMapperFactory
      */
-    public MailboxSessionMapperFactory<Id> getMapperFactory() {
+    public MailboxSessionMapperFactory getMapperFactory() {
         return mailboxSessionMapperFactory;
     }
 
@@ -271,7 +269,7 @@ public class StoreMailboxManager<Id extends MailboxId> implements MailboxManager
      */
     public void setDelegatingMailboxListener(DelegatingMailboxListener delegatingListener) {
         this.delegatingListener = delegatingListener;
-        dispatcher = new MailboxEventDispatcher<Id>(getDelegationListener());
+        dispatcher = new MailboxEventDispatcher(getDelegationListener());
     }
 
     /**
@@ -280,7 +278,7 @@ public class StoreMailboxManager<Id extends MailboxId> implements MailboxManager
      *
      * @param index
      */
-    public void setMessageSearchIndex(MessageSearchIndex<Id> index) {
+    public void setMessageSearchIndex(MessageSearchIndex index) {
         this.index = index;
     }
 
@@ -360,8 +358,8 @@ public class StoreMailboxManager<Id extends MailboxId> implements MailboxManager
      * @param session
      * @return storeMailbox
      */
-    protected StoreMessageManager<Id> createMessageManager(Mailbox<Id> mailbox, MailboxSession session) throws MailboxException {
-        return new StoreMessageManager<Id>(getMapperFactory(), getMessageSearchIndex(), getEventDispatcher(), getLocker(), mailbox, getAclResolver(), getGroupMembershipResolver(), getQuotaManager(), getQuotaRootResolver());
+    protected StoreMessageManager createMessageManager(Mailbox mailbox, MailboxSession session) throws MailboxException {
+        return new StoreMessageManager(getMapperFactory(), getMessageSearchIndex(), getEventDispatcher(), getLocker(), mailbox, getAclResolver(), getGroupMembershipResolver(), getQuotaManager(), getQuotaRootResolver());
     }
 
     /**
@@ -373,15 +371,15 @@ public class StoreMailboxManager<Id extends MailboxId> implements MailboxManager
      * @param session
      * @throws MailboxException
      */
-    protected org.apache.james.mailbox.store.mail.model.Mailbox<Id> doCreateMailbox(MailboxPath mailboxPath, MailboxSession session) throws MailboxException {
-        return new SimpleMailbox<Id>(mailboxPath, randomUidValidity());
+    protected org.apache.james.mailbox.store.mail.model.Mailbox doCreateMailbox(MailboxPath mailboxPath, MailboxSession session) throws MailboxException {
+        return new SimpleMailbox(mailboxPath, randomUidValidity());
     }
 
     @Override
     public org.apache.james.mailbox.MessageManager getMailbox(MailboxPath mailboxPath, MailboxSession session)
             throws MailboxException {
-        final MailboxMapper<Id> mapper = mailboxSessionMapperFactory.getMailboxMapper(session);
-        Mailbox<Id> mailboxRow = mapper.findMailboxByPath(mailboxPath);
+        final MailboxMapper mapper = mailboxSessionMapperFactory.getMailboxMapper(session);
+        Mailbox mailboxRow = mapper.findMailboxByPath(mailboxPath);
 
         if (mailboxRow == null) {
             session.getLog().info("Mailbox '" + mailboxPath + "' not found.");
@@ -390,7 +388,7 @@ public class StoreMailboxManager<Id extends MailboxId> implements MailboxManager
         } else {
             session.getLog().debug("Loaded mailbox " + mailboxPath);
 
-            StoreMessageManager<Id> m = createMessageManager(mailboxRow, session);
+            StoreMessageManager m = createMessageManager(mailboxRow, session);
             m.setFetchBatchSize(fetchBatchSize);
             return m;
         }
@@ -417,8 +415,8 @@ public class StoreMailboxManager<Id extends MailboxId> implements MailboxManager
 
                     public Void execute() throws MailboxException {
                         if (!mailboxExists(mailbox, mailboxSession)) {
-                            final org.apache.james.mailbox.store.mail.model.Mailbox<Id> m = doCreateMailbox(mailbox, mailboxSession);
-                            final MailboxMapper<Id> mapper = mailboxSessionMapperFactory.getMailboxMapper(mailboxSession);
+                            final org.apache.james.mailbox.store.mail.model.Mailbox m = doCreateMailbox(mailbox, mailboxSession);
+                            final MailboxMapper mapper = mailboxSessionMapperFactory.getMailboxMapper(mailboxSession);
                             mapper.execute(new TransactionalMapper.VoidTransaction() {
 
                                 public void runVoid() throws MailboxException {
@@ -441,19 +439,19 @@ public class StoreMailboxManager<Id extends MailboxId> implements MailboxManager
     @Override
     public void deleteMailbox(final MailboxPath mailboxPath, MailboxSession session) throws MailboxException {
         session.getLog().info("deleteMailbox " + mailboxPath);
-        final MailboxMapper<Id> mapper = mailboxSessionMapperFactory.getMailboxMapper(session);
+        final MailboxMapper mapper = mailboxSessionMapperFactory.getMailboxMapper(session);
 
-        Mailbox<Id> mailbox = mapper.execute(new Mapper.Transaction<Mailbox<Id>>() {
+        Mailbox mailbox = mapper.execute(new Mapper.Transaction<Mailbox>() {
 
-            public Mailbox<Id> run() throws MailboxException {
-                final Mailbox<Id> mailbox = mapper.findMailboxByPath(mailboxPath);
+            public Mailbox run() throws MailboxException {
+                final Mailbox mailbox = mapper.findMailboxByPath(mailboxPath);
                 if (mailbox == null) {
                     throw new MailboxNotFoundException("Mailbox not found");
                 }
 
                 // We need to create a copy of the mailbox as maybe we can not refer to the real
                 // mailbox once we remove it 
-                SimpleMailbox<Id> m = new SimpleMailbox<Id>(mailbox);
+                SimpleMailbox m = new SimpleMailbox(mailbox);
                 mapper.delete(mailbox);
                 return m;
             }
@@ -473,12 +471,12 @@ public class StoreMailboxManager<Id extends MailboxId> implements MailboxManager
             throw new MailboxExistsException(to.toString());
         }
 
-        final MailboxMapper<Id> mapper = mailboxSessionMapperFactory.getMailboxMapper(session);
+        final MailboxMapper mapper = mailboxSessionMapperFactory.getMailboxMapper(session);
         mapper.execute(new Mapper.VoidTransaction() {
 
             public void runVoid() throws MailboxException {
                 // TODO put this into a serilizable transaction
-                final Mailbox<Id> mailbox = mapper.findMailboxByPath(from);
+                final Mailbox mailbox = mapper.findMailboxByPath(from);
                 if (mailbox == null) {
                     throw new MailboxNotFoundException(from);
                 }
@@ -494,8 +492,8 @@ public class StoreMailboxManager<Id extends MailboxId> implements MailboxManager
                 locker.executeWithLock(session, children, new LockAwareExecution<Void>() {
 
                     public Void execute() throws MailboxException {
-                        final List<Mailbox<Id>> subMailboxes = mapper.findMailboxWithPathLike(children);
-                        for (Mailbox<Id> sub : subMailboxes) {
+                        final List<Mailbox> subMailboxes = mapper.findMailboxWithPathLike(children);
+                        for (Mailbox sub : subMailboxes) {
                             final String subOriginalName = sub.getName();
                             final String subNewName = to.getName() + subOriginalName.substring(from.getName().length());
                             final MailboxPath fromPath = new MailboxPath(children, subOriginalName);
@@ -516,10 +514,9 @@ public class StoreMailboxManager<Id extends MailboxId> implements MailboxManager
 
 
     @Override
-    @SuppressWarnings("unchecked")
     public List<MessageRange> copyMessages(MessageRange set, MailboxPath from, MailboxPath to, final MailboxSession session) throws MailboxException {
-        final StoreMessageManager<Id> toMailbox = (StoreMessageManager<Id>) getMailbox(to, session);
-        final StoreMessageManager<Id> fromMailbox = (StoreMessageManager<Id>) getMailbox(from, session);
+        final StoreMessageManager toMailbox = (StoreMessageManager) getMailbox(to, session);
+        final StoreMessageManager fromMailbox = (StoreMessageManager) getMailbox(from, session);
 
         return copyBatcher.batchMessages(set, new MessageBatcher.BatchedOperation() {
             public List<MessageRange> execute(MessageRange messageRange) throws MailboxException {
@@ -529,10 +526,9 @@ public class StoreMailboxManager<Id extends MailboxId> implements MailboxManager
     }
 
     @Override
-    @SuppressWarnings("unchecked")
     public List<MessageRange> moveMessages(MessageRange set, MailboxPath from, MailboxPath to, final MailboxSession session) throws MailboxException {
-        final StoreMessageManager<Id> toMailbox = (StoreMessageManager<Id>) getMailbox(to, session);
-        final StoreMessageManager<Id> fromMailbox = (StoreMessageManager<Id>) getMailbox(from, session);
+        final StoreMessageManager toMailbox = (StoreMessageManager) getMailbox(to, session);
+        final StoreMessageManager fromMailbox = (StoreMessageManager) getMailbox(from, session);
 
         return moveBatcher.batchMessages(set, new MessageBatcher.BatchedOperation() {
             public List<MessageRange> execute(MessageRange messageRange) throws MailboxException {
@@ -558,10 +554,10 @@ public class StoreMailboxManager<Id extends MailboxId> implements MailboxManager
                 .replace(localWildcard, SQL_WILDCARD_CHAR);
         final MailboxPath search = new MailboxPath(mailboxExpression.getBase(), combinedName);
 
-        final MailboxMapper<Id> mapper = mailboxSessionMapperFactory.getMailboxMapper(session);
-        final List<Mailbox<Id>> mailboxes = mapper.findMailboxWithPathLike(search);
+        final MailboxMapper mapper = mailboxSessionMapperFactory.getMailboxMapper(session);
+        final List<Mailbox> mailboxes = mapper.findMailboxWithPathLike(search);
         final List<MailboxMetaData> results = new ArrayList<MailboxMetaData>(mailboxes.size());
-        for (Mailbox<Id> mailbox : mailboxes) {
+        for (Mailbox mailbox : mailboxes) {
             final String name = mailbox.getName();
             if(belongsToNamespaceAndUser(mailboxExpression.getBase(), mailbox)) {
                 if (name.startsWith(baseName)) {
@@ -583,7 +579,7 @@ public class StoreMailboxManager<Id extends MailboxId> implements MailboxManager
         return results;
     }
 
-    public boolean belongsToNamespaceAndUser(MailboxPath base, Mailbox<Id> mailbox) {
+    public boolean belongsToNamespaceAndUser(MailboxPath base, Mailbox mailbox) {
         if (mailbox.getUser() == null) {
             return  base.getUser() == null
                 && mailbox.getNamespace().equals(base.getNamespace());
@@ -595,7 +591,7 @@ public class StoreMailboxManager<Id extends MailboxId> implements MailboxManager
     @Override
     public boolean mailboxExists(MailboxPath mailboxPath, MailboxSession session) throws MailboxException {
         try {
-            final MailboxMapper<Id> mapper = mailboxSessionMapperFactory.getMailboxMapper(session);
+            final MailboxMapper mapper = mailboxSessionMapperFactory.getMailboxMapper(session);
             mapper.findMailboxByPath(mailboxPath);
             return true;
         } catch (MailboxNotFoundException e) {
@@ -630,8 +626,8 @@ public class StoreMailboxManager<Id extends MailboxId> implements MailboxManager
     @Override
     public List<MailboxPath> list(MailboxSession session) throws MailboxException {
         List<MailboxPath> mList = new ArrayList<MailboxPath>();
-        List<Mailbox<Id>> mailboxes = mailboxSessionMapperFactory.getMailboxMapper(session).list();
-        for (Mailbox<Id> m : mailboxes) {
+        List<Mailbox> mailboxes = mailboxSessionMapperFactory.getMailboxMapper(session).list();
+        for (Mailbox m : mailboxes) {
             mList.add(new MailboxPath(m.getNamespace(), m.getUser(), m.getName()));
         }
         return Collections.unmodifiableList(mList);
@@ -656,8 +652,8 @@ public class StoreMailboxManager<Id extends MailboxId> implements MailboxManager
 
     @Override
     public boolean hasRight(MailboxPath mailboxPath, MailboxACL.MailboxACLRight right, MailboxSession session) throws MailboxException {
-        MailboxMapper<Id> mapper = mailboxSessionMapperFactory.getMailboxMapper(session);
-        Mailbox<Id> mailbox = mapper.findMailboxByPath(mailboxPath);
+        MailboxMapper mapper = mailboxSessionMapperFactory.getMailboxMapper(session);
+        Mailbox mailbox = mapper.findMailboxByPath(mailboxPath);
         MailboxSession.User user = session.getUser();
         String userName = user != null ? user.getUserName() : null;
         return aclResolver.hasRight(userName, groupMembershipResolver, right, mailbox.getACL(), mailbox.getUser(), new GroupFolderResolver(session).isGroupFolder(mailbox));
@@ -665,8 +661,8 @@ public class StoreMailboxManager<Id extends MailboxId> implements MailboxManager
 
     @Override
     public MailboxACL.MailboxACLRights myRights(MailboxPath mailboxPath, MailboxSession session) throws MailboxException {
-        MailboxMapper<Id> mapper = mailboxSessionMapperFactory.getMailboxMapper(session);
-        Mailbox<Id> mailbox = mapper.findMailboxByPath(mailboxPath);
+        MailboxMapper mapper = mailboxSessionMapperFactory.getMailboxMapper(session);
+        Mailbox mailbox = mapper.findMailboxByPath(mailboxPath);
         MailboxSession.User user = session.getUser();
         if (user != null) {
             return aclResolver.resolveRights(user.getUserName(), groupMembershipResolver, mailbox.getACL(), mailbox.getUser(), new GroupFolderResolver(session).isGroupFolder(mailbox));
@@ -676,15 +672,15 @@ public class StoreMailboxManager<Id extends MailboxId> implements MailboxManager
     }
 
     public MailboxACL.MailboxACLRights[] listRigths(MailboxPath mailboxPath, MailboxACL.MailboxACLEntryKey key, MailboxSession session) throws MailboxException {
-        final MailboxMapper<Id> mapper = mailboxSessionMapperFactory.getMailboxMapper(session);
-        Mailbox<Id> mailbox = mapper.findMailboxByPath(mailboxPath);
+        final MailboxMapper mapper = mailboxSessionMapperFactory.getMailboxMapper(session);
+        Mailbox mailbox = mapper.findMailboxByPath(mailboxPath);
         return aclResolver.listRights(key, groupMembershipResolver, mailbox.getUser(), new GroupFolderResolver(session).isGroupFolder(mailbox));
     }
 
     @Override
     public void setRights(MailboxPath mailboxPath, final MailboxACL.MailboxACLCommand mailboxACLCommand, MailboxSession session) throws MailboxException {
-        final MailboxMapper<Id> mapper = mailboxSessionMapperFactory.getMailboxMapper(session);
-        final Mailbox<Id> mailbox = mapper.findMailboxByPath(mailboxPath);
+        final MailboxMapper mapper = mailboxSessionMapperFactory.getMailboxMapper(session);
+        final Mailbox mailbox = mapper.findMailboxByPath(mailboxPath);
         mapper.execute(
             new Mapper.VoidTransaction() {
                 @Override

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/store/src/main/java/org/apache/james/mailbox/store/StoreMailboxPath.java
----------------------------------------------------------------------
diff --git a/mailbox/store/src/main/java/org/apache/james/mailbox/store/StoreMailboxPath.java b/mailbox/store/src/main/java/org/apache/james/mailbox/store/StoreMailboxPath.java
index 78a9525..2e905c2 100644
--- a/mailbox/store/src/main/java/org/apache/james/mailbox/store/StoreMailboxPath.java
+++ b/mailbox/store/src/main/java/org/apache/james/mailbox/store/StoreMailboxPath.java
@@ -20,10 +20,9 @@
 package org.apache.james.mailbox.store;
 
 import org.apache.james.mailbox.model.MailboxPath;
-import org.apache.james.mailbox.store.mail.model.MailboxId;
 import org.apache.james.mailbox.store.mail.model.Mailbox;
 
-public class StoreMailboxPath<Id extends MailboxId> extends MailboxPath {
+public class StoreMailboxPath extends MailboxPath {
 
     public StoreMailboxPath(String namespace, String user, String name) {
         super(namespace, user, name);
@@ -37,7 +36,7 @@ public class StoreMailboxPath<Id extends MailboxId> extends MailboxPath {
         super(mailboxPath, name);
     }
     
-    public StoreMailboxPath(Mailbox<Id> mailbox) {
+    public StoreMailboxPath(Mailbox mailbox) {
         super(mailbox.getNamespace(), mailbox.getUser(), mailbox.getName());
     }
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/store/src/main/java/org/apache/james/mailbox/store/StoreMessageManager.java
----------------------------------------------------------------------
diff --git a/mailbox/store/src/main/java/org/apache/james/mailbox/store/StoreMessageManager.java b/mailbox/store/src/main/java/org/apache/james/mailbox/store/StoreMessageManager.java
index 75ecafb..6a8d300 100644
--- a/mailbox/store/src/main/java/org/apache/james/mailbox/store/StoreMessageManager.java
+++ b/mailbox/store/src/main/java/org/apache/james/mailbox/store/StoreMessageManager.java
@@ -65,7 +65,6 @@ import org.apache.james.mailbox.store.mail.MessageMapper;
 import org.apache.james.mailbox.store.mail.MessageMapper.FetchType;
 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.mailbox.store.mail.model.impl.PropertyBuilder;
 import org.apache.james.mailbox.store.mail.model.impl.SimpleMailboxMessage;
@@ -94,7 +93,7 @@ import org.apache.james.mime4j.stream.RecursionMode;
  * 
  * 
  */
-public class StoreMessageManager<Id extends MailboxId> implements org.apache.james.mailbox.MessageManager {
+public class StoreMessageManager implements org.apache.james.mailbox.MessageManager {
 
     /**
      * The minimal Permanent flags the {@link MessageManager} must support. <br>
@@ -112,13 +111,13 @@ public class StoreMessageManager<Id extends MailboxId> implements org.apache.jam
         MINIMAL_PERMANET_FLAGS.add(Flags.Flag.SEEN);
     }
 
-    private final Mailbox<Id> mailbox;
+    private final Mailbox mailbox;
 
-    private final MailboxEventDispatcher<Id> dispatcher;
+    private final MailboxEventDispatcher dispatcher;
 
-    private final MessageMapperFactory<Id> mapperFactory;
+    private final MessageMapperFactory mapperFactory;
 
-    private final MessageSearchIndex<Id> index;
+    private final MessageSearchIndex index;
 
     private final MailboxACLResolver aclResolver;
 
@@ -132,7 +131,7 @@ public class StoreMessageManager<Id extends MailboxId> implements org.apache.jam
 
     private int fetchBatchSize;
 
-    public StoreMessageManager(MessageMapperFactory<Id> mapperFactory, MessageSearchIndex<Id> index, MailboxEventDispatcher<Id> dispatcher, MailboxPathLocker locker, Mailbox<Id> mailbox, MailboxACLResolver aclResolver,
+    public StoreMessageManager(MessageMapperFactory mapperFactory, MessageSearchIndex index, MailboxEventDispatcher dispatcher, MailboxPathLocker locker, Mailbox mailbox, MailboxACLResolver aclResolver,
             final GroupMembershipResolver groupMembershipResolver, QuotaManager quotaManager, QuotaRootResolver quotaRootResolver) throws MailboxException {
         this.mailbox = mailbox;
         this.dispatcher = dispatcher;
@@ -163,7 +162,7 @@ public class StoreMessageManager<Id extends MailboxId> implements org.apache.jam
      * 
      * @return dispatcher
      */
-    protected MailboxEventDispatcher<Id> getDispatcher() {
+    protected MailboxEventDispatcher getDispatcher() {
         return dispatcher;
     }
 
@@ -174,7 +173,7 @@ public class StoreMessageManager<Id extends MailboxId> implements org.apache.jam
      * @throws MailboxException
      */
 
-    public Mailbox<Id> getMailboxEntity() throws MailboxException {
+    public Mailbox getMailboxEntity() throws MailboxException {
         return mailbox;
     }
 
@@ -236,7 +235,7 @@ public class StoreMessageManager<Id extends MailboxId> implements org.apache.jam
      */
     public Iterator<Long> expunge(MessageRange set, MailboxSession mailboxSession) throws MailboxException {
         if (!isWriteable(mailboxSession)) {
-            throw new ReadOnlyException(new StoreMailboxPath<Id>(getMailboxEntity()), mailboxSession.getPathDelimiter());
+            throw new ReadOnlyException(new StoreMailboxPath(getMailboxEntity()), mailboxSession.getPathDelimiter());
         }
         Map<Long, MessageMetaData> uids = deleteMarkedInMailbox(set, mailboxSession);
 
@@ -258,7 +257,7 @@ public class StoreMessageManager<Id extends MailboxId> implements org.apache.jam
         SharedFileInputStream contentIn = null;
 
         if (!isWriteable(mailboxSession)) {
-            throw new ReadOnlyException(new StoreMailboxPath<Id>(getMailboxEntity()), mailboxSession.getPathDelimiter());
+            throw new ReadOnlyException(new StoreMailboxPath(getMailboxEntity()), mailboxSession.getPathDelimiter());
         }
 
         try {
@@ -371,11 +370,11 @@ public class StoreMessageManager<Id extends MailboxId> implements org.apache.jam
             contentIn = new SharedFileInputStream(file);
             final int size = (int) file.length();
 
-            final MailboxMessage<Id> message = createMessage(internalDate, size, bodyStartOctet, contentIn, flags, propertyBuilder);
+            final MailboxMessage message = createMessage(internalDate, size, bodyStartOctet, contentIn, flags, propertyBuilder);
 
-            new QuotaChecker<Id>(quotaManager, quotaRootResolver, mailbox).tryAddition(1, size);
+            new QuotaChecker(quotaManager, quotaRootResolver, mailbox).tryAddition(1, size);
 
-            return locker.executeWithLock(mailboxSession, new StoreMailboxPath<Id>(getMailboxEntity()), new MailboxPathLocker.LockAwareExecution<Long>() {
+            return locker.executeWithLock(mailboxSession, new StoreMailboxPath(getMailboxEntity()), new MailboxPathLocker.LockAwareExecution<Long>() {
 
                 @Override
                 public Long execute() throws MailboxException {
@@ -421,8 +420,8 @@ public class StoreMessageManager<Id extends MailboxId> implements org.apache.jam
      * @return membership
      * @throws MailboxException
      */
-    protected MailboxMessage<Id> createMessage(Date internalDate, int size, int bodyStartOctet, SharedInputStream content, Flags flags, PropertyBuilder propertyBuilder) throws MailboxException {
-        return new SimpleMailboxMessage<Id>(internalDate, size, bodyStartOctet, content, flags, propertyBuilder, getMailboxEntity().getMailboxId());
+    protected MailboxMessage createMessage(Date internalDate, int size, int bodyStartOctet, SharedInputStream content, Flags flags, PropertyBuilder propertyBuilder) throws MailboxException {
+        return new SimpleMailboxMessage(internalDate, size, bodyStartOctet, content, flags, propertyBuilder, getMailboxEntity().getMailboxId());
     }
 
     /**
@@ -528,13 +527,13 @@ public class StoreMessageManager<Id extends MailboxId> implements org.apache.jam
     public Map<Long, Flags> setFlags(final Flags flags, final FlagsUpdateMode flagsUpdateMode, final MessageRange set, MailboxSession mailboxSession) throws MailboxException {
 
         if (!isWriteable(mailboxSession)) {
-            throw new ReadOnlyException(new StoreMailboxPath<Id>(getMailboxEntity()), mailboxSession.getPathDelimiter());
+            throw new ReadOnlyException(new StoreMailboxPath(getMailboxEntity()), mailboxSession.getPathDelimiter());
         }
         final SortedMap<Long, Flags> newFlagsByUid = new TreeMap<Long, Flags>();
 
         trimFlags(flags, mailboxSession);
 
-        final MessageMapper<Id> messageMapper = mapperFactory.getMessageMapper(mailboxSession);
+        final MessageMapper messageMapper = mapperFactory.getMessageMapper(mailboxSession);
 
         Iterator<UpdatedFlags> it = messageMapper.execute(new Mapper.Transaction<Iterator<UpdatedFlags>>() {
 
@@ -564,12 +563,12 @@ public class StoreMessageManager<Id extends MailboxId> implements org.apache.jam
      * @param session
      * @throws MailboxException
      */
-    public List<MessageRange> copyTo(final MessageRange set, final StoreMessageManager<Id> toMailbox, final MailboxSession session) throws MailboxException {
+    public List<MessageRange> copyTo(final MessageRange set, final StoreMessageManager toMailbox, final MailboxSession session) throws MailboxException {
         if (!toMailbox.isWriteable(session)) {
-            throw new ReadOnlyException(new StoreMailboxPath<Id>(toMailbox.getMailboxEntity()), session.getPathDelimiter());
+            throw new ReadOnlyException(new StoreMailboxPath(toMailbox.getMailboxEntity()), session.getPathDelimiter());
         }
 
-        return locker.executeWithLock(session, new StoreMailboxPath<Id>(toMailbox.getMailboxEntity()), new MailboxPathLocker.LockAwareExecution<List<MessageRange>>() {
+        return locker.executeWithLock(session, new StoreMailboxPath(toMailbox.getMailboxEntity()), new MailboxPathLocker.LockAwareExecution<List<MessageRange>>() {
 
             @Override
             public List<MessageRange> execute() throws MailboxException {
@@ -588,16 +587,16 @@ public class StoreMessageManager<Id extends MailboxId> implements org.apache.jam
      * @param session
      * @throws MailboxException
      */
-    public List<MessageRange> moveTo(final MessageRange set, final StoreMessageManager<Id> toMailbox, final MailboxSession session) throws MailboxException {
+    public List<MessageRange> moveTo(final MessageRange set, final StoreMessageManager toMailbox, final MailboxSession session) throws MailboxException {
         if (!isWriteable(session)) {
-            throw new ReadOnlyException(new StoreMailboxPath<Id>(getMailboxEntity()), session.getPathDelimiter());
+            throw new ReadOnlyException(new StoreMailboxPath(getMailboxEntity()), session.getPathDelimiter());
         }
         if (!toMailbox.isWriteable(session)) {
-            throw new ReadOnlyException(new StoreMailboxPath<Id>(toMailbox.getMailboxEntity()), session.getPathDelimiter());
+            throw new ReadOnlyException(new StoreMailboxPath(toMailbox.getMailboxEntity()), session.getPathDelimiter());
         }
 
         //TODO lock the from mailbox too, in a non-deadlocking manner - how?
-        return locker.executeWithLock(session, new StoreMailboxPath<Id>(toMailbox.getMailboxEntity()), new MailboxPathLocker.LockAwareExecution<List<MessageRange>>() {
+        return locker.executeWithLock(session, new StoreMailboxPath(toMailbox.getMailboxEntity()), new MailboxPathLocker.LockAwareExecution<List<MessageRange>>() {
 
             @Override
             public List<MessageRange> execute() throws MailboxException {
@@ -608,8 +607,8 @@ public class StoreMessageManager<Id extends MailboxId> implements org.apache.jam
         }, true);
     }
 
-    protected MessageMetaData appendMessageToStore(final MailboxMessage<Id> message, MailboxSession session) throws MailboxException {
-        final MessageMapper<Id> mapper = mapperFactory.getMessageMapper(session);
+    protected MessageMetaData appendMessageToStore(final MailboxMessage message, MailboxSession session) throws MailboxException {
+        final MessageMapper mapper = mapperFactory.getMessageMapper(session);
         return mapperFactory.getMessageMapper(session).execute(new Mapper.Transaction<MessageMetaData>() {
 
             public MessageMetaData run() throws MailboxException {
@@ -632,8 +631,8 @@ public class StoreMessageManager<Id extends MailboxId> implements org.apache.jam
      *      org.apache.james.mailbox.MailboxSession)
      */
     public MessageResultIterator getMessages(MessageRange set, FetchGroup fetchGroup, MailboxSession mailboxSession) throws MailboxException {
-        final MessageMapper<Id> messageMapper = mapperFactory.getMessageMapper(mailboxSession);
-        return new StoreMessageResultIterator<Id>(messageMapper, mailbox, set, fetchBatchSize, fetchGroup);
+        final MessageMapper messageMapper = mapperFactory.getMessageMapper(mailboxSession);
+        return new StoreMessageResultIterator(messageMapper, mailbox, set, fetchBatchSize, fetchGroup);
     }
 
     /**
@@ -648,10 +647,10 @@ public class StoreMessageManager<Id extends MailboxId> implements org.apache.jam
     protected List<Long> recent(final boolean reset, MailboxSession mailboxSession) throws MailboxException {
         if (reset) {
             if (!isWriteable(mailboxSession)) {
-                throw new ReadOnlyException(new StoreMailboxPath<Id>(getMailboxEntity()), mailboxSession.getPathDelimiter());
+                throw new ReadOnlyException(new StoreMailboxPath(getMailboxEntity()), mailboxSession.getPathDelimiter());
             }
         }
-        final MessageMapper<Id> messageMapper = mapperFactory.getMessageMapper(mailboxSession);
+        final MessageMapper messageMapper = mapperFactory.getMessageMapper(mailboxSession);
 
         return messageMapper.execute(new Mapper.Transaction<List<Long>>() {
 
@@ -676,7 +675,7 @@ public class StoreMessageManager<Id extends MailboxId> implements org.apache.jam
 
     protected Map<Long, MessageMetaData> deleteMarkedInMailbox(final MessageRange range, MailboxSession session) throws MailboxException {
 
-        final MessageMapper<Id> messageMapper = mapperFactory.getMessageMapper(session);
+        final MessageMapper messageMapper = mapperFactory.getMessageMapper(session);
 
         return messageMapper.execute(new Mapper.Transaction<Map<Long, MessageMetaData>>() {
 
@@ -695,13 +694,13 @@ public class StoreMessageManager<Id extends MailboxId> implements org.apache.jam
         return index.search(mailboxSession, getMailboxEntity(), query);
     }
 
-    private Iterator<MessageMetaData> copy(Iterator<MailboxMessage<Id>> originalRows, MailboxSession session) throws MailboxException {
+    private Iterator<MessageMetaData> copy(Iterator<MailboxMessage> originalRows, MailboxSession session) throws MailboxException {
         final List<MessageMetaData> copiedRows = new ArrayList<MessageMetaData>();
-        final MessageMapper<Id> messageMapper = mapperFactory.getMessageMapper(session);
-        QuotaChecker<Id> quotaChecker = new QuotaChecker<Id>(quotaManager, quotaRootResolver, mailbox);
+        final MessageMapper messageMapper = mapperFactory.getMessageMapper(session);
+        QuotaChecker quotaChecker = new QuotaChecker(quotaManager, quotaRootResolver, mailbox);
 
         while (originalRows.hasNext()) {
-            final MailboxMessage<Id> originalMessage = originalRows.next();
+            final MailboxMessage originalMessage = originalRows.next();
             quotaChecker.tryAddition(1, originalMessage.getFullContentOctets());
             MessageMetaData data = messageMapper.execute(new Mapper.Transaction<MessageMetaData>() {
                 public MessageMetaData run() throws MailboxException {
@@ -715,13 +714,13 @@ public class StoreMessageManager<Id extends MailboxId> implements org.apache.jam
         return copiedRows.iterator();
     }
 
-    private MoveResult move(Iterator<MailboxMessage<Id>> originalRows, MailboxSession session) throws MailboxException {
+    private MoveResult move(Iterator<MailboxMessage> originalRows, MailboxSession session) throws MailboxException {
         final List<MessageMetaData> movedRows = new ArrayList<MessageMetaData>();
         final List<MessageMetaData> originalRowsCopy = new ArrayList<MessageMetaData>();
-        final MessageMapper<Id> messageMapper = mapperFactory.getMessageMapper(session);
+        final MessageMapper messageMapper = mapperFactory.getMessageMapper(session);
 
         while (originalRows.hasNext()) {
-            final MailboxMessage<Id> originalMessage = originalRows.next();
+            final MailboxMessage originalMessage = originalRows.next();
             originalRowsCopy.add(new SimpleMessageMetaData(originalMessage));
             MessageMetaData data = messageMapper.execute(new Mapper.Transaction<MessageMetaData>() {
                 public MessageMetaData run() throws MailboxException {
@@ -735,20 +734,20 @@ public class StoreMessageManager<Id extends MailboxId> implements org.apache.jam
 	}
 
 
-    private SortedMap<Long, MessageMetaData> copy(MessageRange set, StoreMessageManager<Id> to, MailboxSession session) throws MailboxException {
-        Iterator<MailboxMessage<Id>> originalRows = retrieveOriginalRows(set, session);
+    private SortedMap<Long, MessageMetaData> copy(MessageRange set, StoreMessageManager to, MailboxSession session) throws MailboxException {
+        Iterator<MailboxMessage> originalRows = retrieveOriginalRows(set, session);
         return collectMetadata(to.copy(originalRows, session));
     }
 
-    private SortedMap<Long, MessageMetaData> move(MessageRange set, StoreMessageManager<Id> to, MailboxSession session) throws MailboxException {
-        Iterator<MailboxMessage<Id>> originalRows = retrieveOriginalRows(set, session);
+    private SortedMap<Long, MessageMetaData> move(MessageRange set, StoreMessageManager to, MailboxSession session) throws MailboxException {
+        Iterator<MailboxMessage> originalRows = retrieveOriginalRows(set, session);
         MoveResult moveResult = to.move(originalRows, session);
         dispatcher.expunged(session, collectMetadata(moveResult.getOriginalMessages()), getMailboxEntity());
         return collectMetadata(moveResult.getMovedMessages());
     }
 
-    private Iterator<MailboxMessage<Id>> retrieveOriginalRows(MessageRange set, MailboxSession session) throws MailboxException {
-        MessageMapper<Id> messageMapper = mapperFactory.getMessageMapper(session);
+    private Iterator<MailboxMessage> retrieveOriginalRows(MessageRange set, MailboxSession session) throws MailboxException {
+        MessageMapper messageMapper = mapperFactory.getMessageMapper(session);
         return messageMapper.findInMailbox(mailbox, set, FetchType.Full, -1);
     }
 
@@ -768,7 +767,7 @@ public class StoreMessageManager<Id extends MailboxId> implements org.apache.jam
      * @throws MailboxException
      */
     protected long countUnseenMessagesInMailbox(MailboxSession session) throws MailboxException {
-        MessageMapper<Id> messageMapper = mapperFactory.getMessageMapper(session);
+        MessageMapper messageMapper = mapperFactory.getMessageMapper(session);
         return messageMapper.countUnseenMessagesInMailbox(getMailboxEntity());
     }
 
@@ -780,7 +779,7 @@ public class StoreMessageManager<Id extends MailboxId> implements org.apache.jam
      * @throws MailboxException
      */
     protected Long findFirstUnseenMessageUid(MailboxSession session) throws MailboxException {
-        MessageMapper<Id> messageMapper = mapperFactory.getMessageMapper(session);
+        MessageMapper messageMapper = mapperFactory.getMessageMapper(session);
         return messageMapper.findFirstUnseenMessageUid(getMailboxEntity());
     }
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/store/src/main/java/org/apache/james/mailbox/store/StoreMessageResultIterator.java
----------------------------------------------------------------------
diff --git a/mailbox/store/src/main/java/org/apache/james/mailbox/store/StoreMessageResultIterator.java b/mailbox/store/src/main/java/org/apache/james/mailbox/store/StoreMessageResultIterator.java
index 6741352..b32062e 100644
--- a/mailbox/store/src/main/java/org/apache/james/mailbox/store/StoreMessageResultIterator.java
+++ b/mailbox/store/src/main/java/org/apache/james/mailbox/store/StoreMessageResultIterator.java
@@ -35,25 +35,24 @@ import org.apache.james.mailbox.model.MessageResultIterator;
 import org.apache.james.mailbox.model.MimeDescriptor;
 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.MailboxId;
 import org.apache.james.mailbox.store.mail.model.Mailbox;
 import org.apache.james.mailbox.store.mail.model.MailboxMessage;
 
-public class StoreMessageResultIterator<Id extends MailboxId> implements MessageResultIterator {
+public class StoreMessageResultIterator implements MessageResultIterator {
 
-    private Iterator<MailboxMessage<Id>> next = null;
+    private Iterator<MailboxMessage> next = null;
     private MailboxException exception;
-    private final Mailbox<Id> mailbox;
+    private final Mailbox mailbox;
     private final FetchGroup group;
     private final long from;
     private long cursor;
     private final long to;
     private final int batchSize;
     private final Type type;
-    private final MessageMapper<Id> mapper;
+    private final MessageMapper mapper;
     private final FetchType ftype;
 
-    public StoreMessageResultIterator(MessageMapper<Id> mapper, Mailbox<Id> mailbox, MessageRange range, int batchSize, org.apache.james.mailbox.model.MessageResult.FetchGroup group) {
+    public StoreMessageResultIterator(MessageMapper mapper, Mailbox mailbox, MessageRange range, int batchSize, org.apache.james.mailbox.model.MessageResult.FetchGroup group) {
         this.mailbox = mailbox;
         this.group = group;
         this.mapper = mapper;
@@ -157,13 +156,13 @@ public class StoreMessageResultIterator<Id extends MailboxId> implements Message
           throw new NoSuchElementException();
         }
         
-        final MailboxMessage<Id> message = next.next();
+        final MailboxMessage message = next.next();
         MessageResult result;
         try {
             result = ResultUtils.loadMessageResult(message, group);
             cursor = result.getUid();
         } catch (MailboxException e) {
-            result = new UnloadedMessageResult<Id>(message, e);
+            result = new UnloadedMessageResult(message, e);
         }
 
         cursor++;
@@ -180,7 +179,7 @@ public class StoreMessageResultIterator<Id extends MailboxId> implements Message
         return exception;
     }
 
-    private static final class UnloadedMessageResult<Id extends MailboxId> implements MessageResult {
+    private static final class UnloadedMessageResult implements MessageResult {
         private final MailboxException exception;
 
         private final Date internalDate;
@@ -193,7 +192,7 @@ public class StoreMessageResultIterator<Id extends MailboxId> implements Message
 
         private long modSeq = -1;
 
-        public UnloadedMessageResult(MailboxMessage<Id> message, MailboxException exception) {
+        public UnloadedMessageResult(MailboxMessage message, MailboxException exception) {
             super();
             internalDate = message.getInternalDate();
             size = message.getFullContentOctets();
@@ -251,8 +250,7 @@ public class StoreMessageResultIterator<Id extends MailboxId> implements Message
                 return true;
             }
             if (obj instanceof UnloadedMessageResult) {
-                @SuppressWarnings("unchecked")
-                UnloadedMessageResult<Id> that = (UnloadedMessageResult<Id>)obj;
+                UnloadedMessageResult that = (UnloadedMessageResult)obj;
                 return (size == that.size) && (uid == that.uid) && (modSeq == that.modSeq) && exception.equals(that.exception)
                         && internalDate.equals(that.internalDate) && flags.equals(that.flags);
             }

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/store/src/main/java/org/apache/james/mailbox/store/event/EventFactory.java
----------------------------------------------------------------------
diff --git a/mailbox/store/src/main/java/org/apache/james/mailbox/store/event/EventFactory.java b/mailbox/store/src/main/java/org/apache/james/mailbox/store/event/EventFactory.java
index f9425dd..deb6c1a 100644
--- a/mailbox/store/src/main/java/org/apache/james/mailbox/store/event/EventFactory.java
+++ b/mailbox/store/src/main/java/org/apache/james/mailbox/store/event/EventFactory.java
@@ -19,8 +19,10 @@
 
 package org.apache.james.mailbox.store.event;
 
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableMap;
+import java.util.List;
+import java.util.Map;
+import java.util.SortedMap;
+
 import org.apache.james.mailbox.MailboxListener;
 import org.apache.james.mailbox.MailboxSession;
 import org.apache.james.mailbox.model.MailboxPath;
@@ -28,24 +30,22 @@ import org.apache.james.mailbox.model.MessageMetaData;
 import org.apache.james.mailbox.model.UpdatedFlags;
 import org.apache.james.mailbox.store.StoreMailboxPath;
 import org.apache.james.mailbox.store.mail.model.Mailbox;
-import org.apache.james.mailbox.store.mail.model.MailboxId;
 
-import java.util.List;
-import java.util.Map;
-import java.util.SortedMap;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
 
-public class EventFactory<Id extends MailboxId> {
+public class EventFactory {
 
-    public interface MailboxAware<LocalId extends MailboxId> {
-        Mailbox<LocalId> getMailbox();
+    public interface MailboxAware {
+        Mailbox getMailbox();
     }
 
-    public final class AddedImpl<LocalId extends MailboxId> extends MailboxListener.Added implements MailboxAware<LocalId> {
+    public final class AddedImpl extends MailboxListener.Added implements MailboxAware {
         private final Map<Long, MessageMetaData> added;
-        private final Mailbox<LocalId> mailbox;
+        private final Mailbox mailbox;
 
-        public AddedImpl(MailboxSession session, Mailbox<LocalId> mailbox, SortedMap<Long, MessageMetaData> added) {
-            super(session, new StoreMailboxPath<LocalId>(mailbox));
+        public AddedImpl(MailboxSession session, Mailbox mailbox, SortedMap<Long, MessageMetaData> added) {
+            super(session, new StoreMailboxPath(mailbox));
             this.added = ImmutableMap.copyOf(added);
             this.mailbox = mailbox;
         }
@@ -58,17 +58,17 @@ public class EventFactory<Id extends MailboxId> {
             return added.get(uid);
         }
 
-        public Mailbox<LocalId> getMailbox() {
+        public Mailbox getMailbox() {
             return mailbox;
         }
     }
 
-    public final class ExpungedImpl<LocalId extends MailboxId> extends MailboxListener.Expunged implements MailboxAware<LocalId> {
+    public final class ExpungedImpl extends MailboxListener.Expunged implements MailboxAware {
         private final Map<Long, MessageMetaData> uids;
-        private final Mailbox<LocalId> mailbox;
+        private final Mailbox mailbox;
 
-        public ExpungedImpl(MailboxSession session, Mailbox<LocalId> mailbox,  Map<Long, MessageMetaData> uids) {
-            super(session,  new StoreMailboxPath<LocalId>(mailbox));
+        public ExpungedImpl(MailboxSession session, Mailbox mailbox,  Map<Long, MessageMetaData> uids) {
+            super(session,  new StoreMailboxPath(mailbox));
             this.uids = ImmutableMap.copyOf(uids);
             this.mailbox = mailbox;
         }
@@ -81,20 +81,20 @@ public class EventFactory<Id extends MailboxId> {
             return uids.get(uid);
         }
 
-        public Mailbox<LocalId> getMailbox() {
+        public Mailbox getMailbox() {
             return mailbox;
         }
     }
 
-    public final class FlagsUpdatedImpl<LocalId extends MailboxId> extends MailboxListener.FlagsUpdated implements MailboxAware<LocalId> {
+    public final class FlagsUpdatedImpl extends MailboxListener.FlagsUpdated implements MailboxAware {
         private final List<Long> uids;
 
-        private final Mailbox<LocalId> mailbox;
+        private final Mailbox mailbox;
 
         private final List<UpdatedFlags> uFlags;
 
-        public FlagsUpdatedImpl(MailboxSession session, Mailbox<LocalId> mailbox, List<Long> uids, List<UpdatedFlags> uFlags) {
-            super(session, new StoreMailboxPath<LocalId>(mailbox));
+        public FlagsUpdatedImpl(MailboxSession session, Mailbox mailbox, List<Long> uids, List<UpdatedFlags> uFlags) {
+            super(session, new StoreMailboxPath(mailbox));
             this.uids = ImmutableList.copyOf(uids);
             this.uFlags = ImmutableList.copyOf(uFlags);
             this.mailbox = mailbox;
@@ -108,51 +108,51 @@ public class EventFactory<Id extends MailboxId> {
             return uFlags;
         }
 
-        public Mailbox<LocalId> getMailbox() {
+        public Mailbox getMailbox() {
             return mailbox;
         }
 
     }
 
-    public final class MailboxDeletionImpl<LocalId extends MailboxId> extends MailboxListener.MailboxDeletion implements MailboxAware<LocalId> {
-        private final Mailbox<LocalId> mailbox;
+    public final class MailboxDeletionImpl extends MailboxListener.MailboxDeletion implements MailboxAware {
+        private final Mailbox mailbox;
 
-        public MailboxDeletionImpl(MailboxSession session, Mailbox<LocalId> mailbox) {
-            super(session, new StoreMailboxPath<LocalId>(mailbox));
+        public MailboxDeletionImpl(MailboxSession session, Mailbox mailbox) {
+            super(session, new StoreMailboxPath(mailbox));
             this.mailbox = mailbox;
         }
 
 
-        public Mailbox<LocalId> getMailbox() {
+        public Mailbox getMailbox() {
             return mailbox;
         }
 
     }
 
-    public final class MailboxAddedImpl<LocalId extends MailboxId> extends MailboxListener.MailboxAdded implements MailboxAware<LocalId> {
+    public final class MailboxAddedImpl extends MailboxListener.MailboxAdded implements MailboxAware {
 
-        private final Mailbox<LocalId> mailbox;
+        private final Mailbox mailbox;
 
-        public MailboxAddedImpl(MailboxSession session, Mailbox<LocalId> mailbox) {
-            super(session,  new StoreMailboxPath<LocalId>(mailbox));
+        public MailboxAddedImpl(MailboxSession session, Mailbox mailbox) {
+            super(session,  new StoreMailboxPath(mailbox));
             this.mailbox = mailbox;
         }
 
 
-        public Mailbox<LocalId> getMailbox() {
+        public Mailbox getMailbox() {
             return mailbox;
         }
 
     }
 
-    public final class MailboxRenamedEventImpl<LocalId extends MailboxId> extends MailboxListener.MailboxRenamed implements MailboxAware<LocalId> {
+    public final class MailboxRenamedEventImpl extends MailboxListener.MailboxRenamed implements MailboxAware {
 
         private final MailboxPath newPath;
-        private final Mailbox<LocalId> newMailbox;
+        private final Mailbox newMailbox;
 
-        public MailboxRenamedEventImpl(MailboxSession session, MailboxPath oldPath, Mailbox<LocalId> newMailbox) {
+        public MailboxRenamedEventImpl(MailboxSession session, MailboxPath oldPath, Mailbox newMailbox) {
             super(session, oldPath);
-            this.newPath = new StoreMailboxPath<LocalId>(newMailbox);
+            this.newPath = new StoreMailboxPath(newMailbox);
             this.newMailbox = newMailbox;
         }
 
@@ -161,33 +161,33 @@ public class EventFactory<Id extends MailboxId> {
         }
 
         @Override
-        public Mailbox<LocalId> getMailbox() {
+        public Mailbox getMailbox() {
             return newMailbox;
         }
     }
 
-    public MailboxListener.Added added(MailboxSession session, SortedMap<Long, MessageMetaData> uids, Mailbox<Id> mailbox) {
-        return new AddedImpl<Id>(session, mailbox, uids);
+    public MailboxListener.Added added(MailboxSession session, SortedMap<Long, MessageMetaData> uids, Mailbox mailbox) {
+        return new AddedImpl(session, mailbox, uids);
     }
 
-    public MailboxListener.Expunged expunged(MailboxSession session,  Map<Long, MessageMetaData> uids, Mailbox<Id> mailbox) {
-        return new ExpungedImpl<Id>(session, mailbox, uids);
+    public MailboxListener.Expunged expunged(MailboxSession session,  Map<Long, MessageMetaData> uids, Mailbox mailbox) {
+        return new ExpungedImpl(session, mailbox, uids);
     }
 
-    public MailboxListener.FlagsUpdated flagsUpdated(MailboxSession session, List<Long> uids, Mailbox<Id> mailbox, List<UpdatedFlags> uflags) {
-        return new FlagsUpdatedImpl<Id>(session, mailbox, uids, uflags);
+    public MailboxListener.FlagsUpdated flagsUpdated(MailboxSession session, List<Long> uids, Mailbox mailbox, List<UpdatedFlags> uflags) {
+        return new FlagsUpdatedImpl(session, mailbox, uids, uflags);
     }
 
-    public MailboxListener.MailboxRenamed mailboxRenamed(MailboxSession session, MailboxPath from, Mailbox<Id> to) {
-        return new MailboxRenamedEventImpl<Id>(session, from, to);
+    public MailboxListener.MailboxRenamed mailboxRenamed(MailboxSession session, MailboxPath from, Mailbox to) {
+        return new MailboxRenamedEventImpl(session, from, to);
     }
 
-    public MailboxListener.MailboxDeletion mailboxDeleted(MailboxSession session, Mailbox<Id> mailbox) {
-        return new MailboxDeletionImpl<Id>(session, mailbox);
+    public MailboxListener.MailboxDeletion mailboxDeleted(MailboxSession session, Mailbox mailbox) {
+        return new MailboxDeletionImpl(session, mailbox);
     }
 
-    public MailboxListener.MailboxAdded mailboxAdded(MailboxSession session, Mailbox<Id> mailbox) {
-        return new MailboxAddedImpl<Id>(session, mailbox);
+    public MailboxListener.MailboxAdded mailboxAdded(MailboxSession session, Mailbox mailbox) {
+        return new MailboxAddedImpl(session, mailbox);
     }
 
 }

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/store/src/main/java/org/apache/james/mailbox/store/event/MailboxEventDispatcher.java
----------------------------------------------------------------------
diff --git a/mailbox/store/src/main/java/org/apache/james/mailbox/store/event/MailboxEventDispatcher.java b/mailbox/store/src/main/java/org/apache/james/mailbox/store/event/MailboxEventDispatcher.java
index d845d82..acf5ee1 100644
--- a/mailbox/store/src/main/java/org/apache/james/mailbox/store/event/MailboxEventDispatcher.java
+++ b/mailbox/store/src/main/java/org/apache/james/mailbox/store/event/MailboxEventDispatcher.java
@@ -28,20 +28,19 @@ import org.apache.james.mailbox.MailboxSession;
 import org.apache.james.mailbox.model.MailboxPath;
 import org.apache.james.mailbox.model.MessageMetaData;
 import org.apache.james.mailbox.model.UpdatedFlags;
-import org.apache.james.mailbox.store.mail.model.MailboxId;
 import org.apache.james.mailbox.store.mail.model.Mailbox;
 
 /**
  * Helper class to dispatch {@link org.apache.james.mailbox.MailboxListener.Event}'s to registerend MailboxListener
  */
-public class MailboxEventDispatcher<Id extends MailboxId> {
+public class MailboxEventDispatcher {
 
     private final MailboxListener listener;
-    private final EventFactory<Id> eventFactory;
+    private final EventFactory eventFactory;
 
     public MailboxEventDispatcher(MailboxListener listener) {
         this.listener = listener;
-        this.eventFactory = new EventFactory<Id>();
+        this.eventFactory = new EventFactory();
     }
 
     /**
@@ -52,7 +51,7 @@ public class MailboxEventDispatcher<Id extends MailboxId> {
      * @param uids Sorted map with uids and message meta data
      * @param mailbox The mailbox
      */
-    public void added(MailboxSession session, SortedMap<Long, MessageMetaData> uids, Mailbox<Id> mailbox) {
+    public void added(MailboxSession session, SortedMap<Long, MessageMetaData> uids, Mailbox mailbox) {
         listener.event(eventFactory.added(session, uids, mailbox));
     }
 
@@ -64,7 +63,7 @@ public class MailboxEventDispatcher<Id extends MailboxId> {
      * @param uids Sorted map with uids and message meta data
      * @param mailbox The mailbox
      */
-    public void expunged(MailboxSession session,  Map<Long, MessageMetaData> uids, Mailbox<Id> mailbox) {
+    public void expunged(MailboxSession session,  Map<Long, MessageMetaData> uids, Mailbox mailbox) {
         listener.event(eventFactory.expunged(session, uids, mailbox));
     }
 
@@ -72,7 +71,7 @@ public class MailboxEventDispatcher<Id extends MailboxId> {
      * Should get called when the message flags were update in a Mailbox. All
      * registered MailboxListener will get triggered then
      */
-    public void flagsUpdated(MailboxSession session, List<Long> uids, Mailbox<Id> mailbox, List<UpdatedFlags> uflags) {
+    public void flagsUpdated(MailboxSession session, List<Long> uids, Mailbox mailbox, List<UpdatedFlags> uflags) {
         listener.event(eventFactory.flagsUpdated(session, uids, mailbox, uflags));
     }
 
@@ -80,7 +79,7 @@ public class MailboxEventDispatcher<Id extends MailboxId> {
      * Should get called when a Mailbox was renamed. All registered
      * MailboxListener will get triggered then
      */
-    public void mailboxRenamed(MailboxSession session, MailboxPath from, Mailbox<Id> to) {
+    public void mailboxRenamed(MailboxSession session, MailboxPath from, Mailbox to) {
         listener.event(eventFactory.mailboxRenamed(session, from, to));
     }
 
@@ -88,7 +87,7 @@ public class MailboxEventDispatcher<Id extends MailboxId> {
      * Should get called when a Mailbox was deleted. All registered
      * MailboxListener will get triggered then
      */
-    public void mailboxDeleted(MailboxSession session, Mailbox<Id> mailbox) {
+    public void mailboxDeleted(MailboxSession session, Mailbox mailbox) {
         listener.event(eventFactory.mailboxDeleted(session, mailbox));
     }
 
@@ -96,7 +95,7 @@ public class MailboxEventDispatcher<Id extends MailboxId> {
      * Should get called when a Mailbox was added. All registered
      * MailboxListener will get triggered then
      */
-    public void mailboxAdded(MailboxSession session, Mailbox<Id> mailbox) {
+    public void mailboxAdded(MailboxSession session, Mailbox mailbox) {
         listener.event(eventFactory.mailboxAdded(session, mailbox));
     }
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/store/src/main/java/org/apache/james/mailbox/store/json/JacksonEventSerializer.java
----------------------------------------------------------------------
diff --git a/mailbox/store/src/main/java/org/apache/james/mailbox/store/json/JacksonEventSerializer.java b/mailbox/store/src/main/java/org/apache/james/mailbox/store/json/JacksonEventSerializer.java
index a5444d5..41b0c2a 100644
--- a/mailbox/store/src/main/java/org/apache/james/mailbox/store/json/JacksonEventSerializer.java
+++ b/mailbox/store/src/main/java/org/apache/james/mailbox/store/json/JacksonEventSerializer.java
@@ -19,19 +19,19 @@
 
 package org.apache.james.mailbox.store.json;
 
-import com.fasterxml.jackson.databind.ObjectMapper;
 import org.apache.james.mailbox.MailboxListener;
 import org.apache.james.mailbox.store.event.EventSerializer;
 import org.apache.james.mailbox.store.json.event.EventConverter;
 import org.apache.james.mailbox.store.json.event.dto.EventDataTransferObject;
-import org.apache.james.mailbox.store.mail.model.MailboxId;
 
-public class JacksonEventSerializer<Id extends MailboxId> implements EventSerializer {
+import com.fasterxml.jackson.databind.ObjectMapper;
+
+public class JacksonEventSerializer implements EventSerializer {
 
-    private final EventConverter<Id> eventConverter;
+    private final EventConverter eventConverter;
     private final ObjectMapper objectMapper;
 
-    public JacksonEventSerializer(EventConverter<Id> eventConverter, ObjectMapper objectMapper) {
+    public JacksonEventSerializer(EventConverter eventConverter, ObjectMapper objectMapper) {
         this.eventConverter = eventConverter;
         this.objectMapper = objectMapper;
     }


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