james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From adup...@apache.org
Subject [07/13] james-project git commit: JAMES-1733 Remove generics from mailbox API
Date Tue, 17 May 2016 08:14:53 GMT
http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/store/src/main/java/org/apache/james/mailbox/store/json/JsonEventSerializer.java
----------------------------------------------------------------------
diff --git a/mailbox/store/src/main/java/org/apache/james/mailbox/store/json/JsonEventSerializer.java b/mailbox/store/src/main/java/org/apache/james/mailbox/store/json/JsonEventSerializer.java
index 7950846..187405c 100644
--- a/mailbox/store/src/main/java/org/apache/james/mailbox/store/json/JsonEventSerializer.java
+++ b/mailbox/store/src/main/java/org/apache/james/mailbox/store/json/JsonEventSerializer.java
@@ -20,13 +20,12 @@
 package org.apache.james.mailbox.store.json;
 
 import org.apache.james.mailbox.store.json.event.EventConverter;
-import org.apache.james.mailbox.store.mail.model.MailboxId;
 
 import com.fasterxml.jackson.databind.ObjectMapper;
 
-public class JsonEventSerializer<Id extends MailboxId> extends JacksonEventSerializer<Id> {
+public class JsonEventSerializer extends JacksonEventSerializer {
 
-    public JsonEventSerializer(EventConverter<Id> eventConverter) {
+    public JsonEventSerializer(EventConverter eventConverter) {
         super(eventConverter, new ObjectMapper());
     }
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/store/src/main/java/org/apache/james/mailbox/store/json/MessagePackEventSerializer.java
----------------------------------------------------------------------
diff --git a/mailbox/store/src/main/java/org/apache/james/mailbox/store/json/MessagePackEventSerializer.java b/mailbox/store/src/main/java/org/apache/james/mailbox/store/json/MessagePackEventSerializer.java
index a75a58b..b4c232d 100644
--- a/mailbox/store/src/main/java/org/apache/james/mailbox/store/json/MessagePackEventSerializer.java
+++ b/mailbox/store/src/main/java/org/apache/james/mailbox/store/json/MessagePackEventSerializer.java
@@ -19,17 +19,17 @@
 
 package org.apache.james.mailbox.store.json;
 
-import com.fasterxml.jackson.databind.ObjectMapper;
 import org.apache.james.mailbox.store.json.event.EventConverter;
-import org.apache.james.mailbox.store.mail.model.MailboxId;
 import org.msgpack.jackson.dataformat.MessagePackFactory;
 
+import com.fasterxml.jackson.databind.ObjectMapper;
+
 /**
  * MailboxMessage Pack ( http://msgpack.org/ ) Event Serializer
  */
-public class MessagePackEventSerializer<Id extends MailboxId> extends JacksonEventSerializer<Id> {
+public class MessagePackEventSerializer extends JacksonEventSerializer {
 
-    public MessagePackEventSerializer(EventConverter<Id> eventConverter) {
+    public MessagePackEventSerializer(EventConverter eventConverter) {
         super(eventConverter, new ObjectMapper(new MessagePackFactory()));
     }
 }

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/store/src/main/java/org/apache/james/mailbox/store/json/event/EventConverter.java
----------------------------------------------------------------------
diff --git a/mailbox/store/src/main/java/org/apache/james/mailbox/store/json/event/EventConverter.java b/mailbox/store/src/main/java/org/apache/james/mailbox/store/json/event/EventConverter.java
index 98d5a5b..fe91bd4 100644
--- a/mailbox/store/src/main/java/org/apache/james/mailbox/store/json/event/EventConverter.java
+++ b/mailbox/store/src/main/java/org/apache/james/mailbox/store/json/event/EventConverter.java
@@ -19,6 +19,14 @@
 
 package org.apache.james.mailbox.store.json.event;
 
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.SortedMap;
+import java.util.TreeMap;
+
 import org.apache.james.mailbox.MailboxListener;
 import org.apache.james.mailbox.MailboxSession;
 import org.apache.james.mailbox.model.MailboxPath;
@@ -33,27 +41,18 @@ import org.apache.james.mailbox.store.json.event.dto.MailboxSessionDataTransferO
 import org.apache.james.mailbox.store.json.event.dto.MessageMetaDataDataTransferObject;
 import org.apache.james.mailbox.store.json.event.dto.UpdatedFlagsDataTransferObject;
 import org.apache.james.mailbox.store.mail.model.Mailbox;
-import org.apache.james.mailbox.store.mail.model.MailboxId;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.SortedMap;
-import java.util.TreeMap;
-
-public class EventConverter<Id extends MailboxId> {
+public class EventConverter {
 
     private static final Logger LOG = LoggerFactory.getLogger(EventConverter.class);
 
-    private final EventFactory<Id> eventFactory;
-    private final MailboxConverter<Id> mailboxConverter;
+    private final EventFactory eventFactory;
+    private final MailboxConverter mailboxConverter;
 
-    public EventConverter(MailboxConverter<Id> mailboxConverter) {
-        this.eventFactory = new EventFactory<Id>();
+    public EventConverter(MailboxConverter mailboxConverter) {
+        this.eventFactory = new EventFactory();
         this.mailboxConverter = mailboxConverter;
     }
 
@@ -93,7 +92,7 @@ public class EventConverter<Id extends MailboxId> {
     }
 
     public MailboxListener.Event retrieveEvent(EventDataTransferObject eventDataTransferObject) throws Exception {
-        Mailbox<Id> mailbox = mailboxConverter.retrieveMailbox(eventDataTransferObject.getMailbox());
+        Mailbox mailbox = mailboxConverter.retrieveMailbox(eventDataTransferObject.getMailbox());
         switch (eventDataTransferObject.getType()) {
             case ADDED:
                 return eventFactory.added(eventDataTransferObject.getSession().getMailboxSession(),

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/store/src/main/java/org/apache/james/mailbox/store/json/event/MailboxConverter.java
----------------------------------------------------------------------
diff --git a/mailbox/store/src/main/java/org/apache/james/mailbox/store/json/event/MailboxConverter.java b/mailbox/store/src/main/java/org/apache/james/mailbox/store/json/event/MailboxConverter.java
index 89d1e3e..185899e 100644
--- a/mailbox/store/src/main/java/org/apache/james/mailbox/store/json/event/MailboxConverter.java
+++ b/mailbox/store/src/main/java/org/apache/james/mailbox/store/json/event/MailboxConverter.java
@@ -19,34 +19,34 @@
 
 package org.apache.james.mailbox.store.json.event;
 
-import com.fasterxml.jackson.core.JsonProcessingException;
+import java.io.IOException;
+
 import org.apache.james.mailbox.MailboxListener;
 import org.apache.james.mailbox.model.MailboxPath;
 import org.apache.james.mailbox.store.event.EventFactory;
 import org.apache.james.mailbox.store.json.SimpleMailboxACLJsonConverter;
 import org.apache.james.mailbox.store.json.event.dto.MailboxDataTransferObject;
 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.MailboxIdDeserialisationException;
 import org.apache.james.mailbox.store.mail.model.MailboxIdDeserializer;
 import org.apache.james.mailbox.store.mail.model.impl.SimpleMailbox;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.io.IOException;
+import com.fasterxml.jackson.core.JsonProcessingException;
 
-public class MailboxConverter<Id extends MailboxId> {
+public class MailboxConverter {
 
     private final static Logger LOGGER = LoggerFactory.getLogger(MailboxConverter.class);
 
-    private final MailboxIdDeserializer<Id> mailboxIdDeserializer;
+    private final MailboxIdDeserializer mailboxIdDeserializer;
 
-    public MailboxConverter(MailboxIdDeserializer<Id> mailboxIdDeserializer) {
+    public MailboxConverter(MailboxIdDeserializer mailboxIdDeserializer) {
         this.mailboxIdDeserializer = mailboxIdDeserializer;
     }
 
-    public Mailbox<Id> retrieveMailbox(MailboxDataTransferObject mailboxDataTransferObject) {
-        SimpleMailbox<Id> mailbox = new SimpleMailbox<Id>(new MailboxPath(mailboxDataTransferObject.getNamespace(),
+    public Mailbox retrieveMailbox(MailboxDataTransferObject mailboxDataTransferObject) {
+        SimpleMailbox mailbox = new SimpleMailbox(new MailboxPath(mailboxDataTransferObject.getNamespace(),
             mailboxDataTransferObject.getUser(),
             mailboxDataTransferObject.getName()),
             mailboxDataTransferObject.getUidValidity());
@@ -61,7 +61,7 @@ public class MailboxConverter<Id extends MailboxId> {
         return mailbox;
     }
 
-    public MailboxDataTransferObject convertMailboxDataTransferObject(Mailbox<Id> mailbox) {
+    public MailboxDataTransferObject convertMailboxDataTransferObject(Mailbox mailbox) {
         return MailboxDataTransferObject.builder()
             .serializedMailboxId(mailbox.getMailboxId().serialize())
             .namespace(mailbox.getNamespace())
@@ -72,16 +72,15 @@ public class MailboxConverter<Id extends MailboxId> {
             .build();
     }
 
-    @SuppressWarnings("unchecked")
     public MailboxDataTransferObject extractMailboxDataTransferObject(MailboxListener.Event event) {
         if (event instanceof EventFactory.MailboxAware) {
-            return convertMailboxDataTransferObject(((EventFactory.MailboxAware<Id>) event).getMailbox());
+            return convertMailboxDataTransferObject(((EventFactory.MailboxAware) event).getMailbox());
         } else {
             throw new RuntimeException("Unsupported event class : " + event.getClass().getCanonicalName());
         }
     }
 
-    private String getSerializedACL(Mailbox<Id> mailbox) {
+    private String getSerializedACL(Mailbox mailbox) {
         try {
             return SimpleMailboxACLJsonConverter.toJson(mailbox.getACL());
         } catch (JsonProcessingException e) {

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/AbstractLockingModSeqProvider.java
----------------------------------------------------------------------
diff --git a/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/AbstractLockingModSeqProvider.java b/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/AbstractLockingModSeqProvider.java
index 5278aa6..b05202a 100644
--- a/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/AbstractLockingModSeqProvider.java
+++ b/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/AbstractLockingModSeqProvider.java
@@ -23,16 +23,14 @@ import org.apache.james.mailbox.MailboxPathLocker.LockAwareExecution;
 import org.apache.james.mailbox.MailboxSession;
 import org.apache.james.mailbox.exception.MailboxException;
 import org.apache.james.mailbox.store.StoreMailboxPath;
-import org.apache.james.mailbox.store.mail.model.MailboxId;
 import org.apache.james.mailbox.store.mail.model.Mailbox;
 
 /**
  * Abstract base implementation of {@link ModSeqProvider} which uses the given {@link MailboxPathLocker} to lock the {@link Mailbox} during the mod-seq generation.
  * 
  *
- * @param <Id>
  */
-public abstract class AbstractLockingModSeqProvider<Id extends MailboxId> implements ModSeqProvider<Id>{
+public abstract class AbstractLockingModSeqProvider implements ModSeqProvider{
 
     private final MailboxPathLocker locker;
 
@@ -41,8 +39,8 @@ public abstract class AbstractLockingModSeqProvider<Id extends MailboxId> implem
     }
     
     @Override
-    public long nextModSeq(final MailboxSession session, final Mailbox<Id> mailbox) throws MailboxException {
-        return locker.executeWithLock(session, new StoreMailboxPath<Id>(mailbox), new LockAwareExecution<Long>() {
+    public long nextModSeq(final MailboxSession session, final Mailbox mailbox) throws MailboxException {
+        return locker.executeWithLock(session, new StoreMailboxPath(mailbox), new LockAwareExecution<Long>() {
 
             @Override
             public Long execute() throws MailboxException {
@@ -59,6 +57,6 @@ public abstract class AbstractLockingModSeqProvider<Id extends MailboxId> implem
      * @return nextModSeq
      * @throws MailboxException
      */
-    protected abstract long lockedNextModSeq(MailboxSession session, Mailbox<Id> mailbox) throws MailboxException;
+    protected abstract long lockedNextModSeq(MailboxSession session, Mailbox mailbox) throws MailboxException;
 
 }

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/AbstractLockingUidProvider.java
----------------------------------------------------------------------
diff --git a/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/AbstractLockingUidProvider.java b/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/AbstractLockingUidProvider.java
index 8152c69..b0531c6 100644
--- a/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/AbstractLockingUidProvider.java
+++ b/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/AbstractLockingUidProvider.java
@@ -23,7 +23,6 @@ import org.apache.james.mailbox.MailboxPathLocker.LockAwareExecution;
 import org.apache.james.mailbox.MailboxSession;
 import org.apache.james.mailbox.exception.MailboxException;
 import org.apache.james.mailbox.store.StoreMailboxPath;
-import org.apache.james.mailbox.store.mail.model.MailboxId;
 import org.apache.james.mailbox.store.mail.model.Mailbox;
 
 
@@ -32,9 +31,8 @@ import org.apache.james.mailbox.store.mail.model.Mailbox;
  * lock the {@link Mailbox} while the next uid is generated
  * 
  *
- * @param <Id>
  */
-public abstract class AbstractLockingUidProvider<Id extends MailboxId> implements UidProvider<Id>{
+public abstract class AbstractLockingUidProvider implements UidProvider{
 
     private final MailboxPathLocker locker;
 
@@ -43,8 +41,8 @@ public abstract class AbstractLockingUidProvider<Id extends MailboxId> implement
     }
     
     @Override
-    public long nextUid(final MailboxSession session, final Mailbox<Id> mailbox) throws MailboxException {
-        return locker.executeWithLock(session, new StoreMailboxPath<Id>(mailbox), new LockAwareExecution<Long>() {
+    public long nextUid(final MailboxSession session, final Mailbox mailbox) throws MailboxException {
+        return locker.executeWithLock(session, new StoreMailboxPath(mailbox), new LockAwareExecution<Long>() {
 
             @Override
             public Long execute() throws MailboxException {
@@ -61,6 +59,6 @@ public abstract class AbstractLockingUidProvider<Id extends MailboxId> implement
      * @return nextUid
      * @throws MailboxException
      */
-    protected abstract long lockedNextUid(MailboxSession session, Mailbox<Id> mailbox) throws MailboxException;
+    protected abstract long lockedNextUid(MailboxSession session, Mailbox mailbox) throws MailboxException;
 
 }

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/AbstractMessageMapper.java
----------------------------------------------------------------------
diff --git a/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/AbstractMessageMapper.java b/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/AbstractMessageMapper.java
index c43ac9f..59361b8 100644
--- a/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/AbstractMessageMapper.java
+++ b/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/AbstractMessageMapper.java
@@ -30,7 +30,6 @@ import org.apache.james.mailbox.model.MessageMetaData;
 import org.apache.james.mailbox.model.MessageRange;
 import org.apache.james.mailbox.model.UpdatedFlags;
 import org.apache.james.mailbox.store.FlagsUpdateCalculator;
-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;
 import org.apache.james.mailbox.store.transaction.TransactionalMapper;
@@ -39,14 +38,13 @@ import org.apache.james.mailbox.store.transaction.TransactionalMapper;
  * Abstract base class for {@link MessageMapper} implementation
  * which already takes care of most uid / mod-seq handling.
  *
- * @param <Id>
  */
-public abstract class AbstractMessageMapper<Id extends MailboxId> extends TransactionalMapper implements MessageMapper<Id> {
+public abstract class AbstractMessageMapper extends TransactionalMapper implements MessageMapper {
     protected final MailboxSession mailboxSession;
-    private final UidProvider<Id> uidProvider;
-    private final ModSeqProvider<Id> modSeqProvider;
+    private final UidProvider uidProvider;
+    private final ModSeqProvider modSeqProvider;
 
-    public AbstractMessageMapper(MailboxSession mailboxSession, UidProvider<Id> uidProvider, ModSeqProvider<Id> modSeqProvider) {
+    public AbstractMessageMapper(MailboxSession mailboxSession, UidProvider uidProvider, ModSeqProvider modSeqProvider) {
         this.mailboxSession = mailboxSession;
         this.uidProvider = uidProvider;
         this.modSeqProvider = modSeqProvider;
@@ -55,23 +53,23 @@ public abstract class AbstractMessageMapper<Id extends MailboxId> extends Transa
     /**
      * @see org.apache.james.mailbox.store.mail.MessageMapper#getHighestModSeq(org.apache.james.mailbox.store.mail.model.Mailbox)
      */
-    public long getHighestModSeq(Mailbox<Id> mailbox) throws MailboxException {
+    public long getHighestModSeq(Mailbox mailbox) throws MailboxException {
         return modSeqProvider.highestModSeq(mailboxSession, mailbox);
     }
 
     /**
      * @see org.apache.james.mailbox.store.mail.MessageMapper#getLastUid(org.apache.james.mailbox.store.mail.model.Mailbox)
      */
-    public long getLastUid(Mailbox<Id> mailbox) throws MailboxException {
+    public long getLastUid(Mailbox mailbox) throws MailboxException {
         return uidProvider.lastUid(mailboxSession, mailbox);
     }
     
     /**
      * @see org.apache.james.mailbox.store.mail.MessageMapper#updateFlags(org.apache.james.mailbox.store.mail.model.Mailbox, javax.mail.Flags, boolean, boolean, org.apache.james.mailbox.model.MessageRange)
      */
-    public Iterator<UpdatedFlags> updateFlags(Mailbox<Id> mailbox, FlagsUpdateCalculator flagsUpdateCalculator, MessageRange set) throws MailboxException {
+    public Iterator<UpdatedFlags> updateFlags(Mailbox mailbox, FlagsUpdateCalculator flagsUpdateCalculator, MessageRange set) throws MailboxException {
         final List<UpdatedFlags> updatedFlags = new ArrayList<UpdatedFlags>();
-        Iterator<MailboxMessage<Id>> messages = findInMailbox(mailbox, set, FetchType.Metadata, -1);
+        Iterator<MailboxMessage> messages = findInMailbox(mailbox, set, FetchType.Metadata, -1);
         
         long modSeq = -1;
         if (messages.hasNext()) {
@@ -81,7 +79,7 @@ public abstract class AbstractMessageMapper<Id extends MailboxId> extends Transa
             }
         }
         while(messages.hasNext()) {
-        	final MailboxMessage<Id> member = messages.next();
+        	final MailboxMessage member = messages.next();
             Flags originalFlags = member.createFlags();
             member.setFlags(flagsUpdateCalculator.buildNewFlags(originalFlags));
             Flags newFlags = member.createFlags();
@@ -105,7 +103,7 @@ public abstract class AbstractMessageMapper<Id extends MailboxId> extends Transa
     /**
      * @see org.apache.james.mailbox.store.mail.MessageMapper#add(org.apache.james.mailbox.store.mail.model.Mailbox, MailboxMessage)
      */
-    public MessageMetaData add(Mailbox<Id> mailbox, MailboxMessage<Id> message) throws MailboxException {
+    public MessageMetaData add(Mailbox mailbox, MailboxMessage message) throws MailboxException {
         message.setUid(uidProvider.nextUid(mailboxSession, mailbox));
         
         // if a mailbox does not support mod-sequences the provider may be null
@@ -122,7 +120,7 @@ public abstract class AbstractMessageMapper<Id extends MailboxId> extends Transa
     /**
      * @see org.apache.james.mailbox.store.mail.MessageMapper#copy(org.apache.james.mailbox.store.mail.model.Mailbox, MailboxMessage)
      */
-    public MessageMetaData copy(Mailbox<Id> mailbox, MailboxMessage<Id> original) throws MailboxException {
+    public MessageMetaData copy(Mailbox mailbox, MailboxMessage original) throws MailboxException {
         long uid = uidProvider.nextUid(mailboxSession, mailbox);
         long modSeq = -1;
         if (modSeqProvider != null) {
@@ -144,7 +142,7 @@ public abstract class AbstractMessageMapper<Id extends MailboxId> extends Transa
      * @return metaData
      * @throws MailboxException
      */
-    protected abstract MessageMetaData save(Mailbox<Id> mailbox, MailboxMessage<Id> message) throws MailboxException;
+    protected abstract MessageMetaData save(Mailbox mailbox, MailboxMessage message) throws MailboxException;
 
     
     /**
@@ -157,6 +155,6 @@ public abstract class AbstractMessageMapper<Id extends MailboxId> extends Transa
      * @return metaData
      * @throws MailboxException
      */
-    protected abstract MessageMetaData copy(Mailbox<Id> mailbox, long uid, long modSeq, MailboxMessage<Id> original) throws MailboxException;
+    protected abstract MessageMetaData copy(Mailbox mailbox, long uid, long modSeq, MailboxMessage original) throws MailboxException;
     
 }

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/MailboxMapper.java
----------------------------------------------------------------------
diff --git a/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/MailboxMapper.java b/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/MailboxMapper.java
index 82582cd..a1f5878 100644
--- a/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/MailboxMapper.java
+++ b/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/MailboxMapper.java
@@ -24,7 +24,6 @@ import org.apache.james.mailbox.exception.MailboxException;
 import org.apache.james.mailbox.exception.MailboxNotFoundException;
 import org.apache.james.mailbox.model.MailboxACL;
 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;
 import org.apache.james.mailbox.store.transaction.Mapper;
 
@@ -33,7 +32,7 @@ import org.apache.james.mailbox.store.transaction.Mapper;
  * to the end of the request.
  *
  */
-public interface MailboxMapper<Id extends MailboxId> extends Mapper {
+public interface MailboxMapper extends Mapper {
     
     /**
      * Save the give {@link Mailbox} to the underlying storage
@@ -41,7 +40,7 @@ public interface MailboxMapper<Id extends MailboxId> extends Mapper {
      * @param mailbox
      * @throws MailboxException
      */
-    void save(Mailbox<Id> mailbox) throws MailboxException;
+    void save(Mailbox mailbox) throws MailboxException;
     
     /**
      * Delete the given {@link Mailbox} from the underlying storage
@@ -49,7 +48,7 @@ public interface MailboxMapper<Id extends MailboxId> extends Mapper {
      * @param mailbox
      * @throws MailboxException
      */
-    void delete(Mailbox<Id> mailbox) throws MailboxException;
+    void delete(Mailbox mailbox) throws MailboxException;
 
   
     /**
@@ -60,7 +59,7 @@ public interface MailboxMapper<Id extends MailboxId> extends Mapper {
      * @throws MailboxException
      * @throws MailboxNotFoundException
      */
-    Mailbox<Id> findMailboxByPath(MailboxPath mailboxName)
+    Mailbox findMailboxByPath(MailboxPath mailboxName)
             throws MailboxException, MailboxNotFoundException;
 
     /**
@@ -70,7 +69,7 @@ public interface MailboxMapper<Id extends MailboxId> extends Mapper {
      * @return mailboxList
      * @throws MailboxException
      */
-    List<Mailbox<Id>> findMailboxWithPathLike(MailboxPath mailboxPath)
+    List<Mailbox> findMailboxWithPathLike(MailboxPath mailboxPath)
             throws MailboxException;
 
     /**
@@ -82,7 +81,7 @@ public interface MailboxMapper<Id extends MailboxId> extends Mapper {
      * @throws MailboxException
      * @throws MailboxNotFoundException
      */
-    boolean hasChildren(Mailbox<Id> mailbox, char delimiter)
+    boolean hasChildren(Mailbox mailbox, char delimiter)
             throws MailboxException, MailboxNotFoundException;
 
     /**
@@ -91,7 +90,7 @@ public interface MailboxMapper<Id extends MailboxId> extends Mapper {
      * @param mailbox Mailbox for whom we want to update ACL
      * @param mailboxACLCommand Update to perform
      */
-    void updateACL(Mailbox<Id> mailbox, MailboxACL.MailboxACLCommand mailboxACLCommand) throws MailboxException;
+    void updateACL(Mailbox mailbox, MailboxACL.MailboxACLCommand mailboxACLCommand) throws MailboxException;
 
     /**
      * Return a unmodifable {@link List} of all {@link Mailbox} 
@@ -99,5 +98,5 @@ public interface MailboxMapper<Id extends MailboxId> extends Mapper {
      * @return mailboxList
      * @throws MailboxException 
      */
-    List<Mailbox<Id>> list() throws MailboxException;
+    List<Mailbox> list() throws MailboxException;
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/MailboxMapperFactory.java
----------------------------------------------------------------------
diff --git a/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/MailboxMapperFactory.java b/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/MailboxMapperFactory.java
index 4121076..3dcb672 100644
--- a/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/MailboxMapperFactory.java
+++ b/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/MailboxMapperFactory.java
@@ -20,9 +20,8 @@ package org.apache.james.mailbox.store.mail;
 
 import org.apache.james.mailbox.MailboxSession;
 import org.apache.james.mailbox.exception.MailboxException;
-import org.apache.james.mailbox.store.mail.model.MailboxId;
 
-public interface MailboxMapperFactory<Id extends MailboxId> {
+public interface MailboxMapperFactory {
 
     /**
      * Create a {@link MailboxMapper} instance or return the one which exists for the {@link MailboxSession} already
@@ -30,5 +29,5 @@ public interface MailboxMapperFactory<Id extends MailboxId> {
      * @param session
      * @return mapper
      */
-    MailboxMapper<Id> getMailboxMapper(MailboxSession session) throws MailboxException;
+    MailboxMapper getMailboxMapper(MailboxSession session) throws MailboxException;
 }

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/MessageMapper.java
----------------------------------------------------------------------
diff --git a/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/MessageMapper.java b/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/MessageMapper.java
index fedaa26..94bac52 100644
--- a/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/MessageMapper.java
+++ b/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/MessageMapper.java
@@ -27,7 +27,6 @@ import org.apache.james.mailbox.model.MessageMetaData;
 import org.apache.james.mailbox.model.MessageRange;
 import org.apache.james.mailbox.model.UpdatedFlags;
 import org.apache.james.mailbox.store.FlagsUpdateCalculator;
-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;
 import org.apache.james.mailbox.store.mail.model.Property;
@@ -37,7 +36,7 @@ import org.apache.james.mailbox.store.transaction.Mapper;
  * Maps {@link MailboxMessage} in a {@link org.apache.james.mailbox.MessageManager}. A {@link MessageMapper} has a lifecycle from the start of a request
  * to the end of the request.
  */
-public interface MessageMapper<Id extends MailboxId> extends Mapper {
+public interface MessageMapper extends Mapper {
 
     /**
      * Return a {@link Iterator} which holds the messages for the given criterias
@@ -50,7 +49,7 @@ public interface MessageMapper<Id extends MailboxId> extends Mapper {
      *              MAY just ignore it
      * @throws MailboxException
      */
-    Iterator<MailboxMessage<Id>> findInMailbox(Mailbox<Id> mailbox, MessageRange set, FetchType type, int limit)
+    Iterator<MailboxMessage> findInMailbox(Mailbox mailbox, MessageRange set, FetchType type, int limit)
             throws MailboxException;
 
     /**
@@ -62,7 +61,7 @@ public interface MessageMapper<Id extends MailboxId> extends Mapper {
      * @throws MailboxException
      */
     Map<Long, MessageMetaData> expungeMarkedForDeletionInMailbox(
-            Mailbox<Id> mailbox, MessageRange set)
+            Mailbox mailbox, MessageRange set)
             throws MailboxException;
 
     /**
@@ -72,7 +71,7 @@ public interface MessageMapper<Id extends MailboxId> extends Mapper {
      * @return count
      * @throws MailboxException
      */
-    long countMessagesInMailbox(Mailbox<Id> mailbox)
+    long countMessagesInMailbox(Mailbox mailbox)
             throws MailboxException;
 
     /**
@@ -82,7 +81,7 @@ public interface MessageMapper<Id extends MailboxId> extends Mapper {
      * @return unseenCount
      * @throws StorageException
      */
-    long countUnseenMessagesInMailbox(Mailbox<Id> mailbox)
+    long countUnseenMessagesInMailbox(Mailbox mailbox)
             throws MailboxException;
 
 
@@ -93,7 +92,7 @@ public interface MessageMapper<Id extends MailboxId> extends Mapper {
      * @param message
      * @throws StorageException
      */
-    void delete(Mailbox<Id> mailbox, MailboxMessage<Id> message) throws MailboxException;
+    void delete(Mailbox mailbox, MailboxMessage message) throws MailboxException;
 
     /**
      * Return the uid of the first unseen message. If non can be found null will get returned
@@ -103,7 +102,7 @@ public interface MessageMapper<Id extends MailboxId> extends Mapper {
      * @return uid or null
      * @throws StorageException
      */
-    Long findFirstUnseenMessageUid(Mailbox<Id> mailbox) throws MailboxException;
+    Long findFirstUnseenMessageUid(Mailbox mailbox) throws MailboxException;
 
     /**
      * Return a List of {@link MailboxMessage} which are recent.
@@ -113,7 +112,7 @@ public interface MessageMapper<Id extends MailboxId> extends Mapper {
      * @return recentList
      * @throws StorageException
      */
-    List<Long> findRecentMessageUidsInMailbox(Mailbox<Id> mailbox) throws MailboxException;
+    List<Long> findRecentMessageUidsInMailbox(Mailbox mailbox) throws MailboxException;
 
 
     /**
@@ -126,7 +125,7 @@ public interface MessageMapper<Id extends MailboxId> extends Mapper {
      * @return uid
      * @throws StorageException
      */
-    MessageMetaData add(Mailbox<Id> mailbox, MailboxMessage<Id> message) throws MailboxException;
+    MessageMetaData add(Mailbox mailbox, MailboxMessage message) throws MailboxException;
     
     /**
      * Update flags for the given {@link MessageRange}. Only the flags may be modified after a message was saved to a mailbox.
@@ -137,7 +136,7 @@ public interface MessageMapper<Id extends MailboxId> extends Mapper {
      * @return updatedFlags
      * @throws MailboxException
      */
-    Iterator<UpdatedFlags> updateFlags(Mailbox<Id> mailbox, FlagsUpdateCalculator flagsUpdateCalculator,
+    Iterator<UpdatedFlags> updateFlags(Mailbox mailbox, FlagsUpdateCalculator flagsUpdateCalculator,
             final MessageRange set) throws MailboxException;
     
     /**
@@ -148,7 +147,7 @@ public interface MessageMapper<Id extends MailboxId> extends Mapper {
      * @param original the original to copy
      * @throws StorageException
      */
-    MessageMetaData copy(Mailbox<Id> mailbox,MailboxMessage<Id> original) throws MailboxException;
+    MessageMetaData copy(Mailbox mailbox,MailboxMessage original) throws MailboxException;
     
     /**
      * Move the given {@link MailboxMessage} to a new mailbox and return the uid of the moved. Be aware that the given uid is just a suggestion for the uid of the moved
@@ -158,7 +157,7 @@ public interface MessageMapper<Id extends MailboxId> extends Mapper {
      * @param original the original to move
      * @throws StorageException
      */
-    MessageMetaData move(Mailbox<Id> mailbox,MailboxMessage<Id> original) throws MailboxException;
+    MessageMetaData move(Mailbox mailbox,MailboxMessage original) throws MailboxException;
     
     
     /**
@@ -168,7 +167,7 @@ public interface MessageMapper<Id extends MailboxId> extends Mapper {
      * @return lastUid
      * @throws MailboxException
      */
-    long getLastUid(Mailbox<Id> mailbox) throws MailboxException;
+    long getLastUid(Mailbox mailbox) throws MailboxException;
 
 
     /**
@@ -178,7 +177,7 @@ public interface MessageMapper<Id extends MailboxId> extends Mapper {
      * @return lastUid
      * @throws MailboxException
      */
-    long getHighestModSeq(Mailbox<Id> mailbox) throws MailboxException;
+    long getHighestModSeq(Mailbox mailbox) throws MailboxException;
     
     /**
      * Specify what data needs to get filled in a {@link MailboxMessage} before returning it

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/MessageMapperFactory.java
----------------------------------------------------------------------
diff --git a/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/MessageMapperFactory.java b/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/MessageMapperFactory.java
index e88578e..47ba4b9 100644
--- a/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/MessageMapperFactory.java
+++ b/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/MessageMapperFactory.java
@@ -20,9 +20,8 @@ package org.apache.james.mailbox.store.mail;
 
 import org.apache.james.mailbox.MailboxSession;
 import org.apache.james.mailbox.exception.MailboxException;
-import org.apache.james.mailbox.store.mail.model.MailboxId;
 
-public interface MessageMapperFactory<Id extends MailboxId> {
+public interface MessageMapperFactory {
 
     /**
      * Create a {@link MessageMapper} instance of return the one which exists for the {@link MailboxSession} already
@@ -30,6 +29,6 @@ public interface MessageMapperFactory<Id extends MailboxId> {
      * @param session
      * @return mapper
      */
-    MessageMapper<Id> getMessageMapper(MailboxSession session) throws MailboxException;
+    MessageMapper getMessageMapper(MailboxSession session) throws MailboxException;
         
 }

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/ModSeqProvider.java
----------------------------------------------------------------------
diff --git a/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/ModSeqProvider.java b/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/ModSeqProvider.java
index fffc1d1..b2578c9 100644
--- a/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/ModSeqProvider.java
+++ b/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/ModSeqProvider.java
@@ -20,7 +20,6 @@ package org.apache.james.mailbox.store.mail;
 
 import org.apache.james.mailbox.MailboxSession;
 import org.apache.james.mailbox.exception.MailboxException;
-import org.apache.james.mailbox.store.mail.model.MailboxId;
 import org.apache.james.mailbox.store.mail.model.Mailbox;
 
 /**
@@ -28,9 +27,8 @@ import org.apache.james.mailbox.store.mail.model.Mailbox;
  * need to be thread-safe!
  * 
  *
- * @param <Id>
  */
-public interface ModSeqProvider<Id extends MailboxId> {
+public interface ModSeqProvider {
 
     /**
      * Return the next mod-sequence which can be used for the {@link Mailbox}.
@@ -44,7 +42,7 @@ public interface ModSeqProvider<Id extends MailboxId> {
      * @return modSeq
      * @throws MailboxException
      */
-    long nextModSeq(MailboxSession session, Mailbox<Id> mailbox) throws MailboxException;
+    long nextModSeq(MailboxSession session, Mailbox mailbox) throws MailboxException;
     
     /**
      * Return the highest mod-sequence which were used for the {@link Mailbox}
@@ -54,5 +52,5 @@ public interface ModSeqProvider<Id extends MailboxId> {
      * @return highest
      * @throws MailboxException
      */
-    long highestModSeq(MailboxSession session, Mailbox<Id> mailbox) throws MailboxException;
+    long highestModSeq(MailboxSession session, Mailbox mailbox) throws MailboxException;
 }

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/UidProvider.java
----------------------------------------------------------------------
diff --git a/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/UidProvider.java b/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/UidProvider.java
index 771cdee..870d1a6 100644
--- a/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/UidProvider.java
+++ b/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/UidProvider.java
@@ -20,7 +20,6 @@ package org.apache.james.mailbox.store.mail;
 
 import org.apache.james.mailbox.MailboxSession;
 import org.apache.james.mailbox.exception.MailboxException;
-import org.apache.james.mailbox.store.mail.model.MailboxId;
 import org.apache.james.mailbox.store.mail.model.Mailbox;
 
 /**
@@ -28,9 +27,8 @@ import org.apache.james.mailbox.store.mail.model.Mailbox;
  * need to be thread-safe!
  * 
  *
- * @param <Id>
  */
-public interface UidProvider<Id extends MailboxId> {
+public interface UidProvider {
 
     /**
      * Return the next uid which can be used while append a MailboxMessage to the {@link Mailbox}.
@@ -42,7 +40,7 @@ public interface UidProvider<Id extends MailboxId> {
      * @return nextUid
      * @throws MailboxException
      */
-    long nextUid(MailboxSession session, Mailbox<Id> mailbox) throws MailboxException;
+    long nextUid(MailboxSession session, Mailbox mailbox) throws MailboxException;
     
     /**
      * Return the last uid which were used for storing a MailboxMessage in the {@link Mailbox}
@@ -52,5 +50,5 @@ public interface UidProvider<Id extends MailboxId> {
      * @return lastUid
      * @throws MailboxException
      */
-    long lastUid(MailboxSession session, Mailbox<Id> mailbox) throws MailboxException;
+    long lastUid(MailboxSession session, Mailbox mailbox) throws MailboxException;
 }

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/model/DelegatingMailboxMessage.java
----------------------------------------------------------------------
diff --git a/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/model/DelegatingMailboxMessage.java b/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/model/DelegatingMailboxMessage.java
index 3ac6c46..0ede32d 100644
--- a/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/model/DelegatingMailboxMessage.java
+++ b/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/model/DelegatingMailboxMessage.java
@@ -27,7 +27,7 @@ import javax.mail.Flags;
 
 import org.apache.james.mailbox.store.mail.model.impl.MessageUidComparator;
 
-public abstract class DelegatingMailboxMessage<Id extends MailboxId> implements MailboxMessage<Id> {
+public abstract class DelegatingMailboxMessage implements MailboxMessage {
 
     private static final MessageUidComparator MESSAGE_UID_COMPARATOR = new MessageUidComparator();
     
@@ -38,7 +38,7 @@ public abstract class DelegatingMailboxMessage<Id extends MailboxId> implements
     }
 
     @Override
-    public int compareTo(MailboxMessage<Id> other) {
+    public int compareTo(MailboxMessage other) {
         return MESSAGE_UID_COMPARATOR.compare(this, other);
     }
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/model/FlagsBuilder.java
----------------------------------------------------------------------
diff --git a/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/model/FlagsBuilder.java b/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/model/FlagsBuilder.java
index 7d542a7..0c8ce4d 100644
--- a/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/model/FlagsBuilder.java
+++ b/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/model/FlagsBuilder.java
@@ -22,7 +22,7 @@ import javax.mail.Flags;
 
 public class FlagsBuilder {
 
-    public static Flags createFlags(MailboxMessage<?> mailboxMessage, String[] userFlags) {
+    public static Flags createFlags(MailboxMessage mailboxMessage, String[] userFlags) {
         final Flags flags = new Flags();
 
         if (mailboxMessage.isAnswered()) {

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/model/Mailbox.java
----------------------------------------------------------------------
diff --git a/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/model/Mailbox.java b/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/model/Mailbox.java
index 925251b..5172841 100644
--- a/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/model/Mailbox.java
+++ b/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/model/Mailbox.java
@@ -23,13 +23,13 @@ import org.apache.james.mailbox.model.MailboxACL;
 /**
  * Models long term mailbox data.
  */
-public interface Mailbox<Id extends MailboxId> {
+public interface Mailbox {
 
     /**
      * Gets the unique mailbox ID.
      * @return mailbox id
      */
-    Id getMailboxId();
+    MailboxId getMailboxId();
 
     /**
      * Gets the current namespace for this mailbox.

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/model/MailboxIdDeserializer.java
----------------------------------------------------------------------
diff --git a/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/model/MailboxIdDeserializer.java b/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/model/MailboxIdDeserializer.java
index f0fdcb3..5515f68 100644
--- a/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/model/MailboxIdDeserializer.java
+++ b/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/model/MailboxIdDeserializer.java
@@ -19,8 +19,8 @@
 
 package org.apache.james.mailbox.store.mail.model;
 
-public interface MailboxIdDeserializer<Id extends MailboxId> {
+public interface MailboxIdDeserializer {
 
-    Id deserialize(String serializedMailboxId) throws MailboxIdDeserialisationException;
+    MailboxId deserialize(String serializedMailboxId) throws MailboxIdDeserialisationException;
 
 }

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/model/MailboxMessage.java
----------------------------------------------------------------------
diff --git a/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/model/MailboxMessage.java b/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/model/MailboxMessage.java
index b6f3ee3..f572ce1 100644
--- a/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/model/MailboxMessage.java
+++ b/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/model/MailboxMessage.java
@@ -25,14 +25,14 @@ import javax.mail.Flags;
  * plus body content. In the case of multipart documents, this body content
  * has internal structure described by the meta-data.
  */
-public interface MailboxMessage<Id extends MailboxId> extends Message, Comparable<MailboxMessage<Id>> {
+public interface MailboxMessage extends Message, Comparable<MailboxMessage> {
 
     /**
      * Return the mailbox id of the linked mailbox
      * 
      * @return mailboxId
      */
-    Id getMailboxId();
+    MailboxId getMailboxId();
 
     /**
      * Return the uid

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/model/impl/MessageUidComparator.java
----------------------------------------------------------------------
diff --git a/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/model/impl/MessageUidComparator.java b/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/model/impl/MessageUidComparator.java
index 23517f8..1c62ede 100644
--- a/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/model/impl/MessageUidComparator.java
+++ b/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/model/impl/MessageUidComparator.java
@@ -18,14 +18,14 @@
  ****************************************************************/
 package org.apache.james.mailbox.store.mail.model.impl;
 
-import org.apache.james.mailbox.store.mail.model.MailboxMessage;
-
 import java.util.Comparator;
 
-public class MessageUidComparator implements Comparator<MailboxMessage<?>> {
+import org.apache.james.mailbox.store.mail.model.MailboxMessage;
+
+public class MessageUidComparator implements Comparator<MailboxMessage> {
 
     @Override
-    public int compare(MailboxMessage<?> m1, MailboxMessage<?> m2) {
+    public int compare(MailboxMessage m1, MailboxMessage m2) {
         return Long.valueOf(m1.getUid()).compareTo(m2.getUid());
     }
 }

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/model/impl/SimpleMailbox.java
----------------------------------------------------------------------
diff --git a/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/model/impl/SimpleMailbox.java b/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/model/impl/SimpleMailbox.java
index d9eb858..05c1ec1 100644
--- a/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/model/impl/SimpleMailbox.java
+++ b/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/model/impl/SimpleMailbox.java
@@ -21,12 +21,12 @@ package org.apache.james.mailbox.store.mail.model.impl;
 import org.apache.james.mailbox.model.MailboxACL;
 import org.apache.james.mailbox.model.MailboxPath;
 import org.apache.james.mailbox.model.SimpleMailboxACL;
-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.MailboxId;
 
-public class SimpleMailbox<Id extends MailboxId> implements Mailbox<Id> {
+public class SimpleMailbox implements Mailbox {
 
-    private Id id = null;
+    private MailboxId id = null;
     private String namespace;
     private String user;
     private String name;
@@ -40,7 +40,7 @@ public class SimpleMailbox<Id extends MailboxId> implements Mailbox<Id> {
         this.uidValidity = uidValidity;
     }
     
-    public SimpleMailbox(Mailbox<Id> mailbox) {
+    public SimpleMailbox(Mailbox mailbox) {
         this.id = mailbox.getMailboxId();
         this.namespace = mailbox.getNamespace();
         this.user = mailbox.getUser();
@@ -51,7 +51,7 @@ public class SimpleMailbox<Id extends MailboxId> implements Mailbox<Id> {
     /**
      * @see org.apache.james.mailbox.store.mail.model.Mailbox#getMailboxId()
      */
-    public Id getMailboxId() {
+    public MailboxId getMailboxId() {
         return id;
     }
 
@@ -109,17 +109,16 @@ public class SimpleMailbox<Id extends MailboxId> implements Mailbox<Id> {
     /**
      * @see java.lang.Object#equals(java.lang.Object)
      */
-    @SuppressWarnings("unchecked")
     public boolean equals(Object obj) {
         if (obj == this) {
             return true;
         }
         if (obj instanceof SimpleMailbox) {
             if (id != null) {
-                if (id.equals(((SimpleMailbox<Id>) obj).getMailboxId()))
+                if (id.equals(((SimpleMailbox) obj).getMailboxId()))
                     return true;
             } else {
-                if (((SimpleMailbox<Id>) obj).getMailboxId() == null)
+                if (((SimpleMailbox) obj).getMailboxId() == null)
                     return true;
             }
         }
@@ -148,7 +147,7 @@ public class SimpleMailbox<Id extends MailboxId> implements Mailbox<Id> {
     }
 
 
-    public void setMailboxId(Id id) {
+    public void setMailboxId(MailboxId id) {
         this.id = id;
     }
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/model/impl/SimpleMailboxMessage.java
----------------------------------------------------------------------
diff --git a/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/model/impl/SimpleMailboxMessage.java b/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/model/impl/SimpleMailboxMessage.java
index 24ddb27..1455c79 100644
--- a/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/model/impl/SimpleMailboxMessage.java
+++ b/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/model/impl/SimpleMailboxMessage.java
@@ -35,9 +35,9 @@ import org.apache.james.mailbox.store.mail.model.MailboxMessage;
 import com.google.common.base.MoreObjects;
 import com.google.common.primitives.Ints;
 
-public class SimpleMailboxMessage<Id extends MailboxId> extends DelegatingMailboxMessage<Id> {
+public class SimpleMailboxMessage extends DelegatingMailboxMessage {
 
-    public static <Id extends MailboxId> SimpleMailboxMessage<Id> copy(Id mailboxId, MailboxMessage<Id> original) throws MailboxException {
+    public static SimpleMailboxMessage copy(MailboxId mailboxId, MailboxMessage original) throws MailboxException {
         Date internalDate = original.getInternalDate();
         long size = original.getFullContentOctets();
         Flags flags = original.createFlags();
@@ -45,10 +45,10 @@ public class SimpleMailboxMessage<Id extends MailboxId> extends DelegatingMailbo
         int bodyStartOctet = Ints.checkedCast(original.getFullContentOctets() - original.getBodyOctets());
         PropertyBuilder pBuilder = new PropertyBuilder(original.getProperties());
         pBuilder.setTextualLineCount(original.getTextualLineCount());
-        return new SimpleMailboxMessage<Id>(internalDate, size, bodyStartOctet, content, flags, pBuilder, mailboxId);
+        return new SimpleMailboxMessage(internalDate, size, bodyStartOctet, content, flags, pBuilder, mailboxId);
     }
 
-    private static <Id extends MailboxId> SharedByteArrayInputStream copyFullContent(MailboxMessage<Id> original) throws MailboxException {
+    private static SharedByteArrayInputStream copyFullContent(MailboxMessage original) throws MailboxException {
         try {
             return new SharedByteArrayInputStream(IOUtils.toByteArray(original.getFullContent()));
         } catch (IOException e) {
@@ -57,7 +57,7 @@ public class SimpleMailboxMessage<Id extends MailboxId> extends DelegatingMailbo
     }
 
     private long uid;
-    private final Id mailboxId;
+    private final MailboxId mailboxId;
     private boolean answered;
     private boolean deleted;
     private boolean draft;
@@ -69,7 +69,7 @@ public class SimpleMailboxMessage<Id extends MailboxId> extends DelegatingMailbo
 
     public SimpleMailboxMessage(Date internalDate, long size, int bodyStartOctet,
                                 SharedInputStream content, Flags flags,
-                                PropertyBuilder propertyBuilder, Id mailboxId) {
+                                PropertyBuilder propertyBuilder, MailboxId mailboxId) {
         super(new SimpleMessage(
             content, size, internalDate, propertyBuilder.getSubType(),
             propertyBuilder.getMediaType(),
@@ -88,7 +88,7 @@ public class SimpleMailboxMessage<Id extends MailboxId> extends DelegatingMailbo
         return userFlags.clone();
     }
 
-    public Id getMailboxId() {
+    public MailboxId getMailboxId() {
         return mailboxId;
     }
 
@@ -150,7 +150,6 @@ public class SimpleMailboxMessage<Id extends MailboxId> extends DelegatingMailbo
         return result;
     }
 
-    @SuppressWarnings("unchecked")
     @Override
     public boolean equals(Object obj) {
         if (this == obj)
@@ -159,7 +158,7 @@ public class SimpleMailboxMessage<Id extends MailboxId> extends DelegatingMailbo
             return false;
         if (getClass() != obj.getClass())
             return false;
-        final SimpleMailboxMessage<Id> other = (SimpleMailboxMessage<Id>) obj;
+        final SimpleMailboxMessage other = (SimpleMailboxMessage) obj;
         if (uid != other.uid)
             return false;
         return true;

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/store/src/main/java/org/apache/james/mailbox/store/quota/CurrentQuotaCalculator.java
----------------------------------------------------------------------
diff --git a/mailbox/store/src/main/java/org/apache/james/mailbox/store/quota/CurrentQuotaCalculator.java b/mailbox/store/src/main/java/org/apache/james/mailbox/store/quota/CurrentQuotaCalculator.java
index 2c02ff4..77dc150 100644
--- a/mailbox/store/src/main/java/org/apache/james/mailbox/store/quota/CurrentQuotaCalculator.java
+++ b/mailbox/store/src/main/java/org/apache/james/mailbox/store/quota/CurrentQuotaCalculator.java
@@ -19,9 +19,12 @@
 
 package org.apache.james.mailbox.store.quota;
 
-import com.google.common.base.Function;
-import com.google.common.base.Throwables;
-import com.google.common.collect.Lists;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.inject.Inject;
+import javax.inject.Singleton;
+
 import org.apache.james.mailbox.MailboxSession;
 import org.apache.james.mailbox.exception.MailboxException;
 import org.apache.james.mailbox.model.MailboxPath;
@@ -32,34 +35,32 @@ import org.apache.james.mailbox.store.MailboxSessionMapperFactory;
 import org.apache.james.mailbox.store.mail.MailboxMapper;
 import org.apache.james.mailbox.store.mail.MessageMapper;
 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 javax.inject.Inject;
-import javax.inject.Singleton;
-import java.util.Iterator;
-import java.util.List;
+import com.google.common.base.Function;
+import com.google.common.base.Throwables;
+import com.google.common.collect.Lists;
 
 @Singleton
-public class CurrentQuotaCalculator<Id extends MailboxId> {
+public class CurrentQuotaCalculator {
 
-    private final MailboxSessionMapperFactory<Id> factory;
+    private final MailboxSessionMapperFactory factory;
     private final QuotaRootResolver quotaRootResolver;
 
     @Inject
-    public CurrentQuotaCalculator(MailboxSessionMapperFactory<Id> factory,
+    public CurrentQuotaCalculator(MailboxSessionMapperFactory factory,
                                   QuotaRootResolver quotaRootResolver) {
         this.factory = factory;
         this.quotaRootResolver = quotaRootResolver;
     }
 
     public CurrentQuotas recalculateCurrentQuotas(QuotaRoot quotaRoot, MailboxSession session) throws MailboxException {
-        List<Mailbox<Id>> mailboxes = retrieveMailboxes(quotaRoot, session);
-        MessageMapper<Id> mapper = factory.getMessageMapper(session);
+        List<Mailbox> mailboxes = retrieveMailboxes(quotaRoot, session);
+        MessageMapper mapper = factory.getMessageMapper(session);
         long messagesSizes = 0;
         long messageCount = 0;
-        for (Mailbox<Id> mailbox : mailboxes) {
-            Iterator<MailboxMessage<Id>> messages = mapper.findInMailbox(mailbox, MessageRange.all(), MessageMapper.FetchType.Metadata, -1);
+        for (Mailbox mailbox : mailboxes) {
+            Iterator<MailboxMessage> messages = mapper.findInMailbox(mailbox, MessageRange.all(), MessageMapper.FetchType.Metadata, -1);
             messageCount += mapper.countMessagesInMailbox(mailbox);
             while(messages.hasNext()) {
                 messagesSizes +=  messages.next().getFullContentOctets();
@@ -68,12 +69,12 @@ public class CurrentQuotaCalculator<Id extends MailboxId> {
         return new CurrentQuotas(messageCount, messagesSizes);
     }
 
-    private List<Mailbox<Id>> retrieveMailboxes(QuotaRoot quotaRoot, MailboxSession session) throws MailboxException {
+    private List<Mailbox> retrieveMailboxes(QuotaRoot quotaRoot, MailboxSession session) throws MailboxException {
         List<MailboxPath> paths = quotaRootResolver.retrieveAssociatedMailboxes(quotaRoot, session);
-        final MailboxMapper<Id> mapper = factory.getMailboxMapper(session);
-        return Lists.transform(paths, new Function<MailboxPath, Mailbox<Id>>() {
+        final MailboxMapper mapper = factory.getMailboxMapper(session);
+        return Lists.transform(paths, new Function<MailboxPath, Mailbox>() {
             @Override
-            public Mailbox<Id> apply(MailboxPath mailboxPath) {
+            public Mailbox apply(MailboxPath mailboxPath) {
                 try {
                     return mapper.findMailboxByPath(mailboxPath);
                 } catch (MailboxException e) {

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/store/src/main/java/org/apache/james/mailbox/store/quota/DefaultQuotaRootResolver.java
----------------------------------------------------------------------
diff --git a/mailbox/store/src/main/java/org/apache/james/mailbox/store/quota/DefaultQuotaRootResolver.java b/mailbox/store/src/main/java/org/apache/james/mailbox/store/quota/DefaultQuotaRootResolver.java
index 579365f..7dbf12e 100644
--- a/mailbox/store/src/main/java/org/apache/james/mailbox/store/quota/DefaultQuotaRootResolver.java
+++ b/mailbox/store/src/main/java/org/apache/james/mailbox/store/quota/DefaultQuotaRootResolver.java
@@ -30,7 +30,6 @@ import org.apache.james.mailbox.model.QuotaRoot;
 import org.apache.james.mailbox.quota.QuotaRootResolver;
 import org.apache.james.mailbox.store.MailboxSessionMapperFactory;
 import org.apache.james.mailbox.store.mail.model.Mailbox;
-import org.apache.james.mailbox.store.mail.model.MailboxId;
 
 import com.google.common.base.Function;
 import com.google.common.base.Preconditions;
@@ -41,10 +40,10 @@ public class DefaultQuotaRootResolver implements QuotaRootResolver {
 
     public static final String SEPARATOR = "&"; // Character illegal for mailbox naming in regard of RFC 3501 section 5.1
 
-    private final MailboxSessionMapperFactory<? extends MailboxId> factory;
+    private final MailboxSessionMapperFactory factory;
 
     @Inject
-    public DefaultQuotaRootResolver(MailboxSessionMapperFactory<? extends MailboxId> factory) {
+    public DefaultQuotaRootResolver(MailboxSessionMapperFactory factory) {
         this.factory = factory;
     }
 
@@ -69,9 +68,9 @@ public class DefaultQuotaRootResolver implements QuotaRootResolver {
         String namespace = parts.get(0);
         String user = parts.get(1);
         return Lists.transform(factory.getMailboxMapper(mailboxSession).findMailboxWithPathLike(new MailboxPath(namespace, user, "%")),
-            new Function<Mailbox<? extends MailboxId>, MailboxPath>() {
+            new Function<Mailbox, MailboxPath>() {
                 @Override
-                public MailboxPath apply(Mailbox<? extends MailboxId> idMailbox) {
+                public MailboxPath apply(Mailbox idMailbox) {
                     return new MailboxPath(idMailbox.getNamespace(), idMailbox.getUser(), idMailbox.getName());
                 }
             });

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/store/src/main/java/org/apache/james/mailbox/store/quota/QuotaChecker.java
----------------------------------------------------------------------
diff --git a/mailbox/store/src/main/java/org/apache/james/mailbox/store/quota/QuotaChecker.java b/mailbox/store/src/main/java/org/apache/james/mailbox/store/quota/QuotaChecker.java
index 6d32da0..869582c 100644
--- a/mailbox/store/src/main/java/org/apache/james/mailbox/store/quota/QuotaChecker.java
+++ b/mailbox/store/src/main/java/org/apache/james/mailbox/store/quota/QuotaChecker.java
@@ -27,15 +27,14 @@ import org.apache.james.mailbox.model.QuotaRoot;
 import org.apache.james.mailbox.quota.QuotaManager;
 import org.apache.james.mailbox.quota.QuotaRootResolver;
 import org.apache.james.mailbox.store.mail.model.Mailbox;
-import org.apache.james.mailbox.store.mail.model.MailboxId;
 
-public class QuotaChecker<Id extends MailboxId> {
+public class QuotaChecker {
 
     private final Quota messageQuota;
     private final Quota sizeQuota;
     private final QuotaRoot quotaRoot;
 
-    public QuotaChecker(QuotaManager quotaManager, QuotaRootResolver quotaRootResolver, Mailbox<Id> mailbox) throws MailboxException {
+    public QuotaChecker(QuotaManager quotaManager, QuotaRootResolver quotaRootResolver, Mailbox mailbox) throws MailboxException {
         this.quotaRoot = quotaRootResolver.getQuotaRoot(new MailboxPath(mailbox.getNamespace(), mailbox.getUser(), mailbox.getName()));
         this.messageQuota = quotaManager.getMessageQuota(quotaRoot);
         this.sizeQuota = quotaManager.getStorageQuota(quotaRoot);

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/LazyMessageSearchIndex.java
----------------------------------------------------------------------
diff --git a/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/LazyMessageSearchIndex.java b/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/LazyMessageSearchIndex.java
index f9e1bd8..25031e9 100644
--- a/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/LazyMessageSearchIndex.java
+++ b/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/LazyMessageSearchIndex.java
@@ -28,8 +28,8 @@ import org.apache.james.mailbox.model.MessageRange;
 import org.apache.james.mailbox.model.SearchQuery;
 import org.apache.james.mailbox.model.UpdatedFlags;
 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.MailboxId;
 import org.apache.james.mailbox.store.mail.model.MailboxMessage;
 
 /**
@@ -40,15 +40,14 @@ import org.apache.james.mailbox.store.mail.model.MailboxMessage;
  * This class is mostly useful for in-memory indexes or for indexed that should be recreated on every server restart.
  * 
  *
- * @param <Id>
  */
-public class LazyMessageSearchIndex<Id extends MailboxId> extends ListeningMessageSearchIndex<Id> {
+public class LazyMessageSearchIndex extends ListeningMessageSearchIndex {
 
-    private final ListeningMessageSearchIndex<Id> index;
-    private final ConcurrentHashMap<Id, Object> indexed = new ConcurrentHashMap<Id, Object>();
+    private final ListeningMessageSearchIndex index;
+    private final ConcurrentHashMap<MailboxId, Object> indexed = new ConcurrentHashMap<MailboxId, Object>();
     
     
-    public LazyMessageSearchIndex(ListeningMessageSearchIndex<Id> index) {
+    public LazyMessageSearchIndex(ListeningMessageSearchIndex index) {
         super(index.getFactory());
         this.index = index;
     }
@@ -59,17 +58,17 @@ public class LazyMessageSearchIndex<Id extends MailboxId> extends ListeningMessa
     }
 
     @Override
-    public void add(MailboxSession session, Mailbox<Id> mailbox, MailboxMessage<Id> message) throws MailboxException {
+    public void add(MailboxSession session, Mailbox mailbox, MailboxMessage message) throws MailboxException {
         index.add(session, mailbox, message);
     }
 
     @Override
-    public void delete(MailboxSession session, Mailbox<Id> mailbox, List<Long> expungedUids) throws MailboxException {
+    public void delete(MailboxSession session, Mailbox mailbox, List<Long> expungedUids) throws MailboxException {
         index.delete(session, mailbox, expungedUids);
     }
 
     @Override
-    public void deleteAll(MailboxSession session, Mailbox<Id> mailbox) throws MailboxException {
+    public void deleteAll(MailboxSession session, Mailbox mailbox) throws MailboxException {
         index.deleteAll(session, mailbox);
     }
 
@@ -80,8 +79,8 @@ public class LazyMessageSearchIndex<Id extends MailboxId> extends ListeningMessa
      * 
      */
     @Override
-    public Iterator<Long> search(MailboxSession session, Mailbox<Id> mailbox, SearchQuery searchQuery) throws MailboxException {
-        Id id = mailbox.getMailboxId();
+    public Iterator<Long> search(MailboxSession session, Mailbox mailbox, SearchQuery searchQuery) throws MailboxException {
+        MailboxId id = mailbox.getMailboxId();
         
         Object done = indexed.get(id);
         if (done == null) {
@@ -91,9 +90,9 @@ public class LazyMessageSearchIndex<Id extends MailboxId> extends ListeningMessa
                 done = oldDone;
             }
             synchronized (done) {
-                Iterator<MailboxMessage<Id>> messages = getFactory().getMessageMapper(session).findInMailbox(mailbox, MessageRange.all(), FetchType.Full, -1);
+                Iterator<MailboxMessage> messages = getFactory().getMessageMapper(session).findInMailbox(mailbox, MessageRange.all(), FetchType.Full, -1);
                 while(messages.hasNext()) {
-                    final MailboxMessage<Id> message = messages.next();
+                    final MailboxMessage message = messages.next();
                     try {
                         add(session, mailbox, message);
                     } catch (MailboxException e) {
@@ -108,7 +107,7 @@ public class LazyMessageSearchIndex<Id extends MailboxId> extends ListeningMessa
     }
 
     @Override
-    public void update(MailboxSession session, Mailbox<Id> mailbox, List<UpdatedFlags> updatedFlagsList) throws MailboxException {
+    public void update(MailboxSession session, Mailbox mailbox, List<UpdatedFlags> updatedFlagsList) throws MailboxException {
         index.update(session, mailbox, updatedFlagsList);
     }
 }

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/ListeningMessageSearchIndex.java
----------------------------------------------------------------------
diff --git a/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/ListeningMessageSearchIndex.java b/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/ListeningMessageSearchIndex.java
index 52541bf..0495398 100644
--- a/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/ListeningMessageSearchIndex.java
+++ b/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/ListeningMessageSearchIndex.java
@@ -29,7 +29,6 @@ import org.apache.james.mailbox.model.UpdatedFlags;
 import org.apache.james.mailbox.store.event.EventFactory;
 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.MailboxId;
 import org.apache.james.mailbox.store.mail.model.Mailbox;
 import org.apache.james.mailbox.store.mail.model.MailboxMessage;
 
@@ -38,13 +37,12 @@ import org.apache.james.mailbox.store.mail.model.MailboxMessage;
  * notified about message changes. This will then allow to update the underlying index.
  * 
  *
- * @param <Id>
  */
-public abstract class ListeningMessageSearchIndex<Id extends MailboxId> implements MessageSearchIndex<Id>, MailboxListener {
+public abstract class ListeningMessageSearchIndex implements MessageSearchIndex, MailboxListener {
 
-    private final MessageMapperFactory<Id> factory;
+    private final MessageMapperFactory factory;
 
-    public ListeningMessageSearchIndex(MessageMapperFactory<Id> factory) {
+    public ListeningMessageSearchIndex(MessageMapperFactory factory) {
         this.factory = factory;
     }
 
@@ -58,7 +56,7 @@ public abstract class ListeningMessageSearchIndex<Id extends MailboxId> implemen
      * 
      * @return factory
      */
-    protected MessageMapperFactory<Id> getFactory() {
+    protected MessageMapperFactory getFactory() {
         return factory;
     }
     
@@ -67,7 +65,6 @@ public abstract class ListeningMessageSearchIndex<Id extends MailboxId> implemen
      * Process the {@link org.apache.james.mailbox.MailboxListener.Event} and update the index if
      * something relevant is received
      */
-    @SuppressWarnings({ "rawtypes", "unchecked" })
     @Override
     public void event(Event event) {
         final MailboxSession session = event.getSession();
@@ -76,12 +73,12 @@ public abstract class ListeningMessageSearchIndex<Id extends MailboxId> implemen
             if (event instanceof MessageEvent) {
                 if (event instanceof EventFactory.AddedImpl) {
                     EventFactory.AddedImpl added = (EventFactory.AddedImpl) event;
-                    final Mailbox<Id> mailbox = added.getMailbox();
+                    final Mailbox mailbox = added.getMailbox();
 
                     for (Long next : (Iterable<Long>) added.getUids()) {
-                        Iterator<MailboxMessage<Id>> messages = factory.getMessageMapper(session).findInMailbox(mailbox, MessageRange.one(next), FetchType.Full, -1);
+                        Iterator<MailboxMessage> messages = factory.getMessageMapper(session).findInMailbox(mailbox, MessageRange.one(next), FetchType.Full, -1);
                         while (messages.hasNext()) {
-                            MailboxMessage<Id> message = messages.next();
+                            MailboxMessage message = messages.next();
                             try {
                                 add(session, mailbox, message);
                             } catch (MailboxException e) {
@@ -99,7 +96,7 @@ public abstract class ListeningMessageSearchIndex<Id extends MailboxId> implemen
                     }
                 } else if (event instanceof EventFactory.FlagsUpdatedImpl) {
                     EventFactory.FlagsUpdatedImpl flagsUpdated = (EventFactory.FlagsUpdatedImpl) event;
-                    final Mailbox<Id> mailbox = flagsUpdated.getMailbox();
+                    final Mailbox mailbox = flagsUpdated.getMailbox();
 
                     try {
                         update(session, mailbox, flagsUpdated.getUpdatedFlags());
@@ -124,7 +121,7 @@ public abstract class ListeningMessageSearchIndex<Id extends MailboxId> implemen
      * @param message The added message
      * @throws MailboxException
      */
-    public abstract void add(MailboxSession session, Mailbox<Id> mailbox, MailboxMessage<Id> message) throws MailboxException;
+    public abstract void add(MailboxSession session, Mailbox mailbox, MailboxMessage message) throws MailboxException;
 
     /**
      * Delete the concerned UIDs for the given {@link Mailbox} from the index
@@ -134,7 +131,7 @@ public abstract class ListeningMessageSearchIndex<Id extends MailboxId> implemen
      * @param expungedUids UIDS to be deleted
      * @throws MailboxException
      */
-    public abstract void delete(MailboxSession session, Mailbox<Id> mailbox, List<Long> expungedUids) throws MailboxException;
+    public abstract void delete(MailboxSession session, Mailbox mailbox, List<Long> expungedUids) throws MailboxException;
 
     /**
      * Delete the messages contained in the given {@link Mailbox} from the index
@@ -143,7 +140,7 @@ public abstract class ListeningMessageSearchIndex<Id extends MailboxId> implemen
      * @param mailbox mailbox on which the expunge was performed
      * @throws MailboxException
      */
-    public abstract void deleteAll(MailboxSession session, Mailbox<Id> mailbox) throws MailboxException;
+    public abstract void deleteAll(MailboxSession session, Mailbox mailbox) throws MailboxException;
     
     /**
      * Update the messages concerned by the updated flags list for the given {@link Mailbox}
@@ -153,5 +150,5 @@ public abstract class ListeningMessageSearchIndex<Id extends MailboxId> implemen
      * @param updatedFlagsList list of flags that were updated
      * @throws MailboxException
      */
-    public abstract void update(MailboxSession session, Mailbox<Id> mailbox, List<UpdatedFlags> updatedFlagsList) throws MailboxException;
+    public abstract void update(MailboxSession session, Mailbox mailbox, List<UpdatedFlags> updatedFlagsList) throws MailboxException;
 }

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/MessageSearchIndex.java
----------------------------------------------------------------------
diff --git a/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/MessageSearchIndex.java b/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/MessageSearchIndex.java
index 81f6183..459af2c 100644
--- a/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/MessageSearchIndex.java
+++ b/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/MessageSearchIndex.java
@@ -24,7 +24,6 @@ import java.util.Iterator;
 import org.apache.james.mailbox.MailboxSession;
 import org.apache.james.mailbox.exception.MailboxException;
 import org.apache.james.mailbox.model.SearchQuery;
-import org.apache.james.mailbox.store.mail.model.MailboxId;
 import org.apache.james.mailbox.store.mail.model.Mailbox;
 
 
@@ -36,7 +35,7 @@ import org.apache.james.mailbox.store.mail.model.Mailbox;
  *
  * @param <Id>
  */
-public interface MessageSearchIndex<Id extends MailboxId> {
+public interface MessageSearchIndex {
     
     /**
      * Return all uids of the previous indexed {@link Mailbox}'s which match the {@link SearchQuery}
@@ -46,5 +45,5 @@ public interface MessageSearchIndex<Id extends MailboxId> {
      * @return Iterator on found uids
      * @throws MailboxException
      */
-    Iterator<Long> search(MailboxSession session, Mailbox<Id> mailbox, SearchQuery searchQuery) throws MailboxException;
+    Iterator<Long> search(MailboxSession session, Mailbox mailbox, SearchQuery searchQuery) throws MailboxException;
 }

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/MessageSearches.java
----------------------------------------------------------------------
diff --git a/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/MessageSearches.java b/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/MessageSearches.java
index 0bed7de..13863e0 100644
--- a/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/MessageSearches.java
+++ b/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/MessageSearches.java
@@ -36,7 +36,6 @@ import java.util.TreeSet;
 
 import javax.mail.Flags;
 
-import com.google.common.collect.Lists;
 import org.apache.james.mailbox.exception.MailboxException;
 import org.apache.james.mailbox.exception.UnsupportedSearchException;
 import org.apache.james.mailbox.model.MessageResult.Header;
@@ -61,20 +60,22 @@ import org.apache.james.mime4j.field.datetime.parser.ParseException;
 import org.apache.james.mime4j.utils.search.MessageMatcher;
 import org.slf4j.Logger;
 
+import com.google.common.collect.Lists;
+
 /**
  * Utility methods to help perform search operations.
  */
 public class MessageSearches implements Iterable<Long> {
 
-    private Iterator<MailboxMessage<?>> messages;
+    private Iterator<MailboxMessage> messages;
     private SearchQuery query;
     private Logger log;
 
-    public MessageSearches(Iterator<MailboxMessage<?>> messages, SearchQuery query) {
+    public MessageSearches(Iterator<MailboxMessage> messages, SearchQuery query) {
         this(messages, query, null);
     }
 
-    public MessageSearches(Iterator<MailboxMessage<?>> messages, SearchQuery query, Logger log) {
+    public MessageSearches(Iterator<MailboxMessage> messages, SearchQuery query, Logger log) {
         this.messages = messages;
         this.query = query;
         this.log = log;
@@ -87,9 +88,9 @@ public class MessageSearches implements Iterable<Long> {
     }
 
     private Collection<Long> search() {
-        TreeSet<MailboxMessage<?>> matched = new TreeSet<MailboxMessage<?>>(CombinedComparator.create(query.getSorts()));
+        TreeSet<MailboxMessage> matched = new TreeSet<MailboxMessage>(CombinedComparator.create(query.getSorts()));
         while (messages.hasNext()) {
-            MailboxMessage<?> m = messages.next();
+            MailboxMessage m = messages.next();
             try {
                 if (isMatch(query, m, log)) {
                     matched.add(m);
@@ -99,7 +100,7 @@ public class MessageSearches implements Iterable<Long> {
             }
         }
         Set<Long> uids = new HashSet<Long>();
-        Iterator<MailboxMessage<?>> matchedIt = matched.iterator();
+        Iterator<MailboxMessage> matchedIt = matched.iterator();
         while (matchedIt.hasNext()) {
             uids.add(matchedIt.next().getUid());
         }
@@ -119,7 +120,7 @@ public class MessageSearches implements Iterable<Long> {
      *         <code>false</code> otherwise
      * @throws MailboxException
      */
-    protected boolean isMatch(SearchQuery query, MailboxMessage<?> message, Logger log) throws MailboxException {
+    protected boolean isMatch(SearchQuery query, MailboxMessage message, Logger log) throws MailboxException {
         final List<SearchQuery.Criterion> criteria = query.getCriterias();
         final Collection<Long> recentMessageUids = query.getRecentMessageUids();
         boolean result = true;
@@ -149,7 +150,7 @@ public class MessageSearches implements Iterable<Long> {
      *         <code>false</code> otherwise
      * @throws MailboxException
      */
-    public boolean isMatch(SearchQuery.Criterion criterion, MailboxMessage<?> message,
+    public boolean isMatch(SearchQuery.Criterion criterion, MailboxMessage message,
             final Collection<Long> recentMessageUids, Logger log) throws MailboxException {
         final boolean result;
         if (criterion instanceof SearchQuery.InternalDateCriterion) {
@@ -182,7 +183,7 @@ public class MessageSearches implements Iterable<Long> {
         return result;
     }
 
-    protected boolean matches(SearchQuery.TextCriterion criterion, MailboxMessage<?> message, Logger log)
+    protected boolean matches(SearchQuery.TextCriterion criterion, MailboxMessage message, Logger log)
             throws MailboxException {
         try {
             final SearchQuery.ContainsOperator operator = criterion.getOperator();
@@ -202,7 +203,7 @@ public class MessageSearches implements Iterable<Long> {
         }
     }
 
-    protected boolean bodyContains(String value, MailboxMessage<?> message, Logger log) throws IOException, MimeException {
+    protected boolean bodyContains(String value, MailboxMessage message, Logger log) throws IOException, MimeException {
         final InputStream input = message.getFullContent();
         return isInMessage(value, input, false, log);
     }
@@ -218,12 +219,12 @@ public class MessageSearches implements Iterable<Long> {
         return builder.build().messageMatches(input);
     }
 
-    protected boolean messageContains(String value, MailboxMessage<?> message, Logger log) throws IOException, MimeException {
+    protected boolean messageContains(String value, MailboxMessage message, Logger log) throws IOException, MimeException {
         final InputStream input = message.getFullContent();
         return isInMessage(value, input, true, log);
     }
 
-    private boolean matches(SearchQuery.ConjunctionCriterion criterion, MailboxMessage<?> message,
+    private boolean matches(SearchQuery.ConjunctionCriterion criterion, MailboxMessage message,
             final Collection<Long> recentMessageUids, Logger log) throws MailboxException {
         final List<SearchQuery.Criterion> criteria = criterion.getCriteria();
         switch (criterion.getType()) {
@@ -238,7 +239,7 @@ public class MessageSearches implements Iterable<Long> {
         }
     }
 
-    private boolean and(List<SearchQuery.Criterion> criteria, MailboxMessage<?> message,
+    private boolean and(List<SearchQuery.Criterion> criteria, MailboxMessage message,
             final Collection<Long> recentMessageUids, Logger log) throws MailboxException {
         boolean result = true;
         for (SearchQuery.Criterion criterion : criteria) {
@@ -251,7 +252,7 @@ public class MessageSearches implements Iterable<Long> {
         return result;
     }
 
-    private boolean or(List<SearchQuery.Criterion> criteria, MailboxMessage<?> message,
+    private boolean or(List<SearchQuery.Criterion> criteria, MailboxMessage message,
             final Collection<Long> recentMessageUids, Logger log) throws MailboxException {
         boolean result = false;
         for (SearchQuery.Criterion criterion : criteria) {
@@ -264,7 +265,7 @@ public class MessageSearches implements Iterable<Long> {
         return result;
     }
 
-    private boolean nor(List<SearchQuery.Criterion> criteria, MailboxMessage<?> message,
+    private boolean nor(List<SearchQuery.Criterion> criteria, MailboxMessage message,
             final Collection<Long> recentMessageUids, Logger log) throws MailboxException {
         boolean result = true;
         for (SearchQuery.Criterion criterion : criteria) {
@@ -277,7 +278,7 @@ public class MessageSearches implements Iterable<Long> {
         return result;
     }
 
-    private boolean matches(SearchQuery.FlagCriterion criterion, MailboxMessage<?> message,
+    private boolean matches(SearchQuery.FlagCriterion criterion, MailboxMessage message,
             Collection<Long> recentMessageUids) {
         SearchQuery.BooleanOperator operator = criterion.getOperator();
         boolean isSet = operator.isSet();
@@ -302,7 +303,7 @@ public class MessageSearches implements Iterable<Long> {
         return result;
     }
 
-    private boolean matches(SearchQuery.CustomFlagCriterion criterion, MailboxMessage<?> message,
+    private boolean matches(SearchQuery.CustomFlagCriterion criterion, MailboxMessage message,
             Collection<Long> recentMessageUids) {
         SearchQuery.BooleanOperator operator = criterion.getOperator();
         boolean isSet = operator.isSet();
@@ -310,7 +311,7 @@ public class MessageSearches implements Iterable<Long> {
         return isSet == message.createFlags().contains(flag);
     }
 
-    private boolean matches(SearchQuery.UidCriterion criterion, MailboxMessage<?> message) {
+    private boolean matches(SearchQuery.UidCriterion criterion, MailboxMessage message) {
         SearchQuery.InOperator operator = criterion.getOperator();
         NumericRange[] ranges = operator.getRange();
         long uid = message.getUid();
@@ -324,7 +325,7 @@ public class MessageSearches implements Iterable<Long> {
         return result;
     }
 
-    private boolean matches(SearchQuery.HeaderCriterion criterion, MailboxMessage<?> message, Logger log)
+    private boolean matches(SearchQuery.HeaderCriterion criterion, MailboxMessage message, Logger log)
             throws MailboxException, IOException {
         SearchQuery.HeaderOperator operator = criterion.getOperator();
         String headerName = criterion.getHeaderName();
@@ -354,7 +355,7 @@ public class MessageSearches implements Iterable<Long> {
      * @throws IOException
      */
     private boolean matchesAddress(SearchQuery.AddressOperator operator, String headerName,
-                                   MailboxMessage<?> message, Logger log) throws MailboxException, IOException {
+                                   MailboxMessage message, Logger log) throws MailboxException, IOException {
         String text = operator.getAddress().toUpperCase(Locale.ENGLISH);
         List<Header> headers = ResultUtils.createHeaders(message);
         for (Header header : headers) {
@@ -386,7 +387,7 @@ public class MessageSearches implements Iterable<Long> {
         return false;
     }
 
-    private boolean exists(String headerName, MailboxMessage<?> message) throws MailboxException, IOException {
+    private boolean exists(String headerName, MailboxMessage message) throws MailboxException, IOException {
         boolean result = false;
         List<Header> headers = ResultUtils.createHeaders(message);
 
@@ -401,7 +402,7 @@ public class MessageSearches implements Iterable<Long> {
     }
 
     private boolean matches(SearchQuery.ContainsOperator operator, String headerName,
-            MailboxMessage<?> message) throws MailboxException, IOException {
+            MailboxMessage message) throws MailboxException, IOException {
         String text = operator.getValue().toUpperCase();
         boolean result = false;
         List<Header> headers = ResultUtils.createHeaders(message);
@@ -420,7 +421,7 @@ public class MessageSearches implements Iterable<Long> {
         return result;
     }
 
-    private boolean matches(SearchQuery.DateOperator operator, String headerName, MailboxMessage<?> message)
+    private boolean matches(SearchQuery.DateOperator operator, String headerName, MailboxMessage message)
             throws MailboxException {
 
         Date date = operator.getDate();
@@ -452,7 +453,7 @@ public class MessageSearches implements Iterable<Long> {
         }
     }
 
-    private String headerValue(String headerName, MailboxMessage<?> message) throws MailboxException, IOException {
+    private String headerValue(String headerName, MailboxMessage message) throws MailboxException, IOException {
         List<Header> headers = ResultUtils.createHeaders(message);
         String value = null;
         for (Header header : headers) {
@@ -474,7 +475,7 @@ public class MessageSearches implements Iterable<Long> {
         return cal.getTime();
     }
 
-    private boolean matches(SearchQuery.SizeCriterion criterion, MailboxMessage<?> message) throws UnsupportedSearchException {
+    private boolean matches(SearchQuery.SizeCriterion criterion, MailboxMessage message) throws UnsupportedSearchException {
         SearchQuery.NumericOperator operator = criterion.getOperator();
         long size = message.getFullContentOctets();
         long value = operator.getValue();
@@ -490,7 +491,7 @@ public class MessageSearches implements Iterable<Long> {
         }
     }
 
-    private boolean matches(SearchQuery.ModSeqCriterion criterion, MailboxMessage<?> message)
+    private boolean matches(SearchQuery.ModSeqCriterion criterion, MailboxMessage message)
             throws UnsupportedSearchException {
         SearchQuery.NumericOperator operator = criterion.getOperator();
         long modSeq = message.getModSeq();
@@ -507,13 +508,13 @@ public class MessageSearches implements Iterable<Long> {
         }
     }
 
-    private boolean matches(SearchQuery.InternalDateCriterion criterion, MailboxMessage<?> message)
+    private boolean matches(SearchQuery.InternalDateCriterion criterion, MailboxMessage message)
             throws UnsupportedSearchException {
         SearchQuery.DateOperator operator = criterion.getOperator();
         return matchesInternalDate(operator, message);
     }
 
-    private boolean matchesInternalDate(SearchQuery.DateOperator operator, MailboxMessage<?> message)
+    private boolean matchesInternalDate(SearchQuery.DateOperator operator, MailboxMessage message)
             throws UnsupportedSearchException {
         Date date = operator.getDate();
         DateResolution res = operator.getDateResultion();


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