james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From adup...@apache.org
Subject [10/13] james-project git commit: JAMES-1733 Remove generics from mailbox API
Date Tue, 17 May 2016 08:14:56 GMT
http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/jcr/src/main/java/org/apache/james/mailbox/jcr/mail/JCRMailboxMapper.java
----------------------------------------------------------------------
diff --git a/mailbox/jcr/src/main/java/org/apache/james/mailbox/jcr/mail/JCRMailboxMapper.java b/mailbox/jcr/src/main/java/org/apache/james/mailbox/jcr/mail/JCRMailboxMapper.java
index 1ed57eb..3ad6988 100644
--- a/mailbox/jcr/src/main/java/org/apache/james/mailbox/jcr/mail/JCRMailboxMapper.java
+++ b/mailbox/jcr/src/main/java/org/apache/james/mailbox/jcr/mail/JCRMailboxMapper.java
@@ -37,7 +37,6 @@ import org.apache.james.mailbox.MailboxSession;
 import org.apache.james.mailbox.exception.MailboxException;
 import org.apache.james.mailbox.exception.MailboxNotFoundException;
 import org.apache.james.mailbox.jcr.AbstractJCRScalingMapper;
-import org.apache.james.mailbox.jcr.JCRId;
 import org.apache.james.mailbox.jcr.MailboxSessionJCRRepository;
 import org.apache.james.mailbox.jcr.mail.model.JCRMailbox;
 import org.apache.james.mailbox.model.MailboxACL;
@@ -50,7 +49,7 @@ import org.apache.james.mailbox.store.mail.model.Mailbox;
  * 
  * 
  */
-public class JCRMailboxMapper extends AbstractJCRScalingMapper implements MailboxMapper<JCRId> {
+public class JCRMailboxMapper extends AbstractJCRScalingMapper implements MailboxMapper {
 
 	@SuppressWarnings("deprecation")
     private static final String XPATH_LANGUAGE = Query.XPATH;
@@ -66,7 +65,7 @@ public class JCRMailboxMapper extends AbstractJCRScalingMapper implements Mailbo
      * org.apache.james.mailbox.store.mail.MailboxMapper#delete(org.apache.james
      * .imap.store.mail.model.Mailbox)
      */
-    public void delete(Mailbox<JCRId> mailbox) throws MailboxException {
+    public void delete(Mailbox mailbox) throws MailboxException {
         try {
             Node node = getSession().getNodeByIdentifier(((JCRMailbox) mailbox).getMailboxId().serialize());
                    
@@ -83,7 +82,7 @@ public class JCRMailboxMapper extends AbstractJCRScalingMapper implements Mailbo
      * (non-Javadoc)
      * @see org.apache.james.mailbox.store.mail.MailboxMapper#findMailboxByPath(org.apache.james.imap.api.MailboxPath)
      */
-    public Mailbox<JCRId> findMailboxByPath(MailboxPath path) throws MailboxException, MailboxNotFoundException {
+    public Mailbox findMailboxByPath(MailboxPath path) throws MailboxException, MailboxNotFoundException {
         try {
             String name = Text.escapeIllegalXpathSearchChars(path.getName());
             String user = path.getUser();
@@ -114,8 +113,8 @@ public class JCRMailboxMapper extends AbstractJCRScalingMapper implements Mailbo
      * (non-Javadoc)
      * @see org.apache.james.mailbox.store.mail.MailboxMapper#findMailboxWithPathLike(org.apache.james.imap.api.MailboxPath)
      */
-    public List<Mailbox<JCRId>> findMailboxWithPathLike(MailboxPath path) throws MailboxException {
-        List<Mailbox<JCRId>> mailboxList = new ArrayList<Mailbox<JCRId>>();
+    public List<Mailbox> findMailboxWithPathLike(MailboxPath path) throws MailboxException {
+        List<Mailbox> mailboxList = new ArrayList<Mailbox>();
         try {
             String name = Text.escapeIllegalXpathSearchChars(path.getName());
             String user = path.getUser();
@@ -147,7 +146,7 @@ public class JCRMailboxMapper extends AbstractJCRScalingMapper implements Mailbo
      * org.apache.james.mailbox.store.mail.MailboxMapper#save(org.apache.james.
      * imap.store.mail.model.Mailbox)
      */
-    public void save(Mailbox<JCRId> mailbox) throws MailboxException {
+    public void save(Mailbox mailbox) throws MailboxException {
         
         try {
             final JCRMailbox jcrMailbox = (JCRMailbox)mailbox;
@@ -191,7 +190,7 @@ public class JCRMailboxMapper extends AbstractJCRScalingMapper implements Mailbo
      * @see org.apache.james.mailbox.store.mail.MailboxMapper#hasChildren(org.apache.james.
      * imap.store.mail.model.Mailbox)
      */
-    public boolean hasChildren(Mailbox<JCRId> mailbox, char delimiter)
+    public boolean hasChildren(Mailbox mailbox, char delimiter)
             throws MailboxException, MailboxNotFoundException {
         try {
             String name = Text.escapeIllegalXpathSearchChars(mailbox.getName());
@@ -220,9 +219,9 @@ public class JCRMailboxMapper extends AbstractJCRScalingMapper implements Mailbo
      * (non-Javadoc)
      * @see org.apache.james.mailbox.store.mail.MailboxMapper#list()
      */
-    public List<Mailbox<JCRId>> list() throws MailboxException {
+    public List<Mailbox> list() throws MailboxException {
         try {
-            List<Mailbox<JCRId>> mList = new ArrayList<Mailbox<JCRId>>();
+            List<Mailbox> mList = new ArrayList<Mailbox>();
             QueryManager manager = getSession().getWorkspace().getQueryManager();
 
             String queryString = "/jcr:root/" + MAILBOXES_PATH + "//element(*,jamesMailbox:mailbox)";
@@ -238,7 +237,7 @@ public class JCRMailboxMapper extends AbstractJCRScalingMapper implements Mailbo
     }
 
     @Override
-    public void updateACL(Mailbox<JCRId> 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/jcr/src/main/java/org/apache/james/mailbox/jcr/mail/JCRMessageMapper.java
----------------------------------------------------------------------
diff --git a/mailbox/jcr/src/main/java/org/apache/james/mailbox/jcr/mail/JCRMessageMapper.java b/mailbox/jcr/src/main/java/org/apache/james/mailbox/jcr/mail/JCRMessageMapper.java
index 9436125..51e9860 100644
--- a/mailbox/jcr/src/main/java/org/apache/james/mailbox/jcr/mail/JCRMessageMapper.java
+++ b/mailbox/jcr/src/main/java/org/apache/james/mailbox/jcr/mail/JCRMessageMapper.java
@@ -40,7 +40,6 @@ import org.apache.jackrabbit.commons.JcrUtils;
 import org.apache.jackrabbit.util.ISO9075;
 import org.apache.james.mailbox.MailboxSession;
 import org.apache.james.mailbox.exception.MailboxException;
-import org.apache.james.mailbox.jcr.JCRId;
 import org.apache.james.mailbox.jcr.JCRImapConstants;
 import org.apache.james.mailbox.jcr.MailboxSessionJCRRepository;
 import org.apache.james.mailbox.jcr.mail.model.JCRMailboxMessage;
@@ -60,7 +59,7 @@ import org.apache.james.mailbox.store.mail.model.MailboxMessage;
  * message as a seperate child node under the mailbox
  * 
  */
-public class JCRMessageMapper extends AbstractMessageMapper<JCRId> implements JCRImapConstants {
+public class JCRMessageMapper extends AbstractMessageMapper implements JCRImapConstants {
 
     @SuppressWarnings("deprecation")
     private static final String XPATH_LANGUAGE = Query.XPATH;
@@ -122,7 +121,7 @@ public class JCRMessageMapper extends AbstractMessageMapper<JCRId> implements JC
      *            {@link #MESSAGE_SCALE_YEAR}
      */
     public JCRMessageMapper(MailboxSessionJCRRepository repository, MailboxSession mSession,
-            UidProvider<JCRId> uidProvider, ModSeqProvider<JCRId> modSeqProvider, int scaleType) {
+            UidProvider uidProvider, ModSeqProvider modSeqProvider, int scaleType) {
         super(mSession, uidProvider, modSeqProvider);
         this.repository = repository;
         this.scaleType = scaleType;
@@ -142,7 +141,7 @@ public class JCRMessageMapper extends AbstractMessageMapper<JCRId> implements JC
      *            {@link ModSeqProvider} to use
      */
     public JCRMessageMapper(MailboxSessionJCRRepository repos, MailboxSession session,
-            UidProvider<JCRId> uidProvider, ModSeqProvider<JCRId> modSeqProvider) {
+            UidProvider uidProvider, ModSeqProvider modSeqProvider) {
         this(repos, session, uidProvider, modSeqProvider, MESSAGE_SCALE_DAY);
     }
 
@@ -209,7 +208,7 @@ public class JCRMessageMapper extends AbstractMessageMapper<JCRId> implements JC
      * org.apache.james.mailbox.store.mail.MessageMapper#countMessagesInMailbox
      * ()
      */
-    public long countMessagesInMailbox(Mailbox<JCRId> mailbox) throws MailboxException {
+    public long countMessagesInMailbox(Mailbox mailbox) throws MailboxException {
         try {
             // we use order by because without it count will always be 0 in
             // jackrabbit
@@ -239,7 +238,7 @@ public class JCRMessageMapper extends AbstractMessageMapper<JCRId> implements JC
      * @see org.apache.james.mailbox.store.mail.MessageMapper#
      * countUnseenMessagesInMailbox ()
      */
-    public long countUnseenMessagesInMailbox(Mailbox<JCRId> mailbox) throws MailboxException {
+    public long countUnseenMessagesInMailbox(Mailbox mailbox) throws MailboxException {
 
         try {
             // we use order by because without it count will always be 0 in
@@ -273,7 +272,7 @@ public class JCRMessageMapper extends AbstractMessageMapper<JCRId> implements JC
      * .mailbox.store.mail.model.Mailbox,
      * org.apache.james.mailbox.store.mail.model.MailboxMessage)
      */
-    public void delete(Mailbox<JCRId> mailbox, MailboxMessage<JCRId> message) throws MailboxException {
+    public void delete(Mailbox mailbox, MailboxMessage message) throws MailboxException {
         JCRMailboxMessage membership = (JCRMailboxMessage) message;
         if (membership.isPersistent()) {
             try {
@@ -294,10 +293,10 @@ public class JCRMessageMapper extends AbstractMessageMapper<JCRId> implements JC
      * org.apache.james.mailbox.MessageRange,
      * org.apache.james.mailbox.store.mail.MessageMapper.FetchType, int)
      */
-    public Iterator<MailboxMessage<JCRId>> findInMailbox(Mailbox<JCRId> mailbox, MessageRange set, FetchType fType, int max)
+    public Iterator<MailboxMessage> findInMailbox(Mailbox mailbox, MessageRange set, FetchType fType, int max)
             throws MailboxException {
         try {
-            List<MailboxMessage<JCRId>> results;
+            List<MailboxMessage> results;
             long from = set.getUidFrom();
             final long to = set.getUidTo();
             final Type type = set.getType();
@@ -333,7 +332,7 @@ public class JCRMessageMapper extends AbstractMessageMapper<JCRId> implements JC
      * @see org.apache.james.mailbox.store.mail.MessageMapper#
      * findRecentMessageUidsInMailbox ()
      */
-    public List<Long> findRecentMessageUidsInMailbox(Mailbox<JCRId> mailbox) throws MailboxException {
+    public List<Long> findRecentMessageUidsInMailbox(Mailbox mailbox) throws MailboxException {
 
         try {
 
@@ -363,7 +362,7 @@ public class JCRMessageMapper extends AbstractMessageMapper<JCRId> implements JC
      * org.apache.james.mailbox.store.mail.MessageMapper#findFirstUnseenMessageUid
      * (org.apache.james.mailbox.store.mail.model.Mailbox)
      */
-    public Long findFirstUnseenMessageUid(Mailbox<JCRId> mailbox) throws MailboxException {
+    public Long findFirstUnseenMessageUid(Mailbox mailbox) throws MailboxException {
         try {
             String queryString = "/jcr:root" + getMailboxPath(mailbox) + "//element(*,jamesMailbox:message)[@"
                     + JCRMailboxMessage.SEEN_PROPERTY + "='false'] order by @" + JCRMailboxMessage.UID_PROPERTY;
@@ -386,10 +385,10 @@ public class JCRMessageMapper extends AbstractMessageMapper<JCRId> implements JC
     }
 
     @Override
-    public Map<Long, MessageMetaData> expungeMarkedForDeletionInMailbox(Mailbox<JCRId> mailbox, MessageRange set)
+    public Map<Long, MessageMetaData> expungeMarkedForDeletionInMailbox(Mailbox mailbox, MessageRange set)
             throws MailboxException {
         try {
-            final List<MailboxMessage<JCRId>> results;
+            final List<MailboxMessage> results;
             final long from = set.getUidFrom();
             final long to = set.getUidTo();
             final Type type = set.getType();
@@ -409,7 +408,7 @@ public class JCRMessageMapper extends AbstractMessageMapper<JCRId> implements JC
                 break;
             }
             Map<Long, MessageMetaData> uids = new HashMap<Long, MessageMetaData>();
-            for (MailboxMessage<JCRId> m : results) {
+            for (MailboxMessage m : results) {
                 long uid = m.getUid();
                 uids.put(uid, new SimpleMessageMetaData(m));
                 delete(mailbox, m);
@@ -427,12 +426,12 @@ public class JCRMessageMapper extends AbstractMessageMapper<JCRId> implements JC
      *      MailboxMessage)
      */
     @Override
-    public MessageMetaData move(Mailbox<JCRId> mailbox, MailboxMessage<JCRId> 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");
     }
 
     @Override
-    protected MessageMetaData copy(Mailbox<JCRId> mailbox, long uid, long modSeq, MailboxMessage<JCRId> original)
+    protected MessageMetaData copy(Mailbox mailbox, long uid, long modSeq, MailboxMessage original)
             throws MailboxException {
         try {
             String newMessagePath = getSession().getNodeByIdentifier(mailbox.getMailboxId().serialize()).getPath() + NODE_DELIMITER
@@ -455,7 +454,7 @@ public class JCRMessageMapper extends AbstractMessageMapper<JCRId> implements JC
     }
 
     @Override
-    protected MessageMetaData save(Mailbox<JCRId> mailbox, MailboxMessage<JCRId> message) throws MailboxException {
+    protected MessageMetaData save(Mailbox mailbox, MailboxMessage message) throws MailboxException {
         final JCRMailboxMessage membership = (JCRMailboxMessage) message;
         try {
     
@@ -542,13 +541,13 @@ public class JCRMessageMapper extends AbstractMessageMapper<JCRId> implements JC
      * @throws ItemNotFoundException
      * @throws RepositoryException
      */
-    private String getMailboxPath(Mailbox<JCRId> mailbox) throws ItemNotFoundException, RepositoryException {
+    private String getMailboxPath(Mailbox mailbox) throws ItemNotFoundException, RepositoryException {
         return ISO9075.encodePath(getSession().getNodeByIdentifier(mailbox.getMailboxId().serialize()).getPath());
     }
 
-    private List<MailboxMessage<JCRId>> findMessagesInMailboxAfterUID(Mailbox<JCRId> mailbox, long uid, int batchSize)
+    private List<MailboxMessage> findMessagesInMailboxAfterUID(Mailbox mailbox, long uid, int batchSize)
             throws RepositoryException {
-        List<MailboxMessage<JCRId>> list = new ArrayList<MailboxMessage<JCRId>>();
+        List<MailboxMessage> list = new ArrayList<MailboxMessage>();
         String queryString = "/jcr:root" + getMailboxPath(mailbox) + "//element(*,jamesMailbox:message)[@"
                 + JCRMailboxMessage.UID_PROPERTY + ">=" + uid + "] order by @" + JCRMailboxMessage.UID_PROPERTY;
 
@@ -565,9 +564,9 @@ public class JCRMessageMapper extends AbstractMessageMapper<JCRId> implements JC
         return list;
     }
 
-    private List<MailboxMessage<JCRId>> findMessageInMailboxWithUID(Mailbox<JCRId> mailbox, long uid)
+    private List<MailboxMessage> findMessageInMailboxWithUID(Mailbox mailbox, long uid)
             throws RepositoryException {
-        List<MailboxMessage<JCRId>> list = new ArrayList<MailboxMessage<JCRId>>();
+        List<MailboxMessage> list = new ArrayList<MailboxMessage>();
         String queryString = "/jcr:root" + getMailboxPath(mailbox) + "//element(*,jamesMailbox:message)[@"
                 + JCRMailboxMessage.UID_PROPERTY + "=" + uid + "]";
 
@@ -582,9 +581,9 @@ public class JCRMessageMapper extends AbstractMessageMapper<JCRId> implements JC
         return list;
     }
 
-    private List<MailboxMessage<JCRId>> findMessagesInMailboxBetweenUIDs(Mailbox<JCRId> mailbox, long from, long to,
+    private List<MailboxMessage> findMessagesInMailboxBetweenUIDs(Mailbox mailbox, long from, long to,
                                                                          int batchSize) throws RepositoryException {
-        List<MailboxMessage<JCRId>> list = new ArrayList<MailboxMessage<JCRId>>();
+        List<MailboxMessage> list = new ArrayList<MailboxMessage>();
         String queryString = "/jcr:root" + getMailboxPath(mailbox) + "//element(*,jamesMailbox:message)[@"
                 + JCRMailboxMessage.UID_PROPERTY + ">=" + from + " and @" + JCRMailboxMessage.UID_PROPERTY + "<=" + to
                 + "] order by @" + JCRMailboxMessage.UID_PROPERTY;
@@ -602,9 +601,9 @@ public class JCRMessageMapper extends AbstractMessageMapper<JCRId> implements JC
         return list;
     }
 
-    private List<MailboxMessage<JCRId>> findMessagesInMailbox(Mailbox<JCRId> mailbox, int batchSize)
+    private List<MailboxMessage> findMessagesInMailbox(Mailbox mailbox, int batchSize)
             throws RepositoryException {
-        List<MailboxMessage<JCRId>> list = new ArrayList<MailboxMessage<JCRId>>();
+        List<MailboxMessage> list = new ArrayList<MailboxMessage>();
 
         String queryString = "/jcr:root" + getMailboxPath(mailbox) + "//element(*,jamesMailbox:message) order by @"
                 + JCRMailboxMessage.UID_PROPERTY;
@@ -621,9 +620,9 @@ public class JCRMessageMapper extends AbstractMessageMapper<JCRId> implements JC
         return list;
     }
 
-    private List<MailboxMessage<JCRId>> findDeletedMessagesInMailboxAfterUID(Mailbox<JCRId> mailbox, long uid)
+    private List<MailboxMessage> findDeletedMessagesInMailboxAfterUID(Mailbox mailbox, long uid)
             throws RepositoryException {
-        List<MailboxMessage<JCRId>> list = new ArrayList<MailboxMessage<JCRId>>();
+        List<MailboxMessage> list = new ArrayList<MailboxMessage>();
         String queryString = "/jcr:root" + getMailboxPath(mailbox) + "//element(*,jamesMailbox:message)[@"
                 + JCRMailboxMessage.UID_PROPERTY + ">=" + uid + " and @" + JCRMailboxMessage.DELETED_PROPERTY + "='true'] order by @"
                 + JCRMailboxMessage.UID_PROPERTY;
@@ -638,9 +637,9 @@ public class JCRMessageMapper extends AbstractMessageMapper<JCRId> implements JC
         return list;
     }
 
-    private List<MailboxMessage<JCRId>> findDeletedMessageInMailboxWithUID(Mailbox<JCRId> mailbox, long uid)
+    private List<MailboxMessage> findDeletedMessageInMailboxWithUID(Mailbox mailbox, long uid)
             throws RepositoryException {
-        List<MailboxMessage<JCRId>> list = new ArrayList<MailboxMessage<JCRId>>();
+        List<MailboxMessage> list = new ArrayList<MailboxMessage>();
         String queryString = "/jcr:root" + getMailboxPath(mailbox) + "//element(*,jamesMailbox:message)[@"
                 + JCRMailboxMessage.UID_PROPERTY + "=" + uid + " and @" + JCRMailboxMessage.DELETED_PROPERTY + "='true']";
         QueryManager manager = getSession().getWorkspace().getQueryManager();
@@ -656,9 +655,9 @@ public class JCRMessageMapper extends AbstractMessageMapper<JCRId> implements JC
         return list;
     }
 
-    private List<MailboxMessage<JCRId>> findDeletedMessagesInMailboxBetweenUIDs(Mailbox<JCRId> mailbox, long from, long to)
+    private List<MailboxMessage> findDeletedMessagesInMailboxBetweenUIDs(Mailbox mailbox, long from, long to)
             throws RepositoryException {
-        List<MailboxMessage<JCRId>> list = new ArrayList<MailboxMessage<JCRId>>();
+        List<MailboxMessage> list = new ArrayList<MailboxMessage>();
         String queryString = "/jcr:root" + getMailboxPath(mailbox) + "//element(*,jamesMailbox:message)[@"
                 + JCRMailboxMessage.UID_PROPERTY + ">=" + from + " and @" + JCRMailboxMessage.UID_PROPERTY + "<=" + to + " and @"
                 + JCRMailboxMessage.DELETED_PROPERTY + "='true'] order by @" + JCRMailboxMessage.UID_PROPERTY;
@@ -673,9 +672,9 @@ public class JCRMessageMapper extends AbstractMessageMapper<JCRId> implements JC
         return list;
     }
 
-    private List<MailboxMessage<JCRId>> findDeletedMessagesInMailbox(Mailbox<JCRId> mailbox) throws RepositoryException {
+    private List<MailboxMessage> findDeletedMessagesInMailbox(Mailbox mailbox) throws RepositoryException {
 
-        List<MailboxMessage<JCRId>> list = new ArrayList<MailboxMessage<JCRId>>();
+        List<MailboxMessage> list = new ArrayList<MailboxMessage>();
         String queryString = "/jcr:root" + getMailboxPath(mailbox) + "//element(*,jamesMailbox:message)[@"
                 + JCRMailboxMessage.DELETED_PROPERTY + "='true'] order by @" + JCRMailboxMessage.UID_PROPERTY;
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/jcr/src/main/java/org/apache/james/mailbox/jcr/mail/JCRModSeqProvider.java
----------------------------------------------------------------------
diff --git a/mailbox/jcr/src/main/java/org/apache/james/mailbox/jcr/mail/JCRModSeqProvider.java b/mailbox/jcr/src/main/java/org/apache/james/mailbox/jcr/mail/JCRModSeqProvider.java
index 9e3ffd2..5138265 100644
--- a/mailbox/jcr/src/main/java/org/apache/james/mailbox/jcr/mail/JCRModSeqProvider.java
+++ b/mailbox/jcr/src/main/java/org/apache/james/mailbox/jcr/mail/JCRModSeqProvider.java
@@ -25,13 +25,12 @@ import javax.jcr.Session;
 import org.apache.james.mailbox.MailboxPathLocker;
 import org.apache.james.mailbox.MailboxSession;
 import org.apache.james.mailbox.exception.MailboxException;
-import org.apache.james.mailbox.jcr.JCRId;
 import org.apache.james.mailbox.jcr.MailboxSessionJCRRepository;
 import org.apache.james.mailbox.jcr.mail.model.JCRMailbox;
 import org.apache.james.mailbox.store.mail.AbstractLockingModSeqProvider;
 import org.apache.james.mailbox.store.mail.model.Mailbox;
 
-public class JCRModSeqProvider extends AbstractLockingModSeqProvider<JCRId>{
+public class JCRModSeqProvider extends AbstractLockingModSeqProvider{
 
     private final MailboxSessionJCRRepository repository;
 
@@ -41,7 +40,7 @@ public class JCRModSeqProvider extends AbstractLockingModSeqProvider<JCRId>{
     }
 
     @Override
-    public long highestModSeq(MailboxSession session, Mailbox<JCRId> mailbox) throws MailboxException {
+    public long highestModSeq(MailboxSession session, Mailbox mailbox) throws MailboxException {
         try {
             Session s = repository.login(session);
             Node node = s.getNodeByIdentifier(mailbox.getMailboxId().serialize());
@@ -52,7 +51,7 @@ public class JCRModSeqProvider extends AbstractLockingModSeqProvider<JCRId>{
     }
 
     @Override
-    protected long lockedNextModSeq(MailboxSession session, Mailbox<JCRId> mailbox) throws MailboxException {
+    protected long lockedNextModSeq(MailboxSession session, Mailbox mailbox) throws MailboxException {
         try {
             Session s = repository.login(session);
             Node node = s.getNodeByIdentifier(mailbox.getMailboxId().serialize());

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/jcr/src/main/java/org/apache/james/mailbox/jcr/mail/JCRUidProvider.java
----------------------------------------------------------------------
diff --git a/mailbox/jcr/src/main/java/org/apache/james/mailbox/jcr/mail/JCRUidProvider.java b/mailbox/jcr/src/main/java/org/apache/james/mailbox/jcr/mail/JCRUidProvider.java
index 0db4fcd..21ba5f0 100644
--- a/mailbox/jcr/src/main/java/org/apache/james/mailbox/jcr/mail/JCRUidProvider.java
+++ b/mailbox/jcr/src/main/java/org/apache/james/mailbox/jcr/mail/JCRUidProvider.java
@@ -25,13 +25,12 @@ import javax.jcr.Session;
 import org.apache.james.mailbox.MailboxPathLocker;
 import org.apache.james.mailbox.MailboxSession;
 import org.apache.james.mailbox.exception.MailboxException;
-import org.apache.james.mailbox.jcr.JCRId;
 import org.apache.james.mailbox.jcr.MailboxSessionJCRRepository;
 import org.apache.james.mailbox.jcr.mail.model.JCRMailbox;
 import org.apache.james.mailbox.store.mail.AbstractLockingUidProvider;
 import org.apache.james.mailbox.store.mail.model.Mailbox;
 
-public class JCRUidProvider extends AbstractLockingUidProvider<JCRId> {
+public class JCRUidProvider extends AbstractLockingUidProvider {
 
     private final MailboxSessionJCRRepository repository;
 
@@ -41,7 +40,7 @@ public class JCRUidProvider extends AbstractLockingUidProvider<JCRId> {
     }
 
     @Override
-    public long lastUid(MailboxSession mailboxSession, Mailbox<JCRId> mailbox) throws MailboxException {
+    public long lastUid(MailboxSession mailboxSession, Mailbox mailbox) throws MailboxException {
         try {
             Session s = repository.login(mailboxSession);
             Node node = s.getNodeByIdentifier(mailbox.getMailboxId().serialize());
@@ -53,7 +52,7 @@ public class JCRUidProvider extends AbstractLockingUidProvider<JCRId> {
     }
 
     @Override
-    protected long lockedNextUid(MailboxSession session, Mailbox<JCRId> mailbox) throws MailboxException {
+    protected long lockedNextUid(MailboxSession session, Mailbox mailbox) throws MailboxException {
         try {
             Session s = repository.login(session);
             Node node = s.getNodeByIdentifier(mailbox.getMailboxId().serialize());

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/jcr/src/main/java/org/apache/james/mailbox/jcr/mail/model/JCRMailbox.java
----------------------------------------------------------------------
diff --git a/mailbox/jcr/src/main/java/org/apache/james/mailbox/jcr/mail/model/JCRMailbox.java b/mailbox/jcr/src/main/java/org/apache/james/mailbox/jcr/mail/model/JCRMailbox.java
index 703f6e2..18addc6 100644
--- a/mailbox/jcr/src/main/java/org/apache/james/mailbox/jcr/mail/model/JCRMailbox.java
+++ b/mailbox/jcr/src/main/java/org/apache/james/mailbox/jcr/mail/model/JCRMailbox.java
@@ -36,7 +36,7 @@ import org.slf4j.Logger;
 /**
  * JCR implementation of a {@link Mailbox}
  */
-public class JCRMailbox implements Mailbox<JCRId>, JCRImapConstants, Persistent{
+public class JCRMailbox implements Mailbox, JCRImapConstants, Persistent{
 
     private static final String TAB = " ";
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/jcr/src/main/java/org/apache/james/mailbox/jcr/mail/model/JCRMailboxMessage.java
----------------------------------------------------------------------
diff --git a/mailbox/jcr/src/main/java/org/apache/james/mailbox/jcr/mail/model/JCRMailboxMessage.java b/mailbox/jcr/src/main/java/org/apache/james/mailbox/jcr/mail/model/JCRMailboxMessage.java
index ad14763..8bbf28d 100644
--- a/mailbox/jcr/src/main/java/org/apache/james/mailbox/jcr/mail/model/JCRMailboxMessage.java
+++ b/mailbox/jcr/src/main/java/org/apache/james/mailbox/jcr/mail/model/JCRMailboxMessage.java
@@ -50,7 +50,7 @@ import org.apache.james.mailbox.store.mail.model.impl.MessageUidComparator;
 import org.apache.james.mailbox.store.mail.model.impl.PropertyBuilder;
 import org.slf4j.Logger;
 
-public class JCRMailboxMessage implements MailboxMessage<JCRId>, JCRImapConstants, Persistent {
+public class JCRMailboxMessage implements MailboxMessage, JCRImapConstants, Persistent {
 
     private static final MessageUidComparator MESSAGE_UID_COMPARATOR = new MessageUidComparator();
     
@@ -673,7 +673,7 @@ public class JCRMailboxMessage implements MailboxMessage<JCRId>, JCRImapConstant
     }
 
     @Override
-    public int compareTo(MailboxMessage<JCRId> 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/jcr/src/test/java/org/apache/james/mailbox/jcr/JCRMailboxIdDeserializerTest.java
----------------------------------------------------------------------
diff --git a/mailbox/jcr/src/test/java/org/apache/james/mailbox/jcr/JCRMailboxIdDeserializerTest.java b/mailbox/jcr/src/test/java/org/apache/james/mailbox/jcr/JCRMailboxIdDeserializerTest.java
index c065743..79b7a64 100644
--- a/mailbox/jcr/src/test/java/org/apache/james/mailbox/jcr/JCRMailboxIdDeserializerTest.java
+++ b/mailbox/jcr/src/test/java/org/apache/james/mailbox/jcr/JCRMailboxIdDeserializerTest.java
@@ -30,7 +30,7 @@ public class JCRMailboxIdDeserializerTest {
     private static final String SERIALIZED_ID = "some_string";
     private static final JCRId JCR_ID = JCRId.of(SERIALIZED_ID);
 
-    private MailboxIdDeserializer<JCRId> mailboxIdDeserializer;
+    private MailboxIdDeserializer mailboxIdDeserializer;
 
     @Before
     public void setUp() {

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

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/jpa/src/main/java/org/apache/james/mailbox/jpa/JPAMailboxManager.java
----------------------------------------------------------------------
diff --git a/mailbox/jpa/src/main/java/org/apache/james/mailbox/jpa/JPAMailboxManager.java b/mailbox/jpa/src/main/java/org/apache/james/mailbox/jpa/JPAMailboxManager.java
index 7a4f795..1e74805 100644
--- a/mailbox/jpa/src/main/java/org/apache/james/mailbox/jpa/JPAMailboxManager.java
+++ b/mailbox/jpa/src/main/java/org/apache/james/mailbox/jpa/JPAMailboxManager.java
@@ -34,7 +34,7 @@ import org.apache.james.mailbox.store.transaction.TransactionalMapper;
 /**
  * JPA implementation of {@link StoreMailboxManager}
  */
-public abstract class JPAMailboxManager extends StoreMailboxManager<JPAId> {
+public abstract class JPAMailboxManager extends StoreMailboxManager {
     
     public JPAMailboxManager(JPAMailboxSessionMapperFactory mailboxSessionMapperFactory,
             final Authenticator authenticator, MailboxPathLocker locker, MailboxACLResolver aclResolver, GroupMembershipResolver groupMembershipResolver) {
@@ -42,7 +42,7 @@ public abstract class JPAMailboxManager extends StoreMailboxManager<JPAId> {
     }
     
     @Override
-    protected Mailbox<JPAId> doCreateMailbox(MailboxPath path, MailboxSession session) throws MailboxException {
+    protected Mailbox doCreateMailbox(MailboxPath path, MailboxSession session) throws MailboxException {
         return  new JPAMailbox(path, randomUidValidity());
     }
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/jpa/src/main/java/org/apache/james/mailbox/jpa/JPAMailboxSessionMapperFactory.java
----------------------------------------------------------------------
diff --git a/mailbox/jpa/src/main/java/org/apache/james/mailbox/jpa/JPAMailboxSessionMapperFactory.java b/mailbox/jpa/src/main/java/org/apache/james/mailbox/jpa/JPAMailboxSessionMapperFactory.java
index 53ca244..73890fb 100644
--- a/mailbox/jpa/src/main/java/org/apache/james/mailbox/jpa/JPAMailboxSessionMapperFactory.java
+++ b/mailbox/jpa/src/main/java/org/apache/james/mailbox/jpa/JPAMailboxSessionMapperFactory.java
@@ -36,13 +36,13 @@ import org.apache.james.mailbox.store.user.SubscriptionMapper;
  * JPA implementation of {@link MailboxSessionMapperFactory}
  *
  */
-public class JPAMailboxSessionMapperFactory extends MailboxSessionMapperFactory<JPAId> {
+public class JPAMailboxSessionMapperFactory extends MailboxSessionMapperFactory {
 
     private final EntityManagerFactory entityManagerFactory;
-    private final UidProvider<JPAId> uidProvider;
-    private final ModSeqProvider<JPAId> modSeqProvider;
+    private final UidProvider uidProvider;
+    private final ModSeqProvider modSeqProvider;
 
-    public JPAMailboxSessionMapperFactory(EntityManagerFactory entityManagerFactory, UidProvider<JPAId> uidProvider, ModSeqProvider<JPAId> modSeqProvider) {
+    public JPAMailboxSessionMapperFactory(EntityManagerFactory entityManagerFactory, UidProvider uidProvider, ModSeqProvider modSeqProvider) {
         this.entityManagerFactory = entityManagerFactory;
         this.uidProvider = uidProvider;
         this.modSeqProvider = modSeqProvider;
@@ -50,12 +50,12 @@ public class JPAMailboxSessionMapperFactory extends MailboxSessionMapperFactory<
     }
     
     @Override
-    public MailboxMapper<JPAId> createMailboxMapper(MailboxSession session) {
+    public MailboxMapper createMailboxMapper(MailboxSession session) {
         return new JPAMailboxMapper(entityManagerFactory);
     }
 
     @Override
-    public MessageMapper<JPAId> createMessageMapper(MailboxSession session) {
+    public MessageMapper createMessageMapper(MailboxSession session) {
         return new JPAMessageMapper(session, uidProvider, modSeqProvider, entityManagerFactory);
     }
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/jpa/src/main/java/org/apache/james/mailbox/jpa/JPAMessageManager.java
----------------------------------------------------------------------
diff --git a/mailbox/jpa/src/main/java/org/apache/james/mailbox/jpa/JPAMessageManager.java b/mailbox/jpa/src/main/java/org/apache/james/mailbox/jpa/JPAMessageManager.java
index 8e20139..f798b9d 100644
--- a/mailbox/jpa/src/main/java/org/apache/james/mailbox/jpa/JPAMessageManager.java
+++ b/mailbox/jpa/src/main/java/org/apache/james/mailbox/jpa/JPAMessageManager.java
@@ -32,9 +32,9 @@ import org.apache.james.mailbox.jpa.mail.model.JPAMailbox;
 import org.apache.james.mailbox.jpa.mail.model.openjpa.JPAMailboxMessage;
 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.mail.model.MailboxMessage;
 import org.apache.james.mailbox.store.mail.model.impl.PropertyBuilder;
@@ -43,11 +43,11 @@ import org.apache.james.mailbox.store.search.MessageSearchIndex;
 /**
  * Abstract base class which should be used from JPA implementations.
  */
-public class JPAMessageManager extends StoreMessageManager<JPAId> {
+public class JPAMessageManager extends StoreMessageManager {
     
-    public JPAMessageManager(MailboxSessionMapperFactory<JPAId> mapperFactory, MessageSearchIndex<JPAId> index, 
-    			final MailboxEventDispatcher<JPAId> dispatcher, MailboxPathLocker locker, 
-    			final Mailbox<JPAId> mailbox, MailboxACLResolver aclResolver, 
+    public JPAMessageManager(MailboxSessionMapperFactory mapperFactory, MessageSearchIndex index, 
+    			final MailboxEventDispatcher dispatcher, MailboxPathLocker locker, 
+    			final Mailbox mailbox, MailboxACLResolver aclResolver, 
     			GroupMembershipResolver groupMembershipResolver, QuotaManager quotaManager,
                 QuotaRootResolver quotaRootResolver) throws MailboxException {
     	
@@ -56,7 +56,7 @@ public class JPAMessageManager extends StoreMessageManager<JPAId> {
     }
     
     @Override
-    protected MailboxMessage<JPAId> createMessage(Date internalDate, int size, int bodyStartOctet, SharedInputStream content,
+    protected MailboxMessage createMessage(Date internalDate, int size, int bodyStartOctet, SharedInputStream content,
                                                   final Flags flags, PropertyBuilder propertyBuilder) throws MailboxException{
 
         return new JPAMailboxMessage((JPAMailbox) getMailboxEntity(), internalDate, size, flags, content,  bodyStartOctet,  propertyBuilder);

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/jpa/src/main/java/org/apache/james/mailbox/jpa/mail/JPAMailboxMapper.java
----------------------------------------------------------------------
diff --git a/mailbox/jpa/src/main/java/org/apache/james/mailbox/jpa/mail/JPAMailboxMapper.java b/mailbox/jpa/src/main/java/org/apache/james/mailbox/jpa/mail/JPAMailboxMapper.java
index 8ea4408..fd64f9c 100644
--- a/mailbox/jpa/src/main/java/org/apache/james/mailbox/jpa/mail/JPAMailboxMapper.java
+++ b/mailbox/jpa/src/main/java/org/apache/james/mailbox/jpa/mail/JPAMailboxMapper.java
@@ -32,7 +32,6 @@ import org.apache.james.mailbox.exception.MailboxExistsException;
 import org.apache.james.mailbox.exception.MailboxNotFoundException;
 import org.apache.james.mailbox.jpa.JPAId;
 import org.apache.james.mailbox.jpa.JPATransactionalMapper;
-import org.apache.james.mailbox.jpa.mail.model.JPAMailbox;
 import org.apache.james.mailbox.model.MailboxACL;
 import org.apache.james.mailbox.model.MailboxPath;
 import org.apache.james.mailbox.store.mail.MailboxMapper;
@@ -41,7 +40,7 @@ import org.apache.james.mailbox.store.mail.model.Mailbox;
 /**
  * Data access management for mailbox.
  */
-public class JPAMailboxMapper extends JPATransactionalMapper implements MailboxMapper<JPAId> {
+public class JPAMailboxMapper extends JPATransactionalMapper implements MailboxMapper {
 
     private static final char SQL_WILDCARD_CHAR = '%';
     private String lastMailboxName;
@@ -73,7 +72,7 @@ public class JPAMailboxMapper extends JPATransactionalMapper implements MailboxM
     /**
      * @see org.apache.james.mailbox.store.mail.MailboxMapper#save(Mailbox)
      */
-    public void save(Mailbox<JPAId> mailbox) throws MailboxException {
+    public void save(Mailbox mailbox) throws MailboxException {
         try {
             this.lastMailboxName = mailbox.getName();
             getEntityManager().persist(mailbox);
@@ -85,12 +84,12 @@ public class JPAMailboxMapper extends JPATransactionalMapper implements MailboxM
     /**
      * @see org.apache.james.mailbox.store.mail.MailboxMapper#findMailboxByPath(MailboxPath)
      */
-    public Mailbox<JPAId> findMailboxByPath(MailboxPath mailboxPath) throws MailboxException, MailboxNotFoundException {
+    public Mailbox findMailboxByPath(MailboxPath mailboxPath) throws MailboxException, MailboxNotFoundException {
         try {
             if (mailboxPath.getUser() == null) {
-                return (JPAMailbox) getEntityManager().createNamedQuery("findMailboxByName").setParameter("nameParam", mailboxPath.getName()).setParameter("namespaceParam", mailboxPath.getNamespace()).getSingleResult();
+                return (Mailbox) getEntityManager().createNamedQuery("findMailboxByName").setParameter("nameParam", mailboxPath.getName()).setParameter("namespaceParam", mailboxPath.getNamespace()).getSingleResult();
             } else {
-                return (JPAMailbox) getEntityManager().createNamedQuery("findMailboxByNameWithUser").setParameter("nameParam", mailboxPath.getName()).setParameter("namespaceParam", mailboxPath.getNamespace()).setParameter("userParam", mailboxPath.getUser()).getSingleResult();
+                return (Mailbox) getEntityManager().createNamedQuery("findMailboxByNameWithUser").setParameter("nameParam", mailboxPath.getName()).setParameter("namespaceParam", mailboxPath.getNamespace()).setParameter("userParam", mailboxPath.getUser()).getSingleResult();
             }
         } catch (NoResultException e) {
             throw new MailboxNotFoundException(mailboxPath);
@@ -102,9 +101,10 @@ public class JPAMailboxMapper extends JPATransactionalMapper implements MailboxM
     /**
      * @see org.apache.james.mailbox.store.mail.MailboxMapper#delete(Mailbox)
      */
-    public void delete(Mailbox<JPAId> mailbox) throws MailboxException {
+    public void delete(Mailbox mailbox) throws MailboxException {
         try {  
-            getEntityManager().createNamedQuery("deleteMessages").setParameter("idParam", mailbox.getMailboxId().getRawId()).executeUpdate();
+            JPAId mailboxId = (JPAId) mailbox.getMailboxId();
+            getEntityManager().createNamedQuery("deleteMessages").setParameter("idParam", mailboxId.getRawId()).executeUpdate();
             getEntityManager().remove(mailbox);
         } catch (PersistenceException e) {
             throw new MailboxException("Delete of mailbox " + mailbox + " failed", e);
@@ -115,7 +115,7 @@ public class JPAMailboxMapper extends JPATransactionalMapper implements MailboxM
      * @see org.apache.james.mailbox.store.mail.MailboxMapper#findMailboxWithPathLike(MailboxPath)
      */
     @SuppressWarnings("unchecked")
-    public List<Mailbox<JPAId>> findMailboxWithPathLike(MailboxPath path) throws MailboxException {
+    public List<Mailbox> findMailboxWithPathLike(MailboxPath path) throws MailboxException {
         try {
             if (path.getUser() == null) {
                 return getEntityManager().createNamedQuery("findMailboxWithNameLike").setParameter("nameParam", SQL_WILDCARD_CHAR + path.getName() + SQL_WILDCARD_CHAR).setParameter("namespaceParam", path.getNamespace()).getResultList();
@@ -146,7 +146,7 @@ public class JPAMailboxMapper extends JPATransactionalMapper implements MailboxM
     /**
      * @see org.apache.james.mailbox.store.mail.MailboxMapper#hasChildren(Mailbox, char)
      */
-    public boolean hasChildren(Mailbox<JPAId> mailbox, char delimiter) throws MailboxException,
+    public boolean hasChildren(Mailbox mailbox, char delimiter) throws MailboxException,
             MailboxNotFoundException {
         final String name = mailbox.getName() + delimiter + SQL_WILDCARD_CHAR; 
         final Long numberOfChildMailboxes;
@@ -162,7 +162,7 @@ public class JPAMailboxMapper extends JPATransactionalMapper implements MailboxM
      * @see org.apache.james.mailbox.store.mail.MailboxMapper#list()
      */
     @SuppressWarnings("unchecked")
-    public List<Mailbox<JPAId>> list() throws MailboxException{
+    public List<Mailbox> list() throws MailboxException{
         try {
             return getEntityManager().createNamedQuery("listMailboxes").getResultList();
         } catch (PersistenceException e) {
@@ -171,7 +171,7 @@ public class JPAMailboxMapper extends JPATransactionalMapper implements MailboxM
     }
 
     @Override
-    public void updateACL(Mailbox<JPAId> 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/jpa/src/main/java/org/apache/james/mailbox/jpa/mail/JPAMessageMapper.java
----------------------------------------------------------------------
diff --git a/mailbox/jpa/src/main/java/org/apache/james/mailbox/jpa/mail/JPAMessageMapper.java b/mailbox/jpa/src/main/java/org/apache/james/mailbox/jpa/mail/JPAMessageMapper.java
index 167cdd7..3bb57da 100644
--- a/mailbox/jpa/src/main/java/org/apache/james/mailbox/jpa/mail/JPAMessageMapper.java
+++ b/mailbox/jpa/src/main/java/org/apache/james/mailbox/jpa/mail/JPAMessageMapper.java
@@ -52,12 +52,12 @@ import org.apache.openjpa.persistence.ArgumentException;
 /**
  * JPA implementation of a {@link MessageMapper}. This class is not thread-safe!
  */
-public class JPAMessageMapper extends AbstractMessageMapper<JPAId> implements MessageMapper<JPAId> {
+public class JPAMessageMapper extends AbstractMessageMapper implements MessageMapper {
     protected EntityManagerFactory entityManagerFactory;
     protected EntityManager entityManager;
 
-    public JPAMessageMapper(MailboxSession session, UidProvider<JPAId> uidProvider,
-            ModSeqProvider<JPAId> modSeqProvider, EntityManagerFactory entityManagerFactory) {
+    public JPAMessageMapper(MailboxSession session, UidProvider uidProvider,
+            ModSeqProvider modSeqProvider, EntityManagerFactory entityManagerFactory) {
         super(session, uidProvider, modSeqProvider);
         this.entityManagerFactory = entityManagerFactory;
     }
@@ -124,27 +124,28 @@ public class JPAMessageMapper extends AbstractMessageMapper<JPAId> implements Me
      *      org.apache.james.mailbox.model.MessageRange,
      *      org.apache.james.mailbox.store.mail.MessageMapper.FetchType, int)
      */
-    public Iterator<MailboxMessage<JPAId>> findInMailbox(Mailbox<JPAId> mailbox, MessageRange set, FetchType fType, int max)
+    public Iterator<MailboxMessage> findInMailbox(Mailbox mailbox, MessageRange set, FetchType fType, int max)
             throws MailboxException {
         try {
-            List<MailboxMessage<JPAId>> results;
+            List<MailboxMessage> results;
             long from = set.getUidFrom();
             final long to = set.getUidTo();
             final Type type = set.getType();
+            JPAId mailboxId = (JPAId) mailbox.getMailboxId();
 
             switch (type) {
             default:
             case ALL:
-                results = findMessagesInMailbox(mailbox, max);
+                results = findMessagesInMailbox(mailboxId, max);
                 break;
             case FROM:
-                results = findMessagesInMailboxAfterUID(mailbox, from, max);
+                results = findMessagesInMailboxAfterUID(mailboxId, from, max);
                 break;
             case ONE:
-                results = findMessagesInMailboxWithUID(mailbox, from);
+                results = findMessagesInMailboxWithUID(mailboxId, from);
                 break;
             case RANGE:
-                results = findMessagesInMailboxBetweenUIDs(mailbox, from, to, max);
+                results = findMessagesInMailboxBetweenUIDs(mailboxId, from, to, max);
                 break;
             }
 
@@ -158,10 +159,11 @@ public class JPAMessageMapper extends AbstractMessageMapper<JPAId> implements Me
     /**
      * @see org.apache.james.mailbox.store.mail.MessageMapper#countMessagesInMailbox(Mailbox)
      */
-    public long countMessagesInMailbox(Mailbox<JPAId> mailbox) throws MailboxException {
+    public long countMessagesInMailbox(Mailbox mailbox) throws MailboxException {
         try {
+            JPAId mailboxId = (JPAId) mailbox.getMailboxId();
             return (Long) getEntityManager().createNamedQuery("countMessagesInMailbox")
-                    .setParameter("idParam", mailbox.getMailboxId().getRawId()).getSingleResult();
+                    .setParameter("idParam", mailboxId.getRawId()).getSingleResult();
         } catch (PersistenceException e) {
             throw new MailboxException("Count of messages failed in mailbox " + mailbox, e);
         }
@@ -170,10 +172,11 @@ public class JPAMessageMapper extends AbstractMessageMapper<JPAId> implements Me
     /**
      * @see org.apache.james.mailbox.store.mail.MessageMapper#countUnseenMessagesInMailbox(Mailbox)
      */
-    public long countUnseenMessagesInMailbox(Mailbox<JPAId> mailbox) throws MailboxException {
+    public long countUnseenMessagesInMailbox(Mailbox mailbox) throws MailboxException {
         try {
+            JPAId mailboxId = (JPAId) mailbox.getMailboxId();
             return (Long) getEntityManager().createNamedQuery("countUnseenMessagesInMailbox")
-                    .setParameter("idParam", mailbox.getMailboxId().getRawId()).getSingleResult();
+                    .setParameter("idParam", mailboxId.getRawId()).getSingleResult();
         } catch (PersistenceException e) {
             throw new MailboxException("Count of useen messages failed in mailbox " + mailbox, e);
         }
@@ -183,7 +186,7 @@ public class JPAMessageMapper extends AbstractMessageMapper<JPAId> implements Me
      * @see org.apache.james.mailbox.store.mail.MessageMapper#delete(org.apache.james.mailbox.store.mail.model.Mailbox,
      *      MailboxMessage)
      */
-    public void delete(Mailbox<JPAId> mailbox, MailboxMessage<JPAId> message) throws MailboxException {
+    public void delete(Mailbox mailbox, MailboxMessage message) throws MailboxException {
         try {
             getEntityManager().remove(message);
         } catch (PersistenceException e) {
@@ -195,12 +198,13 @@ public class JPAMessageMapper extends AbstractMessageMapper<JPAId> implements Me
      * @see org.apache.james.mailbox.store.mail.MessageMapper#findFirstUnseenMessageUid(Mailbox)
      */
     @SuppressWarnings("unchecked")
-    public Long findFirstUnseenMessageUid(Mailbox<JPAId> mailbox) throws MailboxException {
+    public Long findFirstUnseenMessageUid(Mailbox mailbox) throws MailboxException {
         try {
+            JPAId mailboxId = (JPAId) mailbox.getMailboxId();
             Query query = getEntityManager().createNamedQuery("findUnseenMessagesInMailboxOrderByUid").setParameter(
-                    "idParam", mailbox.getMailboxId().getRawId());
+                    "idParam", mailboxId.getRawId());
             query.setMaxResults(1);
-            List<MailboxMessage<JPAId>> result = query.getResultList();
+            List<MailboxMessage> result = query.getResultList();
             if (result.isEmpty()) {
                 return null;
             } else {
@@ -215,10 +219,11 @@ public class JPAMessageMapper extends AbstractMessageMapper<JPAId> implements Me
      * @see org.apache.james.mailbox.store.mail.MessageMapper#findRecentMessageUidsInMailbox(Mailbox)
      */
     @SuppressWarnings("unchecked")
-    public List<Long> findRecentMessageUidsInMailbox(Mailbox<JPAId> mailbox) throws MailboxException {
+    public List<Long> findRecentMessageUidsInMailbox(Mailbox mailbox) throws MailboxException {
         try {
+            JPAId mailboxId = (JPAId) mailbox.getMailboxId();
             Query query = getEntityManager().createNamedQuery("findRecentMessageUidsInMailbox").setParameter("idParam",
-                    mailbox.getMailboxId().getRawId());
+                    mailboxId.getRawId());
             return query.getResultList();
         } catch (PersistenceException e) {
             throw new MailboxException("Search of recent messages failed in mailbox " + mailbox, e);
@@ -226,35 +231,36 @@ public class JPAMessageMapper extends AbstractMessageMapper<JPAId> implements Me
     }
 
     @Override
-    public Map<Long, MessageMetaData> expungeMarkedForDeletionInMailbox(Mailbox<JPAId> mailbox, MessageRange set)
+    public Map<Long, MessageMetaData> expungeMarkedForDeletionInMailbox(Mailbox mailbox, MessageRange set)
             throws MailboxException {
         try {
             final Map<Long, MessageMetaData> data;
-            final List<MailboxMessage<JPAId>> results;
+            final List<MailboxMessage> results;
             final long from = set.getUidFrom();
             final long to = set.getUidTo();
+            JPAId mailboxId = (JPAId) mailbox.getMailboxId();
 
             switch (set.getType()) {
             case ONE:
-                results = findDeletedMessagesInMailboxWithUID(mailbox, from);
+                results = findDeletedMessagesInMailboxWithUID(mailboxId, from);
                 data = createMetaData(results);
-                deleteDeletedMessagesInMailboxWithUID(mailbox, from);
+                deleteDeletedMessagesInMailboxWithUID(mailboxId, from);
                 break;
             case RANGE:
-                results = findDeletedMessagesInMailboxBetweenUIDs(mailbox, from, to);
+                results = findDeletedMessagesInMailboxBetweenUIDs(mailboxId, from, to);
                 data = createMetaData(results);
-                deleteDeletedMessagesInMailboxBetweenUIDs(mailbox, from, to);
+                deleteDeletedMessagesInMailboxBetweenUIDs(mailboxId, from, to);
                 break;
             case FROM:
-                results = findDeletedMessagesInMailboxAfterUID(mailbox, from);
+                results = findDeletedMessagesInMailboxAfterUID(mailboxId, from);
                 data = createMetaData(results);
-                deleteDeletedMessagesInMailboxAfterUID(mailbox, from);
+                deleteDeletedMessagesInMailboxAfterUID(mailboxId, from);
                 break;
             default:
             case ALL:
-                results = findDeletedMessagesInMailbox(mailbox);
+                results = findDeletedMessagesInMailbox(mailboxId);
                 data = createMetaData(results);
-                deleteDeletedMessagesInMailbox(mailbox);
+                deleteDeletedMessagesInMailbox(mailboxId);
                 break;
             }
 
@@ -271,7 +277,7 @@ public class JPAMessageMapper extends AbstractMessageMapper<JPAId> implements Me
      *      MailboxMessage)
      */
     @Override
-    public MessageMetaData move(Mailbox<JPAId> mailbox, MailboxMessage<JPAId> 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");
     }
 
@@ -279,9 +285,9 @@ public class JPAMessageMapper extends AbstractMessageMapper<JPAId> implements Me
      * @see org.apache.james.mailbox.store.mail.AbstractMessageMapper#copy(Mailbox,
      *      long, long, MailboxMessage)
      */
-    protected MessageMetaData copy(Mailbox<JPAId> mailbox, long uid, long modSeq, MailboxMessage<JPAId> original)
+    protected MessageMetaData copy(Mailbox mailbox, long uid, long modSeq, MailboxMessage original)
             throws MailboxException {
-        MailboxMessage<JPAId> copy;
+        MailboxMessage copy;
         if (original instanceof JPAStreamingMailboxMessage) {
             copy = new JPAStreamingMailboxMessage((JPAMailbox) mailbox, uid, modSeq, original);
         } else if (original instanceof JPAEncryptedMailboxMessage) {
@@ -296,7 +302,7 @@ public class JPAMessageMapper extends AbstractMessageMapper<JPAId> implements Me
      * @see org.apache.james.mailbox.store.mail.AbstractMessageMapper#save(Mailbox,
      *      MailboxMessage)
      */
-    protected MessageMetaData save(Mailbox<JPAId> mailbox, MailboxMessage<JPAId> message) throws MailboxException {
+    protected MessageMetaData save(Mailbox mailbox, MailboxMessage message) throws MailboxException {
 
         try {
 
@@ -304,8 +310,9 @@ public class JPAMessageMapper extends AbstractMessageMapper<JPAId> implements Me
             // mailbox is already "JPA detached"
             // If we don't this, we will get an
             // org.apache.openjpa.persistence.ArgumentException.
+            JPAId mailboxId = (JPAId) mailbox.getMailboxId();
             ((AbstractJPAMailboxMessage) message)
-                    .setMailbox(getEntityManager().find(JPAMailbox.class, mailbox.getMailboxId().getRawId()));
+                    .setMailbox(getEntityManager().find(JPAMailbox.class, mailboxId.getRawId()));
 
             getEntityManager().persist(message);
             return new SimpleMessageMetaData(message);
@@ -317,9 +324,9 @@ public class JPAMessageMapper extends AbstractMessageMapper<JPAId> implements Me
     }
 
     @SuppressWarnings("unchecked")
-    private List<MailboxMessage<JPAId>> findMessagesInMailboxAfterUID(Mailbox<JPAId> mailbox, long uid, int batchSize) {
+    private List<MailboxMessage> findMessagesInMailboxAfterUID(JPAId mailboxId, long uid, int batchSize) {
         Query query = getEntityManager().createNamedQuery("findMessagesInMailboxAfterUID")
-                .setParameter("idParam", mailbox.getMailboxId().getRawId()).setParameter("uidParam", uid);
+                .setParameter("idParam", mailboxId.getRawId()).setParameter("uidParam", uid);
 
         if (batchSize > 0)
             query.setMaxResults(batchSize);
@@ -328,17 +335,17 @@ public class JPAMessageMapper extends AbstractMessageMapper<JPAId> implements Me
     }
 
     @SuppressWarnings("unchecked")
-    private List<MailboxMessage<JPAId>> findMessagesInMailboxWithUID(Mailbox<JPAId> mailbox, long uid) {
+    private List<MailboxMessage> findMessagesInMailboxWithUID(JPAId mailboxId, long uid) {
         return getEntityManager().createNamedQuery("findMessagesInMailboxWithUID")
-                .setParameter("idParam", mailbox.getMailboxId().getRawId()).setParameter("uidParam", uid).setMaxResults(1)
+                .setParameter("idParam", mailboxId.getRawId()).setParameter("uidParam", uid).setMaxResults(1)
                 .getResultList();
     }
 
     @SuppressWarnings("unchecked")
-    private List<MailboxMessage<JPAId>> findMessagesInMailboxBetweenUIDs(Mailbox<JPAId> mailbox, long from, long to,
+    private List<MailboxMessage> findMessagesInMailboxBetweenUIDs(JPAId mailboxId, long from, long to,
                                                                          int batchSize) {
         Query query = getEntityManager().createNamedQuery("findMessagesInMailboxBetweenUIDs")
-                .setParameter("idParam", mailbox.getMailboxId().getRawId()).setParameter("fromParam", from)
+                .setParameter("idParam", mailboxId.getRawId()).setParameter("fromParam", from)
                 .setParameter("toParam", to);
 
         if (batchSize > 0)
@@ -348,66 +355,66 @@ public class JPAMessageMapper extends AbstractMessageMapper<JPAId> implements Me
     }
 
     @SuppressWarnings("unchecked")
-    private List<MailboxMessage<JPAId>> findMessagesInMailbox(Mailbox<JPAId> mailbox, int batchSize) {
+    private List<MailboxMessage> findMessagesInMailbox(JPAId mailboxId, int batchSize) {
         Query query = getEntityManager().createNamedQuery("findMessagesInMailbox").setParameter("idParam",
-                mailbox.getMailboxId().getRawId());
+                mailboxId.getRawId());
         if (batchSize > 0)
             query.setMaxResults(batchSize);
         return query.getResultList();
     }
 
-    private Map<Long, MessageMetaData> createMetaData(List<MailboxMessage<JPAId>> uids) {
+    private Map<Long, MessageMetaData> createMetaData(List<MailboxMessage> uids) {
         final Map<Long, MessageMetaData> data = new HashMap<Long, MessageMetaData>();
-        for (MailboxMessage<JPAId> m : uids) {
+        for (MailboxMessage m : uids) {
             data.put(m.getUid(), new SimpleMessageMetaData(m));
         }
         return data;
     }
 
-    private int deleteDeletedMessagesInMailbox(Mailbox<JPAId> mailbox) {
+    private int deleteDeletedMessagesInMailbox(JPAId mailboxId) {
         return getEntityManager().createNamedQuery("deleteDeletedMessagesInMailbox")
-                .setParameter("idParam", mailbox.getMailboxId().getRawId()).executeUpdate();
+                .setParameter("idParam", mailboxId.getRawId()).executeUpdate();
     }
 
-    private int deleteDeletedMessagesInMailboxAfterUID(Mailbox<JPAId> mailbox, long uid) {
+    private int deleteDeletedMessagesInMailboxAfterUID(JPAId mailboxId, long uid) {
         return getEntityManager().createNamedQuery("deleteDeletedMessagesInMailboxAfterUID")
-                .setParameter("idParam", mailbox.getMailboxId().getRawId()).setParameter("uidParam", uid).executeUpdate();
+                .setParameter("idParam", mailboxId.getRawId()).setParameter("uidParam", uid).executeUpdate();
     }
 
-    private int deleteDeletedMessagesInMailboxWithUID(Mailbox<JPAId> mailbox, long uid) {
+    private int deleteDeletedMessagesInMailboxWithUID(JPAId mailboxId, long uid) {
         return getEntityManager().createNamedQuery("deleteDeletedMessagesInMailboxWithUID")
-                .setParameter("idParam", mailbox.getMailboxId().getRawId()).setParameter("uidParam", uid).executeUpdate();
+                .setParameter("idParam", mailboxId.getRawId()).setParameter("uidParam", uid).executeUpdate();
     }
 
-    private int deleteDeletedMessagesInMailboxBetweenUIDs(Mailbox<JPAId> mailbox, long from, long to) {
+    private int deleteDeletedMessagesInMailboxBetweenUIDs(JPAId mailboxId, long from, long to) {
         return getEntityManager().createNamedQuery("deleteDeletedMessagesInMailboxBetweenUIDs")
-                .setParameter("idParam", mailbox.getMailboxId().getRawId()).setParameter("fromParam", from)
+                .setParameter("idParam", mailboxId.getRawId()).setParameter("fromParam", from)
                 .setParameter("toParam", to).executeUpdate();
     }
 
     @SuppressWarnings("unchecked")
-    private List<MailboxMessage<JPAId>> findDeletedMessagesInMailbox(Mailbox<JPAId> mailbox) {
+    private List<MailboxMessage> findDeletedMessagesInMailbox(JPAId mailboxId) {
         return getEntityManager().createNamedQuery("findDeletedMessagesInMailbox")
-                .setParameter("idParam", mailbox.getMailboxId().getRawId()).getResultList();
+                .setParameter("idParam", mailboxId.getRawId()).getResultList();
     }
 
     @SuppressWarnings("unchecked")
-    private List<MailboxMessage<JPAId>> findDeletedMessagesInMailboxAfterUID(Mailbox<JPAId> mailbox, long uid) {
+    private List<MailboxMessage> findDeletedMessagesInMailboxAfterUID(JPAId mailboxId, long uid) {
         return getEntityManager().createNamedQuery("findDeletedMessagesInMailboxAfterUID")
-                .setParameter("idParam", mailbox.getMailboxId().getRawId()).setParameter("uidParam", uid).getResultList();
+                .setParameter("idParam", mailboxId.getRawId()).setParameter("uidParam", uid).getResultList();
     }
 
     @SuppressWarnings("unchecked")
-    private List<MailboxMessage<JPAId>> findDeletedMessagesInMailboxWithUID(Mailbox<JPAId> mailbox, long uid) {
+    private List<MailboxMessage> findDeletedMessagesInMailboxWithUID(JPAId mailboxId, long uid) {
         return getEntityManager().createNamedQuery("findDeletedMessagesInMailboxWithUID")
-                .setParameter("idParam", mailbox.getMailboxId().getRawId()).setParameter("uidParam", uid).setMaxResults(1)
+                .setParameter("idParam", mailboxId.getRawId()).setParameter("uidParam", uid).setMaxResults(1)
                 .getResultList();
     }
 
     @SuppressWarnings("unchecked")
-    private List<MailboxMessage<JPAId>> findDeletedMessagesInMailboxBetweenUIDs(Mailbox<JPAId> mailbox, long from, long to) {
+    private List<MailboxMessage> findDeletedMessagesInMailboxBetweenUIDs(JPAId mailboxId, long from, long to) {
         return getEntityManager().createNamedQuery("findDeletedMessagesInMailboxBetweenUIDs")
-                .setParameter("idParam", mailbox.getMailboxId().getRawId()).setParameter("fromParam", from)
+                .setParameter("idParam", mailboxId.getRawId()).setParameter("fromParam", from)
                 .setParameter("toParam", to).getResultList();
     }
 }

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/jpa/src/main/java/org/apache/james/mailbox/jpa/mail/JPAModSeqProvider.java
----------------------------------------------------------------------
diff --git a/mailbox/jpa/src/main/java/org/apache/james/mailbox/jpa/mail/JPAModSeqProvider.java b/mailbox/jpa/src/main/java/org/apache/james/mailbox/jpa/mail/JPAModSeqProvider.java
index ca7c9e7..7d002d6 100644
--- a/mailbox/jpa/src/main/java/org/apache/james/mailbox/jpa/mail/JPAModSeqProvider.java
+++ b/mailbox/jpa/src/main/java/org/apache/james/mailbox/jpa/mail/JPAModSeqProvider.java
@@ -30,7 +30,7 @@ import org.apache.james.mailbox.jpa.mail.model.JPAMailbox;
 import org.apache.james.mailbox.store.mail.AbstractLockingModSeqProvider;
 import org.apache.james.mailbox.store.mail.model.Mailbox;
 
-public class JPAModSeqProvider extends AbstractLockingModSeqProvider<JPAId> {
+public class JPAModSeqProvider extends AbstractLockingModSeqProvider {
 
     private final EntityManagerFactory factory;
 
@@ -40,12 +40,13 @@ public class JPAModSeqProvider extends AbstractLockingModSeqProvider<JPAId> {
     }
 
     @Override
-    public long highestModSeq(MailboxSession session, Mailbox<JPAId> mailbox) throws MailboxException {
+    public long highestModSeq(MailboxSession session, Mailbox mailbox) throws MailboxException {
         EntityManager manager = null;
         try {
             manager = factory.createEntityManager();
             manager.getTransaction().begin();
-            long highest = (Long) manager.createNamedQuery("findHighestModSeq").setParameter("idParam", mailbox.getMailboxId().getRawId()).getSingleResult();
+            JPAId mailboxId = (JPAId) mailbox.getMailboxId();
+            long highest = (Long) manager.createNamedQuery("findHighestModSeq").setParameter("idParam", mailboxId.getRawId()).getSingleResult();
             manager.getTransaction().commit();
             return highest;
         } catch (PersistenceException e) {
@@ -61,12 +62,13 @@ public class JPAModSeqProvider extends AbstractLockingModSeqProvider<JPAId> {
     }
 
     @Override
-    protected long lockedNextModSeq(MailboxSession session, Mailbox<JPAId> mailbox) throws MailboxException {
+    protected long lockedNextModSeq(MailboxSession session, Mailbox mailbox) throws MailboxException {
         EntityManager manager = null;
         try {
             manager = factory.createEntityManager();
             manager.getTransaction().begin();
-            JPAMailbox m = manager.find(JPAMailbox.class, mailbox.getMailboxId().getRawId());
+            JPAId mailboxId = (JPAId) mailbox.getMailboxId();
+            JPAMailbox m = manager.find(JPAMailbox.class, mailboxId.getRawId());
             long modSeq = m.consumeModSeq();
             manager.persist(m);
             manager.getTransaction().commit();

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/jpa/src/main/java/org/apache/james/mailbox/jpa/mail/JPAUidProvider.java
----------------------------------------------------------------------
diff --git a/mailbox/jpa/src/main/java/org/apache/james/mailbox/jpa/mail/JPAUidProvider.java b/mailbox/jpa/src/main/java/org/apache/james/mailbox/jpa/mail/JPAUidProvider.java
index 5d3e142..bd4f9c6 100644
--- a/mailbox/jpa/src/main/java/org/apache/james/mailbox/jpa/mail/JPAUidProvider.java
+++ b/mailbox/jpa/src/main/java/org/apache/james/mailbox/jpa/mail/JPAUidProvider.java
@@ -30,7 +30,7 @@ import org.apache.james.mailbox.jpa.mail.model.JPAMailbox;
 import org.apache.james.mailbox.store.mail.AbstractLockingUidProvider;
 import org.apache.james.mailbox.store.mail.model.Mailbox;
 
-public class JPAUidProvider extends AbstractLockingUidProvider<JPAId> {
+public class JPAUidProvider extends AbstractLockingUidProvider {
 
     private final EntityManagerFactory factory;
 
@@ -41,12 +41,13 @@ public class JPAUidProvider extends AbstractLockingUidProvider<JPAId> {
     
     
     @Override
-    public long lastUid(MailboxSession session, Mailbox<JPAId> mailbox) throws MailboxException {
+    public long lastUid(MailboxSession session, Mailbox mailbox) throws MailboxException {
         EntityManager manager = null;
         try {
             manager = factory.createEntityManager();
             manager.getTransaction().begin();
-            long uid = (Long) manager.createNamedQuery("findLastUid").setParameter("idParam", mailbox.getMailboxId().getRawId()).getSingleResult();
+            JPAId mailboxId = (JPAId) mailbox.getMailboxId();
+            long uid = (Long) manager.createNamedQuery("findLastUid").setParameter("idParam", mailboxId.getRawId()).getSingleResult();
             manager.getTransaction().commit();
             return uid;
         } catch (PersistenceException e) {
@@ -62,12 +63,13 @@ public class JPAUidProvider extends AbstractLockingUidProvider<JPAId> {
     }
 
     @Override
-    protected long lockedNextUid(MailboxSession session, Mailbox<JPAId> mailbox) throws MailboxException {
+    protected long lockedNextUid(MailboxSession session, Mailbox mailbox) throws MailboxException {
         EntityManager manager = null;
         try {
             manager = factory.createEntityManager();
             manager.getTransaction().begin();
-            JPAMailbox m = manager.find(JPAMailbox.class, mailbox.getMailboxId().getRawId());
+            JPAId mailboxId = (JPAId) mailbox.getMailboxId();
+            JPAMailbox m = manager.find(JPAMailbox.class, mailboxId.getRawId());
             long uid = m.consumeUid();
             manager.persist(m);
             manager.getTransaction().commit();

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/jpa/src/main/java/org/apache/james/mailbox/jpa/mail/model/JPAMailbox.java
----------------------------------------------------------------------
diff --git a/mailbox/jpa/src/main/java/org/apache/james/mailbox/jpa/mail/model/JPAMailbox.java b/mailbox/jpa/src/main/java/org/apache/james/mailbox/jpa/mail/model/JPAMailbox.java
index 4d91482..4129ba2 100644
--- a/mailbox/jpa/src/main/java/org/apache/james/mailbox/jpa/mail/model/JPAMailbox.java
+++ b/mailbox/jpa/src/main/java/org/apache/james/mailbox/jpa/mail/model/JPAMailbox.java
@@ -59,7 +59,7 @@ import org.apache.james.mailbox.store.mail.model.Mailbox;
     @NamedQuery(name="findLastUid",
         query="SELECT mailbox.lastUid FROM Mailbox mailbox WHERE mailbox.mailboxId = :idParam")
 })
-public class JPAMailbox implements Mailbox<JPAId> {
+public class JPAMailbox implements Mailbox {
     
     private static final String TAB = " ";
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/jpa/src/main/java/org/apache/james/mailbox/jpa/mail/model/openjpa/AbstractJPAMailboxMessage.java
----------------------------------------------------------------------
diff --git a/mailbox/jpa/src/main/java/org/apache/james/mailbox/jpa/mail/model/openjpa/AbstractJPAMailboxMessage.java b/mailbox/jpa/src/main/java/org/apache/james/mailbox/jpa/mail/model/openjpa/AbstractJPAMailboxMessage.java
index 1ea8aa8..8bef304 100644
--- a/mailbox/jpa/src/main/java/org/apache/james/mailbox/jpa/mail/model/openjpa/AbstractJPAMailboxMessage.java
+++ b/mailbox/jpa/src/main/java/org/apache/james/mailbox/jpa/mail/model/openjpa/AbstractJPAMailboxMessage.java
@@ -45,8 +45,8 @@ import org.apache.james.mailbox.jpa.JPAId;
 import org.apache.james.mailbox.jpa.mail.model.JPAMailbox;
 import org.apache.james.mailbox.jpa.mail.model.JPAProperty;
 import org.apache.james.mailbox.jpa.mail.model.JPAUserFlag;
-import org.apache.james.mailbox.store.mail.model.DelegatingMailboxMessage;
 import org.apache.james.mailbox.store.mail.model.DefaultMessageId;
+import org.apache.james.mailbox.store.mail.model.DelegatingMailboxMessage;
 import org.apache.james.mailbox.store.mail.model.FlagsBuilder;
 import org.apache.james.mailbox.store.mail.model.MailboxMessage;
 import org.apache.james.mailbox.store.mail.model.MessageId;
@@ -106,7 +106,7 @@ import org.apache.openjpa.persistence.jdbc.Index;
             query="DELETE FROM MailboxMessage message")
 })
 @MappedSuperclass
-public abstract class AbstractJPAMailboxMessage implements MailboxMessage<JPAId> {
+public abstract class AbstractJPAMailboxMessage implements MailboxMessage {
 
     private static final MessageUidComparator MESSAGE_UID_COMPARATOR = new MessageUidComparator();
     private static final String TOSTRING_SEPARATOR = " ";
@@ -278,7 +278,7 @@ public abstract class AbstractJPAMailboxMessage implements MailboxMessage<JPAId>
      * @param modSeq new modSeq
      * @param original message to be copied, not null
      */
-    public AbstractJPAMailboxMessage(JPAMailbox mailbox, long uid, long modSeq, MailboxMessage<?> original) throws MailboxException {
+    public AbstractJPAMailboxMessage(JPAMailbox mailbox, long uid, long modSeq, MailboxMessage original) throws MailboxException {
         super();
         this.mailbox = mailbox;
         this.uid = uid;
@@ -555,7 +555,7 @@ public abstract class AbstractJPAMailboxMessage implements MailboxMessage<JPAId>
     }
 
     @Override
-    public int compareTo(MailboxMessage<JPAId> 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/jpa/src/main/java/org/apache/james/mailbox/jpa/mail/model/openjpa/JPAEncryptedMailboxMessage.java
----------------------------------------------------------------------
diff --git a/mailbox/jpa/src/main/java/org/apache/james/mailbox/jpa/mail/model/openjpa/JPAEncryptedMailboxMessage.java b/mailbox/jpa/src/main/java/org/apache/james/mailbox/jpa/mail/model/openjpa/JPAEncryptedMailboxMessage.java
index 30f1d20..392dd59 100644
--- a/mailbox/jpa/src/main/java/org/apache/james/mailbox/jpa/mail/model/openjpa/JPAEncryptedMailboxMessage.java
+++ b/mailbox/jpa/src/main/java/org/apache/james/mailbox/jpa/mail/model/openjpa/JPAEncryptedMailboxMessage.java
@@ -79,7 +79,7 @@ public class JPAEncryptedMailboxMessage extends AbstractJPAMailboxMessage {
         /**
          * Create a copy of the given message
          */
-        public JPAEncryptedMailboxMessage(JPAMailbox mailbox, long uid, long modSeq, MailboxMessage<?> message) throws MailboxException{
+        public JPAEncryptedMailboxMessage(JPAMailbox mailbox, long uid, long modSeq, MailboxMessage message) throws MailboxException{
             super(mailbox, uid, modSeq, message);
             try {
                 this.body = IOUtils.toByteArray(message.getBodyContent());

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/jpa/src/main/java/org/apache/james/mailbox/jpa/mail/model/openjpa/JPAMailboxMessage.java
----------------------------------------------------------------------
diff --git a/mailbox/jpa/src/main/java/org/apache/james/mailbox/jpa/mail/model/openjpa/JPAMailboxMessage.java b/mailbox/jpa/src/main/java/org/apache/james/mailbox/jpa/mail/model/openjpa/JPAMailboxMessage.java
index 343cdd6..8f01525 100644
--- a/mailbox/jpa/src/main/java/org/apache/james/mailbox/jpa/mail/model/openjpa/JPAMailboxMessage.java
+++ b/mailbox/jpa/src/main/java/org/apache/james/mailbox/jpa/mail/model/openjpa/JPAMailboxMessage.java
@@ -73,7 +73,7 @@ public class JPAMailboxMessage extends AbstractJPAMailboxMessage {
     /**
      * Create a copy of the given message
      */
-    public JPAMailboxMessage(JPAMailbox mailbox, long uid, long modSeq, MailboxMessage<?> message) throws MailboxException{
+    public JPAMailboxMessage(JPAMailbox mailbox, long uid, long modSeq, MailboxMessage message) throws MailboxException{
         super(mailbox, uid, modSeq, message);
         try {
             this.body = IOUtils.toByteArray(message.getBodyContent());

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/jpa/src/main/java/org/apache/james/mailbox/jpa/mail/model/openjpa/JPAStreamingMailboxMessage.java
----------------------------------------------------------------------
diff --git a/mailbox/jpa/src/main/java/org/apache/james/mailbox/jpa/mail/model/openjpa/JPAStreamingMailboxMessage.java b/mailbox/jpa/src/main/java/org/apache/james/mailbox/jpa/mail/model/openjpa/JPAStreamingMailboxMessage.java
index 9ae171c..2083e1d 100644
--- a/mailbox/jpa/src/main/java/org/apache/james/mailbox/jpa/mail/model/openjpa/JPAStreamingMailboxMessage.java
+++ b/mailbox/jpa/src/main/java/org/apache/james/mailbox/jpa/mail/model/openjpa/JPAStreamingMailboxMessage.java
@@ -77,7 +77,7 @@ public class JPAStreamingMailboxMessage extends AbstractJPAMailboxMessage {
     /**
      * Create a copy of the given message
      */
-    public JPAStreamingMailboxMessage(JPAMailbox mailbox, long uid, long modSeq, MailboxMessage<?> message) throws MailboxException {
+    public JPAStreamingMailboxMessage(JPAMailbox mailbox, long uid, long modSeq, MailboxMessage message) throws MailboxException {
         super(mailbox, uid, modSeq, message);
         try {
             this.content = new SharedByteArrayInputStream(IOUtils.toByteArray(message.getFullContent()));

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/jpa/src/main/java/org/apache/james/mailbox/jpa/openjpa/OpenJPAMailboxManager.java
----------------------------------------------------------------------
diff --git a/mailbox/jpa/src/main/java/org/apache/james/mailbox/jpa/openjpa/OpenJPAMailboxManager.java b/mailbox/jpa/src/main/java/org/apache/james/mailbox/jpa/openjpa/OpenJPAMailboxManager.java
index 8a0df76..21e49df 100644
--- a/mailbox/jpa/src/main/java/org/apache/james/mailbox/jpa/openjpa/OpenJPAMailboxManager.java
+++ b/mailbox/jpa/src/main/java/org/apache/james/mailbox/jpa/openjpa/OpenJPAMailboxManager.java
@@ -25,7 +25,6 @@ import org.apache.james.mailbox.MailboxSession;
 import org.apache.james.mailbox.acl.GroupMembershipResolver;
 import org.apache.james.mailbox.acl.MailboxACLResolver;
 import org.apache.james.mailbox.exception.MailboxException;
-import org.apache.james.mailbox.jpa.JPAId;
 import org.apache.james.mailbox.jpa.JPAMailboxManager;
 import org.apache.james.mailbox.jpa.JPAMailboxSessionMapperFactory;
 import org.apache.james.mailbox.jpa.mail.model.openjpa.EncryptDecryptHelper;
@@ -67,7 +66,7 @@ public class OpenJPAMailboxManager extends JPAMailboxManager {
     }
 
     @Override
-    protected StoreMessageManager<JPAId> createMessageManager(Mailbox<JPAId> mailboxRow, MailboxSession session) throws MailboxException {
+    protected StoreMessageManager createMessageManager(Mailbox mailboxRow, MailboxSession session) throws MailboxException {
         return new OpenJPAMessageManager(getMapperFactory(),
             getMessageSearchIndex(),
             getEventDispatcher(),

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/jpa/src/main/java/org/apache/james/mailbox/jpa/openjpa/OpenJPAMessageManager.java
----------------------------------------------------------------------
diff --git a/mailbox/jpa/src/main/java/org/apache/james/mailbox/jpa/openjpa/OpenJPAMessageManager.java b/mailbox/jpa/src/main/java/org/apache/james/mailbox/jpa/openjpa/OpenJPAMessageManager.java
index 2b1e6b3..6e1f3bc 100644
--- a/mailbox/jpa/src/main/java/org/apache/james/mailbox/jpa/openjpa/OpenJPAMessageManager.java
+++ b/mailbox/jpa/src/main/java/org/apache/james/mailbox/jpa/openjpa/OpenJPAMessageManager.java
@@ -28,15 +28,14 @@ import org.apache.james.mailbox.MailboxPathLocker;
 import org.apache.james.mailbox.acl.GroupMembershipResolver;
 import org.apache.james.mailbox.acl.MailboxACLResolver;
 import org.apache.james.mailbox.exception.MailboxException;
-import org.apache.james.mailbox.jpa.JPAId;
 import org.apache.james.mailbox.jpa.JPAMessageManager;
 import org.apache.james.mailbox.jpa.mail.model.JPAMailbox;
 import org.apache.james.mailbox.jpa.mail.model.openjpa.JPAEncryptedMailboxMessage;
 import org.apache.james.mailbox.jpa.mail.model.openjpa.JPAStreamingMailboxMessage;
 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.event.MailboxEventDispatcher;
 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.PropertyBuilder;
@@ -55,17 +54,17 @@ public class OpenJPAMessageManager extends JPAMessageManager {
         Encryption
     }
     
-    public OpenJPAMessageManager(MailboxSessionMapperFactory<JPAId> mapperFactory, 
-    		MessageSearchIndex<JPAId> index,MailboxEventDispatcher<JPAId> dispatcher, 
-    		MailboxPathLocker locker, Mailbox<JPAId> mailbox, MailboxACLResolver aclResolver, 
+    public OpenJPAMessageManager(MailboxSessionMapperFactory mapperFactory, 
+    		MessageSearchIndex index,MailboxEventDispatcher dispatcher, 
+    		MailboxPathLocker locker, Mailbox mailbox, MailboxACLResolver aclResolver, 
     		GroupMembershipResolver groupMembershipResolver,
             QuotaManager quotaManager, QuotaRootResolver quotaRootResolver) throws MailboxException {
         this(mapperFactory, index, dispatcher, locker,  mailbox, AdvancedFeature.None, aclResolver, groupMembershipResolver, quotaManager, quotaRootResolver);
     }
 
-    public OpenJPAMessageManager(MailboxSessionMapperFactory<JPAId> mapperFactory, 
-    		MessageSearchIndex<JPAId> index, MailboxEventDispatcher<JPAId> dispatcher, 
-    		MailboxPathLocker locker, Mailbox<JPAId> mailbox, AdvancedFeature f, 
+    public OpenJPAMessageManager(MailboxSessionMapperFactory mapperFactory, 
+    		MessageSearchIndex index, MailboxEventDispatcher dispatcher, 
+    		MailboxPathLocker locker, Mailbox mailbox, AdvancedFeature f, 
     		MailboxACLResolver aclResolver, GroupMembershipResolver groupMembershipResolver,
             QuotaManager quotaManager, QuotaRootResolver quotaRootResolver) throws MailboxException {
     	
@@ -74,7 +73,7 @@ public class OpenJPAMessageManager extends JPAMessageManager {
     }
 
     @Override
-    protected MailboxMessage<JPAId> createMessage(Date internalDate, int size, int bodyStartOctet, SharedInputStream content, Flags flags, PropertyBuilder propertyBuilder) throws MailboxException {
+    protected MailboxMessage createMessage(Date internalDate, int size, int bodyStartOctet, SharedInputStream content, Flags flags, PropertyBuilder propertyBuilder) throws MailboxException {
         int headerEnd = bodyStartOctet -2;
         if (headerEnd < 0) {
             headerEnd = 0;


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