james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From adup...@apache.org
Subject [09/13] james-project git commit: JAMES-1733 Remove generics from mailbox API
Date Tue, 17 May 2016 08:14:55 GMT
http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/lucene/src/main/java/org/apache/james/mailbox/lucene/search/LuceneMessageSearchIndex.java
----------------------------------------------------------------------
diff --git a/mailbox/lucene/src/main/java/org/apache/james/mailbox/lucene/search/LuceneMessageSearchIndex.java b/mailbox/lucene/src/main/java/org/apache/james/mailbox/lucene/search/LuceneMessageSearchIndex.java
index 05c7f6b..c9585b5 100644
--- a/mailbox/lucene/src/main/java/org/apache/james/mailbox/lucene/search/LuceneMessageSearchIndex.java
+++ b/mailbox/lucene/src/main/java/org/apache/james/mailbox/lucene/search/LuceneMessageSearchIndex.java
@@ -58,7 +58,6 @@ import org.apache.james.mailbox.model.SearchQuery.NumericRange;
 import org.apache.james.mailbox.model.SearchQuery.UidCriterion;
 import org.apache.james.mailbox.model.UpdatedFlags;
 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;
 import org.apache.james.mailbox.store.search.ListeningMessageSearchIndex;
@@ -115,9 +114,9 @@ import org.apache.lucene.util.Version;
  * 
  * 
 
- * @param <Id>
+ * @param 
  */
-public class LuceneMessageSearchIndex<Id extends MailboxId> extends ListeningMessageSearchIndex<Id> {
+public class LuceneMessageSearchIndex extends ListeningMessageSearchIndex {
     private final static Date MAX_DATE;
     private final static Date MIN_DATE;
     
@@ -335,18 +334,18 @@ public class LuceneMessageSearchIndex<Id extends MailboxId> extends ListeningMes
     private final static SortField FIRST_FROM_MAILBOX_DISPLAY_SORT_REVERSE = new SortField(FIRST_FROM_MAILBOX_DISPLAY_FIELD, SortField.STRING, true);
 
     
-    public LuceneMessageSearchIndex(MessageMapperFactory<Id> factory, Directory directory) throws CorruptIndexException, LockObtainFailedException, IOException {
+    public LuceneMessageSearchIndex(MessageMapperFactory factory, Directory directory) throws CorruptIndexException, LockObtainFailedException, IOException {
         this(factory, directory, false, true);
     }
     
     
-    public LuceneMessageSearchIndex(MessageMapperFactory<Id> factory, Directory directory, boolean dropIndexOnStart, boolean lenient) throws CorruptIndexException, LockObtainFailedException, IOException {
+    public LuceneMessageSearchIndex(MessageMapperFactory factory, Directory directory, boolean dropIndexOnStart, boolean lenient) throws CorruptIndexException, LockObtainFailedException, IOException {
         super(factory);
         this.writer = new IndexWriter(directory,  createConfig(createAnalyzer(lenient), dropIndexOnStart));
     }
     
     
-    public LuceneMessageSearchIndex(MessageMapperFactory<Id> factory, IndexWriter writer) {
+    public LuceneMessageSearchIndex(MessageMapperFactory factory, IndexWriter writer) {
         super(factory);
         this.writer = writer;
     }
@@ -409,7 +408,7 @@ public class LuceneMessageSearchIndex<Id extends MailboxId> extends ListeningMes
     /**
      * @see org.apache.james.mailbox.store.search.MessageSearchIndex#search(org.apache.james.mailbox.MailboxSession, org.apache.james.mailbox.store.mail.model.Mailbox, org.apache.james.mailbox.model.SearchQuery)
      */
-    public Iterator<Long> search(MailboxSession session, Mailbox<Id> mailbox, SearchQuery searchQuery) throws MailboxException {
+    public Iterator<Long> search(MailboxSession session, Mailbox mailbox, SearchQuery searchQuery) throws MailboxException {
         Set<Long> uids = new LinkedHashSet<Long>();
         IndexSearcher searcher = null;
 
@@ -454,7 +453,7 @@ public class LuceneMessageSearchIndex<Id extends MailboxId> extends ListeningMes
      * @param membership
      * @return document
      */
-    private Document createMessageDocument(final MailboxSession session, final MailboxMessage<?> membership) throws MailboxException{
+    private Document createMessageDocument(final MailboxSession session, final MailboxMessage membership) throws MailboxException{
         final Document doc = new Document();
         // TODO: Better handling
         doc.add(new Field(MAILBOX_ID_FIELD, membership.getMailboxId().serialize().toUpperCase(Locale.ENGLISH), Store.YES, Index.NOT_ANALYZED));
@@ -886,7 +885,7 @@ public class LuceneMessageSearchIndex<Id extends MailboxId> extends ListeningMes
      * @return query
      * @throws UnsupportedSearchException
      */
-    private Query createFlagQuery(String flag, boolean isSet, Mailbox<?> mailbox, Collection<Long> recentUids) throws MailboxException, UnsupportedSearchException {
+    private Query createFlagQuery(String flag, boolean isSet, Mailbox mailbox, Collection<Long> recentUids) throws MailboxException, UnsupportedSearchException {
         BooleanQuery query = new BooleanQuery();
         
         if (isSet) {   
@@ -1115,7 +1114,7 @@ public class LuceneMessageSearchIndex<Id extends MailboxId> extends ListeningMes
      * @return query
      * @throws UnsupportedSearchException
      */
-    private Query createConjunctionQuery(SearchQuery.ConjunctionCriterion crit, Mailbox<?> mailbox, Collection<Long> recentUids) throws UnsupportedSearchException, MailboxException {
+    private Query createConjunctionQuery(SearchQuery.ConjunctionCriterion crit, Mailbox mailbox, Collection<Long> recentUids) throws UnsupportedSearchException, MailboxException {
         List<Criterion> crits = crit.getCriteria();
         BooleanQuery conQuery = new BooleanQuery();
         switch (crit.getType()) {
@@ -1151,7 +1150,7 @@ public class LuceneMessageSearchIndex<Id extends MailboxId> extends ListeningMes
      * @return query
      * @throws UnsupportedSearchException
      */
-    private Query createQuery(Criterion criterion, Mailbox<?> mailbox, Collection<Long> recentUids) throws UnsupportedSearchException, MailboxException {
+    private Query createQuery(Criterion criterion, Mailbox mailbox, Collection<Long> recentUids) throws UnsupportedSearchException, MailboxException {
         if (criterion instanceof SearchQuery.InternalDateCriterion) {
             SearchQuery.InternalDateCriterion crit = (SearchQuery.InternalDateCriterion) criterion;
             return createInternalDateQuery(crit);
@@ -1190,7 +1189,7 @@ public class LuceneMessageSearchIndex<Id extends MailboxId> extends ListeningMes
     /**
      * @see org.apache.james.mailbox.store.search.ListeningMessageSearchIndex#add(org.apache.james.mailbox.MailboxSession, org.apache.james.mailbox.store.mail.model.Mailbox, MailboxMessage)
      */
-    public void add(MailboxSession session, Mailbox<Id> mailbox, MailboxMessage<Id> membership) throws MailboxException {
+    public void add(MailboxSession session, Mailbox mailbox, MailboxMessage membership) throws MailboxException {
         Document doc = createMessageDocument(session, membership);
         Document flagsDoc = createFlagsDocument(membership);
 
@@ -1208,13 +1207,13 @@ public class LuceneMessageSearchIndex<Id extends MailboxId> extends ListeningMes
      * @see ListeningMessageSearchIndex#update
      */
     @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 {
         for (UpdatedFlags updatedFlags : updatedFlagsList) {
             update(mailbox, updatedFlags.getUid(), updatedFlags.getNewFlags());
         }
     }
 
-    private void update(Mailbox<Id> mailbox, long uid, Flags f) throws MailboxException {
+    private void update(Mailbox mailbox, long uid, Flags f) throws MailboxException {
         IndexSearcher searcher = null;
         try {
             searcher = new IndexSearcher(IndexReader.open(writer, true));
@@ -1255,7 +1254,7 @@ public class LuceneMessageSearchIndex<Id extends MailboxId> extends ListeningMes
      * @param f
      * @param doc
      */
-    private Document createFlagsDocument(MailboxMessage<?> message) {
+    private Document createFlagsDocument(MailboxMessage message) {
         Document doc = new Document();
         doc.add(new Field(ID_FIELD, "flags-" + message.getMailboxId().serialize() +"-" + Long.toString(message.getUid()), Store.YES, Index.NOT_ANALYZED));
         doc.add(new Field(MAILBOX_ID_FIELD, message.getMailboxId().serialize(), Store.YES, Index.NOT_ANALYZED));
@@ -1303,7 +1302,7 @@ public class LuceneMessageSearchIndex<Id extends MailboxId> extends ListeningMes
     }
 
     @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 {
         Collection<MessageRange> messageRanges = MessageRange.toRanges(expungedUids);
         for (MessageRange messageRange : messageRanges) {
             delete(mailbox, messageRange);
@@ -1311,11 +1310,11 @@ public class LuceneMessageSearchIndex<Id extends MailboxId> extends ListeningMes
     }
 
     @Override
-    public void deleteAll(MailboxSession session, Mailbox<Id> mailbox) throws MailboxException {
+    public void deleteAll(MailboxSession session, Mailbox mailbox) throws MailboxException {
         delete(mailbox, MessageRange.all());
     }
 
-    public void delete(Mailbox<Id> mailbox, MessageRange range) throws MailboxException {
+    public void delete(Mailbox mailbox, MessageRange range) throws MailboxException {
         BooleanQuery query = new BooleanQuery();
         query.add(new TermQuery(new Term(MAILBOX_ID_FIELD, mailbox.getMailboxId().serialize())), BooleanClause.Occur.MUST);
         query.add(createQuery(range), BooleanClause.Occur.MUST);

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/lucene/src/test/java/org/apache/james/mailbox/lucene/search/LuceneMailboxMessageSearchIndexTest.java
----------------------------------------------------------------------
diff --git a/mailbox/lucene/src/test/java/org/apache/james/mailbox/lucene/search/LuceneMailboxMessageSearchIndexTest.java b/mailbox/lucene/src/test/java/org/apache/james/mailbox/lucene/search/LuceneMailboxMessageSearchIndexTest.java
index 2f052ad..f116bfb 100644
--- a/mailbox/lucene/src/test/java/org/apache/james/mailbox/lucene/search/LuceneMailboxMessageSearchIndexTest.java
+++ b/mailbox/lucene/src/test/java/org/apache/james/mailbox/lucene/search/LuceneMailboxMessageSearchIndexTest.java
@@ -36,10 +36,10 @@ import javax.mail.Flags.Flag;
 
 import org.apache.james.mailbox.model.MailboxACL;
 import org.apache.james.mailbox.model.SearchQuery;
-import org.apache.james.mailbox.model.SimpleMailboxACL;
 import org.apache.james.mailbox.model.SearchQuery.AddressType;
 import org.apache.james.mailbox.model.SearchQuery.DateResolution;
 import org.apache.james.mailbox.model.SearchQuery.Sort.SortClause;
+import org.apache.james.mailbox.model.SimpleMailboxACL;
 import org.apache.james.mailbox.store.MessageBuilder;
 import org.apache.james.mailbox.store.SimpleMailboxMembership;
 import org.apache.james.mailbox.store.TestId;
@@ -50,7 +50,7 @@ import org.junit.Test;
 
 public class LuceneMailboxMessageSearchIndexTest {
 
-	private LuceneMessageSearchIndex<TestId> index;
+	private LuceneMessageSearchIndex index;
     
     private SimpleMailbox mailbox = new SimpleMailbox(0);
     private SimpleMailbox mailbox2 = new SimpleMailbox(1);
@@ -75,7 +75,7 @@ public class LuceneMailboxMessageSearchIndexTest {
     
     @Before
     public void setUp() throws Exception {
-        index = new LuceneMessageSearchIndex<TestId>(null, new RAMDirectory(), true, useLenient());
+        index = new LuceneMessageSearchIndex(null, new RAMDirectory(), true, useLenient());
         index.setEnableSuffixMatch(true);
         Map<String, String> headersSubject = new HashMap<String, String>();
         headersSubject.put("Subject", "test (fwd)");
@@ -702,7 +702,7 @@ public class LuceneMailboxMessageSearchIndexTest {
         assertFalse(it4.hasNext());
     }
     
-    private final class SimpleMailbox implements Mailbox<TestId> {
+    private final class SimpleMailbox implements Mailbox {
         private final TestId id;
 
         public SimpleMailbox(long id) {

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/maildir/src/main/java/org/apache/james/mailbox/maildir/MaildirMailboxIdDeserializer.java
----------------------------------------------------------------------
diff --git a/mailbox/maildir/src/main/java/org/apache/james/mailbox/maildir/MaildirMailboxIdDeserializer.java b/mailbox/maildir/src/main/java/org/apache/james/mailbox/maildir/MaildirMailboxIdDeserializer.java
index 48a2ace..16f301c 100644
--- a/mailbox/maildir/src/main/java/org/apache/james/mailbox/maildir/MaildirMailboxIdDeserializer.java
+++ b/mailbox/maildir/src/main/java/org/apache/james/mailbox/maildir/MaildirMailboxIdDeserializer.java
@@ -22,7 +22,7 @@ package org.apache.james.mailbox.maildir;
 import org.apache.james.mailbox.store.mail.model.MailboxIdDeserialisationException;
 import org.apache.james.mailbox.store.mail.model.MailboxIdDeserializer;
 
-public class MaildirMailboxIdDeserializer implements MailboxIdDeserializer<MaildirId> {
+public class MaildirMailboxIdDeserializer implements MailboxIdDeserializer {
 
     @Override
     public MaildirId deserialize(String serializedMailboxId) throws MailboxIdDeserialisationException {

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/maildir/src/main/java/org/apache/james/mailbox/maildir/MaildirMailboxSessionMapperFactory.java
----------------------------------------------------------------------
diff --git a/mailbox/maildir/src/main/java/org/apache/james/mailbox/maildir/MaildirMailboxSessionMapperFactory.java b/mailbox/maildir/src/main/java/org/apache/james/mailbox/maildir/MaildirMailboxSessionMapperFactory.java
index daa581a..de572a5 100644
--- a/mailbox/maildir/src/main/java/org/apache/james/mailbox/maildir/MaildirMailboxSessionMapperFactory.java
+++ b/mailbox/maildir/src/main/java/org/apache/james/mailbox/maildir/MaildirMailboxSessionMapperFactory.java
@@ -30,7 +30,7 @@ import org.apache.james.mailbox.store.mail.MessageMapper;
 import org.apache.james.mailbox.store.user.SubscriptionMapper;
 
 public class MaildirMailboxSessionMapperFactory extends
-        MailboxSessionMapperFactory<MaildirId> {
+        MailboxSessionMapperFactory {
 
     private final MaildirStore store;
 
@@ -41,13 +41,13 @@ public class MaildirMailboxSessionMapperFactory extends
     
     
     @Override
-    public MailboxMapper<MaildirId> createMailboxMapper(MailboxSession session)
+    public MailboxMapper createMailboxMapper(MailboxSession session)
             throws MailboxException {
         return new MaildirMailboxMapper(store, session);
     }
 
     @Override
-    public MessageMapper<MaildirId> createMessageMapper(MailboxSession session)
+    public MessageMapper createMessageMapper(MailboxSession session)
             throws MailboxException {
         return new MaildirMessageMapper(session, store);
     }

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/maildir/src/main/java/org/apache/james/mailbox/maildir/MaildirStore.java
----------------------------------------------------------------------
diff --git a/mailbox/maildir/src/main/java/org/apache/james/mailbox/maildir/MaildirStore.java b/mailbox/maildir/src/main/java/org/apache/james/mailbox/maildir/MaildirStore.java
index e1a540c..ee21117 100644
--- a/mailbox/maildir/src/main/java/org/apache/james/mailbox/maildir/MaildirStore.java
+++ b/mailbox/maildir/src/main/java/org/apache/james/mailbox/maildir/MaildirStore.java
@@ -34,7 +34,7 @@ import org.apache.james.mailbox.store.mail.UidProvider;
 import org.apache.james.mailbox.store.mail.model.Mailbox;
 import org.apache.james.mailbox.store.mail.model.impl.SimpleMailbox;
 
-public class MaildirStore implements UidProvider<MaildirId>, ModSeqProvider<MaildirId> {
+public class MaildirStore implements UidProvider, ModSeqProvider {
 
     public static final String PATH_USER = "%user";
     public static final String PATH_DOMAIN = "%domain";
@@ -78,7 +78,7 @@ public class MaildirStore implements UidProvider<MaildirId>, ModSeqProvider<Mail
      * @param mailbox
      * @return The MaildirFolder
      */
-    public MaildirFolder createMaildirFolder(Mailbox<MaildirId> mailbox) {
+    public MaildirFolder createMaildirFolder(Mailbox mailbox) {
         MaildirFolder mf = new MaildirFolder(getFolderName(mailbox), new MailboxPath(mailbox.getNamespace(), mailbox.getUser(), mailbox.getName()), locker);
         mf.setMessageNameStrictParse(isMessageNameStrictParse());
         return mf;
@@ -93,7 +93,7 @@ public class MaildirStore implements UidProvider<MaildirId>, ModSeqProvider<Mail
      * @return The Mailbox object populated with data from the file system
      * @throws MailboxException If the mailbox folder doesn't exist or can't be read
      */
-    public Mailbox<MaildirId> loadMailbox(MailboxSession session, File root, String namespace, String user, String folderName) throws MailboxException {
+    public Mailbox loadMailbox(MailboxSession session, File root, String namespace, String user, String folderName) throws MailboxException {
         String mailboxName = getMailboxNameFromFolderName(folderName);
         return loadMailbox(session, new File(root, folderName), new MailboxPath(namespace, user, mailboxName));
     }
@@ -105,7 +105,7 @@ public class MaildirStore implements UidProvider<MaildirId>, ModSeqProvider<Mail
      * @throws MailboxNotFoundException If the mailbox folder doesn't exist
      * @throws MailboxException If the mailbox folder can't be read
      */
-    public Mailbox<MaildirId> loadMailbox(MailboxSession session, MailboxPath mailboxPath)
+    public Mailbox loadMailbox(MailboxSession session, MailboxPath mailboxPath)
     throws MailboxNotFoundException, MailboxException {
         MaildirFolder folder = new MaildirFolder(getFolderName(mailboxPath), mailboxPath, locker);
         folder.setMessageNameStrictParse(isMessageNameStrictParse());
@@ -121,11 +121,11 @@ public class MaildirStore implements UidProvider<MaildirId>, ModSeqProvider<Mail
      * @return The Mailbox object populated with data from the file system
      * @throws MailboxException If the mailbox folder doesn't exist or can't be read
      */
-    private Mailbox<MaildirId> loadMailbox(MailboxSession session, File mailboxFile, MailboxPath mailboxPath) throws MailboxException {
+    private Mailbox loadMailbox(MailboxSession session, File mailboxFile, MailboxPath mailboxPath) throws MailboxException {
         MaildirFolder folder = new MaildirFolder(mailboxFile.getAbsolutePath(), mailboxPath, locker);
         folder.setMessageNameStrictParse(isMessageNameStrictParse());
         try {
-            Mailbox<MaildirId> loadedMailbox = new SimpleMailbox<MaildirId>(mailboxPath, folder.getUidValidity());
+            Mailbox loadedMailbox = new SimpleMailbox(mailboxPath, folder.getUidValidity());
             loadedMailbox.setACL(folder.getACL(session));
             return loadedMailbox;
         } catch (IOException e) {
@@ -224,7 +224,7 @@ public class MaildirStore implements UidProvider<MaildirId>, ModSeqProvider<Mail
      * @param mailbox The mailbox
      * @return The absolute path to the folder containing the mailbox
      */
-    public String getFolderName(Mailbox<MaildirId> mailbox) {
+    public String getFolderName(Mailbox mailbox) {
         return getFolderName(mailbox.getNamespace(), mailbox.getUser(), mailbox.getName());
     }
     
@@ -241,7 +241,7 @@ public class MaildirStore implements UidProvider<MaildirId>, ModSeqProvider<Mail
      * @see org.apache.james.mailbox.store.mail.UidProvider#nextUid(org.apache.james.mailbox.MailboxSession, org.apache.james.mailbox.store.mail.model.Mailbox)
      */
     @Override
-    public long nextUid(MailboxSession session, Mailbox<MaildirId> mailbox) throws MailboxException {
+    public long nextUid(MailboxSession session, Mailbox mailbox) throws MailboxException {
         try {
             return createMaildirFolder(mailbox).getLastUid(session) +1;
         } catch (MailboxException e) {
@@ -250,12 +250,12 @@ public class MaildirStore implements UidProvider<MaildirId>, ModSeqProvider<Mail
     }
 
     @Override
-    public long nextModSeq(MailboxSession session, Mailbox<MaildirId> mailbox) throws MailboxException {
+    public long nextModSeq(MailboxSession session, Mailbox mailbox) throws MailboxException {
         return System.currentTimeMillis();
     }
 
     @Override
-    public long highestModSeq(MailboxSession session, Mailbox<MaildirId> mailbox) throws MailboxException {
+    public long highestModSeq(MailboxSession session, Mailbox mailbox) throws MailboxException {
         try {
             return createMaildirFolder(mailbox).getHighestModSeq();
         } catch (IOException e) {
@@ -264,7 +264,7 @@ public class MaildirStore implements UidProvider<MaildirId>, ModSeqProvider<Mail
     }
 
     @Override
-    public long lastUid(MailboxSession session, Mailbox<MaildirId> mailbox) throws MailboxException {
+    public long lastUid(MailboxSession session, Mailbox mailbox) throws MailboxException {
        return createMaildirFolder(mailbox).getLastUid(session);
     }
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/maildir/src/main/java/org/apache/james/mailbox/maildir/mail/MaildirMailboxMapper.java
----------------------------------------------------------------------
diff --git a/mailbox/maildir/src/main/java/org/apache/james/mailbox/maildir/mail/MaildirMailboxMapper.java b/mailbox/maildir/src/main/java/org/apache/james/mailbox/maildir/mail/MaildirMailboxMapper.java
index fbb874e..629afb9 100644
--- a/mailbox/maildir/src/main/java/org/apache/james/mailbox/maildir/mail/MaildirMailboxMapper.java
+++ b/mailbox/maildir/src/main/java/org/apache/james/mailbox/maildir/mail/MaildirMailboxMapper.java
@@ -43,7 +43,7 @@ import org.apache.james.mailbox.store.mail.model.Mailbox;
 import org.apache.james.mailbox.store.mail.model.impl.SimpleMailbox;
 import org.apache.james.mailbox.store.transaction.NonTransactionalMapper;
 
-public class MaildirMailboxMapper extends NonTransactionalMapper implements MailboxMapper<MaildirId> {
+public class MaildirMailboxMapper extends NonTransactionalMapper implements MailboxMapper {
 
     /**
      * The {@link MaildirStore} the mailboxes reside in
@@ -53,7 +53,7 @@ public class MaildirMailboxMapper extends NonTransactionalMapper implements Mail
     /**
      * A request-scoped list of mailboxes in order to refer to them via id
      */
-    private final ArrayList<Mailbox<MaildirId>> mailboxCache = new ArrayList<Mailbox<MaildirId>>();
+    private final ArrayList<Mailbox> mailboxCache = new ArrayList<Mailbox>();
 
     private final MailboxSession session;
     
@@ -66,7 +66,7 @@ public class MaildirMailboxMapper extends NonTransactionalMapper implements Mail
      * @see org.apache.james.mailbox.store.mail.MailboxMapper#delete(org.apache.james.mailbox.store.mail.model.Mailbox)
      */
     @Override
-    public void delete(Mailbox<MaildirId> mailbox) throws MailboxException {
+    public void delete(Mailbox mailbox) throws MailboxException {
         
         String folderName = maildirStore.getFolderName(mailbox);
         File folder = new File(folderName);
@@ -107,9 +107,9 @@ public class MaildirMailboxMapper extends NonTransactionalMapper implements Mail
      * @see org.apache.james.mailbox.store.mail.MailboxMapper#findMailboxByPath(org.apache.james.mailbox.model.MailboxPath)
      */
     @Override
-    public Mailbox<MaildirId> findMailboxByPath(MailboxPath mailboxPath)
+    public Mailbox findMailboxByPath(MailboxPath mailboxPath)
             throws MailboxException, MailboxNotFoundException {      
-        Mailbox<MaildirId> mailbox = maildirStore.loadMailbox(session, mailboxPath);
+        Mailbox mailbox = maildirStore.loadMailbox(session, mailboxPath);
         return cacheMailbox(mailbox);
     }
     
@@ -117,22 +117,22 @@ public class MaildirMailboxMapper extends NonTransactionalMapper implements Mail
      * @see org.apache.james.mailbox.store.mail.MailboxMapper#findMailboxWithPathLike(org.apache.james.mailbox.model.MailboxPath)
      */
     @Override
-    public List<Mailbox<MaildirId>> findMailboxWithPathLike(MailboxPath mailboxPath)
+    public List<Mailbox> findMailboxWithPathLike(MailboxPath mailboxPath)
             throws MailboxException {
         final Pattern searchPattern = Pattern.compile("[" + MaildirStore.maildirDelimiter + "]"
                 + mailboxPath.getName().replace(".", "\\.").replace(MaildirStore.WILDCARD, ".*"));
         FilenameFilter filter = MaildirMessageName.createRegexFilter(searchPattern);
         File root = maildirStore.getMailboxRootForUser(mailboxPath.getUser());
         File[] folders = root.listFiles(filter);
-        ArrayList<Mailbox<MaildirId>> mailboxList = new ArrayList<Mailbox<MaildirId>>();
+        ArrayList<Mailbox> mailboxList = new ArrayList<Mailbox>();
         for (File folder : folders)
             if (folder.isDirectory()) {
-                Mailbox<MaildirId> mailbox = maildirStore.loadMailbox(session, root, mailboxPath.getNamespace(), mailboxPath.getUser(), folder.getName());
+                Mailbox mailbox = maildirStore.loadMailbox(session, root, mailboxPath.getNamespace(), mailboxPath.getUser(), folder.getName());
                 mailboxList.add(cacheMailbox(mailbox));
             }
         // INBOX is in the root of the folder
         if (Pattern.matches(mailboxPath.getName().replace(MaildirStore.WILDCARD, ".*"), MailboxConstants.INBOX)) {
-            Mailbox<MaildirId> mailbox = maildirStore.loadMailbox(session, root, mailboxPath.getNamespace(), mailboxPath.getUser(), "");
+            Mailbox mailbox = maildirStore.loadMailbox(session, root, mailboxPath.getNamespace(), mailboxPath.getUser(), "");
             mailboxList.add(0, cacheMailbox(mailbox));
         }
         return mailboxList;
@@ -142,9 +142,9 @@ public class MaildirMailboxMapper extends NonTransactionalMapper implements Mail
      * @see org.apache.james.mailbox.store.mail.MailboxMapper#hasChildren(org.apache.james.mailbox.store.mail.model.Mailbox, char)
      */
     @Override
-    public boolean hasChildren(Mailbox<MaildirId> mailbox, char delimiter) throws MailboxException, MailboxNotFoundException {
+    public boolean hasChildren(Mailbox mailbox, char delimiter) throws MailboxException, MailboxNotFoundException {
         String searchString = mailbox.getName() + MaildirStore.maildirDelimiter + MaildirStore.WILDCARD;
-        List<Mailbox<MaildirId>> mailboxes = findMailboxWithPathLike(
+        List<Mailbox> mailboxes = findMailboxWithPathLike(
                 new MailboxPath(mailbox.getNamespace(), mailbox.getUser(), searchString));
         return (mailboxes.size() > 0);
     }
@@ -153,9 +153,9 @@ public class MaildirMailboxMapper extends NonTransactionalMapper implements Mail
      * @see org.apache.james.mailbox.store.mail.MailboxMapper#save(org.apache.james.mailbox.store.mail.model.Mailbox)
      */
     @Override
-    public void save(Mailbox<MaildirId> mailbox) throws MailboxException {
+    public void save(Mailbox mailbox) throws MailboxException {
         try {
-            Mailbox<MaildirId> originalMailbox = getCachedMailbox(mailbox.getMailboxId());
+            Mailbox originalMailbox = getCachedMailbox((MaildirId) mailbox.getMailboxId());
             MaildirFolder folder = maildirStore.createMaildirFolder(mailbox);
             // equals with null check
             if (originalMailbox.getName() == null ? mailbox.getName() != null : !originalMailbox.getName().equals(mailbox.getName())) {
@@ -229,10 +229,10 @@ public class MaildirMailboxMapper extends NonTransactionalMapper implements Mail
      * @see org.apache.james.mailbox.store.mail.MailboxMapper#list()
      */
     @Override
-    public List<Mailbox<MaildirId>> list() throws MailboxException {
+    public List<Mailbox> list() throws MailboxException {
         
        File maildirRoot = maildirStore.getMaildirRoot();
-       List<Mailbox<MaildirId>> mailboxList = new ArrayList<Mailbox<MaildirId>>();
+       List<Mailbox> mailboxList = new ArrayList<Mailbox>();
         
        if (maildirStore.getMaildirLocation().endsWith("/" + MaildirStore.PATH_FULLUSER)) {
            File[] users = maildirRoot.listFiles();
@@ -263,10 +263,10 @@ public class MaildirMailboxMapper extends NonTransactionalMapper implements Mail
      * @param mailbox The mailbox to cache
      * @return The id of the cached mailbox
      */
-    private Mailbox<MaildirId> cacheMailbox(Mailbox<MaildirId> mailbox) {
-        mailboxCache.add(new SimpleMailbox<MaildirId>(mailbox));
+    private Mailbox cacheMailbox(Mailbox mailbox) {
+        mailboxCache.add(new SimpleMailbox(mailbox));
         int id = mailboxCache.size() - 1;
-        ((SimpleMailbox<MaildirId>) mailbox).setMailboxId(MaildirId.of(id));
+        ((SimpleMailbox) mailbox).setMailboxId(MaildirId.of(id));
         return mailbox;
     }
     
@@ -276,7 +276,7 @@ public class MaildirMailboxMapper extends NonTransactionalMapper implements Mail
      * @return The mailbox
      * @throws MailboxNotFoundException If the mailboxId is not in the cache
      */
-    private Mailbox<MaildirId> getCachedMailbox(MaildirId mailboxId) throws MailboxNotFoundException {
+    private Mailbox getCachedMailbox(MaildirId mailboxId) throws MailboxNotFoundException {
         if (mailboxId == null)
             throw new MailboxNotFoundException("null");
         try {
@@ -286,7 +286,7 @@ public class MaildirMailboxMapper extends NonTransactionalMapper implements Mail
         }
     }
     
-    private void visitUsersForMailboxList(File domain, File[] users, List<Mailbox<MaildirId>> mailboxList) throws MailboxException {
+    private void visitUsersForMailboxList(File domain, File[] users, List<Mailbox> mailboxList) throws MailboxException {
         
         String userName = null;
         
@@ -328,7 +328,7 @@ public class MaildirMailboxMapper extends NonTransactionalMapper implements Mail
     }
 
     @Override
-    public void updateACL(Mailbox<MaildirId> mailbox, MailboxACL.MailboxACLCommand mailboxACLCommand) throws MailboxException {
+    public void updateACL(Mailbox mailbox, MailboxACL.MailboxACLCommand mailboxACLCommand) throws MailboxException {
         MaildirFolder folder = maildirStore.createMaildirFolder(mailbox);
         MailboxACL newACL = mailbox.getACL().apply(mailboxACLCommand);
         folder.setACL(session, newACL);

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/maildir/src/main/java/org/apache/james/mailbox/maildir/mail/MaildirMessageMapper.java
----------------------------------------------------------------------
diff --git a/mailbox/maildir/src/main/java/org/apache/james/mailbox/maildir/mail/MaildirMessageMapper.java b/mailbox/maildir/src/main/java/org/apache/james/mailbox/maildir/mail/MaildirMessageMapper.java
index c739b0f..86924f5 100644
--- a/mailbox/maildir/src/main/java/org/apache/james/mailbox/maildir/mail/MaildirMessageMapper.java
+++ b/mailbox/maildir/src/main/java/org/apache/james/mailbox/maildir/mail/MaildirMessageMapper.java
@@ -38,7 +38,6 @@ import org.apache.commons.io.FileUtils;
 import org.apache.james.mailbox.MailboxSession;
 import org.apache.james.mailbox.exception.MailboxException;
 import org.apache.james.mailbox.maildir.MaildirFolder;
-import org.apache.james.mailbox.maildir.MaildirId;
 import org.apache.james.mailbox.maildir.MaildirMessageName;
 import org.apache.james.mailbox.maildir.MaildirStore;
 import org.apache.james.mailbox.maildir.mail.model.MaildirMailboxMessage;
@@ -53,7 +52,7 @@ 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.impl.SimpleMailboxMessage;
 
-public class MaildirMessageMapper extends AbstractMessageMapper<MaildirId> {
+public class MaildirMessageMapper extends AbstractMessageMapper {
 
     private final MaildirStore maildirStore;
     private final static int BUF_SIZE = 2048;
@@ -67,7 +66,7 @@ public class MaildirMessageMapper extends AbstractMessageMapper<MaildirId> {
      * @see org.apache.james.mailbox.store.mail.MessageMapper#countMessagesInMailbox(org.apache.james.mailbox.store.mail.model.Mailbox)
      */
     @Override
-    public long countMessagesInMailbox(Mailbox<MaildirId> mailbox) throws MailboxException {
+    public long countMessagesInMailbox(Mailbox mailbox) throws MailboxException {
         MaildirFolder folder = maildirStore.createMaildirFolder(mailbox);
         File newFolder = folder.getNewFolder();
         File curFolder = folder.getCurFolder();
@@ -83,7 +82,7 @@ public class MaildirMessageMapper extends AbstractMessageMapper<MaildirId> {
      * @see org.apache.james.mailbox.store.mail.MessageMapper#countUnseenMessagesInMailbox(org.apache.james.mailbox.store.mail.model.Mailbox)
      */
     @Override
-    public long countUnseenMessagesInMailbox(Mailbox<MaildirId> mailbox) throws MailboxException {
+    public long countUnseenMessagesInMailbox(Mailbox mailbox) throws MailboxException {
         MaildirFolder folder = maildirStore.createMaildirFolder(mailbox);
         File newFolder = folder.getNewFolder();
         File curFolder = folder.getCurFolder();
@@ -100,7 +99,7 @@ public class MaildirMessageMapper extends AbstractMessageMapper<MaildirId> {
      *      MailboxMessage)
      */
     @Override
-    public void delete(Mailbox<MaildirId> mailbox, MailboxMessage<MaildirId> message) throws MailboxException {
+    public void delete(Mailbox mailbox, MailboxMessage message) throws MailboxException {
         MaildirFolder folder = maildirStore.createMaildirFolder(mailbox);
         try {
             folder.delete(mailboxSession, message.getUid());
@@ -115,9 +114,9 @@ public class MaildirMessageMapper extends AbstractMessageMapper<MaildirId> {
      *      org.apache.james.mailbox.store.mail.MessageMapper.FetchType, int)
      */
     @Override
-    public Iterator<MailboxMessage<MaildirId>> findInMailbox(Mailbox<MaildirId> mailbox, MessageRange set, FetchType fType, int max)
+    public Iterator<MailboxMessage> findInMailbox(Mailbox mailbox, MessageRange set, FetchType fType, int max)
             throws MailboxException {
-        final List<MailboxMessage<MaildirId>> results;
+        final List<MailboxMessage> results;
         final long from = set.getUidFrom();
         final long to = set.getUidTo();
         final Type type = set.getType();
@@ -144,7 +143,7 @@ public class MaildirMessageMapper extends AbstractMessageMapper<MaildirId> {
      * @see org.apache.james.mailbox.store.mail.MessageMapper#findRecentMessageUidsInMailbox(org.apache.james.mailbox.store.mail.model.Mailbox)
      */
     @Override
-    public List<Long> findRecentMessageUidsInMailbox(Mailbox<MaildirId> mailbox) throws MailboxException {
+    public List<Long> findRecentMessageUidsInMailbox(Mailbox mailbox) throws MailboxException {
         MaildirFolder folder = maildirStore.createMaildirFolder(mailbox);
         SortedMap<Long, MaildirMessageName> recentMessageNames = folder.getRecentMessages(mailboxSession);
         return new ArrayList<Long>(recentMessageNames.keySet());
@@ -155,8 +154,8 @@ public class MaildirMessageMapper extends AbstractMessageMapper<MaildirId> {
      * @see org.apache.james.mailbox.store.mail.MessageMapper#findFirstUnseenMessageUid(org.apache.james.mailbox.store.mail.model.Mailbox)
      */
     @Override
-    public Long findFirstUnseenMessageUid(Mailbox<MaildirId> mailbox) throws MailboxException {
-        List<MailboxMessage<MaildirId>> result = findMessagesInMailbox(mailbox, MaildirMessageName.FILTER_UNSEEN_MESSAGES, 1);
+    public Long findFirstUnseenMessageUid(Mailbox mailbox) throws MailboxException {
+        List<MailboxMessage> result = findMessagesInMailbox(mailbox, MaildirMessageName.FILTER_UNSEEN_MESSAGES, 1);
         if (result.isEmpty()) {
             return null;
         } else {
@@ -170,13 +169,13 @@ public class MaildirMessageMapper extends AbstractMessageMapper<MaildirId> {
      *      org.apache.james.mailbox.model.MessageRange)
      */
     @Override
-    public Iterator<UpdatedFlags> updateFlags(Mailbox<MaildirId> 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>();
         final MaildirFolder folder = maildirStore.createMaildirFolder(mailbox);
 
-        Iterator<MailboxMessage<MaildirId>> it = findInMailbox(mailbox, set, FetchType.Metadata, -1);
+        Iterator<MailboxMessage> it = findInMailbox(mailbox, set, FetchType.Metadata, -1);
         while (it.hasNext()) {
-            final MailboxMessage<MaildirId> member = it.next();
+            final MailboxMessage member = it.next();
             Flags originalFlags = member.createFlags();
             member.setFlags(flagsUpdateCalculator.buildNewFlags(originalFlags));
             Flags newFlags = member.createFlags();
@@ -228,9 +227,9 @@ public class MaildirMessageMapper extends AbstractMessageMapper<MaildirId> {
     }
 
     @Override
-    public Map<Long, MessageMetaData> expungeMarkedForDeletionInMailbox(Mailbox<MaildirId> mailbox, MessageRange set)
+    public Map<Long, MessageMetaData> expungeMarkedForDeletionInMailbox(Mailbox mailbox, MessageRange set)
             throws MailboxException {
-        List<MailboxMessage<MaildirId>> results = new ArrayList<MailboxMessage<MaildirId>>();
+        List<MailboxMessage> results = new ArrayList<MailboxMessage>();
         final long from = set.getUidFrom();
         final long to = set.getUidTo();
         final Type type = set.getType();
@@ -252,7 +251,7 @@ public class MaildirMessageMapper extends AbstractMessageMapper<MaildirId> {
             break;
         }
         Map<Long, MessageMetaData> uids = new HashMap<Long, MessageMetaData>();
-        for (MailboxMessage<MaildirId> m : results) {
+        for (MailboxMessage m : results) {
             long uid = m.getUid();
             uids.put(uid, new SimpleMessageMetaData(m));
             delete(mailbox, m);
@@ -268,7 +267,7 @@ public class MaildirMessageMapper extends AbstractMessageMapper<MaildirId> {
      *      MailboxMessage)
      */
     @Override
-    public MessageMetaData move(Mailbox<MaildirId> mailbox, MailboxMessage<MaildirId> original) throws MailboxException {
+    public MessageMetaData move(Mailbox mailbox, MailboxMessage original) throws MailboxException {
         throw new UnsupportedOperationException("Not implemented - see https://issues.apache.org/jira/browse/IMAP-370");
     }
 
@@ -278,9 +277,9 @@ public class MaildirMessageMapper extends AbstractMessageMapper<MaildirId> {
      *      MailboxMessage)
      */
     @Override
-    protected MessageMetaData copy(Mailbox<MaildirId> mailbox, long uid, long modSeq, MailboxMessage<MaildirId> original)
+    protected MessageMetaData copy(Mailbox mailbox, long uid, long modSeq, MailboxMessage original)
             throws MailboxException {
-        SimpleMailboxMessage<MaildirId> theCopy = SimpleMailboxMessage.copy(mailbox.getMailboxId(), original);
+        SimpleMailboxMessage theCopy = SimpleMailboxMessage.copy(mailbox.getMailboxId(), original);
         Flags flags = theCopy.createFlags();
         flags.add(Flag.RECENT);
         theCopy.setFlags(flags);
@@ -292,7 +291,7 @@ public class MaildirMessageMapper extends AbstractMessageMapper<MaildirId> {
      *      MailboxMessage)
      */
     @Override
-    protected MessageMetaData save(Mailbox<MaildirId> mailbox, MailboxMessage<MaildirId> message) throws MailboxException {
+    protected MessageMetaData save(Mailbox mailbox, MailboxMessage message) throws MailboxException {
         MaildirFolder folder = maildirStore.createMaildirFolder(mailbox);
         long uid = 0;
         // a new message
@@ -378,13 +377,13 @@ public class MaildirMessageMapper extends AbstractMessageMapper<MaildirId> {
 
     }
 
-    private List<MailboxMessage<MaildirId>> findMessageInMailboxWithUID(Mailbox<MaildirId> mailbox, long uid)
+    private List<MailboxMessage> findMessageInMailboxWithUID(Mailbox mailbox, long uid)
             throws MailboxException {
         MaildirFolder folder = maildirStore.createMaildirFolder(mailbox);
         try {
             MaildirMessageName messageName = folder.getMessageNameByUid(mailboxSession, uid);
 
-            ArrayList<MailboxMessage<MaildirId>> messages = new ArrayList<MailboxMessage<MaildirId>>();
+            ArrayList<MailboxMessage> messages = new ArrayList<MailboxMessage>();
             if (messageName != null && messageName.getFile().exists()) {
                 messages.add(new MaildirMailboxMessage(mailbox, uid, messageName));
             }
@@ -395,7 +394,7 @@ public class MaildirMessageMapper extends AbstractMessageMapper<MaildirId> {
         }
     }
 
-    private List<MailboxMessage<MaildirId>> findMessagesInMailboxBetweenUIDs(Mailbox<MaildirId> mailbox, FilenameFilter filter,
+    private List<MailboxMessage> findMessagesInMailboxBetweenUIDs(Mailbox mailbox, FilenameFilter filter,
                                                                              long from, long to, int max) throws MailboxException {
         MaildirFolder folder = maildirStore.createMaildirFolder(mailbox);
         int cur = 0;
@@ -406,7 +405,7 @@ public class MaildirMessageMapper extends AbstractMessageMapper<MaildirId> {
             else
                 uidMap = folder.getUidMap(mailboxSession, from, to);
 
-            ArrayList<MailboxMessage<MaildirId>> messages = new ArrayList<MailboxMessage<MaildirId>>();
+            ArrayList<MailboxMessage> messages = new ArrayList<MailboxMessage>();
             for (Entry<Long, MaildirMessageName> entry : uidMap.entrySet()) {
                 messages.add(new MaildirMailboxMessage(mailbox, entry.getKey(), entry.getValue()));
                 if (max != -1) {
@@ -422,13 +421,13 @@ public class MaildirMessageMapper extends AbstractMessageMapper<MaildirId> {
 
     }
 
-    private List<MailboxMessage<MaildirId>> findMessagesInMailbox(Mailbox<MaildirId> mailbox, FilenameFilter filter, int limit)
+    private List<MailboxMessage> findMessagesInMailbox(Mailbox mailbox, FilenameFilter filter, int limit)
             throws MailboxException {
         MaildirFolder folder = maildirStore.createMaildirFolder(mailbox);
         try {
             SortedMap<Long, MaildirMessageName> uidMap = folder.getUidMap(mailboxSession, filter, limit);
 
-            ArrayList<MailboxMessage<MaildirId>> filtered = new ArrayList<MailboxMessage<MaildirId>>(uidMap.size());
+            ArrayList<MailboxMessage> filtered = new ArrayList<MailboxMessage>(uidMap.size());
             for (Entry<Long, MaildirMessageName> entry : uidMap.entrySet())
                 filtered.add(new MaildirMailboxMessage(mailbox, entry.getKey(), entry.getValue()));
             return filtered;
@@ -438,12 +437,12 @@ public class MaildirMessageMapper extends AbstractMessageMapper<MaildirId> {
 
     }
 
-    private List<MailboxMessage<MaildirId>> findDeletedMessageInMailboxWithUID(Mailbox<MaildirId> mailbox, long uid)
+    private List<MailboxMessage> findDeletedMessageInMailboxWithUID(Mailbox mailbox, long uid)
             throws MailboxException {
         MaildirFolder folder = maildirStore.createMaildirFolder(mailbox);
         try {
             MaildirMessageName messageName = folder.getMessageNameByUid(mailboxSession, uid);
-            ArrayList<MailboxMessage<MaildirId>> messages = new ArrayList<MailboxMessage<MaildirId>>();
+            ArrayList<MailboxMessage> messages = new ArrayList<MailboxMessage>();
             if (MaildirMessageName.FILTER_DELETED_MESSAGES.accept(null, messageName.getFullName())) {
                 messages.add(new MaildirMailboxMessage(mailbox, uid, messageName));
             }

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/maildir/src/main/java/org/apache/james/mailbox/maildir/mail/model/MaildirMailboxMessage.java
----------------------------------------------------------------------
diff --git a/mailbox/maildir/src/main/java/org/apache/james/mailbox/maildir/mail/model/MaildirMailboxMessage.java b/mailbox/maildir/src/main/java/org/apache/james/mailbox/maildir/mail/model/MaildirMailboxMessage.java
index 04a2107..ca5ff52 100644
--- a/mailbox/maildir/src/main/java/org/apache/james/mailbox/maildir/mail/model/MaildirMailboxMessage.java
+++ b/mailbox/maildir/src/main/java/org/apache/james/mailbox/maildir/mail/model/MaildirMailboxMessage.java
@@ -30,7 +30,7 @@ import org.apache.james.mailbox.maildir.MaildirMessageName;
 import org.apache.james.mailbox.store.mail.model.DelegatingMailboxMessage;
 import org.apache.james.mailbox.store.mail.model.Mailbox;
 
-public class MaildirMailboxMessage extends DelegatingMailboxMessage<MaildirId> {
+public class MaildirMailboxMessage extends DelegatingMailboxMessage {
 
     private boolean answered;
     private boolean deleted;
@@ -38,12 +38,12 @@ public class MaildirMailboxMessage extends DelegatingMailboxMessage<MaildirId> {
     private boolean flagged;
     private boolean recent;
     private boolean seen;
-    private final Mailbox<MaildirId> mailbox;
+    private final Mailbox mailbox;
     private long uid;
     protected boolean newMessage;
     private long modSeq;
     
-    public MaildirMailboxMessage(Mailbox<MaildirId> mailbox, long uid, MaildirMessageName messageName) throws IOException {
+    public MaildirMailboxMessage(Mailbox mailbox, long uid, MaildirMessageName messageName) throws IOException {
         super(new MaildirMessage(messageName));
 
         this.mailbox = mailbox;
@@ -70,7 +70,7 @@ public class MaildirMailboxMessage extends DelegatingMailboxMessage<MaildirId> {
     
     @Override
     public MaildirId getMailboxId() {
-        return mailbox.getMailboxId();
+        return (MaildirId) mailbox.getMailboxId();
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/maildir/src/test/java/org/apache/james/mailbox/maildir/MaildirMailboxIdDeserializerTest.java
----------------------------------------------------------------------
diff --git a/mailbox/maildir/src/test/java/org/apache/james/mailbox/maildir/MaildirMailboxIdDeserializerTest.java b/mailbox/maildir/src/test/java/org/apache/james/mailbox/maildir/MaildirMailboxIdDeserializerTest.java
index 2173a12..a56a0fc 100644
--- a/mailbox/maildir/src/test/java/org/apache/james/mailbox/maildir/MaildirMailboxIdDeserializerTest.java
+++ b/mailbox/maildir/src/test/java/org/apache/james/mailbox/maildir/MaildirMailboxIdDeserializerTest.java
@@ -32,7 +32,7 @@ public class MaildirMailboxIdDeserializerTest {
     private static final String MALFORMED_SERIALIZED_ID = "az";
     private static final MaildirId MAILDIR_ID = MaildirId.of(Integer.valueOf(SERIALIZED_ID));
 
-    private MailboxIdDeserializer<MaildirId> mailboxIdDeserializer;
+    private MailboxIdDeserializer mailboxIdDeserializer;
 
     @Before
     public void setUp() {

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/maildir/src/test/java/org/apache/james/mailbox/maildir/MaildirMailboxManagerTest.java
----------------------------------------------------------------------
diff --git a/mailbox/maildir/src/test/java/org/apache/james/mailbox/maildir/MaildirMailboxManagerTest.java b/mailbox/maildir/src/test/java/org/apache/james/mailbox/maildir/MaildirMailboxManagerTest.java
index 08d9296..fce99e4 100644
--- a/mailbox/maildir/src/test/java/org/apache/james/mailbox/maildir/MaildirMailboxManagerTest.java
+++ b/mailbox/maildir/src/test/java/org/apache/james/mailbox/maildir/MaildirMailboxManagerTest.java
@@ -60,7 +60,7 @@ public class MaildirMailboxManagerTest {
             MailboxACLResolver aclResolver = new UnionMailboxACLResolver();
             GroupMembershipResolver groupMembershipResolver = new SimpleGroupMembershipResolver();
 
-            StoreMailboxManager<MaildirId> manager = new StoreMailboxManager<MaildirId>(mf, null, new JVMMailboxPathLocker(), aclResolver, groupMembershipResolver);
+            StoreMailboxManager manager = new StoreMailboxManager(mf, null, new JVMMailboxPathLocker(), aclResolver, groupMembershipResolver);
             manager.init();
             setMailboxManager(manager);
         }

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/maildir/src/test/java/org/apache/james/mailbox/maildir/MaildirStressTest.java
----------------------------------------------------------------------
diff --git a/mailbox/maildir/src/test/java/org/apache/james/mailbox/maildir/MaildirStressTest.java b/mailbox/maildir/src/test/java/org/apache/james/mailbox/maildir/MaildirStressTest.java
index c2b78d2..64124f4 100644
--- a/mailbox/maildir/src/test/java/org/apache/james/mailbox/maildir/MaildirStressTest.java
+++ b/mailbox/maildir/src/test/java/org/apache/james/mailbox/maildir/MaildirStressTest.java
@@ -38,7 +38,7 @@ public class MaildirStressTest extends AbstractStressTest {
 
     private static final String MAILDIR_HOME = "target/Maildir";
 
-    private StoreMailboxManager<MaildirId> mailboxManager;
+    private StoreMailboxManager mailboxManager;
     
     @Before
     public void setUp() throws MailboxException {
@@ -48,7 +48,7 @@ public class MaildirStressTest extends AbstractStressTest {
         MailboxACLResolver aclResolver = new UnionMailboxACLResolver();
         GroupMembershipResolver groupMembershipResolver = new SimpleGroupMembershipResolver();
 
-        mailboxManager = new StoreMailboxManager<MaildirId>(mf, null, new JVMMailboxPathLocker(), aclResolver, groupMembershipResolver);
+        mailboxManager = new StoreMailboxManager(mf, null, new JVMMailboxPathLocker(), aclResolver, groupMembershipResolver);
         mailboxManager.init();
 
     }

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/memory/src/main/java/org/apache/james/mailbox/inmemory/InMemoryMailboxIdDeserializer.java
----------------------------------------------------------------------
diff --git a/mailbox/memory/src/main/java/org/apache/james/mailbox/inmemory/InMemoryMailboxIdDeserializer.java b/mailbox/memory/src/main/java/org/apache/james/mailbox/inmemory/InMemoryMailboxIdDeserializer.java
index 4995b8a..0eabe09 100644
--- a/mailbox/memory/src/main/java/org/apache/james/mailbox/inmemory/InMemoryMailboxIdDeserializer.java
+++ b/mailbox/memory/src/main/java/org/apache/james/mailbox/inmemory/InMemoryMailboxIdDeserializer.java
@@ -22,7 +22,7 @@ package org.apache.james.mailbox.inmemory;
 import org.apache.james.mailbox.store.mail.model.MailboxIdDeserialisationException;
 import org.apache.james.mailbox.store.mail.model.MailboxIdDeserializer;
 
-public class InMemoryMailboxIdDeserializer implements MailboxIdDeserializer<InMemoryId> {
+public class InMemoryMailboxIdDeserializer implements MailboxIdDeserializer {
 
     @Override
     public InMemoryId deserialize(String serializedMailboxId) throws MailboxIdDeserialisationException {

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/memory/src/main/java/org/apache/james/mailbox/inmemory/InMemoryMailboxManager.java
----------------------------------------------------------------------
diff --git a/mailbox/memory/src/main/java/org/apache/james/mailbox/inmemory/InMemoryMailboxManager.java b/mailbox/memory/src/main/java/org/apache/james/mailbox/inmemory/InMemoryMailboxManager.java
index c8cf946..c7b38b8 100644
--- a/mailbox/memory/src/main/java/org/apache/james/mailbox/inmemory/InMemoryMailboxManager.java
+++ b/mailbox/memory/src/main/java/org/apache/james/mailbox/inmemory/InMemoryMailboxManager.java
@@ -20,6 +20,7 @@
 package org.apache.james.mailbox.inmemory;
 
 import java.util.List;
+
 import javax.inject.Inject;
 
 import org.apache.james.mailbox.MailboxPathLocker;
@@ -35,10 +36,10 @@ import org.apache.james.mailbox.store.mail.model.Mailbox;
 
 import com.google.common.collect.Lists;
 
-public class InMemoryMailboxManager extends StoreMailboxManager<InMemoryId> {
+public class InMemoryMailboxManager extends StoreMailboxManager {
 
     @Inject
-    public InMemoryMailboxManager(MailboxSessionMapperFactory<InMemoryId> mailboxSessionMapperFactory, Authenticator authenticator, MailboxPathLocker locker, MailboxACLResolver aclResolver, GroupMembershipResolver groupMembershipResolver) {
+    public InMemoryMailboxManager(MailboxSessionMapperFactory mailboxSessionMapperFactory, Authenticator authenticator, MailboxPathLocker locker, MailboxACLResolver aclResolver, GroupMembershipResolver groupMembershipResolver) {
         super(mailboxSessionMapperFactory, authenticator, locker, aclResolver, groupMembershipResolver);
     }
 
@@ -48,7 +49,7 @@ public class InMemoryMailboxManager extends StoreMailboxManager<InMemoryId> {
     }
 
     @Override
-    protected StoreMessageManager<InMemoryId> createMessageManager(Mailbox<InMemoryId> mailbox, MailboxSession session) throws MailboxException {
+    protected StoreMessageManager createMessageManager(Mailbox mailbox, MailboxSession session) throws MailboxException {
         return new InMemoryMessageManager(getMapperFactory(),
             getMessageSearchIndex(),
             getEventDispatcher(),

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/memory/src/main/java/org/apache/james/mailbox/inmemory/InMemoryMailboxSessionMapperFactory.java
----------------------------------------------------------------------
diff --git a/mailbox/memory/src/main/java/org/apache/james/mailbox/inmemory/InMemoryMailboxSessionMapperFactory.java b/mailbox/memory/src/main/java/org/apache/james/mailbox/inmemory/InMemoryMailboxSessionMapperFactory.java
index c286eba..ed8184f 100644
--- a/mailbox/memory/src/main/java/org/apache/james/mailbox/inmemory/InMemoryMailboxSessionMapperFactory.java
+++ b/mailbox/memory/src/main/java/org/apache/james/mailbox/inmemory/InMemoryMailboxSessionMapperFactory.java
@@ -31,10 +31,10 @@ import org.apache.james.mailbox.store.mail.MailboxMapper;
 import org.apache.james.mailbox.store.mail.MessageMapper;
 import org.apache.james.mailbox.store.user.SubscriptionMapper;
 
-public class InMemoryMailboxSessionMapperFactory extends MailboxSessionMapperFactory<InMemoryId> {
+public class InMemoryMailboxSessionMapperFactory extends MailboxSessionMapperFactory {
 
-    private final MailboxMapper<InMemoryId> mailboxMapper;
-    private final MessageMapper<InMemoryId> messageMapper;
+    private final MailboxMapper mailboxMapper;
+    private final MessageMapper messageMapper;
     private final SubscriptionMapper subscriptionMapper;
     
     public InMemoryMailboxSessionMapperFactory() {
@@ -44,12 +44,12 @@ public class InMemoryMailboxSessionMapperFactory extends MailboxSessionMapperFac
     }
     
     @Override
-    public MailboxMapper<InMemoryId> createMailboxMapper(MailboxSession session) throws MailboxException {
+    public MailboxMapper createMailboxMapper(MailboxSession session) throws MailboxException {
         return mailboxMapper;
     }
 
     @Override
-    public MessageMapper<InMemoryId> createMessageMapper(MailboxSession session) throws MailboxException {
+    public MessageMapper createMessageMapper(MailboxSession session) throws MailboxException {
         return messageMapper;
     }
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/memory/src/main/java/org/apache/james/mailbox/inmemory/InMemoryMessageManager.java
----------------------------------------------------------------------
diff --git a/mailbox/memory/src/main/java/org/apache/james/mailbox/inmemory/InMemoryMessageManager.java b/mailbox/memory/src/main/java/org/apache/james/mailbox/inmemory/InMemoryMessageManager.java
index 101ca55..bc30379 100644
--- a/mailbox/memory/src/main/java/org/apache/james/mailbox/inmemory/InMemoryMessageManager.java
+++ b/mailbox/memory/src/main/java/org/apache/james/mailbox/inmemory/InMemoryMessageManager.java
@@ -15,9 +15,9 @@ import org.apache.james.mailbox.store.mail.MessageMapperFactory;
 import org.apache.james.mailbox.store.mail.model.Mailbox;
 import org.apache.james.mailbox.store.search.MessageSearchIndex;
 
-public class InMemoryMessageManager extends StoreMessageManager<InMemoryId> {
+public class InMemoryMessageManager extends StoreMessageManager {
 
-    public InMemoryMessageManager(MessageMapperFactory<InMemoryId> mapperFactory, MessageSearchIndex<InMemoryId> index, MailboxEventDispatcher<InMemoryId> dispatcher, MailboxPathLocker locker, Mailbox<InMemoryId> mailbox, MailboxACLResolver aclResolver, GroupMembershipResolver groupMembershipResolver, QuotaManager quotaManager, QuotaRootResolver quotaRootResolver) throws MailboxException {
+    public InMemoryMessageManager(MessageMapperFactory mapperFactory, MessageSearchIndex index, MailboxEventDispatcher dispatcher, MailboxPathLocker locker, Mailbox mailbox, MailboxACLResolver aclResolver, GroupMembershipResolver groupMembershipResolver, QuotaManager quotaManager, QuotaRootResolver quotaRootResolver) throws MailboxException {
         super(mapperFactory, index, dispatcher, locker, mailbox, aclResolver, groupMembershipResolver, quotaManager, quotaRootResolver);
     }
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/memory/src/main/java/org/apache/james/mailbox/inmemory/mail/InMemoryMailboxMapper.java
----------------------------------------------------------------------
diff --git a/mailbox/memory/src/main/java/org/apache/james/mailbox/inmemory/mail/InMemoryMailboxMapper.java b/mailbox/memory/src/main/java/org/apache/james/mailbox/inmemory/mail/InMemoryMailboxMapper.java
index 17dd2f4..2afecc0 100644
--- a/mailbox/memory/src/main/java/org/apache/james/mailbox/inmemory/mail/InMemoryMailboxMapper.java
+++ b/mailbox/memory/src/main/java/org/apache/james/mailbox/inmemory/mail/InMemoryMailboxMapper.java
@@ -35,20 +35,20 @@ import org.apache.james.mailbox.store.mail.model.impl.SimpleMailbox;
 
 import com.google.common.base.Objects;
 
-public class InMemoryMailboxMapper implements MailboxMapper<InMemoryId> {
+public class InMemoryMailboxMapper implements MailboxMapper {
     
     private static final int INITIAL_SIZE = 128;
-    private final Map<InMemoryId, Mailbox<InMemoryId>> mailboxesById;
+    private final Map<InMemoryId, Mailbox> mailboxesById;
     private final AtomicLong mailboxIdGenerator = new AtomicLong();
 
     public InMemoryMailboxMapper() {
-        mailboxesById = new ConcurrentHashMap<InMemoryId, Mailbox<InMemoryId>>(INITIAL_SIZE);
+        mailboxesById = new ConcurrentHashMap<InMemoryId, Mailbox>(INITIAL_SIZE);
     }
 
     /**
      * @see org.apache.james.mailbox.store.mail.MailboxMapper#delete(org.apache.james.mailbox.store.mail.model.Mailbox)
      */
-    public void delete(Mailbox<InMemoryId> mailbox) throws MailboxException {
+    public void delete(Mailbox mailbox) throws MailboxException {
         mailboxesById.remove(mailbox.getMailboxId());
     }
 
@@ -59,9 +59,9 @@ public class InMemoryMailboxMapper implements MailboxMapper<InMemoryId> {
     /**
      * @see org.apache.james.mailbox.store.mail.MailboxMapper#findMailboxByPath(org.apache.james.mailbox.model.MailboxPath)
      */
-    public synchronized Mailbox<InMemoryId> findMailboxByPath(MailboxPath path) throws MailboxException {
-        Mailbox<InMemoryId> result = null;
-        for (Mailbox<InMemoryId> mailbox:mailboxesById.values()) {
+    public synchronized Mailbox findMailboxByPath(MailboxPath path) throws MailboxException {
+        Mailbox result = null;
+        for (Mailbox mailbox:mailboxesById.values()) {
             MailboxPath mp = new MailboxPath(mailbox.getNamespace(), mailbox.getUser(), mailbox.getName());
             if (mp.equals(path)) {
                 result = mailbox;
@@ -78,10 +78,10 @@ public class InMemoryMailboxMapper implements MailboxMapper<InMemoryId> {
     /**
      * @see org.apache.james.mailbox.store.mail.MailboxMapper#findMailboxWithPathLike(org.apache.james.mailbox.model.MailboxPath)
      */
-    public List<Mailbox<InMemoryId>> findMailboxWithPathLike(MailboxPath path) throws MailboxException {
+    public List<Mailbox> findMailboxWithPathLike(MailboxPath path) throws MailboxException {
         final String regex = path.getName().replace("%", ".*");
-        List<Mailbox<InMemoryId>> results = new ArrayList<Mailbox<InMemoryId>>();
-        for (Mailbox<InMemoryId> mailbox:mailboxesById.values()) {
+        List<Mailbox> results = new ArrayList<Mailbox>();
+        for (Mailbox mailbox:mailboxesById.values()) {
             if (mailboxMatchesRegex(mailbox, path, regex)) {
                 results.add(mailbox);
             }
@@ -89,7 +89,7 @@ public class InMemoryMailboxMapper implements MailboxMapper<InMemoryId> {
         return results;
     }
 
-    private boolean mailboxMatchesRegex(Mailbox<InMemoryId> mailbox, MailboxPath path, String regex) {
+    private boolean mailboxMatchesRegex(Mailbox mailbox, MailboxPath path, String regex) {
         return Objects.equal(mailbox.getNamespace(), path.getNamespace())
             && Objects.equal(mailbox.getUser(), path.getUser())
             && mailbox.getName().matches(regex);
@@ -98,11 +98,11 @@ public class InMemoryMailboxMapper implements MailboxMapper<InMemoryId> {
     /**
      * @see org.apache.james.mailbox.store.mail.MailboxMapper#save(org.apache.james.mailbox.store.mail.model.Mailbox)
      */
-    public void save(Mailbox<InMemoryId> mailbox) throws MailboxException {
-        InMemoryId id = mailbox.getMailboxId();
+    public void save(Mailbox mailbox) throws MailboxException {
+        InMemoryId id = (InMemoryId) mailbox.getMailboxId();
         if (id == null) {
             id = InMemoryId.of(mailboxIdGenerator.incrementAndGet());
-            ((SimpleMailbox<InMemoryId>) mailbox).setMailboxId(id);
+            ((SimpleMailbox) mailbox).setMailboxId(id);
         }
         mailboxesById.put(id, mailbox);
     }
@@ -117,9 +117,9 @@ public class InMemoryMailboxMapper implements MailboxMapper<InMemoryId> {
     /**
      * @see org.apache.james.mailbox.store.mail.MailboxMapper#hasChildren(org.apache.james.mailbox.store.mail.model.Mailbox, char)
      */
-    public boolean hasChildren(Mailbox<InMemoryId> mailbox, char delimiter) throws MailboxException {
+    public boolean hasChildren(Mailbox mailbox, char delimiter) throws MailboxException {
         String mailboxName = mailbox.getName() + delimiter;
-        for (Mailbox<InMemoryId> box:mailboxesById.values()) {
+        for (Mailbox box:mailboxesById.values()) {
             if (belongsToSameUser(mailbox, box) && box.getName().startsWith(mailboxName)) {
                 return true;
             }
@@ -127,7 +127,7 @@ public class InMemoryMailboxMapper implements MailboxMapper<InMemoryId> {
         return false;
     }
 
-    private boolean belongsToSameUser(Mailbox<InMemoryId> mailbox, Mailbox<InMemoryId> otherMailbox) {
+    private boolean belongsToSameUser(Mailbox mailbox, Mailbox otherMailbox) {
         return Objects.equal(mailbox.getNamespace(), otherMailbox.getNamespace())
             && Objects.equal(mailbox.getUser(), otherMailbox.getUser());
     }
@@ -135,8 +135,8 @@ public class InMemoryMailboxMapper implements MailboxMapper<InMemoryId> {
     /**
      * @see org.apache.james.mailbox.store.mail.MailboxMapper#list()
      */
-    public List<Mailbox<InMemoryId>> list() throws MailboxException {
-        return new ArrayList<Mailbox<InMemoryId>>(mailboxesById.values());
+    public List<Mailbox> list() throws MailboxException {
+        return new ArrayList<Mailbox>(mailboxesById.values());
     }
 
     public <T> T execute(Transaction<T> transaction) throws MailboxException {
@@ -144,7 +144,7 @@ public class InMemoryMailboxMapper implements MailboxMapper<InMemoryId> {
     }
 
     @Override
-    public void updateACL(Mailbox<InMemoryId> mailbox, MailboxACL.MailboxACLCommand mailboxACLCommand) throws MailboxException{
+    public void updateACL(Mailbox mailbox, MailboxACL.MailboxACLCommand mailboxACLCommand) throws MailboxException{
         mailbox.setACL(mailbox.getACL().apply(mailboxACLCommand));
     }
 }

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/memory/src/main/java/org/apache/james/mailbox/inmemory/mail/InMemoryMessageMapper.java
----------------------------------------------------------------------
diff --git a/mailbox/memory/src/main/java/org/apache/james/mailbox/inmemory/mail/InMemoryMessageMapper.java b/mailbox/memory/src/main/java/org/apache/james/mailbox/inmemory/mail/InMemoryMessageMapper.java
index 931d399..ea8c926 100644
--- a/mailbox/memory/src/main/java/org/apache/james/mailbox/inmemory/mail/InMemoryMessageMapper.java
+++ b/mailbox/memory/src/main/java/org/apache/james/mailbox/inmemory/mail/InMemoryMessageMapper.java
@@ -43,25 +43,25 @@ 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.impl.SimpleMailboxMessage;
 
-public class InMemoryMessageMapper extends AbstractMessageMapper<InMemoryId> {
+public class InMemoryMessageMapper extends AbstractMessageMapper {
 
-    private final Map<InMemoryId, Map<Long, MailboxMessage<InMemoryId>>> mailboxByUid;
+    private final Map<InMemoryId, Map<Long, MailboxMessage>> mailboxByUid;
     private static final int INITIAL_SIZE = 256;
 
-    public InMemoryMessageMapper(MailboxSession session, UidProvider<InMemoryId> uidProvider,
-            ModSeqProvider<InMemoryId> modSeqProvider) {
+    public InMemoryMessageMapper(MailboxSession session, UidProvider uidProvider,
+            ModSeqProvider modSeqProvider) {
         super(session, uidProvider, modSeqProvider);
-        this.mailboxByUid = new ConcurrentHashMap<InMemoryId, Map<Long, MailboxMessage<InMemoryId>>>(INITIAL_SIZE);
+        this.mailboxByUid = new ConcurrentHashMap<InMemoryId, Map<Long, MailboxMessage>>(INITIAL_SIZE);
     }
 
-    private Map<Long, MailboxMessage<InMemoryId>> getMembershipByUidForMailbox(Mailbox<InMemoryId> mailbox) {
-        return getMembershipByUidForId(mailbox.getMailboxId());
+    private Map<Long, MailboxMessage> getMembershipByUidForMailbox(Mailbox mailbox) {
+        return getMembershipByUidForId((InMemoryId) mailbox.getMailboxId());
     }
 
-    private Map<Long, MailboxMessage<InMemoryId>> getMembershipByUidForId(InMemoryId id) {
-        Map<Long, MailboxMessage<InMemoryId>> membershipByUid = mailboxByUid.get(id);
+    private Map<Long, MailboxMessage> getMembershipByUidForId(InMemoryId id) {
+        Map<Long, MailboxMessage> membershipByUid = mailboxByUid.get(id);
         if (membershipByUid == null) {
-            membershipByUid = new ConcurrentHashMap<Long, MailboxMessage<InMemoryId>>(INITIAL_SIZE);
+            membershipByUid = new ConcurrentHashMap<Long, MailboxMessage>(INITIAL_SIZE);
             mailboxByUid.put(id, membershipByUid);
         }
         return membershipByUid;
@@ -70,16 +70,16 @@ public class InMemoryMessageMapper extends AbstractMessageMapper<InMemoryId> {
     /**
      * @see org.apache.james.mailbox.store.mail.MessageMapper#countMessagesInMailbox(org.apache.james.mailbox.store.mail.model.Mailbox)
      */
-    public long countMessagesInMailbox(Mailbox<InMemoryId> mailbox) throws MailboxException {
+    public long countMessagesInMailbox(Mailbox mailbox) throws MailboxException {
         return getMembershipByUidForMailbox(mailbox).size();
     }
 
     /**
      * @see org.apache.james.mailbox.store.mail.MessageMapper#countUnseenMessagesInMailbox(org.apache.james.mailbox.store.mail.model.Mailbox)
      */
-    public long countUnseenMessagesInMailbox(Mailbox<InMemoryId> mailbox) throws MailboxException {
+    public long countUnseenMessagesInMailbox(Mailbox mailbox) throws MailboxException {
         long count = 0;
-        for (MailboxMessage<InMemoryId> member : getMembershipByUidForMailbox(mailbox).values()) {
+        for (MailboxMessage member : getMembershipByUidForMailbox(mailbox).values()) {
             if (!member.isSeen()) {
                 count++;
             }
@@ -91,13 +91,13 @@ public class InMemoryMessageMapper extends AbstractMessageMapper<InMemoryId> {
      * @see org.apache.james.mailbox.store.mail.MessageMapper#delete(org.apache.james.mailbox.store.mail.model.Mailbox,
      *      MailboxMessage)
      */
-    public void delete(Mailbox<InMemoryId> mailbox, MailboxMessage<InMemoryId> message) throws MailboxException {
+    public void delete(Mailbox mailbox, MailboxMessage message) throws MailboxException {
         getMembershipByUidForMailbox(mailbox).remove(message.getUid());
     }
 
     @Override
-    public MessageMetaData move(Mailbox<InMemoryId> mailbox, MailboxMessage<InMemoryId> original) throws MailboxException {
-        InMemoryId originalMailboxId = original.getMailboxId();
+    public MessageMetaData move(Mailbox mailbox, MailboxMessage original) throws MailboxException {
+        InMemoryId originalMailboxId = (InMemoryId) original.getMailboxId();
         long uid = original.getUid();
         MessageMetaData messageMetaData = copy(mailbox, original);
         getMembershipByUidForId(originalMailboxId).remove(uid);
@@ -109,25 +109,25 @@ public class InMemoryMessageMapper extends AbstractMessageMapper<InMemoryId> {
      *      org.apache.james.mailbox.model.MessageRange,
      *      org.apache.james.mailbox.store.mail.MessageMapper.FetchType, int)
      */
-    public Iterator<MailboxMessage<InMemoryId>> findInMailbox(Mailbox<InMemoryId> mailbox, MessageRange set, FetchType ftype, int max)
+    public Iterator<MailboxMessage> findInMailbox(Mailbox mailbox, MessageRange set, FetchType ftype, int max)
             throws MailboxException {
-        List<MailboxMessage<InMemoryId>> results;
+        List<MailboxMessage> results;
         final MessageRange.Type type = set.getType();
         switch (type) {
         case ALL:
-            results = new ArrayList<MailboxMessage<InMemoryId>>(getMembershipByUidForMailbox(mailbox).values());
+            results = new ArrayList<MailboxMessage>(getMembershipByUidForMailbox(mailbox).values());
             break;
         case FROM:
-            results = new ArrayList<MailboxMessage<InMemoryId>>(getMembershipByUidForMailbox(mailbox).values());
-            for (Iterator<MailboxMessage<InMemoryId>> it = results.iterator(); it.hasNext();) {
+            results = new ArrayList<MailboxMessage>(getMembershipByUidForMailbox(mailbox).values());
+            for (Iterator<MailboxMessage> it = results.iterator(); it.hasNext();) {
                 if (it.next().getUid() < set.getUidFrom()) {
                     it.remove();
                 }
             }
             break;
         case RANGE:
-            results = new ArrayList<MailboxMessage<InMemoryId>>(getMembershipByUidForMailbox(mailbox).values());
-            for (Iterator<MailboxMessage<InMemoryId>> it = results.iterator(); it.hasNext();) {
+            results = new ArrayList<MailboxMessage>(getMembershipByUidForMailbox(mailbox).values());
+            for (Iterator<MailboxMessage> it = results.iterator(); it.hasNext();) {
                 final long uid = it.next().getUid();
                 if (uid < set.getUidFrom() || uid > set.getUidTo()) {
                     it.remove();
@@ -135,14 +135,14 @@ public class InMemoryMessageMapper extends AbstractMessageMapper<InMemoryId> {
             }
             break;
         case ONE:
-            results = new ArrayList<MailboxMessage<InMemoryId>>(1);
-            final MailboxMessage<InMemoryId> member = getMembershipByUidForMailbox(mailbox).get(set.getUidFrom());
+            results = new ArrayList<MailboxMessage>(1);
+            final MailboxMessage member = getMembershipByUidForMailbox(mailbox).get(set.getUidFrom());
             if (member != null) {
                 results.add(member);
             }
             break;
         default:
-            results = new ArrayList<MailboxMessage<InMemoryId>>();
+            results = new ArrayList<MailboxMessage>();
             break;
         }
         Collections.sort(results);
@@ -156,9 +156,9 @@ public class InMemoryMessageMapper extends AbstractMessageMapper<InMemoryId> {
     /**
      * @see org.apache.james.mailbox.store.mail.MessageMapper#findRecentMessageUidsInMailbox(org.apache.james.mailbox.store.mail.model.Mailbox)
      */
-    public List<Long> findRecentMessageUidsInMailbox(Mailbox<InMemoryId> mailbox) throws MailboxException {
+    public List<Long> findRecentMessageUidsInMailbox(Mailbox mailbox) throws MailboxException {
         final List<Long> results = new ArrayList<Long>();
-        for (MailboxMessage<InMemoryId> member : getMembershipByUidForMailbox(mailbox).values()) {
+        for (MailboxMessage member : getMembershipByUidForMailbox(mailbox).values()) {
             if (member.isRecent()) {
                 results.add(member.getUid());
             }
@@ -171,10 +171,10 @@ public class InMemoryMessageMapper extends AbstractMessageMapper<InMemoryId> {
     /**
      * @see org.apache.james.mailbox.store.mail.MessageMapper#findFirstUnseenMessageUid(org.apache.james.mailbox.store.mail.model.Mailbox)
      */
-    public Long findFirstUnseenMessageUid(Mailbox<InMemoryId> mailbox) throws MailboxException {
-        List<MailboxMessage<InMemoryId>> memberships = new ArrayList<MailboxMessage<InMemoryId>>(getMembershipByUidForMailbox(mailbox).values());
+    public Long findFirstUnseenMessageUid(Mailbox mailbox) throws MailboxException {
+        List<MailboxMessage> memberships = new ArrayList<MailboxMessage>(getMembershipByUidForMailbox(mailbox).values());
         Collections.sort(memberships);
-        for (MailboxMessage<InMemoryId> m : memberships) {
+        for (MailboxMessage m : memberships) {
             if (m.isSeen() == false) {
                 return m.getUid();
             }
@@ -183,13 +183,13 @@ public class InMemoryMessageMapper extends AbstractMessageMapper<InMemoryId> {
     }
 
     @Override
-    public Map<Long, MessageMetaData> expungeMarkedForDeletionInMailbox(Mailbox<InMemoryId> mailbox, MessageRange set)
+    public Map<Long, MessageMetaData> expungeMarkedForDeletionInMailbox(Mailbox mailbox, MessageRange set)
             throws MailboxException {
         final Map<Long, MessageMetaData> filteredResult = new HashMap<Long, MessageMetaData>();
 
-        Iterator<MailboxMessage<InMemoryId>> it = findInMailbox(mailbox, set, FetchType.Metadata, -1);
+        Iterator<MailboxMessage> it = findInMailbox(mailbox, set, FetchType.Metadata, -1);
         while (it.hasNext()) {
-            MailboxMessage<InMemoryId> member = it.next();
+            MailboxMessage member = it.next();
             if (member.isDeleted()) {
                 filteredResult.put(member.getUid(), new SimpleMessageMetaData(member));
 
@@ -214,9 +214,9 @@ public class InMemoryMessageMapper extends AbstractMessageMapper<InMemoryId> {
      * @see org.apache.james.mailbox.store.mail.AbstractMessageMapper#copy(org.apache.james.mailbox.store.mail.model.Mailbox,
      *      long, long, MailboxMessage)
      */
-    protected MessageMetaData copy(Mailbox<InMemoryId> mailbox, long uid, long modSeq, MailboxMessage<InMemoryId> original)
+    protected MessageMetaData copy(Mailbox mailbox, long uid, long modSeq, MailboxMessage original)
             throws MailboxException {
-        SimpleMailboxMessage<InMemoryId> message = SimpleMailboxMessage.copy(mailbox.getMailboxId(), original);
+        SimpleMailboxMessage message = SimpleMailboxMessage.copy(mailbox.getMailboxId(), original);
         message.setUid(uid);
         message.setModSeq(modSeq);
         Flags flags = original.createFlags();
@@ -231,8 +231,8 @@ public class InMemoryMessageMapper extends AbstractMessageMapper<InMemoryId> {
      * @see org.apache.james.mailbox.store.mail.AbstractMessageMapper#save(org.apache.james.mailbox.store.mail.model.Mailbox,
      *      MailboxMessage)
      */
-    protected MessageMetaData save(Mailbox<InMemoryId> mailbox, MailboxMessage<InMemoryId> message) throws MailboxException {
-        SimpleMailboxMessage<InMemoryId> copy = SimpleMailboxMessage.copy(mailbox.getMailboxId(), message);
+    protected MessageMetaData save(Mailbox mailbox, MailboxMessage message) throws MailboxException {
+        SimpleMailboxMessage copy = SimpleMailboxMessage.copy(mailbox.getMailboxId(), message);
         copy.setUid(message.getUid());
         copy.setModSeq(message.getModSeq());
         getMembershipByUidForMailbox(mailbox).put(message.getUid(), copy);

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/memory/src/main/java/org/apache/james/mailbox/inmemory/mail/InMemoryModSeqProvider.java
----------------------------------------------------------------------
diff --git a/mailbox/memory/src/main/java/org/apache/james/mailbox/inmemory/mail/InMemoryModSeqProvider.java b/mailbox/memory/src/main/java/org/apache/james/mailbox/inmemory/mail/InMemoryModSeqProvider.java
index e19ec04..aaf6dbe 100644
--- a/mailbox/memory/src/main/java/org/apache/james/mailbox/inmemory/mail/InMemoryModSeqProvider.java
+++ b/mailbox/memory/src/main/java/org/apache/james/mailbox/inmemory/mail/InMemoryModSeqProvider.java
@@ -29,18 +29,18 @@ import org.apache.james.mailbox.inmemory.InMemoryId;
 import org.apache.james.mailbox.store.mail.ModSeqProvider;
 import org.apache.james.mailbox.store.mail.model.Mailbox;
 
-public class InMemoryModSeqProvider implements ModSeqProvider<InMemoryId>{
+public class InMemoryModSeqProvider implements ModSeqProvider {
     private final ConcurrentMap<InMemoryId, AtomicLong> map = new ConcurrentHashMap<InMemoryId, AtomicLong>();
 
     @Override
-    public long nextModSeq(MailboxSession session, Mailbox<InMemoryId> mailbox) throws MailboxException {
-        return getHighest(mailbox.getMailboxId()).incrementAndGet();
+    public long nextModSeq(MailboxSession session, Mailbox mailbox) throws MailboxException {
+        return getHighest((InMemoryId) mailbox.getMailboxId()).incrementAndGet();
 
     }
 
     @Override
-    public long highestModSeq(MailboxSession session, Mailbox<InMemoryId> mailbox) throws MailboxException {
-        return getHighest(mailbox.getMailboxId()).get();
+    public long highestModSeq(MailboxSession session, Mailbox mailbox) throws MailboxException {
+        return getHighest((InMemoryId) mailbox.getMailboxId()).get();
     }
     private AtomicLong getHighest(InMemoryId id) {
         AtomicLong uid = map.get(id);

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/memory/src/main/java/org/apache/james/mailbox/inmemory/mail/InMemoryUidProvider.java
----------------------------------------------------------------------
diff --git a/mailbox/memory/src/main/java/org/apache/james/mailbox/inmemory/mail/InMemoryUidProvider.java b/mailbox/memory/src/main/java/org/apache/james/mailbox/inmemory/mail/InMemoryUidProvider.java
index 1d82476..d9004e8 100644
--- a/mailbox/memory/src/main/java/org/apache/james/mailbox/inmemory/mail/InMemoryUidProvider.java
+++ b/mailbox/memory/src/main/java/org/apache/james/mailbox/inmemory/mail/InMemoryUidProvider.java
@@ -29,18 +29,18 @@ import org.apache.james.mailbox.inmemory.InMemoryId;
 import org.apache.james.mailbox.store.mail.UidProvider;
 import org.apache.james.mailbox.store.mail.model.Mailbox;
 
-public class InMemoryUidProvider implements UidProvider<InMemoryId>{
+public class InMemoryUidProvider implements UidProvider{
 
     private final ConcurrentMap<InMemoryId, AtomicLong> map = new ConcurrentHashMap<InMemoryId, AtomicLong>();
     
     @Override
-    public long nextUid(MailboxSession session, Mailbox<InMemoryId> mailbox) throws MailboxException {
-        return getLast(mailbox.getMailboxId()).incrementAndGet();
+    public long nextUid(MailboxSession session, Mailbox mailbox) throws MailboxException {
+        return getLast((InMemoryId) mailbox.getMailboxId()).incrementAndGet();
     }
 
     @Override
-    public long lastUid(MailboxSession session, Mailbox<InMemoryId> mailbox) throws MailboxException {
-        return getLast(mailbox.getMailboxId()).get();
+    public long lastUid(MailboxSession session, Mailbox mailbox) throws MailboxException {
+        return getLast((InMemoryId) mailbox.getMailboxId()).get();
     }
     
     private AtomicLong getLast(InMemoryId id) {

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/memory/src/main/java/org/apache/james/mailbox/inmemory/quota/InMemoryCurrentQuotaManager.java
----------------------------------------------------------------------
diff --git a/mailbox/memory/src/main/java/org/apache/james/mailbox/inmemory/quota/InMemoryCurrentQuotaManager.java b/mailbox/memory/src/main/java/org/apache/james/mailbox/inmemory/quota/InMemoryCurrentQuotaManager.java
index 8ae875c..1771485 100644
--- a/mailbox/memory/src/main/java/org/apache/james/mailbox/inmemory/quota/InMemoryCurrentQuotaManager.java
+++ b/mailbox/memory/src/main/java/org/apache/james/mailbox/inmemory/quota/InMemoryCurrentQuotaManager.java
@@ -25,20 +25,20 @@ import java.util.concurrent.atomic.AtomicLong;
 import javax.inject.Inject;
 import javax.inject.Singleton;
 
-import com.google.common.base.Preconditions;
-import com.google.common.cache.CacheBuilder;
-import com.google.common.cache.CacheLoader;
-import com.google.common.cache.LoadingCache;
 import org.apache.james.mailbox.MailboxListener;
 import org.apache.james.mailbox.MailboxManager;
 import org.apache.james.mailbox.exception.MailboxException;
-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.StoreCurrentQuotaManager;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import com.google.common.base.Preconditions;
+import com.google.common.cache.CacheBuilder;
+import com.google.common.cache.CacheLoader;
+import com.google.common.cache.LoadingCache;
+
 @Singleton
 public class InMemoryCurrentQuotaManager implements StoreCurrentQuotaManager {
 
@@ -47,7 +47,7 @@ public class InMemoryCurrentQuotaManager implements StoreCurrentQuotaManager {
     private final LoadingCache<QuotaRoot, Entry> quotaCache;
 
     @Inject
-    public InMemoryCurrentQuotaManager(final CurrentQuotaCalculator<InMemoryId> quotaCalculator, final MailboxManager mailboxManager) {
+    public InMemoryCurrentQuotaManager(final CurrentQuotaCalculator quotaCalculator, final MailboxManager mailboxManager) {
         this.quotaCache = CacheBuilder.newBuilder().build(new CacheLoader<QuotaRoot, Entry>() {
             @Override
             public Entry load(QuotaRoot quotaRoot) throws Exception {

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/memory/src/test/java/org/apache/james/mailbox/inmemory/InMemoryMailboxIdDeserializerTest.java
----------------------------------------------------------------------
diff --git a/mailbox/memory/src/test/java/org/apache/james/mailbox/inmemory/InMemoryMailboxIdDeserializerTest.java b/mailbox/memory/src/test/java/org/apache/james/mailbox/inmemory/InMemoryMailboxIdDeserializerTest.java
index b8c8934..143b516 100644
--- a/mailbox/memory/src/test/java/org/apache/james/mailbox/inmemory/InMemoryMailboxIdDeserializerTest.java
+++ b/mailbox/memory/src/test/java/org/apache/james/mailbox/inmemory/InMemoryMailboxIdDeserializerTest.java
@@ -19,20 +19,20 @@
 
 package org.apache.james.mailbox.inmemory;
 
+import static org.assertj.core.api.Assertions.assertThat;
+
 import org.apache.james.mailbox.store.mail.model.MailboxIdDeserialisationException;
 import org.apache.james.mailbox.store.mail.model.MailboxIdDeserializer;
 import org.junit.Before;
 import org.junit.Test;
 
-import static org.assertj.core.api.Assertions.assertThat;
-
 public class InMemoryMailboxIdDeserializerTest {
 
     private static final String SERIALIZED_ID = "1234567890123";
     private static final String MALFORMED_SERIALIZED_ID = "aEZ";
     private static final InMemoryId IN_MEMORY_ID = InMemoryId.of(Long.valueOf(SERIALIZED_ID));
 
-    private MailboxIdDeserializer<InMemoryId> mailboxIdDeserializer;
+    private MailboxIdDeserializer mailboxIdDeserializer;
 
     @Before
     public void setUp() {

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/memory/src/test/java/org/apache/james/mailbox/inmemory/InMemoryMailboxManagerTest.java
----------------------------------------------------------------------
diff --git a/mailbox/memory/src/test/java/org/apache/james/mailbox/inmemory/InMemoryMailboxManagerTest.java b/mailbox/memory/src/test/java/org/apache/james/mailbox/inmemory/InMemoryMailboxManagerTest.java
index d3c6cf0..5aa4277 100644
--- a/mailbox/memory/src/test/java/org/apache/james/mailbox/inmemory/InMemoryMailboxManagerTest.java
+++ b/mailbox/memory/src/test/java/org/apache/james/mailbox/inmemory/InMemoryMailboxManagerTest.java
@@ -20,6 +20,8 @@ package org.apache.james.mailbox.inmemory;
 
 import static org.assertj.core.api.Assertions.assertThat;
 
+import java.util.List;
+
 import org.apache.james.mailbox.AbstractMailboxManagerTest;
 import org.apache.james.mailbox.MailboxSession;
 import org.apache.james.mailbox.acl.GroupMembershipResolver;
@@ -39,8 +41,6 @@ import org.junit.Before;
 import org.junit.Test;
 import org.slf4j.LoggerFactory;
 
-import java.util.List;
-
 /**
  * InMemoryMailboxManagerTest that extends the MailboxManagerTest.
  */
@@ -84,7 +84,7 @@ public class InMemoryMailboxManagerTest extends AbstractMailboxManagerTest {
         GroupMembershipResolver groupMembershipResolver = new SimpleGroupMembershipResolver();
 
         InMemoryMailboxSessionMapperFactory mailboxSessionMapperFactory = new InMemoryMailboxSessionMapperFactory();
-        StoreMailboxManager<InMemoryId> mailboxManager = new InMemoryMailboxManager(mailboxSessionMapperFactory, new MockAuthenticator(), new JVMMailboxPathLocker(), aclResolver, groupMembershipResolver);
+        StoreMailboxManager mailboxManager = new InMemoryMailboxManager(mailboxSessionMapperFactory, new MockAuthenticator(), new JVMMailboxPathLocker(), aclResolver, groupMembershipResolver);
         mailboxManager.init();
         
         setMailboxManager(mailboxManager);


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