james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From adup...@apache.org
Subject [11/13] james-project git commit: JAMES-1733 Remove generics from mailbox API
Date Tue, 17 May 2016 08:14:57 GMT
http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch/json/MailboxMessageToElasticSearchJsonTest.java
----------------------------------------------------------------------
diff --git a/mailbox/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch/json/MailboxMessageToElasticSearchJsonTest.java b/mailbox/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch/json/MailboxMessageToElasticSearchJsonTest.java
index 4ceb52c..dbfe8c4 100644
--- a/mailbox/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch/json/MailboxMessageToElasticSearchJsonTest.java
+++ b/mailbox/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch/json/MailboxMessageToElasticSearchJsonTest.java
@@ -19,28 +19,29 @@
 
 package org.apache.james.mailbox.elasticsearch.json;
 
-import com.google.common.base.Throwables;
+import static net.javacrumbs.jsonunit.core.Option.IGNORING_ARRAY_ORDER;
+import static net.javacrumbs.jsonunit.core.Option.IGNORING_VALUES;
+import static net.javacrumbs.jsonunit.fluent.JsonFluentAssert.assertThatJson;
+
+import java.io.IOException;
+import java.time.ZoneId;
+import java.util.Date;
+
+import javax.mail.Flags;
+import javax.mail.util.SharedByteArrayInputStream;
+
 import org.apache.commons.io.IOUtils;
 import org.apache.james.mailbox.FlagsBuilder;
+import org.apache.james.mailbox.store.TestId;
+import org.apache.james.mailbox.store.extractor.DefaultTextExtractor;
 import org.apache.james.mailbox.store.mail.model.MailboxMessage;
+import org.apache.james.mailbox.store.mail.model.impl.PropertyBuilder;
 import org.apache.james.mailbox.store.mail.model.impl.SimpleMailboxMessage;
 import org.apache.james.mailbox.tika.extractor.TikaTextExtractor;
-import org.apache.james.mailbox.store.extractor.DefaultTextExtractor;
-import org.apache.james.mailbox.store.TestId;
-import org.apache.james.mailbox.store.mail.model.impl.PropertyBuilder;
 import org.junit.Before;
 import org.junit.Test;
 
-import javax.mail.Flags;
-import javax.mail.util.SharedByteArrayInputStream;
-
-import java.io.IOException;
-import java.time.ZoneId;
-import java.util.Date;
-
-import static net.javacrumbs.jsonunit.core.Option.IGNORING_ARRAY_ORDER;
-import static net.javacrumbs.jsonunit.core.Option.IGNORING_VALUES;
-import static net.javacrumbs.jsonunit.fluent.JsonFluentAssert.assertThatJson;
+import com.google.common.base.Throwables;
 
 public class MailboxMessageToElasticSearchJsonTest {
 
@@ -69,7 +70,7 @@ public class MailboxMessageToElasticSearchJsonTest {
         MessageToElasticSearchJson messageToElasticSearchJson = new MessageToElasticSearchJson(
             new DefaultTextExtractor(),
             ZoneId.of("Europe/Paris"));
-        MailboxMessage<TestId> spamMail = new SimpleMailboxMessage<>(date,
+        MailboxMessage spamMail = new SimpleMailboxMessage(date,
             SIZE,
             BODY_START_OCTET,
             new SharedByteArrayInputStream(IOUtils.toByteArray(ClassLoader.getSystemResourceAsStream("documents/spamMail.eml"))),
@@ -87,7 +88,7 @@ public class MailboxMessageToElasticSearchJsonTest {
         MessageToElasticSearchJson messageToElasticSearchJson = new MessageToElasticSearchJson(
             new DefaultTextExtractor(),
             ZoneId.of("Europe/Paris"));
-        MailboxMessage<TestId> htmlMail = new SimpleMailboxMessage<>(date,
+        MailboxMessage htmlMail = new SimpleMailboxMessage(date,
             SIZE,
             BODY_START_OCTET,
             new SharedByteArrayInputStream(IOUtils.toByteArray(ClassLoader.getSystemResourceAsStream("documents/htmlMail.eml"))),
@@ -106,7 +107,7 @@ public class MailboxMessageToElasticSearchJsonTest {
         MessageToElasticSearchJson messageToElasticSearchJson = new MessageToElasticSearchJson(
             new DefaultTextExtractor(),
             ZoneId.of("Europe/Paris"));
-        MailboxMessage<TestId> pgpSignedMail = new SimpleMailboxMessage<>(date,
+        MailboxMessage pgpSignedMail = new SimpleMailboxMessage(date,
             SIZE,
             BODY_START_OCTET,
             new SharedByteArrayInputStream(IOUtils.toByteArray(ClassLoader.getSystemResourceAsStream("documents/pgpSignedMail.eml"))),
@@ -125,7 +126,7 @@ public class MailboxMessageToElasticSearchJsonTest {
         MessageToElasticSearchJson messageToElasticSearchJson = new MessageToElasticSearchJson(
             new DefaultTextExtractor(),
             ZoneId.of("Europe/Paris"));
-        MailboxMessage<TestId> mail = new SimpleMailboxMessage<>(date,
+        MailboxMessage mail = new SimpleMailboxMessage(date,
             SIZE,
             BODY_START_OCTET,
             new SharedByteArrayInputStream(IOUtils.toByteArray(ClassLoader.getSystemResourceAsStream("documents/mail.eml"))),
@@ -144,7 +145,7 @@ public class MailboxMessageToElasticSearchJsonTest {
         MessageToElasticSearchJson messageToElasticSearchJson = new MessageToElasticSearchJson(
             new DefaultTextExtractor(),
             ZoneId.of("Europe/Paris"));
-        MailboxMessage<TestId> recursiveMail = new SimpleMailboxMessage<>(date,
+        MailboxMessage recursiveMail = new SimpleMailboxMessage(date,
             SIZE,
             BODY_START_OCTET,
             new SharedByteArrayInputStream(IOUtils.toByteArray(ClassLoader.getSystemResourceAsStream("documents/recursiveMail.eml"))),
@@ -163,7 +164,7 @@ public class MailboxMessageToElasticSearchJsonTest {
         MessageToElasticSearchJson messageToElasticSearchJson = new MessageToElasticSearchJson(
             new DefaultTextExtractor(),
             ZoneId.of("Europe/Paris"));
-        MailboxMessage<TestId> mailWithNoInternalDate = new SimpleMailboxMessage<>(null,
+        MailboxMessage mailWithNoInternalDate = new SimpleMailboxMessage(null,
             SIZE,
             BODY_START_OCTET,
             new SharedByteArrayInputStream(IOUtils.toByteArray(ClassLoader.getSystemResourceAsStream("documents/recursiveMail.eml"))),
@@ -183,9 +184,9 @@ public class MailboxMessageToElasticSearchJsonTest {
         MessageToElasticSearchJson messageToElasticSearchJson = new MessageToElasticSearchJson(
             new DefaultTextExtractor(),
             ZoneId.of("Europe/Paris"));
-        MailboxMessage<TestId> mailWithNoMailboxId;
+        MailboxMessage mailWithNoMailboxId;
         try {
-            mailWithNoMailboxId = new SimpleMailboxMessage<>(date,
+            mailWithNoMailboxId = new SimpleMailboxMessage(date,
                 SIZE,
                 BODY_START_OCTET,
                 new SharedByteArrayInputStream(IOUtils.toByteArray(ClassLoader.getSystemResourceAsStream("documents/recursiveMail.eml"))),
@@ -231,7 +232,7 @@ public class MailboxMessageToElasticSearchJsonTest {
         MessageToElasticSearchJson messageToElasticSearchJson = new MessageToElasticSearchJson(
             new TikaTextExtractor(),
             ZoneId.of("Europe/Paris"));
-        MailboxMessage<TestId> spamMail = new SimpleMailboxMessage<>(date,
+        MailboxMessage spamMail = new SimpleMailboxMessage(date,
             SIZE,
             BODY_START_OCTET,
             new SharedByteArrayInputStream(IOUtils.toByteArray(ClassLoader.getSystemResourceAsStream("documents/nonTextual.eml"))),

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/hbase/src/main/java/org/apache/james/mailbox/hbase/HBaseMailboxIdDeserializer.java
----------------------------------------------------------------------
diff --git a/mailbox/hbase/src/main/java/org/apache/james/mailbox/hbase/HBaseMailboxIdDeserializer.java b/mailbox/hbase/src/main/java/org/apache/james/mailbox/hbase/HBaseMailboxIdDeserializer.java
index 7b6a9a2..ac3f7fd 100644
--- a/mailbox/hbase/src/main/java/org/apache/james/mailbox/hbase/HBaseMailboxIdDeserializer.java
+++ b/mailbox/hbase/src/main/java/org/apache/james/mailbox/hbase/HBaseMailboxIdDeserializer.java
@@ -19,11 +19,12 @@
 
 package org.apache.james.mailbox.hbase;
 
+import java.util.UUID;
+
 import org.apache.james.mailbox.store.mail.model.MailboxIdDeserialisationException;
 import org.apache.james.mailbox.store.mail.model.MailboxIdDeserializer;
-import java.util.UUID;
 
-public class HBaseMailboxIdDeserializer implements MailboxIdDeserializer<HBaseId> {
+public class HBaseMailboxIdDeserializer implements MailboxIdDeserializer {
 
     @Override
     public HBaseId deserialize(String serializedMailboxId) throws MailboxIdDeserialisationException {

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/hbase/src/main/java/org/apache/james/mailbox/hbase/HBaseMailboxManager.java
----------------------------------------------------------------------
diff --git a/mailbox/hbase/src/main/java/org/apache/james/mailbox/hbase/HBaseMailboxManager.java b/mailbox/hbase/src/main/java/org/apache/james/mailbox/hbase/HBaseMailboxManager.java
index ee9742f..9f5954f 100644
--- a/mailbox/hbase/src/main/java/org/apache/james/mailbox/hbase/HBaseMailboxManager.java
+++ b/mailbox/hbase/src/main/java/org/apache/james/mailbox/hbase/HBaseMailboxManager.java
@@ -37,7 +37,7 @@ import org.apache.james.mailbox.store.transaction.TransactionalMapper;
  * HBase implementation of {@link StoreMailboxManager}
  * 
  */
-public class HBaseMailboxManager extends StoreMailboxManager<HBaseId> {
+public class HBaseMailboxManager extends StoreMailboxManager {
 
     public HBaseMailboxManager(HBaseMailboxSessionMapperFactory mapperFactory, Authenticator authenticator, MailboxPathLocker locker, MailboxACLResolver aclResolver, GroupMembershipResolver groupMembershipResolver) {
         super(mapperFactory, authenticator, locker, aclResolver, groupMembershipResolver);
@@ -48,7 +48,7 @@ public class HBaseMailboxManager extends StoreMailboxManager<HBaseId> {
     }
 
     @Override
-    protected Mailbox<HBaseId> doCreateMailbox(MailboxPath mailboxPath, MailboxSession session) throws MailboxException {
+    protected Mailbox doCreateMailbox(MailboxPath mailboxPath, MailboxSession session) throws MailboxException {
         return new HBaseMailbox(mailboxPath, randomUidValidity());
     }
 
@@ -79,7 +79,7 @@ public class HBaseMailboxManager extends StoreMailboxManager<HBaseId> {
     }
 
     @Override
-    protected StoreMessageManager<HBaseId> createMessageManager(Mailbox<HBaseId> mailboxRow, MailboxSession session) throws MailboxException {
+    protected StoreMessageManager createMessageManager(Mailbox mailboxRow, MailboxSession session) throws MailboxException {
         return new HBaseMessageManager(getMapperFactory(),
             getMessageSearchIndex(),
             getEventDispatcher(),

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/hbase/src/main/java/org/apache/james/mailbox/hbase/HBaseMailboxSessionMapperFactory.java
----------------------------------------------------------------------
diff --git a/mailbox/hbase/src/main/java/org/apache/james/mailbox/hbase/HBaseMailboxSessionMapperFactory.java b/mailbox/hbase/src/main/java/org/apache/james/mailbox/hbase/HBaseMailboxSessionMapperFactory.java
index 4a647f0..400bf78 100644
--- a/mailbox/hbase/src/main/java/org/apache/james/mailbox/hbase/HBaseMailboxSessionMapperFactory.java
+++ b/mailbox/hbase/src/main/java/org/apache/james/mailbox/hbase/HBaseMailboxSessionMapperFactory.java
@@ -53,11 +53,11 @@ import org.apache.james.mailbox.store.user.SubscriptionMapper;
  * HBase implementation of {@link MailboxSessionMapperFactory}
  *
  */
-public class HBaseMailboxSessionMapperFactory extends MailboxSessionMapperFactory<HBaseId> {
+public class HBaseMailboxSessionMapperFactory extends MailboxSessionMapperFactory {
 
     private final Configuration conf;
-    private final UidProvider<HBaseId> uidProvider;
-    private final ModSeqProvider<HBaseId> modSeqProvider;
+    private final UidProvider uidProvider;
+    private final ModSeqProvider modSeqProvider;
 
     /**
      * Creates  the necessary tables in HBase if they do not exist.
@@ -69,7 +69,7 @@ public class HBaseMailboxSessionMapperFactory extends MailboxSessionMapperFactor
      * @throws ZooKeeperConnectionException
      * @throws IOException
      */
-    public HBaseMailboxSessionMapperFactory(Configuration conf, UidProvider<HBaseId> uidProvider, ModSeqProvider<HBaseId> modSeqProvider) {
+    public HBaseMailboxSessionMapperFactory(Configuration conf, UidProvider uidProvider, ModSeqProvider modSeqProvider) {
         this.conf = conf;
         this.uidProvider = uidProvider;
         this.modSeqProvider = modSeqProvider;
@@ -126,12 +126,12 @@ public class HBaseMailboxSessionMapperFactory extends MailboxSessionMapperFactor
     }
 
     @Override
-    public MessageMapper<HBaseId> createMessageMapper(MailboxSession session) throws MailboxException {
+    public MessageMapper createMessageMapper(MailboxSession session) throws MailboxException {
         return new HBaseMessageMapper(session, uidProvider, modSeqProvider, this.conf);
     }
 
     @Override
-    public MailboxMapper<HBaseId> createMailboxMapper(MailboxSession session) throws MailboxException {
+    public MailboxMapper createMailboxMapper(MailboxSession session) throws MailboxException {
         return new HBaseMailboxMapper(this.conf);
     }
 
@@ -152,7 +152,7 @@ public class HBaseMailboxSessionMapperFactory extends MailboxSessionMapperFactor
      * Returns the ModSeqProvider used.
      * @return The used modSeqProvider
      */
-    public ModSeqProvider<HBaseId> getModSeqProvider() {
+    public ModSeqProvider getModSeqProvider() {
         return modSeqProvider;
     }
 
@@ -160,7 +160,7 @@ public class HBaseMailboxSessionMapperFactory extends MailboxSessionMapperFactor
      * Returns the UidProvider that generates UID's for mailboxes.
      * @return The provider that generates UID's for mailboxes
      */
-    public UidProvider<HBaseId> getUidProvider() {
+    public UidProvider getUidProvider() {
         return uidProvider;
     }
 }

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/hbase/src/main/java/org/apache/james/mailbox/hbase/HBaseMessageManager.java
----------------------------------------------------------------------
diff --git a/mailbox/hbase/src/main/java/org/apache/james/mailbox/hbase/HBaseMessageManager.java b/mailbox/hbase/src/main/java/org/apache/james/mailbox/hbase/HBaseMessageManager.java
index 026a361..a434c8d 100644
--- a/mailbox/hbase/src/main/java/org/apache/james/mailbox/hbase/HBaseMessageManager.java
+++ b/mailbox/hbase/src/main/java/org/apache/james/mailbox/hbase/HBaseMessageManager.java
@@ -27,9 +27,9 @@ import org.apache.james.mailbox.acl.MailboxACLResolver;
 import org.apache.james.mailbox.exception.MailboxException;
 import org.apache.james.mailbox.quota.QuotaManager;
 import org.apache.james.mailbox.quota.QuotaRootResolver;
-import org.apache.james.mailbox.store.event.MailboxEventDispatcher;
 import org.apache.james.mailbox.store.MailboxSessionMapperFactory;
 import org.apache.james.mailbox.store.StoreMessageManager;
+import org.apache.james.mailbox.store.event.MailboxEventDispatcher;
 import org.apache.james.mailbox.store.mail.model.Mailbox;
 import org.apache.james.mailbox.store.search.MessageSearchIndex;
 
@@ -37,10 +37,10 @@ import org.apache.james.mailbox.store.search.MessageSearchIndex;
  * HBase implementation of MessageManager.
  * 
  */
-public class HBaseMessageManager extends StoreMessageManager<HBaseId> {
+public class HBaseMessageManager extends StoreMessageManager {
 
-    public HBaseMessageManager(MailboxSessionMapperFactory<HBaseId> mapperFactory, MessageSearchIndex<HBaseId> index,
-            MailboxEventDispatcher<HBaseId> dispatcher, MailboxPathLocker locker, Mailbox<HBaseId> mailbox, MailboxACLResolver aclResolver, GroupMembershipResolver groupMembershipResolver, QuotaManager quotaManager, QuotaRootResolver quotaRootResolver) throws MailboxException {
+    public HBaseMessageManager(MailboxSessionMapperFactory 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/hbase/src/main/java/org/apache/james/mailbox/hbase/HBaseUtils.java
----------------------------------------------------------------------
diff --git a/mailbox/hbase/src/main/java/org/apache/james/mailbox/hbase/HBaseUtils.java b/mailbox/hbase/src/main/java/org/apache/james/mailbox/hbase/HBaseUtils.java
index e34fc10..b6d7e35 100644
--- a/mailbox/hbase/src/main/java/org/apache/james/mailbox/hbase/HBaseUtils.java
+++ b/mailbox/hbase/src/main/java/org/apache/james/mailbox/hbase/HBaseUtils.java
@@ -91,7 +91,7 @@ public class HBaseUtils {
      * @param result a result of a HBase Get operation 
      * @return a Mailbox object
      */
-    public static Mailbox<HBaseId> mailboxFromResult(Result result) {
+    public static Mailbox mailboxFromResult(Result result) {
         NavigableMap<byte[], byte[]> rawMailbox = result.getFamilyMap(MAILBOX_CF);
         //TODO: should we test for null values?
         MailboxPath path = new MailboxPath(Bytes.toString(rawMailbox.get(MAILBOX_NAMESPACE)),
@@ -145,7 +145,7 @@ public class HBaseUtils {
      * @param message
      * @return a put that contains all metadata information.
      */
-    public static Put metadataToPut(MailboxMessage<HBaseId> message) {
+    public static Put metadataToPut(MailboxMessage message) {
         Put put = new Put(messageRowKey(message));
         // we store the message uid and mailbox uid in the row key
         // store the meta data
@@ -203,8 +203,8 @@ public class HBaseUtils {
      * @param message message to get row key from
      * @return rowkey byte array that can be used with HBase API
      */
-    public static byte[] messageRowKey(MailboxMessage<HBaseId> message) {
-        return messageRowKey(message.getMailboxId(), message.getUid());
+    public static byte[] messageRowKey(MailboxMessage message) {
+        return messageRowKey((HBaseId) message.getMailboxId(), message.getUid());
     }
 
     /**
@@ -240,7 +240,7 @@ public class HBaseUtils {
      * @param result the result object containing message data
      * @return a HBaseMailboxMessage instance with message metadata.
      */
-    public static MailboxMessage<HBaseId> messageMetaFromResult(Configuration conf, Result result) {
+    public static MailboxMessage messageMetaFromResult(Configuration conf, Result result) {
         HBaseMailboxMessage message = null;
         Flags flags = new Flags();
         List<Property> propList = new ArrayList<Property>();
@@ -328,7 +328,7 @@ public class HBaseUtils {
      * @param flags
      * @return a put object with 
      */
-    public static Put flagsToPut(MailboxMessage<HBaseId> message, Flags flags) {
+    public static Put flagsToPut(MailboxMessage message, Flags flags) {
         Put put = new Put(messageRowKey(message));
         //system flags
         if (flags.contains(Flag.ANSWERED)) {
@@ -376,7 +376,7 @@ public class HBaseUtils {
         return put;
     }
 
-    public static Delete flagsToDelete(MailboxMessage<HBaseId> message, Flags flags) {
+    public static Delete flagsToDelete(MailboxMessage message, Flags flags) {
         Delete delete = new Delete(messageRowKey(message));
         //we mark for delete flags that are not present (they will be Put'ed)
         if (flags.contains(Flag.ANSWERED)) {

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/hbase/src/main/java/org/apache/james/mailbox/hbase/mail/HBaseMailboxMapper.java
----------------------------------------------------------------------
diff --git a/mailbox/hbase/src/main/java/org/apache/james/mailbox/hbase/mail/HBaseMailboxMapper.java b/mailbox/hbase/src/main/java/org/apache/james/mailbox/hbase/mail/HBaseMailboxMapper.java
index c2c2741..628cd8c 100644
--- a/mailbox/hbase/src/main/java/org/apache/james/mailbox/hbase/mail/HBaseMailboxMapper.java
+++ b/mailbox/hbase/src/main/java/org/apache/james/mailbox/hbase/mail/HBaseMailboxMapper.java
@@ -62,7 +62,7 @@ import org.apache.james.mailbox.store.mail.model.Mailbox;
  * Data access management for mailbox.
  *
  */
-public class HBaseMailboxMapper extends HBaseNonTransactionalMapper implements MailboxMapper<HBaseId> {
+public class HBaseMailboxMapper extends HBaseNonTransactionalMapper implements MailboxMapper {
 
     /**
      * Link to the HBase Configuration object and specific mailbox names
@@ -74,7 +74,7 @@ public class HBaseMailboxMapper extends HBaseNonTransactionalMapper implements M
     }
     
     @Override
-    public Mailbox<HBaseId> findMailboxByPath(MailboxPath mailboxPath) throws MailboxException, MailboxNotFoundException {
+    public Mailbox findMailboxByPath(MailboxPath mailboxPath) throws MailboxException, MailboxNotFoundException {
         HTable mailboxes = null;
         ResultScanner scanner = null;
         try {
@@ -125,7 +125,7 @@ public class HBaseMailboxMapper extends HBaseNonTransactionalMapper implements M
     }
     
     @Override
-    public List<Mailbox<HBaseId>> findMailboxWithPathLike(MailboxPath mailboxPath) throws MailboxException {
+    public List<Mailbox> findMailboxWithPathLike(MailboxPath mailboxPath) throws MailboxException {
         HTable mailboxes = null;
         ResultScanner scanner = null;
         try {
@@ -166,7 +166,7 @@ public class HBaseMailboxMapper extends HBaseNonTransactionalMapper implements M
             scan.setFilter(filters);
             scanner = mailboxes.getScanner(scan);
             
-            List<Mailbox<HBaseId>> mailboxList = new ArrayList<Mailbox<HBaseId>>();
+            List<Mailbox> mailboxList = new ArrayList<Mailbox>();
             
             for (Result result : scanner) {
                 mailboxList.add(mailboxFromResult(result));
@@ -187,7 +187,7 @@ public class HBaseMailboxMapper extends HBaseNonTransactionalMapper implements M
     }
     
     @Override
-    public List<Mailbox<HBaseId>> list() throws MailboxException {
+    public List<Mailbox> list() throws MailboxException {
         HTable mailboxes = null;
         ResultScanner scanner = null;
         //TODO: possible performance isssues, we are creating an object from all the rows in HBase mailbox table
@@ -198,11 +198,11 @@ public class HBaseMailboxMapper extends HBaseNonTransactionalMapper implements M
             scan.setCaching(mailboxes.getConfiguration().getInt("hbase.client.scanner.caching", 1) * 2);
             scan.setMaxVersions(1);
             scanner = mailboxes.getScanner(scan);
-            List<Mailbox<HBaseId>> mailboxList = new ArrayList<Mailbox<HBaseId>>();
+            List<Mailbox> mailboxList = new ArrayList<Mailbox>();
             
             Result result;
             while ((result = scanner.next()) != null) {
-                Mailbox<HBaseId> mlbx = mailboxFromResult(result);
+                Mailbox mlbx = mailboxFromResult(result);
                 mailboxList.add(mlbx);
             }
             return mailboxList;
@@ -225,7 +225,7 @@ public class HBaseMailboxMapper extends HBaseNonTransactionalMapper implements M
     }
     
     @Override
-    public void save(Mailbox<HBaseId> mlbx) throws MailboxException {
+    public void save(Mailbox mlbx) throws MailboxException {
         //TODO: maybe switch to checkAndPut for transactions
         HTable mailboxes = null;
         try {
@@ -249,13 +249,14 @@ public class HBaseMailboxMapper extends HBaseNonTransactionalMapper implements M
     }
     
     @Override
-    public void delete(Mailbox<HBaseId> mlbx) throws MailboxException {
+    public void delete(Mailbox mlbx) throws MailboxException {
         //TODO: maybe switch to checkAndDelete
         HTable mailboxes = null;
+        HBaseId mailboxId = (HBaseId) mlbx.getMailboxId();
         try {
             mailboxes = new HTable(conf, MAILBOXES_TABLE);
             //TODO: delete all maessages from this mailbox
-            Delete delete = new Delete(mlbx.getMailboxId().toBytes());
+            Delete delete = new Delete(mailboxId.toBytes());
             mailboxes.delete(delete);
         } catch (IOException ex) {
             throw new MailboxException("IOException in HBase cluster during delete()", ex);
@@ -271,7 +272,7 @@ public class HBaseMailboxMapper extends HBaseNonTransactionalMapper implements M
     }
     
     @Override
-    public boolean hasChildren(Mailbox<HBaseId> mailbox, char c) throws MailboxException, MailboxNotFoundException {
+    public boolean hasChildren(Mailbox mailbox, char c) throws MailboxException, MailboxNotFoundException {
         HTable mailboxes = null;
         ResultScanner scanner = null;
         try {
@@ -385,7 +386,7 @@ public class HBaseMailboxMapper extends HBaseNonTransactionalMapper implements M
     }
 
     @Override
-    public void updateACL(Mailbox<HBaseId> 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/hbase/src/main/java/org/apache/james/mailbox/hbase/mail/HBaseMailboxMessage.java
----------------------------------------------------------------------
diff --git a/mailbox/hbase/src/main/java/org/apache/james/mailbox/hbase/mail/HBaseMailboxMessage.java b/mailbox/hbase/src/main/java/org/apache/james/mailbox/hbase/mail/HBaseMailboxMessage.java
index e1cf7eb..e56df67 100644
--- a/mailbox/hbase/src/main/java/org/apache/james/mailbox/hbase/mail/HBaseMailboxMessage.java
+++ b/mailbox/hbase/src/main/java/org/apache/james/mailbox/hbase/mail/HBaseMailboxMessage.java
@@ -50,7 +50,7 @@ import org.apache.james.mailbox.store.mail.model.impl.PropertyBuilder;
  * message content. The message content is retrieved using a ChunkedInputStream
  * directly from HBase.
  */
-public class HBaseMailboxMessage implements MailboxMessage<HBaseId> {
+public class HBaseMailboxMessage implements MailboxMessage {
 
     private static final MessageUidComparator MESSAGE_UID_COMPARATOR = new MessageUidComparator();
     private static final String TOSTRING_SEPARATOR = " ";
@@ -94,7 +94,7 @@ public class HBaseMailboxMessage implements MailboxMessage<HBaseId> {
      * Create a copy of the given message.
      * All properties are cloned except mailbox and UID.
      */
-    public HBaseMailboxMessage(Configuration conf, HBaseId mailboxId, long uid, long modSeq, MailboxMessage<?> original) throws MailboxException {
+    public HBaseMailboxMessage(Configuration conf, HBaseId mailboxId, long uid, long modSeq, MailboxMessage original) throws MailboxException {
         this.conf = conf;
         this.mailboxId = mailboxId;
         this.uid = uid;
@@ -348,7 +348,7 @@ public class HBaseMailboxMessage implements MailboxMessage<HBaseId> {
     }
 
     @Override
-    public int compareTo(MailboxMessage<HBaseId> 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/hbase/src/main/java/org/apache/james/mailbox/hbase/mail/HBaseMessageMapper.java
----------------------------------------------------------------------
diff --git a/mailbox/hbase/src/main/java/org/apache/james/mailbox/hbase/mail/HBaseMessageMapper.java b/mailbox/hbase/src/main/java/org/apache/james/mailbox/hbase/mail/HBaseMessageMapper.java
index 3d5f69f..1b9e70b 100644
--- a/mailbox/hbase/src/main/java/org/apache/james/mailbox/hbase/mail/HBaseMessageMapper.java
+++ b/mailbox/hbase/src/main/java/org/apache/james/mailbox/hbase/mail/HBaseMessageMapper.java
@@ -85,16 +85,16 @@ import org.apache.james.mailbox.store.transaction.NonTransactionalMapper;
  * I don't know if this class is thread-safe! Asume it is not!
  *
  */
-public class HBaseMessageMapper extends NonTransactionalMapper implements MessageMapper<HBaseId> {
+public class HBaseMessageMapper extends NonTransactionalMapper implements MessageMapper {
 
     private final Configuration conf;
     private final MailboxSession mailboxSession;
-    private final UidProvider<HBaseId> uidProvider;
-    private final ModSeqProvider<HBaseId> modSeqProvider;
+    private final UidProvider uidProvider;
+    private final ModSeqProvider modSeqProvider;
 
     public HBaseMessageMapper(MailboxSession session,
-            final UidProvider<HBaseId> uidProvider,
-            ModSeqProvider<HBaseId> modSeqProvider, Configuration conf) {
+            final UidProvider uidProvider,
+            ModSeqProvider modSeqProvider, Configuration conf) {
         this.mailboxSession = session;
         this.modSeqProvider = modSeqProvider;
         this.uidProvider = uidProvider;
@@ -106,9 +106,10 @@ public class HBaseMessageMapper extends NonTransactionalMapper implements Messag
     }
 
     @Override
-    public Iterator<MailboxMessage<HBaseId>> findInMailbox(Mailbox<HBaseId> mailbox, MessageRange set, FetchType fType, int max) throws MailboxException {
+    public Iterator<MailboxMessage> findInMailbox(Mailbox mailbox, MessageRange set, FetchType fType, int max) throws MailboxException {
+        HBaseId mailboxId = (HBaseId) mailbox.getMailboxId();
         try {
-            List<MailboxMessage<HBaseId>> results;
+            List<MailboxMessage> results;
             long from = set.getUidFrom();
             final long to = set.getUidTo();
             final Type type = set.getType();
@@ -116,16 +117,16 @@ public class HBaseMessageMapper extends NonTransactionalMapper implements Messag
             switch (type) {
                 default:
                 case ALL:
-                    results = findMessagesInMailbox(mailbox, max, false);
+                    results = findMessagesInMailbox(mailboxId, max, false);
                     break;
                 case FROM:
-                    results = findMessagesInMailboxAfterUID(mailbox, from, max, false);
+                    results = findMessagesInMailboxAfterUID(mailboxId, from, max, false);
                     break;
                 case ONE:
-                    results = findMessagesInMailboxWithUID(mailbox, from, false);
+                    results = findMessagesInMailboxWithUID(mailboxId, from, false);
                     break;
                 case RANGE:
-                    results = findMessagesInMailboxBetweenUIDs(mailbox, from, to, max, false);
+                    results = findMessagesInMailboxBetweenUIDs(mailboxId, from, to, max, false);
                     break;
             }
             return results.iterator();
@@ -135,11 +136,11 @@ public class HBaseMessageMapper extends NonTransactionalMapper implements Messag
         }
     }
 
-    private List<MailboxMessage<HBaseId>> findMessagesInMailbox(Mailbox<HBaseId> mailbox, int batchSize, boolean flaggedForDelete) throws IOException {
-        List<MailboxMessage<HBaseId>> messageList = new ArrayList<MailboxMessage<HBaseId>>();
+    private List<MailboxMessage> findMessagesInMailbox(HBaseId mailboxId, int batchSize, boolean flaggedForDelete) throws IOException {
+        List<MailboxMessage> messageList = new ArrayList<MailboxMessage>();
         HTable messages = new HTable(conf, MESSAGES_TABLE);
-        Scan scan = new Scan(customMessageRowKey(mailbox.getMailboxId(), 0L),
-                new PrefixFilter(mailbox.getMailboxId().toBytes()));
+        Scan scan = new Scan(customMessageRowKey(mailboxId, 0L),
+                new PrefixFilter(mailboxId.toBytes()));
         if (flaggedForDelete) {
             SingleColumnValueFilter filter = new SingleColumnValueFilter(MESSAGES_META_CF, FLAGS_DELETED, CompareOp.EQUAL, MARKER_PRESENT);
             filter.setFilterIfMissing(true);
@@ -164,10 +165,10 @@ public class HBaseMessageMapper extends NonTransactionalMapper implements Messag
         return messageList;
     }
 
-    private List<MailboxMessage<HBaseId>> findMessagesInMailboxWithUID(Mailbox<HBaseId> mailbox, long messageUid, boolean flaggedForDelete) throws IOException {
-        List<MailboxMessage<HBaseId>> messageList = new ArrayList<MailboxMessage<HBaseId>>();
+    private List<MailboxMessage> findMessagesInMailboxWithUID(HBaseId mailboxId, long messageUid, boolean flaggedForDelete) throws IOException {
+        List<MailboxMessage> messageList = new ArrayList<MailboxMessage>();
         HTable messages = new HTable(conf, MESSAGES_TABLE);
-        Get get = new Get(messageRowKey(mailbox.getMailboxId(), messageUid));
+        Get get = new Get(messageRowKey(mailboxId, messageUid));
         get.setMaxVersions(1);
         /* we exclude the message content column family because it could be too large.
          * the content will be pulled from HBase on demand by using a a ChunkedInputStream implementation.
@@ -179,7 +180,7 @@ public class HBaseMessageMapper extends NonTransactionalMapper implements Messag
         }
         get.addFamily(MESSAGES_META_CF);
         Result result = messages.get(get);
-        MailboxMessage<HBaseId> message = null;
+        MailboxMessage message = null;
         if (!result.isEmpty()) {
             message = messageMetaFromResult(conf, result);
             messageList.add(message);
@@ -188,12 +189,12 @@ public class HBaseMessageMapper extends NonTransactionalMapper implements Messag
         return messageList;
     }
 
-    private List<MailboxMessage<HBaseId>> findMessagesInMailboxAfterUID(Mailbox<HBaseId> mailbox, long from, int batchSize, boolean flaggedForDelete) throws IOException {
-        List<MailboxMessage<HBaseId>> messageList = new ArrayList<MailboxMessage<HBaseId>>();
+    private List<MailboxMessage> findMessagesInMailboxAfterUID(HBaseId mailboxId, long from, int batchSize, boolean flaggedForDelete) throws IOException {
+        List<MailboxMessage> messageList = new ArrayList<MailboxMessage>();
         HTable messages = new HTable(conf, MESSAGES_TABLE);
         // uids are stored in reverse so we need to search
-        Scan scan = new Scan(messageRowKey(mailbox.getMailboxId(), Long.MAX_VALUE),
-                messageRowKey(mailbox.getMailboxId(), from - 1));
+        Scan scan = new Scan(messageRowKey(mailboxId, Long.MAX_VALUE),
+                messageRowKey(mailboxId, from - 1));
         if (flaggedForDelete) {
             SingleColumnValueFilter filter = new SingleColumnValueFilter(MESSAGES_META_CF, FLAGS_DELETED, CompareOp.EQUAL, MARKER_PRESENT);
             filter.setFilterIfMissing(true);
@@ -218,8 +219,8 @@ public class HBaseMessageMapper extends NonTransactionalMapper implements Messag
         return messageList;
     }
 
-    private List<MailboxMessage<HBaseId>> findMessagesInMailboxBetweenUIDs(Mailbox<HBaseId> mailbox, long from, long to, int batchSize, boolean flaggedForDelete) throws IOException {
-        List<MailboxMessage<HBaseId>> messageList = new ArrayList<MailboxMessage<HBaseId>>();
+    private List<MailboxMessage> findMessagesInMailboxBetweenUIDs(HBaseId mailboxId, long from, long to, int batchSize, boolean flaggedForDelete) throws IOException {
+        List<MailboxMessage> messageList = new ArrayList<MailboxMessage>();
         if (from > to) {
             return messageList;
         }
@@ -227,7 +228,7 @@ public class HBaseMessageMapper extends NonTransactionalMapper implements Messag
         /*TODO: check if Between should be inclusive or exclusive regarding limits.
          * HBase scan operaion are exclusive to the upper bound when providing stop row key.
          */
-        Scan scan = new Scan(messageRowKey(mailbox.getMailboxId(), to), messageRowKey(mailbox.getMailboxId(), from - 1));
+        Scan scan = new Scan(messageRowKey(mailboxId, to), messageRowKey(mailboxId, from - 1));
         if (flaggedForDelete) {
             SingleColumnValueFilter filter = new SingleColumnValueFilter(MESSAGES_META_CF, FLAGS_DELETED, CompareOp.EQUAL, MARKER_PRESENT);
             filter.setFilterIfMissing(true);
@@ -246,7 +247,7 @@ public class HBaseMessageMapper extends NonTransactionalMapper implements Messag
             if (count == 0) {
                 break;
             }
-            MailboxMessage<HBaseId> message = messageMetaFromResult(conf, result);
+            MailboxMessage message = messageMetaFromResult(conf, result);
             messageList.add(message);
             count--;
         }
@@ -258,34 +259,35 @@ public class HBaseMessageMapper extends NonTransactionalMapper implements Messag
     }
 
     @Override
-    public Map<Long, MessageMetaData> expungeMarkedForDeletionInMailbox(Mailbox<HBaseId> mailbox, MessageRange set) throws MailboxException {
+    public Map<Long, MessageMetaData> expungeMarkedForDeletionInMailbox(Mailbox mailbox, MessageRange set) throws MailboxException {
         try {
             final Map<Long, MessageMetaData> data;
-            final List<MailboxMessage<HBaseId>> results;
+            final List<MailboxMessage> results;
             final long from = set.getUidFrom();
             final long to = set.getUidTo();
+            HBaseId mailboxId = (HBaseId) mailbox.getMailboxId();
 
             switch (set.getType()) {
                 case ONE:
-                    results = findMessagesInMailboxWithUID(mailbox, from, true);
+                    results = findMessagesInMailboxWithUID(mailboxId, from, true);
                     data = createMetaData(results);
-                    deleteDeletedMessagesInMailboxWithUID(mailbox, from);
+                    deleteDeletedMessagesInMailboxWithUID(mailboxId, from);
                     break;
                 case RANGE:
-                    results = findMessagesInMailboxBetweenUIDs(mailbox, from, to, -1, true);
+                    results = findMessagesInMailboxBetweenUIDs(mailboxId, from, to, -1, true);
                     data = createMetaData(results);
-                    deleteDeletedMessagesInMailboxBetweenUIDs(mailbox, from, to);
+                    deleteDeletedMessagesInMailboxBetweenUIDs(mailboxId, from, to);
                     break;
                 case FROM:
-                    results = findMessagesInMailboxAfterUID(mailbox, from, -1, true);
+                    results = findMessagesInMailboxAfterUID(mailboxId, from, -1, true);
                     data = createMetaData(results);
-                    deleteDeletedMessagesInMailboxAfterUID(mailbox, from);
+                    deleteDeletedMessagesInMailboxAfterUID(mailboxId, from);
                     break;
                 default:
                 case ALL:
-                    results = findMessagesInMailbox(mailbox, -1, true);
+                    results = findMessagesInMailbox(mailboxId, -1, true);
                     data = createMetaData(results);
-                    deleteDeletedMessagesInMailbox(mailbox);
+                    deleteDeletedMessagesInMailbox(mailboxId);
                     break;
             }
 
@@ -296,11 +298,12 @@ public class HBaseMessageMapper extends NonTransactionalMapper implements Messag
     }
 
     @Override
-    public long countMessagesInMailbox(Mailbox<HBaseId> mailbox) throws MailboxException {
+    public long countMessagesInMailbox(Mailbox mailbox) throws MailboxException {
         HTable mailboxes = null;
+        HBaseId mailboxId = (HBaseId) mailbox.getMailboxId();
         try {
             mailboxes = new HTable(conf, MAILBOXES_TABLE);
-            Get get = new Get(mailbox.getMailboxId().toBytes());
+            Get get = new Get(mailboxId.toBytes());
             get.addColumn(MAILBOX_CF, MAILBOX_MESSAGE_COUNT);
             get.setMaxVersions(1);
             Result result = mailboxes.get(get);
@@ -320,17 +323,18 @@ public class HBaseMessageMapper extends NonTransactionalMapper implements Messag
     }
 
     @Override
-    public long countUnseenMessagesInMailbox(Mailbox<HBaseId> mailbox) throws MailboxException {
+    public long countUnseenMessagesInMailbox(Mailbox mailbox) throws MailboxException {
         /* TODO: see if it is possible to store the number of unseen messages in the mailbox table
          * and just return that value with a Get and kepp it up to date.
          */
         HTable messages = null;
         ResultScanner scanner = null;
+        HBaseId mailboxId = (HBaseId) mailbox.getMailboxId();
         try {
             messages = new HTable(conf, MESSAGES_TABLE);
             /* Limit the number of entries scanned to just the mails in this mailbox */
-            Scan scan = new Scan(messageRowKey(mailbox.getMailboxId(), Long.MAX_VALUE),
-                    messageRowKey(mailbox.getMailboxId(), 0));
+            Scan scan = new Scan(messageRowKey(mailboxId, Long.MAX_VALUE),
+                    messageRowKey(mailboxId, 0));
             scan.addFamily(MESSAGES_META_CF);
             scan.setFilter(new SingleColumnValueExcludeFilter(MESSAGES_META_CF, FLAGS_SEEN, CompareOp.EQUAL, MARKER_MISSING));
             scan.setCaching(messages.getConfiguration().getInt("hbase.client.scanner.caching", 1) * 2);
@@ -356,10 +360,11 @@ public class HBaseMessageMapper extends NonTransactionalMapper implements Messag
     }
 
     @Override
-    public void delete(Mailbox<HBaseId> mailbox, MailboxMessage<HBaseId> message) throws MailboxException {
+    public void delete(Mailbox mailbox, MailboxMessage message) throws MailboxException {
         //TODO: maybe switch to checkAndDelete
         HTable messages = null;
         HTable mailboxes = null;
+        HBaseId mailboxId = (HBaseId) mailbox.getMailboxId();
         try {
             messages = new HTable(conf, MESSAGES_TABLE);
             mailboxes = new HTable(conf, MAILBOXES_TABLE);
@@ -367,7 +372,7 @@ public class HBaseMessageMapper extends NonTransactionalMapper implements Messag
              *  and implement countMessages with get.
              */
             Delete delete = new Delete(messageRowKey(message));
-            mailboxes.incrementColumnValue(mailbox.getMailboxId().toBytes(), MAILBOX_CF, MAILBOX_MESSAGE_COUNT, -1);
+            mailboxes.incrementColumnValue(mailboxId.toBytes(), MAILBOX_CF, MAILBOX_MESSAGE_COUNT, -1);
             messages.delete(delete);
 
         } catch (IOException ex) {
@@ -394,13 +399,14 @@ public class HBaseMessageMapper extends NonTransactionalMapper implements Messag
     }
 
     @Override
-    public Long findFirstUnseenMessageUid(Mailbox<HBaseId> mailbox) throws MailboxException {
+    public Long findFirstUnseenMessageUid(Mailbox mailbox) throws MailboxException {
         HTable messages = null;
         ResultScanner scanner = null;
+        HBaseId mailboxId = (HBaseId) mailbox.getMailboxId();
         try {
             messages = new HTable(conf, MESSAGES_TABLE);
             /* Limit the number of entries scanned to just the mails in this mailbox */
-            Scan scan = new Scan(messageRowKey(mailbox.getMailboxId(), Long.MAX_VALUE), messageRowKey(mailbox.getMailboxId(), 0));
+            Scan scan = new Scan(messageRowKey(mailboxId, Long.MAX_VALUE), messageRowKey(mailboxId, 0));
             scan.addFamily(MESSAGES_META_CF);
             // filter out all rows with FLAGS_SEEN qualifier
             SingleColumnValueFilter filter = new SingleColumnValueFilter(MESSAGES_META_CF, FLAGS_SEEN, CompareOp.EQUAL, MARKER_MISSING);
@@ -433,17 +439,18 @@ public class HBaseMessageMapper extends NonTransactionalMapper implements Messag
     }
 
     @Override
-    public List<Long> findRecentMessageUidsInMailbox(Mailbox<HBaseId> mailbox) throws MailboxException {
+    public List<Long> findRecentMessageUidsInMailbox(Mailbox mailbox) throws MailboxException {
         /** TODO: improve performance by implementing a last seen and last recent value per mailbox.
          * maybe one more call to HBase is less expensive than iterating throgh all rows.
          */
         HTable messages = null;
         ResultScanner scanner = null;
+        HBaseId mailboxId = (HBaseId) mailbox.getMailboxId();
         try {
             messages = new HTable(conf, MESSAGES_TABLE);
             /* Limit the number of entries scanned to just the mails in this mailbox */
-            Scan scan = new Scan(messageRowKey(mailbox.getMailboxId(), Long.MAX_VALUE),
-                    messageRowKey(mailbox.getMailboxId(), 0));
+            Scan scan = new Scan(messageRowKey(mailboxId, Long.MAX_VALUE),
+                    messageRowKey(mailboxId, 0));
             // we add the column, if it exists, the message is recent, else it is not
             scan.addColumn(MESSAGES_META_CF, FLAGS_RECENT);
             SingleColumnValueFilter filter = new SingleColumnValueFilter(MESSAGES_META_CF, FLAGS_RECENT, CompareOp.EQUAL, MARKER_PRESENT);
@@ -478,13 +485,14 @@ public class HBaseMessageMapper extends NonTransactionalMapper implements Messag
      * @see org.apache.james.mailbox.store.mail.MessageMapper#add(org.apache.james.mailbox.store.mail.model.Mailbox, org.apache.james.mailbox.store.mail.model.MailboxMessage)
      */
     @Override
-    public MessageMetaData add(Mailbox<HBaseId> mailbox, MailboxMessage<HBaseId> 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
         if (modSeqProvider != null) {
             message.setModSeq(modSeqProvider.nextModSeq(mailboxSession, mailbox));
         }
-        MessageMetaData data = save(mailbox, message);
+        HBaseId mailboxId = (HBaseId) mailbox.getMailboxId();
+        MessageMetaData data = save(mailboxId, message);
 
         return data;
     }
@@ -494,10 +502,10 @@ public class HBaseMessageMapper extends NonTransactionalMapper implements Messag
      * @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.MessageRange)
      */
     @Override
-    public Iterator<UpdatedFlags> updateFlags(Mailbox<HBaseId> 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<HBaseId>> messagesFound = findInMailbox(mailbox, set, FetchType.Metadata, -1);
+        Iterator<MailboxMessage> messagesFound = findInMailbox(mailbox, set, FetchType.Metadata, -1);
 
         HTable messages = null;
         long modSeq = -1;
@@ -512,7 +520,7 @@ public class HBaseMessageMapper extends NonTransactionalMapper implements Messag
             messages = new HTable(conf, MESSAGES_TABLE);
             while (messagesFound.hasNext()) {
                 Put put = null;
-                final MailboxMessage<HBaseId> member = messagesFound.next();
+                final MailboxMessage member = messagesFound.next();
                 Flags originalFlags = member.createFlags();
                 member.setFlags(flagsUpdateCalculator.buildNewFlags(originalFlags));
                 Flags newFlags = member.createFlags();
@@ -548,16 +556,17 @@ public class HBaseMessageMapper extends NonTransactionalMapper implements Messag
      * @see org.apache.james.mailbox.store.mail.MessageMapper#copy(org.apache.james.mailbox.store.mail.model.Mailbox, org.apache.james.mailbox.store.mail.model.MailboxMessage)
      */
     @Override
-    public MessageMetaData copy(Mailbox<HBaseId> mailbox, MailboxMessage<HBaseId> original) throws MailboxException {
+    public MessageMetaData copy(Mailbox mailbox, MailboxMessage original) throws MailboxException {
         long uid = uidProvider.nextUid(mailboxSession, mailbox);
         long modSeq = -1;
         if (modSeqProvider != null) {
             modSeq = modSeqProvider.nextModSeq(mailboxSession, mailbox);
         }
         //TODO: check if creating a HBase message is the right thing to do
+        HBaseId mailboxId = (HBaseId) mailbox.getMailboxId();
         HBaseMailboxMessage message = new HBaseMailboxMessage(conf,
-                mailbox.getMailboxId(), uid, modSeq, original);
-        return save(mailbox, message);
+                mailboxId, uid, modSeq, original);
+        return save(mailboxId, message);
     }
 
     /*
@@ -565,7 +574,7 @@ public class HBaseMessageMapper extends NonTransactionalMapper implements Messag
      * @see org.apache.james.mailbox.store.mail.MessageMapper#copy(org.apache.james.mailbox.store.mail.model.Mailbox, org.apache.james.mailbox.store.mail.model.MailboxMessage)
      */
     @Override
-    public MessageMetaData move(Mailbox<HBaseId> mailbox, MailboxMessage<HBaseId> original) throws MailboxException {
+    public MessageMetaData move(Mailbox mailbox, MailboxMessage original) throws MailboxException {
     	//TODO implement if possible
     	throw new UnsupportedOperationException();
     }
@@ -575,7 +584,7 @@ public class HBaseMessageMapper extends NonTransactionalMapper implements Messag
      * @see org.apache.james.mailbox.store.mail.MessageMapper#getLastUid(org.apache.james.mailbox.store.mail.model.Mailbox)
      */
     @Override
-    public long getLastUid(Mailbox<HBaseId> mailbox) throws MailboxException {
+    public long getLastUid(Mailbox mailbox) throws MailboxException {
         return uidProvider.lastUid(mailboxSession, mailbox);
     }
 
@@ -584,7 +593,7 @@ public class HBaseMessageMapper extends NonTransactionalMapper implements Messag
      * @see org.apache.james.mailbox.store.mail.MessageMapper#getHighestModSeq(org.apache.james.mailbox.store.mail.model.Mailbox)
      */
     @Override
-    public long getHighestModSeq(Mailbox<HBaseId> mailbox) throws MailboxException {
+    public long getHighestModSeq(Mailbox mailbox) throws MailboxException {
         return modSeqProvider.highestModSeq(mailboxSession, mailbox);
     }
 
@@ -596,7 +605,7 @@ public class HBaseMessageMapper extends NonTransactionalMapper implements Messag
      * @return metaData
      * @throws MailboxException
      */
-    protected MessageMetaData save(Mailbox<HBaseId> mailbox, MailboxMessage<HBaseId> message) throws MailboxException {
+    protected MessageMetaData save(HBaseId mailboxId, MailboxMessage message) throws MailboxException {
         HTable messages = null;
         HTable mailboxes = null;
         BufferedInputStream in = null;
@@ -629,10 +638,10 @@ public class HBaseMessageMapper extends NonTransactionalMapper implements Messag
             in.close();
             out.close();
             // increase the message count for the current mailbox
-            mailboxes.incrementColumnValue(mailbox.getMailboxId().toBytes(), MAILBOX_CF, MAILBOX_MESSAGE_COUNT, 1);
+            mailboxes.incrementColumnValue(mailboxId.toBytes(), MAILBOX_CF, MAILBOX_MESSAGE_COUNT, 1);
             return new SimpleMessageMetaData(message);
         } catch (IOException ex) {
-            throw new MailboxException("Error setting flags for messages in " + mailbox, ex);
+            throw new MailboxException("Error setting flags for messages in " + mailboxId, ex);
         } finally {
             if (messages != null) {
                 try {
@@ -665,26 +674,26 @@ public class HBaseMessageMapper extends NonTransactionalMapper implements Messag
         }
     }
 
-    private void deleteDeletedMessagesInMailboxWithUID(Mailbox<HBaseId> mailbox, long uid) throws IOException {
+    private void deleteDeletedMessagesInMailboxWithUID(HBaseId mailboxId, long uid) throws IOException {
         //TODO: do I have to check if the message is flagged for delete here?
         HTable messages = new HTable(conf, MESSAGES_TABLE);
         HTable mailboxes = new HTable(conf, MAILBOXES_TABLE);
-        Delete delete = new Delete(messageRowKey(mailbox.getMailboxId(), uid));
+        Delete delete = new Delete(messageRowKey(mailboxId, uid));
         messages.delete(delete);
-        mailboxes.incrementColumnValue(mailbox.getMailboxId().toBytes(), MAILBOX_CF, MAILBOX_MESSAGE_COUNT, -1);
-        mailboxes.incrementColumnValue(mailbox.getMailboxId().toBytes(), MAILBOX_CF, MAILBOX_HIGHEST_MODSEQ, 1);
+        mailboxes.incrementColumnValue(mailboxId.toBytes(), MAILBOX_CF, MAILBOX_MESSAGE_COUNT, -1);
+        mailboxes.incrementColumnValue(mailboxId.toBytes(), MAILBOX_CF, MAILBOX_HIGHEST_MODSEQ, 1);
         mailboxes.close();
         messages.close();
     }
 
-    private void deleteDeletedMessagesInMailboxBetweenUIDs(Mailbox<HBaseId> mailbox, long fromUid, long toUid) throws IOException {
+    private void deleteDeletedMessagesInMailboxBetweenUIDs(HBaseId mailboxId, long fromUid, long toUid) throws IOException {
         HTable messages = new HTable(conf, MESSAGES_TABLE);
         HTable mailboxes = new HTable(conf, MAILBOXES_TABLE);
         List<Delete> deletes = new ArrayList<Delete>();
         /*TODO: check if Between should be inclusive or exclusive regarding limits.
          * HBase scan operaion are exclusive to the upper bound when providing stop row key.
          */
-        Scan scan = new Scan(messageRowKey(mailbox.getMailboxId(), fromUid), messageRowKey(mailbox.getMailboxId(), toUid));
+        Scan scan = new Scan(messageRowKey(mailboxId, fromUid), messageRowKey(mailboxId, toUid));
         scan.addColumn(MESSAGES_META_CF, FLAGS_DELETED);
         SingleColumnValueFilter filter = new SingleColumnValueFilter(MESSAGES_META_CF, FLAGS_DELETED, CompareOp.EQUAL, MARKER_PRESENT);
         scan.setFilter(filter);
@@ -697,20 +706,20 @@ public class HBaseMessageMapper extends NonTransactionalMapper implements Messag
         long totalDeletes = deletes.size();
         scanner.close();
         messages.delete(deletes);
-        mailboxes.incrementColumnValue(mailbox.getMailboxId().toBytes(), MAILBOX_CF, MAILBOX_MESSAGE_COUNT, -(totalDeletes - deletes.size()));
-        mailboxes.incrementColumnValue(mailbox.getMailboxId().toBytes(), MAILBOX_CF, MAILBOX_HIGHEST_MODSEQ, 1);
+        mailboxes.incrementColumnValue(mailboxId.toBytes(), MAILBOX_CF, MAILBOX_MESSAGE_COUNT, -(totalDeletes - deletes.size()));
+        mailboxes.incrementColumnValue(mailboxId.toBytes(), MAILBOX_CF, MAILBOX_HIGHEST_MODSEQ, 1);
         mailboxes.close();
         messages.close();
     }
 
-    private void deleteDeletedMessagesInMailboxAfterUID(Mailbox<HBaseId> mailbox, long fromUid) throws IOException {
+    private void deleteDeletedMessagesInMailboxAfterUID(HBaseId mailboxId, long fromUid) throws IOException {
         HTable messages = new HTable(conf, MESSAGES_TABLE);
         HTable mailboxes = new HTable(conf, MAILBOXES_TABLE);
         List<Delete> deletes = new ArrayList<Delete>();
         /*TODO: check if Between should be inclusive or exclusive regarding limits.
          * HBase scan operaion are exclusive to the upper bound when providing stop row key.
          */
-        Scan scan = new Scan(messageRowKey(mailbox.getMailboxId(), fromUid));
+        Scan scan = new Scan(messageRowKey(mailboxId, fromUid));
         scan.addColumn(MESSAGES_META_CF, FLAGS_DELETED);
         SingleColumnValueFilter filter = new SingleColumnValueFilter(MESSAGES_META_CF, FLAGS_DELETED, CompareOp.EQUAL, MARKER_PRESENT);
         scan.setFilter(filter);
@@ -723,21 +732,21 @@ public class HBaseMessageMapper extends NonTransactionalMapper implements Messag
         long totalDeletes = deletes.size();
         scanner.close();
         messages.delete(deletes);
-        mailboxes.incrementColumnValue(mailbox.getMailboxId().toBytes(), MAILBOX_CF, MAILBOX_MESSAGE_COUNT, -(totalDeletes - deletes.size()));
-        mailboxes.incrementColumnValue(mailbox.getMailboxId().toBytes(), MAILBOX_CF, MAILBOX_HIGHEST_MODSEQ, 1);
+        mailboxes.incrementColumnValue(mailboxId.toBytes(), MAILBOX_CF, MAILBOX_MESSAGE_COUNT, -(totalDeletes - deletes.size()));
+        mailboxes.incrementColumnValue(mailboxId.toBytes(), MAILBOX_CF, MAILBOX_HIGHEST_MODSEQ, 1);
         mailboxes.close();
         messages.close();
     }
 
-    private void deleteDeletedMessagesInMailbox(Mailbox<HBaseId> mailbox) throws IOException {
+    private void deleteDeletedMessagesInMailbox(HBaseId mailboxId) throws IOException {
         HTable messages = new HTable(conf, MESSAGES_TABLE);
         HTable mailboxes = new HTable(conf, MAILBOXES_TABLE);
         List<Delete> deletes = new ArrayList<Delete>();
         /*TODO: check if Between should be inclusive or exclusive regarding limits.
          * HBase scan operaion are exclusive to the upper bound when providing stop row key.
          */
-        Scan scan = new Scan(customMessageRowKey(mailbox.getMailboxId(), 0L),
-                new PrefixFilter(mailbox.getMailboxId().toBytes()));
+        Scan scan = new Scan(customMessageRowKey(mailboxId, 0L),
+                new PrefixFilter(mailboxId.toBytes()));
         scan.addColumn(MESSAGES_META_CF, FLAGS_DELETED);
         SingleColumnValueFilter filter = new SingleColumnValueFilter(MESSAGES_META_CF, FLAGS_DELETED, CompareOp.EQUAL, MARKER_PRESENT);
         scan.setFilter(filter);
@@ -750,15 +759,15 @@ public class HBaseMessageMapper extends NonTransactionalMapper implements Messag
         long totalDeletes = deletes.size();
         scanner.close();
         messages.delete(deletes);
-        mailboxes.incrementColumnValue(mailbox.getMailboxId().toBytes(), MAILBOX_CF, MAILBOX_MESSAGE_COUNT, -(totalDeletes - deletes.size()));
-        mailboxes.incrementColumnValue(mailbox.getMailboxId().toBytes(), MAILBOX_CF, MAILBOX_HIGHEST_MODSEQ, 1);
+        mailboxes.incrementColumnValue(mailboxId.toBytes(), MAILBOX_CF, MAILBOX_MESSAGE_COUNT, -(totalDeletes - deletes.size()));
+        mailboxes.incrementColumnValue(mailboxId.toBytes(), MAILBOX_CF, MAILBOX_HIGHEST_MODSEQ, 1);
         mailboxes.close();
         messages.close();
     }
 
-    private Map<Long, MessageMetaData> createMetaData(List<MailboxMessage<HBaseId>> uids) {
+    private Map<Long, MessageMetaData> createMetaData(List<MailboxMessage> uids) {
         final Map<Long, MessageMetaData> data = new HashMap<Long, MessageMetaData>();
-        for (MailboxMessage<HBaseId> m : uids) {
+        for (MailboxMessage m : uids) {
             data.put(m.getUid(), new SimpleMessageMetaData(m));
         }
         return data;

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/hbase/src/main/java/org/apache/james/mailbox/hbase/mail/HBaseModSeqProvider.java
----------------------------------------------------------------------
diff --git a/mailbox/hbase/src/main/java/org/apache/james/mailbox/hbase/mail/HBaseModSeqProvider.java b/mailbox/hbase/src/main/java/org/apache/james/mailbox/hbase/mail/HBaseModSeqProvider.java
index abb5737..8490f5b 100644
--- a/mailbox/hbase/src/main/java/org/apache/james/mailbox/hbase/mail/HBaseModSeqProvider.java
+++ b/mailbox/hbase/src/main/java/org/apache/james/mailbox/hbase/mail/HBaseModSeqProvider.java
@@ -38,7 +38,7 @@ import org.apache.james.mailbox.store.mail.model.Mailbox;
  * ModSeqProvider implementation for HBase.
  * 
  */
-public class HBaseModSeqProvider implements ModSeqProvider<HBaseId> {
+public class HBaseModSeqProvider implements ModSeqProvider {
 
     /** Link to the HBase Configuration object and specific mailbox names */
     private final Configuration conf;
@@ -48,11 +48,12 @@ public class HBaseModSeqProvider implements ModSeqProvider<HBaseId> {
     }
 
     @Override
-    public long highestModSeq(MailboxSession session, Mailbox<HBaseId> mailbox) throws MailboxException {
+    public long highestModSeq(MailboxSession session, Mailbox mailbox) throws MailboxException {
         HTable mailboxes = null;
+        HBaseId mailboxId = (HBaseId) mailbox.getMailboxId();
         try {
             mailboxes = new HTable(conf, MAILBOXES_TABLE);
-            Get get = new Get(mailbox.getMailboxId().toBytes());
+            Get get = new Get(mailboxId.toBytes());
             get.addColumn(MAILBOX_CF, MAILBOX_HIGHEST_MODSEQ);
             get.setMaxVersions(1);
             Result result = mailboxes.get(get);
@@ -76,11 +77,12 @@ public class HBaseModSeqProvider implements ModSeqProvider<HBaseId> {
     }
 
     @Override
-    public long nextModSeq(MailboxSession session, Mailbox<HBaseId> mailbox) throws MailboxException {
+    public long nextModSeq(MailboxSession session, Mailbox mailbox) throws MailboxException {
         HTable mailboxes = null;
+        HBaseId mailboxId = (HBaseId) mailbox.getMailboxId();
         try {
             mailboxes = new HTable(conf, MAILBOXES_TABLE);
-            long newValue = mailboxes.incrementColumnValue(mailbox.getMailboxId().toBytes(), MAILBOX_CF, MAILBOX_HIGHEST_MODSEQ, 1);
+            long newValue = mailboxes.incrementColumnValue(mailboxId.toBytes(), MAILBOX_CF, MAILBOX_HIGHEST_MODSEQ, 1);
             return newValue;
         } catch (IOException e) {
             throw new MailboxException("lastUid", e);

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/hbase/src/main/java/org/apache/james/mailbox/hbase/mail/HBaseUidProvider.java
----------------------------------------------------------------------
diff --git a/mailbox/hbase/src/main/java/org/apache/james/mailbox/hbase/mail/HBaseUidProvider.java b/mailbox/hbase/src/main/java/org/apache/james/mailbox/hbase/mail/HBaseUidProvider.java
index d452d9c..23e667d 100644
--- a/mailbox/hbase/src/main/java/org/apache/james/mailbox/hbase/mail/HBaseUidProvider.java
+++ b/mailbox/hbase/src/main/java/org/apache/james/mailbox/hbase/mail/HBaseUidProvider.java
@@ -38,7 +38,7 @@ import org.apache.james.mailbox.store.mail.model.Mailbox;
  * Message UidProvider for HBase.
  * 
  */
-public class HBaseUidProvider implements UidProvider<HBaseId> {
+public class HBaseUidProvider implements UidProvider {
 
     /** Link to the HBase Configuration object and specific mailbox names */
     private final Configuration conf;
@@ -55,11 +55,12 @@ public class HBaseUidProvider implements UidProvider<HBaseId> {
      * @throws MailboxException 
      */
     @Override
-    public long lastUid(MailboxSession session, Mailbox<HBaseId> mailbox) throws MailboxException {
+    public long lastUid(MailboxSession session, Mailbox mailbox) throws MailboxException {
         HTable mailboxes = null;
+        HBaseId mailboxId = (HBaseId) mailbox.getMailboxId();
         try {
             mailboxes = new HTable(conf, MAILBOXES_TABLE);
-            Get get = new Get(mailbox.getMailboxId().toBytes());
+            Get get = new Get(mailboxId.toBytes());
             get.addColumn(MAILBOX_CF, MAILBOX_LASTUID);
             get.setMaxVersions(1);
             Result result = mailboxes.get(get);
@@ -91,11 +92,12 @@ public class HBaseUidProvider implements UidProvider<HBaseId> {
      * @throws MailboxException 
      */
     @Override
-    public long nextUid(MailboxSession session, Mailbox<HBaseId> mailbox) throws MailboxException {
+    public long nextUid(MailboxSession session, Mailbox mailbox) throws MailboxException {
         HTable mailboxes = null;
+        HBaseId mailboxId = (HBaseId) mailbox.getMailboxId();
         try {
             mailboxes = new HTable(conf, MAILBOXES_TABLE);
-            long newValue = mailboxes.incrementColumnValue(mailbox.getMailboxId().toBytes(), MAILBOX_CF, MAILBOX_LASTUID, 1);
+            long newValue = mailboxes.incrementColumnValue(mailboxId.toBytes(), MAILBOX_CF, MAILBOX_LASTUID, 1);
             mailboxes.close();
             return newValue;
         } catch (IOException e) {

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/hbase/src/main/java/org/apache/james/mailbox/hbase/mail/model/HBaseMailbox.java
----------------------------------------------------------------------
diff --git a/mailbox/hbase/src/main/java/org/apache/james/mailbox/hbase/mail/model/HBaseMailbox.java b/mailbox/hbase/src/main/java/org/apache/james/mailbox/hbase/mail/model/HBaseMailbox.java
index baf6608..de9a6ca 100644
--- a/mailbox/hbase/src/main/java/org/apache/james/mailbox/hbase/mail/model/HBaseMailbox.java
+++ b/mailbox/hbase/src/main/java/org/apache/james/mailbox/hbase/mail/model/HBaseMailbox.java
@@ -31,7 +31,7 @@ import org.apache.james.mailbox.store.mail.model.Mailbox;
  * implementations.
  * 
  */
-public class HBaseMailbox implements Mailbox<HBaseId> {
+public class HBaseMailbox implements Mailbox {
 
     private static final String TAB = " ";
     /** The value for the mailboxId field */

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/hbase/src/test/java/org/apache/james/mailbox/hbase/HBaseMailboxSessionMapperFactoryTest.java
----------------------------------------------------------------------
diff --git a/mailbox/hbase/src/test/java/org/apache/james/mailbox/hbase/HBaseMailboxSessionMapperFactoryTest.java b/mailbox/hbase/src/test/java/org/apache/james/mailbox/hbase/HBaseMailboxSessionMapperFactoryTest.java
index da995ba..c878c4a 100644
--- a/mailbox/hbase/src/test/java/org/apache/james/mailbox/hbase/HBaseMailboxSessionMapperFactoryTest.java
+++ b/mailbox/hbase/src/test/java/org/apache/james/mailbox/hbase/HBaseMailboxSessionMapperFactoryTest.java
@@ -18,10 +18,25 @@
  ****************************************************************/
 package org.apache.james.mailbox.hbase;
 
+import static org.apache.james.mailbox.hbase.HBaseNames.MAILBOXES;
+import static org.apache.james.mailbox.hbase.HBaseNames.MAILBOXES_TABLE;
+import static org.apache.james.mailbox.hbase.HBaseNames.MAILBOX_CF;
+import static org.apache.james.mailbox.hbase.HBaseNames.MESSAGES;
+import static org.apache.james.mailbox.hbase.HBaseNames.MESSAGES_META_CF;
+import static org.apache.james.mailbox.hbase.HBaseNames.MESSAGES_TABLE;
+import static org.apache.james.mailbox.hbase.HBaseNames.MESSAGE_DATA_BODY_CF;
+import static org.apache.james.mailbox.hbase.HBaseNames.MESSAGE_DATA_HEADERS_CF;
+import static org.apache.james.mailbox.hbase.HBaseNames.SUBSCRIPTIONS;
+import static org.apache.james.mailbox.hbase.HBaseNames.SUBSCRIPTIONS_TABLE;
+import static org.apache.james.mailbox.hbase.HBaseNames.SUBSCRIPTION_CF;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
 import java.io.IOException;
+
 import org.apache.hadoop.conf.Configuration;
 import org.apache.james.mailbox.MailboxSession;
-import static org.apache.james.mailbox.hbase.HBaseNames.*;
 import org.apache.james.mailbox.hbase.mail.HBaseModSeqProvider;
 import org.apache.james.mailbox.hbase.mail.HBaseUidProvider;
 import org.apache.james.mailbox.store.mail.MailboxMapper;
@@ -29,7 +44,6 @@ import org.apache.james.mailbox.store.mail.MessageMapper;
 import org.apache.james.mailbox.store.mail.ModSeqProvider;
 import org.apache.james.mailbox.store.mail.UidProvider;
 import org.apache.james.mailbox.store.user.SubscriptionMapper;
-import static org.junit.Assert.*;
 import org.junit.Before;
 import org.junit.Test;
 import org.slf4j.Logger;
@@ -74,7 +88,7 @@ public class HBaseMailboxSessionMapperFactoryTest {
         LOG.info("createMessageMapper");
         MailboxSession session = null;
         HBaseMailboxSessionMapperFactory instance = new HBaseMailboxSessionMapperFactory(conf, null, null);
-        MessageMapper<HBaseId> messageMapper = instance.createMessageMapper(session);
+        MessageMapper messageMapper = instance.createMessageMapper(session);
         assertNotNull(messageMapper);
         assertTrue(messageMapper instanceof MessageMapper);
     }
@@ -88,7 +102,7 @@ public class HBaseMailboxSessionMapperFactoryTest {
         LOG.info("createMailboxMapper");
         MailboxSession session = null;
         HBaseMailboxSessionMapperFactory instance = new HBaseMailboxSessionMapperFactory(conf, null, null);
-        MailboxMapper<HBaseId> mailboxMapper = instance.createMailboxMapper(session);
+        MailboxMapper mailboxMapper = instance.createMailboxMapper(session);
         assertNotNull(mailboxMapper);
         assertTrue(mailboxMapper instanceof MailboxMapper);
     }
@@ -114,9 +128,9 @@ public class HBaseMailboxSessionMapperFactoryTest {
     @Test
     public void testGetModSeqProvider() {
         LOG.info("getModSeqProvider");
-        ModSeqProvider<HBaseId> expResult = new HBaseModSeqProvider(conf);
+        ModSeqProvider expResult = new HBaseModSeqProvider(conf);
         HBaseMailboxSessionMapperFactory instance = new HBaseMailboxSessionMapperFactory(conf, null, expResult);
-        ModSeqProvider<HBaseId> result = instance.getModSeqProvider();
+        ModSeqProvider result = instance.getModSeqProvider();
         assertEquals(expResult, result);
     }
 
@@ -126,9 +140,9 @@ public class HBaseMailboxSessionMapperFactoryTest {
     @Test
     public void testGetUidProvider() {
         LOG.info("getUidProvider");
-        UidProvider<HBaseId> expResult = new HBaseUidProvider(conf);
+        UidProvider expResult = new HBaseUidProvider(conf);
         HBaseMailboxSessionMapperFactory instance = new HBaseMailboxSessionMapperFactory(conf, expResult, null);
-        UidProvider<HBaseId> result = instance.getUidProvider();
+        UidProvider result = instance.getUidProvider();
         assertEquals(expResult, result);
     }
 }

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/hbase/src/test/java/org/apache/james/mailbox/hbase/HBaseUtilsTest.java
----------------------------------------------------------------------
diff --git a/mailbox/hbase/src/test/java/org/apache/james/mailbox/hbase/HBaseUtilsTest.java b/mailbox/hbase/src/test/java/org/apache/james/mailbox/hbase/HBaseUtilsTest.java
index cd4d17a..d6fec12 100644
--- a/mailbox/hbase/src/test/java/org/apache/james/mailbox/hbase/HBaseUtilsTest.java
+++ b/mailbox/hbase/src/test/java/org/apache/james/mailbox/hbase/HBaseUtilsTest.java
@@ -146,7 +146,7 @@ public class HBaseUtilsTest {
         flags.add("userFlag1");
         flags.add("userFlag2");
         HBaseId uuid = HBaseId.of(UUID.randomUUID());
-        final SimpleMailboxMessage<HBaseId> message = new SimpleMailboxMessage<HBaseId>(new Date(), 100, 10, null, flags, new PropertyBuilder(), uuid);
+        final SimpleMailboxMessage message = new SimpleMailboxMessage(new Date(), 100, 10, null, flags, new PropertyBuilder(), uuid);
         Put put = flagsToPut(message, flags);
         //test for the system flags
         assertTrue(put.has(MESSAGES_META_CF, FLAGS_SEEN, MARKER_PRESENT));

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/hbase/src/test/java/org/apache/james/mailbox/hbase/mail/HBaseMailboxMapperTest.java
----------------------------------------------------------------------
diff --git a/mailbox/hbase/src/test/java/org/apache/james/mailbox/hbase/mail/HBaseMailboxMapperTest.java b/mailbox/hbase/src/test/java/org/apache/james/mailbox/hbase/mail/HBaseMailboxMapperTest.java
index 87482b4..27b5c86 100644
--- a/mailbox/hbase/src/test/java/org/apache/james/mailbox/hbase/mail/HBaseMailboxMapperTest.java
+++ b/mailbox/hbase/src/test/java/org/apache/james/mailbox/hbase/mail/HBaseMailboxMapperTest.java
@@ -47,7 +47,6 @@ import org.apache.hadoop.hbase.util.Bytes;
 import org.apache.james.mailbox.exception.MailboxException;
 import org.apache.james.mailbox.exception.MailboxNotFoundException;
 import org.apache.james.mailbox.hbase.HBaseClusterSingleton;
-import org.apache.james.mailbox.hbase.HBaseId;
 import org.apache.james.mailbox.hbase.io.ChunkInputStream;
 import org.apache.james.mailbox.hbase.io.ChunkOutputStream;
 import org.apache.james.mailbox.hbase.mail.model.HBaseMailbox;
@@ -139,7 +138,7 @@ public class HBaseMailboxMapperTest {
         LOG.info("findMailboxWithPathLike");
         MailboxPath path = pathsList.get(pathsList.size() / 2);
 
-        List<Mailbox<HBaseId>> result = mapper.findMailboxWithPathLike(path);
+        List<Mailbox> result = mapper.findMailboxWithPathLike(path);
         assertEquals(1, result.size());
 
         int start = 3;
@@ -164,7 +163,7 @@ public class HBaseMailboxMapperTest {
      */
     private void testList() throws Exception {
         LOG.info("list");
-        List<Mailbox<HBaseId>> result = mapper.list();
+        List<Mailbox> result = mapper.list();
         assertEquals(mailboxList.size(), result.size());
 
     }

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/hbase/src/test/java/org/apache/james/mailbox/hbase/mail/HBaseMailboxMessageMapperTest.java
----------------------------------------------------------------------
diff --git a/mailbox/hbase/src/test/java/org/apache/james/mailbox/hbase/mail/HBaseMailboxMessageMapperTest.java b/mailbox/hbase/src/test/java/org/apache/james/mailbox/hbase/mail/HBaseMailboxMessageMapperTest.java
index 9c5f31e..56fb775 100644
--- a/mailbox/hbase/src/test/java/org/apache/james/mailbox/hbase/mail/HBaseMailboxMessageMapperTest.java
+++ b/mailbox/hbase/src/test/java/org/apache/james/mailbox/hbase/mail/HBaseMailboxMessageMapperTest.java
@@ -18,11 +18,33 @@
  ****************************************************************/
 package org.apache.james.mailbox.hbase.mail;
 
+import static org.apache.james.mailbox.hbase.HBaseNames.MAILBOXES;
+import static org.apache.james.mailbox.hbase.HBaseNames.MAILBOXES_TABLE;
+import static org.apache.james.mailbox.hbase.HBaseNames.MAILBOX_CF;
+import static org.apache.james.mailbox.hbase.HBaseNames.MESSAGES;
+import static org.apache.james.mailbox.hbase.HBaseNames.MESSAGES_META_CF;
+import static org.apache.james.mailbox.hbase.HBaseNames.MESSAGES_TABLE;
+import static org.apache.james.mailbox.hbase.HBaseNames.MESSAGE_DATA_BODY_CF;
+import static org.apache.james.mailbox.hbase.HBaseNames.MESSAGE_DATA_HEADERS_CF;
+import static org.apache.james.mailbox.hbase.HBaseNames.SUBSCRIPTIONS;
+import static org.apache.james.mailbox.hbase.HBaseNames.SUBSCRIPTIONS_TABLE;
+import static org.apache.james.mailbox.hbase.HBaseNames.SUBSCRIPTION_CF;
+import static org.junit.Assert.assertEquals;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Random;
+
+import javax.mail.Flags;
+import javax.mail.internet.SharedInputStream;
+import javax.mail.util.SharedByteArrayInputStream;
+
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.hbase.util.Bytes;
 import org.apache.james.mailbox.MailboxSession;
 import org.apache.james.mailbox.hbase.HBaseClusterSingleton;
-import org.apache.james.mailbox.hbase.HBaseId;
 import org.apache.james.mailbox.hbase.mail.model.HBaseMailbox;
 import org.apache.james.mailbox.mock.MockMailboxSession;
 import org.apache.james.mailbox.model.MailboxPath;
@@ -35,28 +57,6 @@ import org.junit.Test;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import javax.mail.Flags;
-import javax.mail.internet.SharedInputStream;
-import javax.mail.util.SharedByteArrayInputStream;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-import java.util.Random;
-
-import static org.apache.james.mailbox.hbase.HBaseNames.MAILBOXES;
-import static org.apache.james.mailbox.hbase.HBaseNames.MAILBOXES_TABLE;
-import static org.apache.james.mailbox.hbase.HBaseNames.MAILBOX_CF;
-import static org.apache.james.mailbox.hbase.HBaseNames.MESSAGES;
-import static org.apache.james.mailbox.hbase.HBaseNames.MESSAGES_META_CF;
-import static org.apache.james.mailbox.hbase.HBaseNames.MESSAGES_TABLE;
-import static org.apache.james.mailbox.hbase.HBaseNames.MESSAGE_DATA_BODY_CF;
-import static org.apache.james.mailbox.hbase.HBaseNames.MESSAGE_DATA_HEADERS_CF;
-import static org.apache.james.mailbox.hbase.HBaseNames.SUBSCRIPTIONS;
-import static org.apache.james.mailbox.hbase.HBaseNames.SUBSCRIPTIONS_TABLE;
-import static org.apache.james.mailbox.hbase.HBaseNames.SUBSCRIPTION_CF;
-import static org.junit.Assert.assertEquals;
-
 /**
  * Unit tests for HBaseMessageMapper.
  *
@@ -69,8 +69,8 @@ public class HBaseMailboxMessageMapperTest {
     private static HBaseModSeqProvider modSeqProvider;
     private static HBaseMessageMapper messageMapper;
     private static final List<MailboxPath> MBOX_PATHS = new ArrayList<MailboxPath>();
-    private static final List<Mailbox<HBaseId>> MBOXES = new ArrayList<Mailbox<HBaseId>>();
-    private static final List<MailboxMessage<HBaseId>> MESSAGE_NO = new ArrayList<MailboxMessage<HBaseId>>();
+    private static final List<Mailbox> MBOXES = new ArrayList<Mailbox>();
+    private static final List<MailboxMessage> MESSAGE_NO = new ArrayList<MailboxMessage>();
     private static final int COUNT = 5;
     private static Configuration conf;
     /*
@@ -99,7 +99,7 @@ public class HBaseMailboxMessageMapperTest {
         generateTestData();
         final MailboxSession session = new MockMailboxSession("ieugen");
         messageMapper = new HBaseMessageMapper(session, uidProvider, modSeqProvider, conf);
-        for (MailboxMessage<HBaseId> message : MESSAGE_NO) {
+        for (MailboxMessage message : MESSAGE_NO) {
             messageMapper.add(MBOXES.get(1), message);
         }
     }
@@ -136,12 +136,12 @@ public class HBaseMailboxMessageMapperTest {
         propBuilder.setSubType("html");
         propBuilder.setTextualLineCount(2L);
 
-        SimpleMailboxMessage<HBaseId> myMsg;
+        SimpleMailboxMessage myMsg;
         final Flags flags = new Flags(Flags.Flag.RECENT);
         final Date today = new Date();
 
         for (int i = 0; i < COUNT * 2; i++) {
-            myMsg = new SimpleMailboxMessage<HBaseId>(today, messageTemplate.length,
+            myMsg = new SimpleMailboxMessage(today, messageTemplate.length,
                     messageTemplate.length - 20, content, flags, propBuilder,
                     MBOXES.get(1).getMailboxId());
             if (i == COUNT * 2 - 1) {

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/jcr/src/main/java/org/apache/james/mailbox/jcr/JCRMailboxIdDeserializer.java
----------------------------------------------------------------------
diff --git a/mailbox/jcr/src/main/java/org/apache/james/mailbox/jcr/JCRMailboxIdDeserializer.java b/mailbox/jcr/src/main/java/org/apache/james/mailbox/jcr/JCRMailboxIdDeserializer.java
index 4f0800e..290b674 100644
--- a/mailbox/jcr/src/main/java/org/apache/james/mailbox/jcr/JCRMailboxIdDeserializer.java
+++ b/mailbox/jcr/src/main/java/org/apache/james/mailbox/jcr/JCRMailboxIdDeserializer.java
@@ -21,7 +21,7 @@ package org.apache.james.mailbox.jcr;
 
 import org.apache.james.mailbox.store.mail.model.MailboxIdDeserializer;
 
-public class JCRMailboxIdDeserializer implements MailboxIdDeserializer<JCRId> {
+public class JCRMailboxIdDeserializer implements MailboxIdDeserializer {
 
     @Override
     public JCRId deserialize(String serializedMailboxId) {

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/jcr/src/main/java/org/apache/james/mailbox/jcr/JCRMailboxManager.java
----------------------------------------------------------------------
diff --git a/mailbox/jcr/src/main/java/org/apache/james/mailbox/jcr/JCRMailboxManager.java b/mailbox/jcr/src/main/java/org/apache/james/mailbox/jcr/JCRMailboxManager.java
index 00b1b00..15c618c 100644
--- a/mailbox/jcr/src/main/java/org/apache/james/mailbox/jcr/JCRMailboxManager.java
+++ b/mailbox/jcr/src/main/java/org/apache/james/mailbox/jcr/JCRMailboxManager.java
@@ -37,7 +37,7 @@ import org.slf4j.LoggerFactory;
  * JCR implementation of a MailboxManager
  * 
  */
-public class JCRMailboxManager extends StoreMailboxManager<JCRId> implements JCRImapConstants {
+public class JCRMailboxManager extends StoreMailboxManager implements JCRImapConstants {
 
     private final Logger logger = LoggerFactory.getLogger(JCRMailboxManager.class);
     
@@ -51,7 +51,7 @@ public class JCRMailboxManager extends StoreMailboxManager<JCRId> implements JCR
 
     
     @Override
-    protected StoreMessageManager<JCRId> createMessageManager(Mailbox<JCRId> mailboxEntity, MailboxSession session) throws MailboxException{
+    protected StoreMessageManager createMessageManager(Mailbox mailboxEntity, MailboxSession session) throws MailboxException{
         return new JCRMessageManager(getMapperFactory(),
             getMessageSearchIndex(),
             getEventDispatcher(),
@@ -65,7 +65,7 @@ public class JCRMailboxManager extends StoreMailboxManager<JCRId> implements JCR
     }
 
     @Override
-    protected Mailbox<JCRId> doCreateMailbox(MailboxPath path, MailboxSession session) throws MailboxException {
+    protected Mailbox doCreateMailbox(MailboxPath path, MailboxSession session) throws MailboxException {
         return new org.apache.james.mailbox.jcr.mail.model.JCRMailbox(path, randomUidValidity(), logger);
     }
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/jcr/src/main/java/org/apache/james/mailbox/jcr/JCRMailboxSessionMapperFactory.java
----------------------------------------------------------------------
diff --git a/mailbox/jcr/src/main/java/org/apache/james/mailbox/jcr/JCRMailboxSessionMapperFactory.java b/mailbox/jcr/src/main/java/org/apache/james/mailbox/jcr/JCRMailboxSessionMapperFactory.java
index c36a486..35a80ea 100644
--- a/mailbox/jcr/src/main/java/org/apache/james/mailbox/jcr/JCRMailboxSessionMapperFactory.java
+++ b/mailbox/jcr/src/main/java/org/apache/james/mailbox/jcr/JCRMailboxSessionMapperFactory.java
@@ -36,20 +36,20 @@ import org.apache.james.mailbox.store.user.SubscriptionMapper;
  * 
  *
  */
-public class JCRMailboxSessionMapperFactory extends MailboxSessionMapperFactory<JCRId> {
+public class JCRMailboxSessionMapperFactory extends MailboxSessionMapperFactory {
 
     private final MailboxSessionJCRRepository repository;
     private final static int DEFAULT_SCALING = 2;
     private final int scaling;
     private final int messageScaling;
-    private final UidProvider<JCRId> uidProvider;
-    private final ModSeqProvider<JCRId> modSeqProvider;
+    private final UidProvider uidProvider;
+    private final ModSeqProvider modSeqProvider;
 
-    public JCRMailboxSessionMapperFactory(MailboxSessionJCRRepository repository, UidProvider<JCRId> uidProvider, ModSeqProvider<JCRId> modSeqProvider) {
+    public JCRMailboxSessionMapperFactory(MailboxSessionJCRRepository repository, UidProvider uidProvider, ModSeqProvider modSeqProvider) {
         this(repository, uidProvider, modSeqProvider, DEFAULT_SCALING, JCRMessageMapper.MESSAGE_SCALE_DAY);
     }
 
-    public JCRMailboxSessionMapperFactory(MailboxSessionJCRRepository repository, UidProvider<JCRId> uidProvider, ModSeqProvider<JCRId> modSeqProvider, int scaling, int messageScaling) {
+    public JCRMailboxSessionMapperFactory(MailboxSessionJCRRepository repository, UidProvider uidProvider, ModSeqProvider modSeqProvider, int scaling, int messageScaling) {
         this.repository = repository;
         this.scaling = scaling;
         this.messageScaling = messageScaling;
@@ -58,12 +58,12 @@ public class JCRMailboxSessionMapperFactory extends MailboxSessionMapperFactory<
     }
     
     @Override
-    public MailboxMapper<JCRId> createMailboxMapper(MailboxSession session) throws MailboxException {
+    public MailboxMapper createMailboxMapper(MailboxSession session) throws MailboxException {
         return new JCRMailboxMapper(repository, session, scaling);
     }
 
     @Override
-    public MessageMapper<JCRId> createMessageMapper(MailboxSession session) throws MailboxException {
+    public MessageMapper createMessageMapper(MailboxSession session) throws MailboxException {
         return new JCRMessageMapper(repository, session, uidProvider, modSeqProvider,  messageScaling);
     }
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/jcr/src/main/java/org/apache/james/mailbox/jcr/JCRMessageManager.java
----------------------------------------------------------------------
diff --git a/mailbox/jcr/src/main/java/org/apache/james/mailbox/jcr/JCRMessageManager.java b/mailbox/jcr/src/main/java/org/apache/james/mailbox/jcr/JCRMessageManager.java
index 1861ecb..b7452c8 100644
--- a/mailbox/jcr/src/main/java/org/apache/james/mailbox/jcr/JCRMessageManager.java
+++ b/mailbox/jcr/src/main/java/org/apache/james/mailbox/jcr/JCRMessageManager.java
@@ -32,9 +32,9 @@ import org.apache.james.mailbox.jcr.mail.model.JCRMailbox;
 import org.apache.james.mailbox.jcr.mail.model.JCRMailboxMessage;
 import org.apache.james.mailbox.quota.QuotaManager;
 import org.apache.james.mailbox.quota.QuotaRootResolver;
-import org.apache.james.mailbox.store.event.MailboxEventDispatcher;
 import org.apache.james.mailbox.store.MailboxSessionMapperFactory;
 import org.apache.james.mailbox.store.StoreMessageManager;
+import org.apache.james.mailbox.store.event.MailboxEventDispatcher;
 import org.apache.james.mailbox.store.mail.model.MailboxMessage;
 import org.apache.james.mailbox.store.mail.model.impl.PropertyBuilder;
 import org.apache.james.mailbox.store.search.MessageSearchIndex;
@@ -44,20 +44,21 @@ import org.slf4j.Logger;
  * JCR implementation of a {@link org.apache.james.mailbox.MessageManager}
  *
  */
-public class JCRMessageManager extends StoreMessageManager<JCRId> {
+public class JCRMessageManager extends StoreMessageManager {
 
     private final Logger log;
 
-    public JCRMessageManager(MailboxSessionMapperFactory<JCRId> mapperFactory, MessageSearchIndex<JCRId> index, 
-            final MailboxEventDispatcher<JCRId> dispatcher, MailboxPathLocker locker, JCRMailbox mailbox, MailboxACLResolver aclResolver, GroupMembershipResolver groupMembershipResolver, Logger log, QuotaManager quotaManager, QuotaRootResolver quotaRootResolver) throws MailboxException {
+    public JCRMessageManager(MailboxSessionMapperFactory mapperFactory, MessageSearchIndex index, 
+            final MailboxEventDispatcher dispatcher, MailboxPathLocker locker, JCRMailbox mailbox, MailboxACLResolver aclResolver, GroupMembershipResolver groupMembershipResolver, Logger log, QuotaManager quotaManager, QuotaRootResolver quotaRootResolver) throws MailboxException {
         super(mapperFactory, index, dispatcher, locker, mailbox, aclResolver, groupMembershipResolver, quotaManager, quotaRootResolver);
         this.log = log;
     }
 
 
     @Override
-    protected MailboxMessage<JCRId> createMessage(Date internalDate, int size, int bodyStartOctet, SharedInputStream content, Flags flags, PropertyBuilder propertyBuilder) throws MailboxException{
-        return new JCRMailboxMessage(getMailboxEntity().getMailboxId(), internalDate,
+    protected MailboxMessage createMessage(Date internalDate, int size, int bodyStartOctet, SharedInputStream content, Flags flags, PropertyBuilder propertyBuilder) throws MailboxException{
+        JCRId mailboxId = (JCRId) getMailboxEntity().getMailboxId();
+        return new JCRMailboxMessage(mailboxId, internalDate,
                 size, flags, content, bodyStartOctet, propertyBuilder, log);
     }
 


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