james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From btell...@apache.org
Subject svn commit: r1688109 [5/6] - in /james/mailbox/trunk: caching/src/main/java/org/apache/james/mailbox/caching/ caching/src/main/java/org/apache/james/mailbox/caching/guava/ cassandra/src/main/java/org/apache/james/mailbox/cassandra/ cassandra/src/main/j...
Date Mon, 29 Jun 2015 08:21:14 GMT
Modified: james/mailbox/trunk/memory/src/main/java/org/apache/james/mailbox/inmemory/mail/InMemoryUidProvider.java
URL: http://svn.apache.org/viewvc/james/mailbox/trunk/memory/src/main/java/org/apache/james/mailbox/inmemory/mail/InMemoryUidProvider.java?rev=1688109&r1=1688108&r2=1688109&view=diff
==============================================================================
--- james/mailbox/trunk/memory/src/main/java/org/apache/james/mailbox/inmemory/mail/InMemoryUidProvider.java (original)
+++ james/mailbox/trunk/memory/src/main/java/org/apache/james/mailbox/inmemory/mail/InMemoryUidProvider.java Mon Jun 29 08:21:12 2015
@@ -25,24 +25,25 @@ import java.util.concurrent.atomic.Atomi
 
 import org.apache.james.mailbox.MailboxSession;
 import org.apache.james.mailbox.exception.MailboxException;
+import org.apache.james.mailbox.inmemory.InMemoryId;
 import org.apache.james.mailbox.store.mail.UidProvider;
 import org.apache.james.mailbox.store.mail.model.Mailbox;
 
-public class InMemoryUidProvider implements UidProvider<Long>{
+public class InMemoryUidProvider implements UidProvider<InMemoryId>{
 
-    private final ConcurrentMap<Long, AtomicLong> map = new ConcurrentHashMap<Long, AtomicLong>();
+    private final ConcurrentMap<InMemoryId, AtomicLong> map = new ConcurrentHashMap<InMemoryId, AtomicLong>();
     
     @Override
-    public long nextUid(MailboxSession session, Mailbox<Long> mailbox) throws MailboxException {
+    public long nextUid(MailboxSession session, Mailbox<InMemoryId> mailbox) throws MailboxException {
         return getLast(mailbox.getMailboxId()).incrementAndGet();
     }
 
     @Override
-    public long lastUid(MailboxSession session, Mailbox<Long> mailbox) throws MailboxException {
+    public long lastUid(MailboxSession session, Mailbox<InMemoryId> mailbox) throws MailboxException {
         return getLast(mailbox.getMailboxId()).get();
     }
     
-    private AtomicLong getLast(Long id) {
+    private AtomicLong getLast(InMemoryId id) {
         AtomicLong uid = map.get(id);
         if (uid == null) {
             uid = new AtomicLong(0);

Modified: james/mailbox/trunk/memory/src/test/java/org/apache/james/mailbox/inmemory/InMemoryMailboxManagerTest.java
URL: http://svn.apache.org/viewvc/james/mailbox/trunk/memory/src/test/java/org/apache/james/mailbox/inmemory/InMemoryMailboxManagerTest.java?rev=1688109&r1=1688108&r2=1688109&view=diff
==============================================================================
--- james/mailbox/trunk/memory/src/test/java/org/apache/james/mailbox/inmemory/InMemoryMailboxManagerTest.java (original)
+++ james/mailbox/trunk/memory/src/test/java/org/apache/james/mailbox/inmemory/InMemoryMailboxManagerTest.java Mon Jun 29 08:21:12 2015
@@ -83,7 +83,7 @@ public class InMemoryMailboxManagerTest
         MailboxACLResolver aclResolver = new UnionMailboxACLResolver();
         GroupMembershipResolver groupMembershipResolver = new SimpleGroupMembershipResolver();
 
-        StoreMailboxManager<Long> mailboxManager = new StoreMailboxManager<Long>(factory, new MockAuthenticator(), aclResolver, groupMembershipResolver);
+        StoreMailboxManager<InMemoryId> mailboxManager = new StoreMailboxManager<InMemoryId>(factory, new MockAuthenticator(), aclResolver, groupMembershipResolver);
         mailboxManager.init();
         
         setMailboxManager(mailboxManager);

Modified: james/mailbox/trunk/memory/src/test/java/org/apache/james/mailbox/inmemory/InMemoryMailboxMapperTest.java
URL: http://svn.apache.org/viewvc/james/mailbox/trunk/memory/src/test/java/org/apache/james/mailbox/inmemory/InMemoryMailboxMapperTest.java?rev=1688109&r1=1688108&r2=1688109&view=diff
==============================================================================
--- james/mailbox/trunk/memory/src/test/java/org/apache/james/mailbox/inmemory/InMemoryMailboxMapperTest.java (original)
+++ james/mailbox/trunk/memory/src/test/java/org/apache/james/mailbox/inmemory/InMemoryMailboxMapperTest.java Mon Jun 29 08:21:12 2015
@@ -19,6 +19,8 @@
 
 package org.apache.james.mailbox.inmemory;
 
+import static org.assertj.core.api.Assertions.assertThat;
+
 import org.apache.james.mailbox.exception.MailboxException;
 import org.apache.james.mailbox.mock.MockMailboxSession;
 import org.apache.james.mailbox.model.MailboxPath;
@@ -28,8 +30,6 @@ import org.apache.james.mailbox.store.ma
 import org.junit.Before;
 import org.junit.Test;
 
-import static org.assertj.core.api.Assertions.assertThat;
-
 public class InMemoryMailboxMapperTest {
 
     public static final int UID_VALIDITY = 10;
@@ -40,11 +40,11 @@ public class InMemoryMailboxMapperTest {
     private MailboxPath user2OtherBoxPath;
     private MailboxPath user1OtherNamespacePath;
 
-    private Mailbox<Long> user1Inbox;
-    private Mailbox<Long> user1SubMailbox1;
-    private Mailbox<Long> user1SubMailbox2;
+    private Mailbox<InMemoryId> user1Inbox;
+    private Mailbox<InMemoryId> user1SubMailbox1;
+    private Mailbox<InMemoryId> user1SubMailbox2;
 
-    private MailboxMapper<Long> mapper;
+    private MailboxMapper<InMemoryId> mapper;
 
     @Before
     public void setUp() throws MailboxException {
@@ -53,15 +53,15 @@ public class InMemoryMailboxMapperTest {
         user1SubMailbox2Path = new MailboxPath("#private", "user1", "INBOX.sub2");
         user2OtherBoxPath = new MailboxPath("#private", "user2", "other.user");
         user1OtherNamespacePath = new MailboxPath("#namspace", "user1", "other.namespace");
-        user1Inbox = new SimpleMailbox<Long>(user1InboxPath, UID_VALIDITY);
-        user1SubMailbox1 = new SimpleMailbox<Long>(user1SubMailbox1Path, UID_VALIDITY);
-        user1SubMailbox2 = new SimpleMailbox<Long>(user1SubMailbox2Path, UID_VALIDITY);
+        user1Inbox = new SimpleMailbox<InMemoryId>(user1InboxPath, UID_VALIDITY);
+        user1SubMailbox1 = new SimpleMailbox<InMemoryId>(user1SubMailbox1Path, UID_VALIDITY);
+        user1SubMailbox2 = new SimpleMailbox<InMemoryId>(user1SubMailbox2Path, UID_VALIDITY);
         mapper = new InMemoryMailboxSessionMapperFactory().createMailboxMapper(new MockMailboxSession("user"));
         mapper.save(user1Inbox);
         mapper.save(user1SubMailbox1);
         mapper.save(user1SubMailbox2);
-        mapper.save(new SimpleMailbox<Long>(user2OtherBoxPath, UID_VALIDITY));
-        mapper.save(new SimpleMailbox<Long>(user1OtherNamespacePath, UID_VALIDITY));
+        mapper.save(new SimpleMailbox<InMemoryId>(user2OtherBoxPath, UID_VALIDITY));
+        mapper.save(new SimpleMailbox<InMemoryId>(user1OtherNamespacePath, UID_VALIDITY));
     }
 
     @Test

Modified: james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/MailboxEventDispatcher.java
URL: http://svn.apache.org/viewvc/james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/MailboxEventDispatcher.java?rev=1688109&r1=1688108&r2=1688109&view=diff
==============================================================================
--- james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/MailboxEventDispatcher.java (original)
+++ james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/MailboxEventDispatcher.java Mon Jun 29 08:21:12 2015
@@ -23,6 +23,7 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
 import java.util.SortedMap;
+
 import org.apache.james.mailbox.MailboxListener;
 import org.apache.james.mailbox.MailboxListener.MailboxAdded;
 import org.apache.james.mailbox.MailboxListener.MailboxDeletion;
@@ -30,12 +31,13 @@ import org.apache.james.mailbox.MailboxS
 import org.apache.james.mailbox.model.MailboxPath;
 import org.apache.james.mailbox.model.MessageMetaData;
 import org.apache.james.mailbox.model.UpdatedFlags;
+import org.apache.james.mailbox.store.mail.model.MailboxId;
 import org.apache.james.mailbox.store.mail.model.Mailbox;
 
 /**
  * Helper class to dispatch {@link org.apache.james.mailbox.MailboxListener.Event}'s to registerend MailboxListener
  */
-public class MailboxEventDispatcher<Id> {
+public class MailboxEventDispatcher<Id extends MailboxId> {
 
     
     private final MailboxListener listener;

Modified: james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/MailboxSessionMapperFactory.java
URL: http://svn.apache.org/viewvc/james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/MailboxSessionMapperFactory.java?rev=1688109&r1=1688108&r2=1688109&view=diff
==============================================================================
--- james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/MailboxSessionMapperFactory.java (original)
+++ james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/MailboxSessionMapperFactory.java Mon Jun 29 08:21:12 2015
@@ -26,6 +26,7 @@ import org.apache.james.mailbox.store.ma
 import org.apache.james.mailbox.store.mail.MailboxMapperFactory;
 import org.apache.james.mailbox.store.mail.MessageMapper;
 import org.apache.james.mailbox.store.mail.MessageMapperFactory;
+import org.apache.james.mailbox.store.mail.model.MailboxId;
 import org.apache.james.mailbox.store.transaction.Mapper;
 import org.apache.james.mailbox.store.user.SubscriptionMapper;
 import org.apache.james.mailbox.store.user.SubscriptionMapperFactory;
@@ -34,7 +35,7 @@ import org.apache.james.mailbox.store.us
  * Maintain mapper instances by {@link MailboxSession}. So only one mapper instance is used
  * in a {@link MailboxSession}
  */
-public abstract class MailboxSessionMapperFactory <Id> implements RequestAware, MailboxMapperFactory<Id>, MessageMapperFactory<Id>, SubscriptionMapperFactory{
+public abstract class MailboxSessionMapperFactory <Id extends MailboxId> implements RequestAware, MailboxMapperFactory<Id>, MessageMapperFactory<Id>, SubscriptionMapperFactory{
 
     protected final static String MESSAGEMAPPER ="MESSAGEMAPPER";
     protected final static String MAILBOXMAPPER ="MAILBOXMAPPER";

Modified: james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/StoreMailboxManager.java
URL: http://svn.apache.org/viewvc/james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/StoreMailboxManager.java?rev=1688109&r1=1688108&r2=1688109&view=diff
==============================================================================
--- james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/StoreMailboxManager.java (original)
+++ james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/StoreMailboxManager.java Mon Jun 29 08:21:12 2015
@@ -19,6 +19,13 @@
 
 package org.apache.james.mailbox.store;
 
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Locale;
+import java.util.Random;
+
 import org.apache.james.mailbox.MailboxListener;
 import org.apache.james.mailbox.MailboxManager;
 import org.apache.james.mailbox.MailboxPathLocker;
@@ -43,6 +50,7 @@ import org.apache.james.mailbox.model.Ma
 import org.apache.james.mailbox.model.MessageRange;
 import org.apache.james.mailbox.model.SimpleMailboxACL;
 import org.apache.james.mailbox.store.mail.MailboxMapper;
+import org.apache.james.mailbox.store.mail.model.MailboxId;
 import org.apache.james.mailbox.store.mail.model.Mailbox;
 import org.apache.james.mailbox.store.mail.model.impl.SimpleMailbox;
 import org.apache.james.mailbox.store.search.ListeningMessageSearchIndex;
@@ -52,13 +60,6 @@ import org.apache.james.mailbox.store.tr
 import org.apache.james.mailbox.store.transaction.TransactionalMapper;
 import org.slf4j.Logger;
 
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Locale;
-import java.util.Random;
-
 /**
  * This base class of an {@link MailboxManager} implementation provides a high-level api for writing your own
  * {@link MailboxManager} implementation. If you plan to write your own {@link MailboxManager} its most times so easiest
@@ -68,7 +69,7 @@ import java.util.Random;
  *
  * @param <Id>
  */
-public class StoreMailboxManager<Id> implements MailboxManager {
+public class StoreMailboxManager<Id extends MailboxId> implements MailboxManager {
 
     public static final char SQL_WILDCARD_CHAR = '%';
     public static final int DEFAULT_FETCH_BATCH_SIZE = 200;

Modified: james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/StoreMailboxPath.java
URL: http://svn.apache.org/viewvc/james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/StoreMailboxPath.java?rev=1688109&r1=1688108&r2=1688109&view=diff
==============================================================================
--- james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/StoreMailboxPath.java (original)
+++ james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/StoreMailboxPath.java Mon Jun 29 08:21:12 2015
@@ -20,9 +20,10 @@
 package org.apache.james.mailbox.store;
 
 import org.apache.james.mailbox.model.MailboxPath;
+import org.apache.james.mailbox.store.mail.model.MailboxId;
 import org.apache.james.mailbox.store.mail.model.Mailbox;
 
-public class StoreMailboxPath<Id> extends MailboxPath {
+public class StoreMailboxPath<Id extends MailboxId> extends MailboxPath {
 
     public StoreMailboxPath(String namespace, String user, String name) {
         super(namespace, user, name);

Modified: james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/StoreMessageManager.java
URL: http://svn.apache.org/viewvc/james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/StoreMessageManager.java?rev=1688109&r1=1688108&r2=1688109&view=diff
==============================================================================
--- james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/StoreMessageManager.java (original)
+++ james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/StoreMessageManager.java Mon Jun 29 08:21:12 2015
@@ -50,9 +50,6 @@ import org.apache.james.mailbox.exceptio
 import org.apache.james.mailbox.exception.ReadOnlyException;
 import org.apache.james.mailbox.exception.UnsupportedRightException;
 import org.apache.james.mailbox.model.MailboxACL;
-import org.apache.james.mailbox.model.MailboxACL.EditMode;
-import org.apache.james.mailbox.model.MailboxACL.MailboxACLEntryKey;
-import org.apache.james.mailbox.model.MailboxACL.MailboxACLRight;
 import org.apache.james.mailbox.model.MailboxACL.MailboxACLRights;
 import org.apache.james.mailbox.model.MessageMetaData;
 import org.apache.james.mailbox.model.MessageRange;
@@ -64,6 +61,7 @@ import org.apache.james.mailbox.model.Up
 import org.apache.james.mailbox.store.mail.MessageMapper;
 import org.apache.james.mailbox.store.mail.MessageMapper.FetchType;
 import org.apache.james.mailbox.store.mail.MessageMapperFactory;
+import org.apache.james.mailbox.store.mail.model.MailboxId;
 import org.apache.james.mailbox.store.mail.model.Mailbox;
 import org.apache.james.mailbox.store.mail.model.Message;
 import org.apache.james.mailbox.store.mail.model.impl.PropertyBuilder;
@@ -92,7 +90,7 @@ import org.apache.james.mime4j.stream.Re
  * 
  * 
  */
-public class StoreMessageManager<Id> implements org.apache.james.mailbox.MessageManager {
+public class StoreMessageManager<Id extends MailboxId> implements org.apache.james.mailbox.MessageManager {
 
     /**
      * The minimal Permanent flags the {@link MessageManager} must support. <br>

Modified: james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/StoreMessageResultIterator.java
URL: http://svn.apache.org/viewvc/james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/StoreMessageResultIterator.java?rev=1688109&r1=1688108&r2=1688109&view=diff
==============================================================================
--- james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/StoreMessageResultIterator.java (original)
+++ james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/StoreMessageResultIterator.java Mon Jun 29 08:21:12 2015
@@ -28,17 +28,18 @@ import org.apache.james.mailbox.exceptio
 import org.apache.james.mailbox.model.Content;
 import org.apache.james.mailbox.model.Headers;
 import org.apache.james.mailbox.model.MessageRange;
+import org.apache.james.mailbox.model.MessageRange.Type;
 import org.apache.james.mailbox.model.MessageResult;
+import org.apache.james.mailbox.model.MessageResult.FetchGroup;
 import org.apache.james.mailbox.model.MessageResultIterator;
 import org.apache.james.mailbox.model.MimeDescriptor;
-import org.apache.james.mailbox.model.MessageRange.Type;
-import org.apache.james.mailbox.model.MessageResult.FetchGroup;
 import org.apache.james.mailbox.store.mail.MessageMapper;
 import org.apache.james.mailbox.store.mail.MessageMapper.FetchType;
+import org.apache.james.mailbox.store.mail.model.MailboxId;
 import org.apache.james.mailbox.store.mail.model.Mailbox;
 import org.apache.james.mailbox.store.mail.model.Message;
 
-public class StoreMessageResultIterator<Id> implements MessageResultIterator {
+public class StoreMessageResultIterator<Id extends MailboxId> implements MessageResultIterator {
 
     private Iterator<Message<Id>> next = null;
     private MailboxException exception;
@@ -175,7 +176,7 @@ public class StoreMessageResultIterator<
         return exception;
     }
 
-    private static final class UnloadedMessageResult<Id> implements MessageResult {
+    private static final class UnloadedMessageResult<Id extends MailboxId> implements MessageResult {
         private final MailboxException exception;
 
         private final Date internalDate;

Modified: james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/mail/AbstractLockingModSeqProvider.java
URL: http://svn.apache.org/viewvc/james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/mail/AbstractLockingModSeqProvider.java?rev=1688109&r1=1688108&r2=1688109&view=diff
==============================================================================
--- james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/mail/AbstractLockingModSeqProvider.java (original)
+++ james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/mail/AbstractLockingModSeqProvider.java Mon Jun 29 08:21:12 2015
@@ -23,6 +23,7 @@ import org.apache.james.mailbox.MailboxP
 import org.apache.james.mailbox.MailboxSession;
 import org.apache.james.mailbox.exception.MailboxException;
 import org.apache.james.mailbox.store.StoreMailboxPath;
+import org.apache.james.mailbox.store.mail.model.MailboxId;
 import org.apache.james.mailbox.store.mail.model.Mailbox;
 
 /**
@@ -31,7 +32,7 @@ import org.apache.james.mailbox.store.ma
  *
  * @param <Id>
  */
-public abstract class AbstractLockingModSeqProvider<Id> implements ModSeqProvider<Id>{
+public abstract class AbstractLockingModSeqProvider<Id extends MailboxId> implements ModSeqProvider<Id>{
 
     private final MailboxPathLocker locker;
 

Modified: james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/mail/AbstractLockingUidProvider.java
URL: http://svn.apache.org/viewvc/james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/mail/AbstractLockingUidProvider.java?rev=1688109&r1=1688108&r2=1688109&view=diff
==============================================================================
--- james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/mail/AbstractLockingUidProvider.java (original)
+++ james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/mail/AbstractLockingUidProvider.java Mon Jun 29 08:21:12 2015
@@ -23,6 +23,7 @@ import org.apache.james.mailbox.MailboxP
 import org.apache.james.mailbox.MailboxSession;
 import org.apache.james.mailbox.exception.MailboxException;
 import org.apache.james.mailbox.store.StoreMailboxPath;
+import org.apache.james.mailbox.store.mail.model.MailboxId;
 import org.apache.james.mailbox.store.mail.model.Mailbox;
 
 
@@ -33,7 +34,7 @@ import org.apache.james.mailbox.store.ma
  *
  * @param <Id>
  */
-public abstract class AbstractLockingUidProvider<Id> implements UidProvider<Id>{
+public abstract class AbstractLockingUidProvider<Id extends MailboxId> implements UidProvider<Id>{
 
     private final MailboxPathLocker locker;
 

Modified: james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/mail/AbstractMessageMapper.java
URL: http://svn.apache.org/viewvc/james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/mail/AbstractMessageMapper.java?rev=1688109&r1=1688108&r2=1688109&view=diff
==============================================================================
--- james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/mail/AbstractMessageMapper.java (original)
+++ james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/mail/AbstractMessageMapper.java Mon Jun 29 08:21:12 2015
@@ -29,6 +29,7 @@ import org.apache.james.mailbox.exceptio
 import org.apache.james.mailbox.model.MessageMetaData;
 import org.apache.james.mailbox.model.MessageRange;
 import org.apache.james.mailbox.model.UpdatedFlags;
+import org.apache.james.mailbox.store.mail.model.MailboxId;
 import org.apache.james.mailbox.store.mail.model.Mailbox;
 import org.apache.james.mailbox.store.mail.model.Message;
 import org.apache.james.mailbox.store.transaction.TransactionalMapper;
@@ -39,7 +40,7 @@ import org.apache.james.mailbox.store.tr
  *
  * @param <Id>
  */
-public abstract class AbstractMessageMapper<Id> extends TransactionalMapper implements MessageMapper<Id>{
+public abstract class AbstractMessageMapper<Id extends MailboxId> extends TransactionalMapper implements MessageMapper<Id> {
     protected final MailboxSession mailboxSession;
     private final UidProvider<Id> uidProvider;
     private final ModSeqProvider<Id> modSeqProvider;

Modified: james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/mail/MailboxMapper.java
URL: http://svn.apache.org/viewvc/james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/mail/MailboxMapper.java?rev=1688109&r1=1688108&r2=1688109&view=diff
==============================================================================
--- james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/mail/MailboxMapper.java (original)
+++ james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/mail/MailboxMapper.java Mon Jun 29 08:21:12 2015
@@ -24,6 +24,7 @@ import org.apache.james.mailbox.exceptio
 import org.apache.james.mailbox.exception.MailboxNotFoundException;
 import org.apache.james.mailbox.model.MailboxACL;
 import org.apache.james.mailbox.model.MailboxPath;
+import org.apache.james.mailbox.store.mail.model.MailboxId;
 import org.apache.james.mailbox.store.mail.model.Mailbox;
 import org.apache.james.mailbox.store.transaction.Mapper;
 
@@ -32,7 +33,7 @@ import org.apache.james.mailbox.store.tr
  * to the end of the request.
  *
  */
-public interface MailboxMapper<Id> extends Mapper {
+public interface MailboxMapper<Id extends MailboxId> extends Mapper {
     
     /**
      * Save the give {@link Mailbox} to the underlying storage

Modified: james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/mail/MailboxMapperFactory.java
URL: http://svn.apache.org/viewvc/james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/mail/MailboxMapperFactory.java?rev=1688109&r1=1688108&r2=1688109&view=diff
==============================================================================
--- james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/mail/MailboxMapperFactory.java (original)
+++ james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/mail/MailboxMapperFactory.java Mon Jun 29 08:21:12 2015
@@ -20,8 +20,9 @@ package org.apache.james.mailbox.store.m
 
 import org.apache.james.mailbox.MailboxSession;
 import org.apache.james.mailbox.exception.MailboxException;
+import org.apache.james.mailbox.store.mail.model.MailboxId;
 
-public interface MailboxMapperFactory<Id> {
+public interface MailboxMapperFactory<Id extends MailboxId> {
 
     /**
      * Create a {@link MailboxMapper} instance or return the one which exists for the {@link MailboxSession} already

Modified: james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/mail/MessageMapper.java
URL: http://svn.apache.org/viewvc/james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/mail/MessageMapper.java?rev=1688109&r1=1688108&r2=1688109&view=diff
==============================================================================
--- james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/mail/MessageMapper.java (original)
+++ james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/mail/MessageMapper.java Mon Jun 29 08:21:12 2015
@@ -28,6 +28,7 @@ import org.apache.james.mailbox.exceptio
 import org.apache.james.mailbox.model.MessageMetaData;
 import org.apache.james.mailbox.model.MessageRange;
 import org.apache.james.mailbox.model.UpdatedFlags;
+import org.apache.james.mailbox.store.mail.model.MailboxId;
 import org.apache.james.mailbox.store.mail.model.Mailbox;
 import org.apache.james.mailbox.store.mail.model.Message;
 import org.apache.james.mailbox.store.mail.model.Property;
@@ -37,7 +38,7 @@ import org.apache.james.mailbox.store.tr
  * Maps {@link Message} in a {@link org.apache.james.mailbox.MessageManager}. A {@link MessageMapper} has a lifecycle from the start of a request 
  * to the end of the request.
  */
-public interface MessageMapper<Id> extends Mapper {
+public interface MessageMapper<Id extends MailboxId> extends Mapper {
 
     /**
      * Return a {@link Iterator} which holds the messages for the given criterias

Modified: james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/mail/MessageMapperFactory.java
URL: http://svn.apache.org/viewvc/james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/mail/MessageMapperFactory.java?rev=1688109&r1=1688108&r2=1688109&view=diff
==============================================================================
--- james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/mail/MessageMapperFactory.java (original)
+++ james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/mail/MessageMapperFactory.java Mon Jun 29 08:21:12 2015
@@ -20,8 +20,9 @@ package org.apache.james.mailbox.store.m
 
 import org.apache.james.mailbox.MailboxSession;
 import org.apache.james.mailbox.exception.MailboxException;
+import org.apache.james.mailbox.store.mail.model.MailboxId;
 
-public interface MessageMapperFactory<Id> {
+public interface MessageMapperFactory<Id extends MailboxId> {
 
     /**
      * Create a {@link MessageMapper} instance of return the one which exists for the {@link MailboxSession} already

Modified: james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/mail/ModSeqProvider.java
URL: http://svn.apache.org/viewvc/james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/mail/ModSeqProvider.java?rev=1688109&r1=1688108&r2=1688109&view=diff
==============================================================================
--- james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/mail/ModSeqProvider.java (original)
+++ james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/mail/ModSeqProvider.java Mon Jun 29 08:21:12 2015
@@ -20,6 +20,7 @@ package org.apache.james.mailbox.store.m
 
 import org.apache.james.mailbox.MailboxSession;
 import org.apache.james.mailbox.exception.MailboxException;
+import org.apache.james.mailbox.store.mail.model.MailboxId;
 import org.apache.james.mailbox.store.mail.model.Mailbox;
 
 /**
@@ -29,7 +30,7 @@ import org.apache.james.mailbox.store.ma
  *
  * @param <Id>
  */
-public interface ModSeqProvider<Id> {
+public interface ModSeqProvider<Id extends MailboxId> {
 
     /**
      * Return the next mod-sequence which can be used for the {@link Mailbox}.

Modified: james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/mail/UidProvider.java
URL: http://svn.apache.org/viewvc/james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/mail/UidProvider.java?rev=1688109&r1=1688108&r2=1688109&view=diff
==============================================================================
--- james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/mail/UidProvider.java (original)
+++ james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/mail/UidProvider.java Mon Jun 29 08:21:12 2015
@@ -20,6 +20,7 @@ package org.apache.james.mailbox.store.m
 
 import org.apache.james.mailbox.MailboxSession;
 import org.apache.james.mailbox.exception.MailboxException;
+import org.apache.james.mailbox.store.mail.model.MailboxId;
 import org.apache.james.mailbox.store.mail.model.Mailbox;
 
 /**
@@ -29,7 +30,7 @@ import org.apache.james.mailbox.store.ma
  *
  * @param <Id>
  */
-public interface UidProvider<Id> {
+public interface UidProvider<Id extends MailboxId> {
 
     /**
      * Return the next uid which can be used while append a Message to the {@link Mailbox}.

Modified: james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/mail/model/AbstractMessage.java
URL: http://svn.apache.org/viewvc/james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/mail/model/AbstractMessage.java?rev=1688109&r1=1688108&r2=1688109&view=diff
==============================================================================
--- james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/mail/model/AbstractMessage.java (original)
+++ james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/mail/model/AbstractMessage.java Mon Jun 29 08:21:12 2015
@@ -30,7 +30,7 @@ import javax.mail.Flags;
  * Abstract base class for {@link Message}
  *
  */
-public abstract class AbstractMessage<Id> implements Message<Id> {
+public abstract class AbstractMessage<Id extends MailboxId> implements Message<Id> {
     
 
     /**

Modified: james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/mail/model/Mailbox.java
URL: http://svn.apache.org/viewvc/james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/mail/model/Mailbox.java?rev=1688109&r1=1688108&r2=1688109&view=diff
==============================================================================
--- james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/mail/model/Mailbox.java (original)
+++ james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/mail/model/Mailbox.java Mon Jun 29 08:21:12 2015
@@ -23,7 +23,7 @@ import org.apache.james.mailbox.model.Ma
 /**
  * Models long term mailbox data.
  */
-public interface Mailbox<Id> {
+public interface Mailbox<Id extends MailboxId> {
 
     /**
      * Gets the unique mailbox ID.

Added: james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/mail/model/MailboxId.java
URL: http://svn.apache.org/viewvc/james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/mail/model/MailboxId.java?rev=1688109&view=auto
==============================================================================
--- james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/mail/model/MailboxId.java (added)
+++ james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/mail/model/MailboxId.java Mon Jun 29 08:21:12 2015
@@ -0,0 +1,23 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+package org.apache.james.mailbox.store.mail.model;
+
+public interface MailboxId {
+    String serialize();
+}

Modified: james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/mail/model/Message.java
URL: http://svn.apache.org/viewvc/james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/mail/model/Message.java?rev=1688109&r1=1688108&r2=1688109&view=diff
==============================================================================
--- james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/mail/model/Message.java (original)
+++ james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/mail/model/Message.java Mon Jun 29 08:21:12 2015
@@ -30,7 +30,7 @@ import javax.mail.Flags;
  * plus body content. In the case of multipart documents, this body content
  * has internal structure described by the meta-data.
  */
-public interface Message<Id> extends Comparable<Message<Id>>{
+public interface Message<Id extends MailboxId> extends Comparable<Message<Id>>{
 
     Date getInternalDate();
 

Modified: james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/mail/model/impl/SimpleMailbox.java
URL: http://svn.apache.org/viewvc/james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/mail/model/impl/SimpleMailbox.java?rev=1688109&r1=1688108&r2=1688109&view=diff
==============================================================================
--- james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/mail/model/impl/SimpleMailbox.java (original)
+++ james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/mail/model/impl/SimpleMailbox.java Mon Jun 29 08:21:12 2015
@@ -21,9 +21,10 @@ package org.apache.james.mailbox.store.m
 import org.apache.james.mailbox.model.MailboxACL;
 import org.apache.james.mailbox.model.MailboxPath;
 import org.apache.james.mailbox.model.SimpleMailboxACL;
+import org.apache.james.mailbox.store.mail.model.MailboxId;
 import org.apache.james.mailbox.store.mail.model.Mailbox;
 
-public class SimpleMailbox<Id> implements Mailbox<Id> {
+public class SimpleMailbox<Id extends MailboxId> implements Mailbox<Id> {
 
     private Id id = null;
     private String namespace;

Modified: james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/mail/model/impl/SimpleMessage.java
URL: http://svn.apache.org/viewvc/james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/mail/model/impl/SimpleMessage.java?rev=1688109&r1=1688108&r2=1688109&view=diff
==============================================================================
--- james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/mail/model/impl/SimpleMessage.java (original)
+++ james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/mail/model/impl/SimpleMessage.java Mon Jun 29 08:21:12 2015
@@ -32,11 +32,12 @@ import javax.mail.util.SharedByteArrayIn
 import org.apache.commons.io.IOUtils;
 import org.apache.james.mailbox.exception.MailboxException;
 import org.apache.james.mailbox.store.mail.model.AbstractMessage;
+import org.apache.james.mailbox.store.mail.model.MailboxId;
 import org.apache.james.mailbox.store.mail.model.Mailbox;
 import org.apache.james.mailbox.store.mail.model.Message;
 import org.apache.james.mailbox.store.mail.model.Property;
 
-public class SimpleMessage<Id> extends AbstractMessage<Id> {
+public class SimpleMessage<Id extends MailboxId> extends AbstractMessage<Id> {
 
     private long uid;
     private final Id mailboxId;

Modified: james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/quota/PerUserQuotaManager.java
URL: http://svn.apache.org/viewvc/james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/quota/PerUserQuotaManager.java?rev=1688109&r1=1688108&r2=1688109&view=diff
==============================================================================
--- james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/quota/PerUserQuotaManager.java (original)
+++ james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/quota/PerUserQuotaManager.java Mon Jun 29 08:21:12 2015
@@ -25,13 +25,14 @@ import org.apache.james.mailbox.MailboxS
 import org.apache.james.mailbox.exception.MailboxException;
 import org.apache.james.mailbox.model.Quota;
 import org.apache.james.mailbox.store.StoreMailboxManager;
+import org.apache.james.mailbox.store.mail.model.MailboxId;
 
 /**
  * Allows to set a per Users quota
  * 
  *
  */
-public class PerUserQuotaManager<Id> extends ListeningQuotaManager{
+public class PerUserQuotaManager<Id extends MailboxId> extends ListeningQuotaManager {
 
     public PerUserQuotaManager(StoreMailboxManager<Id> manager) throws MailboxException {
         super(manager);

Modified: james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/search/LazyMessageSearchIndex.java
URL: http://svn.apache.org/viewvc/james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/search/LazyMessageSearchIndex.java?rev=1688109&r1=1688108&r2=1688109&view=diff
==============================================================================
--- james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/search/LazyMessageSearchIndex.java (original)
+++ james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/search/LazyMessageSearchIndex.java Mon Jun 29 08:21:12 2015
@@ -28,6 +28,7 @@ import org.apache.james.mailbox.exceptio
 import org.apache.james.mailbox.model.MessageRange;
 import org.apache.james.mailbox.model.SearchQuery;
 import org.apache.james.mailbox.store.mail.MessageMapper.FetchType;
+import org.apache.james.mailbox.store.mail.model.MailboxId;
 import org.apache.james.mailbox.store.mail.model.Mailbox;
 import org.apache.james.mailbox.store.mail.model.Message;
 
@@ -41,7 +42,7 @@ import org.apache.james.mailbox.store.ma
  *
  * @param <Id>
  */
-public class LazyMessageSearchIndex<Id> extends ListeningMessageSearchIndex<Id> {
+public class LazyMessageSearchIndex<Id extends MailboxId> extends ListeningMessageSearchIndex<Id> {
 
     private ListeningMessageSearchIndex<Id> index;
     private final ConcurrentHashMap<Id, Object> indexed = new ConcurrentHashMap<Id, Object>();

Modified: james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/search/ListeningMessageSearchIndex.java
URL: http://svn.apache.org/viewvc/james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/search/ListeningMessageSearchIndex.java?rev=1688109&r1=1688108&r2=1688109&view=diff
==============================================================================
--- james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/search/ListeningMessageSearchIndex.java (original)
+++ james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/search/ListeningMessageSearchIndex.java Mon Jun 29 08:21:12 2015
@@ -34,6 +34,7 @@ import org.apache.james.mailbox.store.Ma
 import org.apache.james.mailbox.store.MailboxEventDispatcher.MailboxDeletionImpl;
 import org.apache.james.mailbox.store.mail.MessageMapper.FetchType;
 import org.apache.james.mailbox.store.mail.MessageMapperFactory;
+import org.apache.james.mailbox.store.mail.model.MailboxId;
 import org.apache.james.mailbox.store.mail.model.Mailbox;
 import org.apache.james.mailbox.store.mail.model.Message;
 
@@ -44,7 +45,7 @@ import org.apache.james.mailbox.store.ma
  *
  * @param <Id>
  */
-public abstract class ListeningMessageSearchIndex<Id> implements MessageSearchIndex<Id>, MailboxListener{
+public abstract class ListeningMessageSearchIndex<Id extends MailboxId> implements MessageSearchIndex<Id>, MailboxListener {
 
     private MessageMapperFactory<Id> factory;
 

Modified: james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/search/MessageSearchIndex.java
URL: http://svn.apache.org/viewvc/james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/search/MessageSearchIndex.java?rev=1688109&r1=1688108&r2=1688109&view=diff
==============================================================================
--- james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/search/MessageSearchIndex.java (original)
+++ james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/search/MessageSearchIndex.java Mon Jun 29 08:21:12 2015
@@ -24,6 +24,7 @@ import java.util.Iterator;
 import org.apache.james.mailbox.MailboxSession;
 import org.apache.james.mailbox.exception.MailboxException;
 import org.apache.james.mailbox.model.SearchQuery;
+import org.apache.james.mailbox.store.mail.model.MailboxId;
 import org.apache.james.mailbox.store.mail.model.Mailbox;
 
 
@@ -35,7 +36,7 @@ import org.apache.james.mailbox.store.ma
  *
  * @param <Id>
  */
-public interface MessageSearchIndex<Id> {
+public interface MessageSearchIndex<Id extends MailboxId> {
     
     /**
      * Return all uids of the previous indexed {@link Mailbox}'s which match the {@link SearchQuery}

Modified: james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/search/SimpleMessageSearchIndex.java
URL: http://svn.apache.org/viewvc/james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/search/SimpleMessageSearchIndex.java?rev=1688109&r1=1688108&r2=1688109&view=diff
==============================================================================
--- james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/search/SimpleMessageSearchIndex.java (original)
+++ james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/search/SimpleMessageSearchIndex.java Mon Jun 29 08:21:12 2015
@@ -34,6 +34,7 @@ import org.apache.james.mailbox.model.Se
 import org.apache.james.mailbox.store.mail.MessageMapper;
 import org.apache.james.mailbox.store.mail.MessageMapper.FetchType;
 import org.apache.james.mailbox.store.mail.MessageMapperFactory;
+import org.apache.james.mailbox.store.mail.model.MailboxId;
 import org.apache.james.mailbox.store.mail.model.Mailbox;
 import org.apache.james.mailbox.store.mail.model.Message;
 
@@ -46,7 +47,7 @@ import org.apache.james.mailbox.store.ma
  *
  * @param <Id>
  */
-public class SimpleMessageSearchIndex<Id> implements MessageSearchIndex<Id>{
+public class SimpleMessageSearchIndex<Id extends MailboxId> implements MessageSearchIndex<Id> {
 
     private final MessageMapperFactory<Id> factory;
     public SimpleMessageSearchIndex(MessageMapperFactory<Id> factory) {

Modified: james/mailbox/trunk/store/src/test/java/org/apache/james/mailbox/store/GroupFolderResolverTest.java
URL: http://svn.apache.org/viewvc/james/mailbox/trunk/store/src/test/java/org/apache/james/mailbox/store/GroupFolderResolverTest.java?rev=1688109&r1=1688108&r2=1688109&view=diff
==============================================================================
--- james/mailbox/trunk/store/src/test/java/org/apache/james/mailbox/store/GroupFolderResolverTest.java (original)
+++ james/mailbox/trunk/store/src/test/java/org/apache/james/mailbox/store/GroupFolderResolverTest.java Mon Jun 29 08:21:12 2015
@@ -43,7 +43,7 @@ public class GroupFolderResolverTest {
         SimpleMailboxSession mailboxSession = new SimpleMailboxSession(1, "username", "password", log, localePreferences, sharedSpaces, null, pathSeparator, SessionType.User);
         GroupFolderResolver testee =  new GroupFolderResolver(mailboxSession);
         
-        SimpleMailbox<Long> mailbox = new SimpleMailbox<Long>(new MailboxPath(null, "user", "name"), UID_VALIDITY);
+        SimpleMailbox<TestId> mailbox = new SimpleMailbox<TestId>(new MailboxPath(null, "user", "name"), UID_VALIDITY);
         assertThat(testee.isGroupFolder(mailbox)).isFalse();
     }
     
@@ -52,7 +52,7 @@ public class GroupFolderResolverTest {
         SimpleMailboxSession mailboxSession = new SimpleMailboxSession(1, "username", "password", log, localePreferences, sharedSpaces, null, pathSeparator, SessionType.User);
         GroupFolderResolver testee =  new GroupFolderResolver(mailboxSession);
         
-        SimpleMailbox<Long> mailbox = new SimpleMailbox<Long>(new MailboxPath(MailboxConstants.USER_NAMESPACE, "user", "name"), UID_VALIDITY);
+        SimpleMailbox<TestId> mailbox = new SimpleMailbox<TestId>(new MailboxPath(MailboxConstants.USER_NAMESPACE, "user", "name"), UID_VALIDITY);
         assertThat(testee.isGroupFolder(mailbox)).isFalse();
     }
     
@@ -62,7 +62,7 @@ public class GroupFolderResolverTest {
         SimpleMailboxSession mailboxSession = new SimpleMailboxSession(1, "username", "password", log, localePreferences, sharedSpaces, otherUsersSpace, pathSeparator, SessionType.User);
         GroupFolderResolver testee =  new GroupFolderResolver(mailboxSession);
         
-        SimpleMailbox<Long> mailbox = new SimpleMailbox<Long>(new MailboxPath("other", "user", "name"), UID_VALIDITY);
+        SimpleMailbox<TestId> mailbox = new SimpleMailbox<TestId>(new MailboxPath("other", "user", "name"), UID_VALIDITY);
         assertThat(testee.isGroupFolder(mailbox)).isFalse();
     }
     
@@ -72,7 +72,7 @@ public class GroupFolderResolverTest {
         SimpleMailboxSession mailboxSession = new SimpleMailboxSession(1, "username", "password", log, localePreferences, sharedSpaces, otherUsersSpace, pathSeparator, SessionType.User);
         GroupFolderResolver testee =  new GroupFolderResolver(mailboxSession);
         
-        SimpleMailbox<Long> mailbox = new SimpleMailbox<Long>(new MailboxPath("namespace", "user", "name"), UID_VALIDITY);
+        SimpleMailbox<TestId> mailbox = new SimpleMailbox<TestId>(new MailboxPath("namespace", "user", "name"), UID_VALIDITY);
         assertThat(testee.isGroupFolder(mailbox)).isTrue();
     }
 }

Modified: james/mailbox/trunk/store/src/test/java/org/apache/james/mailbox/store/MailboxEventDispatcherFlagsTest.java
URL: http://svn.apache.org/viewvc/james/mailbox/trunk/store/src/test/java/org/apache/james/mailbox/store/MailboxEventDispatcherFlagsTest.java?rev=1688109&r1=1688108&r2=1688109&view=diff
==============================================================================
--- james/mailbox/trunk/store/src/test/java/org/apache/james/mailbox/store/MailboxEventDispatcherFlagsTest.java (original)
+++ james/mailbox/trunk/store/src/test/java/org/apache/james/mailbox/store/MailboxEventDispatcherFlagsTest.java Mon Jun 29 08:21:12 2015
@@ -47,7 +47,7 @@ import org.junit.runner.RunWith;
 @RunWith(JMock.class)
 public class MailboxEventDispatcherFlagsTest {
 
-    MailboxEventDispatcher<Long> dispatcher;
+    MailboxEventDispatcher<TestId> dispatcher;
 
     EventCollector collector;
 
@@ -65,11 +65,11 @@ public class MailboxEventDispatcherFlags
 
     private Mockery mockery = new JUnit4Mockery();
 
-    private Mailbox<Long> mailbox = new Mailbox<Long>() {
+    private Mailbox<TestId> mailbox = new Mailbox<TestId>() {
 
         @Override
-        public Long getMailboxId() {
-            return 1L;
+        public TestId getMailboxId() {
+            return TestId.of(1L);
         }
 
         @Override
@@ -120,7 +120,7 @@ public class MailboxEventDispatcherFlags
     public void setUp() throws Exception {
         collector = new EventCollector();
 
-        dispatcher = new MailboxEventDispatcher<Long>(collector);
+        dispatcher = new MailboxEventDispatcher<TestId>(collector);
         result = mockery.mock(MessageResult.class);
         mockery.checking(new Expectations() {{
             allowing(result).getUid();will(returnValue(23L));

Modified: james/mailbox/trunk/store/src/test/java/org/apache/james/mailbox/store/MessageBuilder.java
URL: http://svn.apache.org/viewvc/james/mailbox/trunk/store/src/test/java/org/apache/james/mailbox/store/MessageBuilder.java?rev=1688109&r1=1688108&r2=1688109&view=diff
==============================================================================
--- james/mailbox/trunk/store/src/test/java/org/apache/james/mailbox/store/MessageBuilder.java (original)
+++ james/mailbox/trunk/store/src/test/java/org/apache/james/mailbox/store/MessageBuilder.java Mon Jun 29 08:21:12 2015
@@ -28,7 +28,7 @@ import org.apache.james.mailbox.store.ma
 
 public class MessageBuilder {
     
-    public long mailboxId = 113;
+    public TestId mailboxId = TestId.of(113);
     public long uid = 776;
     public Date internalDate = new Date();
     public int size = 8867;
@@ -37,8 +37,8 @@ public class MessageBuilder {
     public final Map<String, String> headers = new HashMap<String, String>();
     public int lineNumber = 0;
     
-    public Message<Long> build() throws Exception {
-        Message<Long> result = new SimpleMailboxMembership(mailboxId, uid, -1,  internalDate, size, flags, body, headers);
+    public Message<TestId> build() throws Exception {
+        Message<TestId> result = new SimpleMailboxMembership(mailboxId, uid, -1,  internalDate, size, flags, body, headers);
         return result;
     }
     
@@ -48,7 +48,7 @@ public class MessageBuilder {
 
     public void setKey(int mailboxId, int uid) {
         this.uid = uid;
-        this.mailboxId = mailboxId;
+        this.mailboxId = TestId.of(mailboxId);
     }
     
     public void setFlags(boolean seen, boolean flagged, boolean answered,

Modified: james/mailbox/trunk/store/src/test/java/org/apache/james/mailbox/store/MessageResultImplTest.java
URL: http://svn.apache.org/viewvc/james/mailbox/trunk/store/src/test/java/org/apache/james/mailbox/store/MessageResultImplTest.java?rev=1688109&r1=1688108&r2=1688109&view=diff
==============================================================================
--- james/mailbox/trunk/store/src/test/java/org/apache/james/mailbox/store/MessageResultImplTest.java (original)
+++ james/mailbox/trunk/store/src/test/java/org/apache/james/mailbox/store/MessageResultImplTest.java Mon Jun 29 08:21:12 2015
@@ -42,9 +42,9 @@ public class MessageResultImplTest {
     public void initNames() throws Exception
     {
         Date dateAB = new Date();
-        Message<Long> msgA = buildMessage(100, dateAB);
-        Message<Long> msgB = buildMessage(100, dateAB);
-        Message<Long> msgC = buildMessage(200, new Date());
+        Message<TestId> msgA = buildMessage(100, dateAB);
+        Message<TestId> msgB = buildMessage(100, dateAB);
+        Message<TestId> msgC = buildMessage(200, new Date());
         
         msgResultA = new MessageResultImpl(msgA);
         msgResultACopy = new MessageResultImpl(msgA);
@@ -53,7 +53,7 @@ public class MessageResultImplTest {
     }
 
 
-    private Message<Long> buildMessage(int uid, Date aDate) throws Exception {
+    private Message<TestId> buildMessage(int uid, Date aDate) throws Exception {
         MessageBuilder builder = new MessageBuilder();
         builder.uid = uid;
         builder.internalDate = aDate;

Modified: james/mailbox/trunk/store/src/test/java/org/apache/james/mailbox/store/SearchUtilsMultipartMixedTest.java
URL: http://svn.apache.org/viewvc/james/mailbox/trunk/store/src/test/java/org/apache/james/mailbox/store/SearchUtilsMultipartMixedTest.java?rev=1688109&r1=1688108&r2=1688109&view=diff
==============================================================================
--- james/mailbox/trunk/store/src/test/java/org/apache/james/mailbox/store/SearchUtilsMultipartMixedTest.java (original)
+++ james/mailbox/trunk/store/src/test/java/org/apache/james/mailbox/store/SearchUtilsMultipartMixedTest.java Mon Jun 29 08:21:12 2015
@@ -107,7 +107,7 @@ public class SearchUtilsMultipartMixedTe
             + "  Than both your poets can in praise devise.\r\n"
             + "\r\n--2.50290787509--\r\n" + "\r\n--1729--\r\n";
 
-    Message<Long> row;
+    Message<TestId> row;
 
 
     Collection<Long> recent;

Modified: james/mailbox/trunk/store/src/test/java/org/apache/james/mailbox/store/SearchUtilsRFC822Test.java
URL: http://svn.apache.org/viewvc/james/mailbox/trunk/store/src/test/java/org/apache/james/mailbox/store/SearchUtilsRFC822Test.java?rev=1688109&r1=1688108&r2=1688109&view=diff
==============================================================================
--- james/mailbox/trunk/store/src/test/java/org/apache/james/mailbox/store/SearchUtilsRFC822Test.java (original)
+++ james/mailbox/trunk/store/src/test/java/org/apache/james/mailbox/store/SearchUtilsRFC822Test.java Mon Jun 29 08:21:12 2015
@@ -47,7 +47,7 @@ public class SearchUtilsRFC822Test {
             + "It has " + RHUBARD + ".\r\n" + "It has " + CUSTARD + ".\r\n"
             + "It needs naught else.\r\n";
 
-    Message<Long> row;
+    Message<TestId> row;
 
     private Logger log = LoggerFactory.getLogger(getClass());
     Collection<Long> recent;

Modified: james/mailbox/trunk/store/src/test/java/org/apache/james/mailbox/store/SearchUtilsTest.java
URL: http://svn.apache.org/viewvc/james/mailbox/trunk/store/src/test/java/org/apache/james/mailbox/store/SearchUtilsTest.java?rev=1688109&r1=1688108&r2=1688109&view=diff
==============================================================================
--- james/mailbox/trunk/store/src/test/java/org/apache/james/mailbox/store/SearchUtilsTest.java (original)
+++ james/mailbox/trunk/store/src/test/java/org/apache/james/mailbox/store/SearchUtilsTest.java Mon Jun 29 08:21:12 2015
@@ -82,7 +82,7 @@ public class SearchUtilsTest {
     @Test
     public void testMatchSizeLessThan() throws Exception {
         builder.size = SIZE;
-        Message<Long> row = builder.build();
+        Message<TestId> row = builder.build();
         assertFalse(new MessageSearches().isMatch(SearchQuery.sizeLessThan(SIZE - 1), row,
                 recent, log));
         assertFalse(new MessageSearches().isMatch(SearchQuery.sizeLessThan(SIZE), row,
@@ -96,7 +96,7 @@ public class SearchUtilsTest {
     @Test
     public void testMatchSizeMoreThan() throws Exception {
         builder.size = SIZE;
-        Message<Long> row = builder.build();
+        Message<TestId> row = builder.build();
         assertTrue(new MessageSearches().isMatch(SearchQuery.sizeGreaterThan(SIZE - 1), row,
                 recent, log));
         assertFalse(new MessageSearches().isMatch(SearchQuery.sizeGreaterThan(SIZE), row,
@@ -110,7 +110,7 @@ public class SearchUtilsTest {
     @Test
     public void testMatchSizeEquals() throws Exception {
         builder.size = SIZE;
-        Message<Long> row = builder.build();
+        Message<TestId> row = builder.build();
         assertFalse(new MessageSearches().isMatch(SearchQuery.sizeEquals(SIZE - 1), row,
                 recent, log));
         assertTrue(new MessageSearches().isMatch(SearchQuery.sizeEquals(SIZE), row, recent, log));
@@ -123,7 +123,7 @@ public class SearchUtilsTest {
     @Test
     public void testMatchInternalDateEquals() throws Exception {
         builder.internalDate = SUN_SEP_9TH_2001;
-        Message<Long> row = builder.build();
+        Message<TestId> row = builder.build();
         assertFalse(new MessageSearches().isMatch(SearchQuery.internalDateOn(getDate(9, 9, 2000), DateResolution.Day),
                 row, recent, log));
         assertFalse(new MessageSearches().isMatch(SearchQuery.internalDateOn(getDate(8, 9, 2001), DateResolution.Day),
@@ -140,7 +140,7 @@ public class SearchUtilsTest {
     @Test
     public void testMatchInternalDateBefore() throws Exception {
         builder.internalDate = SUN_SEP_9TH_2001;
-        Message<Long> row = builder.build();
+        Message<TestId> row = builder.build();
         assertFalse(new MessageSearches().isMatch(
                 SearchQuery.internalDateBefore(getDate(9, 9, 2000), DateResolution.Day), row, recent, log));
         assertFalse(new MessageSearches().isMatch(
@@ -156,7 +156,7 @@ public class SearchUtilsTest {
     @Test
     public void testMatchInternalDateAfter() throws Exception {
         builder.internalDate = SUN_SEP_9TH_2001;
-        Message<Long> row = builder.build();
+        Message<TestId> row = builder.build();
         assertTrue(new MessageSearches().isMatch(SearchQuery.internalDateAfter(getDate(9, 9, 2000), DateResolution.Day),
                 row, recent, log));
         assertTrue(new MessageSearches().isMatch(SearchQuery.internalDateAfter(getDate(8, 9, 2001), DateResolution.Day),
@@ -172,7 +172,7 @@ public class SearchUtilsTest {
     @Test
     public void testMatchHeaderDateAfter() throws Exception {
         builder.header(DATE_FIELD, RFC822_SUN_SEP_9TH_2001);
-        Message<Long> row = builder.build();
+        Message<TestId> row = builder.build();
         assertTrue(new MessageSearches().isMatch(SearchQuery.headerDateAfter(DATE_FIELD, getDate(9,
                 9, 2000), DateResolution.Day), row, recent, log));
         assertTrue(new MessageSearches().isMatch(SearchQuery.headerDateAfter(DATE_FIELD, getDate(8,
@@ -190,7 +190,7 @@ public class SearchUtilsTest {
     @Test
     public void testShouldMatchCapsHeaderDateAfter() throws Exception {
         builder.header(DATE_FIELD.toUpperCase(), RFC822_SUN_SEP_9TH_2001);
-        Message<Long> row = builder.build();
+        Message<TestId> row = builder.build();
         assertTrue(new MessageSearches().isMatch(SearchQuery.headerDateAfter(DATE_FIELD, getDate(9,
                 9, 2000), DateResolution.Day), row, recent, log));
         assertTrue(new MessageSearches().isMatch(SearchQuery.headerDateAfter(DATE_FIELD, getDate(8,
@@ -208,7 +208,7 @@ public class SearchUtilsTest {
     @Test
     public void testShouldMatchLowersHeaderDateAfter() throws Exception {
         builder.header(DATE_FIELD.toLowerCase(), RFC822_SUN_SEP_9TH_2001);
-        Message<Long> row = builder.build();
+        Message<TestId> row = builder.build();
         assertTrue(new MessageSearches().isMatch(SearchQuery.headerDateAfter(DATE_FIELD, getDate(9,
                 9, 2000), DateResolution.Day), row, recent, log));
         assertTrue(new MessageSearches().isMatch(SearchQuery.headerDateAfter(DATE_FIELD, getDate(8,
@@ -226,7 +226,7 @@ public class SearchUtilsTest {
     @Test
     public void testMatchHeaderDateOn() throws Exception {
         builder.header(DATE_FIELD, RFC822_SUN_SEP_9TH_2001);
-        Message<Long> row = builder.build();
+        Message<TestId> row = builder.build();
         assertFalse(new MessageSearches().isMatch(SearchQuery.headerDateOn(DATE_FIELD, getDate(9, 9,
                 2000), DateResolution.Day),row, recent, log));
         assertFalse(new MessageSearches().isMatch(SearchQuery.headerDateOn(DATE_FIELD, getDate(8, 9,
@@ -244,7 +244,7 @@ public class SearchUtilsTest {
     @Test
     public void testShouldMatchCapsHeaderDateOn() throws Exception {
         builder.header(DATE_FIELD.toUpperCase(), RFC822_SUN_SEP_9TH_2001);
-        Message<Long> row = builder.build();
+        Message<TestId> row = builder.build();
         assertFalse(new MessageSearches().isMatch(SearchQuery.headerDateOn(DATE_FIELD, getDate(9, 9,
                 2000), DateResolution.Day),row, recent, log));
         assertFalse(new MessageSearches().isMatch(SearchQuery.headerDateOn(DATE_FIELD, getDate(8, 9,
@@ -262,7 +262,7 @@ public class SearchUtilsTest {
     @Test
     public void testShouldMatchLowersHeaderDateOn() throws Exception {
         builder.header(DATE_FIELD.toLowerCase(), RFC822_SUN_SEP_9TH_2001);
-        Message<Long> row = builder.build();
+        Message<TestId> row = builder.build();
         assertFalse(new MessageSearches().isMatch(SearchQuery.headerDateOn(DATE_FIELD, getDate(9, 9,
                 2000), DateResolution.Day),row, recent, log));
         assertFalse(new MessageSearches().isMatch(SearchQuery.headerDateOn(DATE_FIELD, getDate(8, 9,
@@ -280,7 +280,7 @@ public class SearchUtilsTest {
     @Test
     public void testMatchHeaderDateBefore() throws Exception {
         builder.header(DATE_FIELD.toLowerCase(), RFC822_SUN_SEP_9TH_2001);
-        Message<Long> row = builder.build();
+        Message<TestId> row = builder.build();
         assertFalse(new MessageSearches().isMatch(SearchQuery.headerDateBefore(DATE_FIELD,
                 getDate(9, 9, 2000), DateResolution.Day),row, recent, log));
         assertFalse(new MessageSearches().isMatch(SearchQuery.headerDateBefore(DATE_FIELD,
@@ -298,7 +298,7 @@ public class SearchUtilsTest {
     @Test
     public void testShouldMatchCapsHeaderDateBefore() throws Exception {
         builder.header(DATE_FIELD.toLowerCase(), RFC822_SUN_SEP_9TH_2001);
-        Message<Long> row = builder.build();
+        Message<TestId> row = builder.build();
         assertFalse(new MessageSearches().isMatch(SearchQuery.headerDateBefore(DATE_FIELD,
                 getDate(9, 9, 2000), DateResolution.Day),row, recent, log));
         assertFalse(new MessageSearches().isMatch(SearchQuery.headerDateBefore(DATE_FIELD,
@@ -316,7 +316,7 @@ public class SearchUtilsTest {
     @Test
     public void testShouldMatchLowersHeaderDateBefore() throws Exception {
         builder.header(DATE_FIELD.toLowerCase(), RFC822_SUN_SEP_9TH_2001);
-        Message<Long> row = builder.build();
+        Message<TestId> row = builder.build();
         assertFalse(new MessageSearches().isMatch(SearchQuery.headerDateBefore(DATE_FIELD,
                 getDate(9, 9, 2000), DateResolution.Day),row, recent, log));
         assertFalse(new MessageSearches().isMatch(SearchQuery.headerDateBefore(DATE_FIELD,
@@ -334,7 +334,7 @@ public class SearchUtilsTest {
     @Test
     public void testMatchHeaderContainsCaps() throws Exception {
         builder.header(SUBJECT_FIELD, TEXT.toUpperCase());
-        Message<Long> row = builder.build();
+        Message<TestId> row = builder.build();
         assertFalse(new MessageSearches().isMatch(SearchQuery.headerContains(DATE_FIELD,
                 CUSTARD), row, recent, log));
         assertFalse(new MessageSearches().isMatch(SearchQuery.headerContains(DATE_FIELD,
@@ -350,7 +350,7 @@ public class SearchUtilsTest {
     @Test
     public void testMatchHeaderContainsLowers() throws Exception {
         builder.header(SUBJECT_FIELD, TEXT.toUpperCase());
-        Message<Long> row = builder.build();
+        Message<TestId> row = builder.build();
         assertFalse(new MessageSearches().isMatch(SearchQuery.headerContains(DATE_FIELD,
                 CUSTARD), row, recent, log));
         assertFalse(new MessageSearches().isMatch(SearchQuery.headerContains(DATE_FIELD,
@@ -366,7 +366,7 @@ public class SearchUtilsTest {
     @Test
     public void testMatchHeaderContains() throws Exception {
         builder.header(SUBJECT_FIELD, TEXT.toUpperCase());
-        Message<Long> row = builder.build();
+        Message<TestId> row = builder.build();
         assertFalse(new MessageSearches().isMatch(SearchQuery.headerContains(DATE_FIELD,
                 CUSTARD), row, recent, log));
         assertFalse(new MessageSearches().isMatch(SearchQuery.headerContains(DATE_FIELD,
@@ -382,7 +382,7 @@ public class SearchUtilsTest {
     @Test
     public void testShouldMatchLowerHeaderContains() throws Exception {
         builder.header(SUBJECT_FIELD.toLowerCase(), TEXT);
-        Message<Long> row = builder.build();
+        Message<TestId> row = builder.build();
         assertFalse(new MessageSearches().isMatch(SearchQuery.headerContains(DATE_FIELD,
                 CUSTARD), row, recent, log));
         assertFalse(new MessageSearches().isMatch(SearchQuery.headerContains(DATE_FIELD,
@@ -398,7 +398,7 @@ public class SearchUtilsTest {
     @Test
     public void testShouldMatchCapsHeaderContains() throws Exception {
         builder.header(SUBJECT_FIELD.toUpperCase(), TEXT);
-        Message<Long> row = builder.build();
+        Message<TestId> row = builder.build();
         assertFalse(new MessageSearches().isMatch(SearchQuery.headerContains(DATE_FIELD,
                 CUSTARD), row, recent, log));
         assertFalse(new MessageSearches().isMatch(SearchQuery.headerContains(DATE_FIELD,
@@ -414,7 +414,7 @@ public class SearchUtilsTest {
     @Test
     public void testMatchHeaderExists() throws Exception {
         builder.header(SUBJECT_FIELD, TEXT);
-        Message<Long> row = builder.build();
+        Message<TestId> row = builder.build();
         assertFalse(new MessageSearches().isMatch(SearchQuery.headerExists(DATE_FIELD), row,
                 recent, log));
         assertTrue(new MessageSearches().isMatch(SearchQuery.headerExists(SUBJECT_FIELD),
@@ -424,7 +424,7 @@ public class SearchUtilsTest {
     @Test
     public void testShouldMatchLowersHeaderExists() throws Exception {
         builder.header(SUBJECT_FIELD.toLowerCase(), TEXT);
-        Message<Long> row = builder.build();
+        Message<TestId> row = builder.build();
         assertFalse(new MessageSearches().isMatch(SearchQuery.headerExists(DATE_FIELD), row,
                 recent, log));
         assertTrue(new MessageSearches().isMatch(SearchQuery.headerExists(SUBJECT_FIELD),
@@ -434,7 +434,7 @@ public class SearchUtilsTest {
     @Test
     public void testShouldMatchUppersHeaderExists() throws Exception {
         builder.header(SUBJECT_FIELD.toLowerCase(), TEXT);
-        Message<Long> row = builder.build();
+        Message<TestId> row = builder.build();
         assertFalse(new MessageSearches().isMatch(SearchQuery.headerExists(DATE_FIELD), row,
                 recent, log));
         assertTrue(new MessageSearches().isMatch(SearchQuery.headerExists(SUBJECT_FIELD),
@@ -444,7 +444,7 @@ public class SearchUtilsTest {
     @Test
     public void testShouldMatchUidRange() throws Exception {
         builder.setKey(1, 1729);
-        Message<Long> row = builder.build();
+        Message<TestId> row = builder.build();
         assertFalse(new MessageSearches().isMatch(SearchQuery.uid(range(1, 1)), row, recent, log));
         assertFalse(new MessageSearches().isMatch(SearchQuery.uid(range(1728, 1728)), row,
                 recent, log));
@@ -475,7 +475,7 @@ public class SearchUtilsTest {
     @Test
     public void testShouldMatchSeenFlagSet() throws Exception {
         builder.setFlags(true, false, false, false, false, false);
-        Message<Long> row = builder.build();
+        Message<TestId> row = builder.build();
         assertTrue(new MessageSearches().isMatch(SearchQuery.flagIsSet(Flags.Flag.SEEN),
                 row, recent, log));
         assertFalse(new MessageSearches().isMatch(SearchQuery.flagIsSet(Flags.Flag.FLAGGED),
@@ -493,7 +493,7 @@ public class SearchUtilsTest {
     @Test
     public void testShouldMatchAnsweredFlagSet() throws Exception {
         builder.setFlags(false, false, true, false, false, false);
-        Message<Long> row = builder.build();
+        Message<TestId> row = builder.build();
         assertFalse(new MessageSearches().isMatch(SearchQuery.flagIsSet(Flags.Flag.SEEN),
                 row, recent, log));
         assertFalse(new MessageSearches().isMatch(SearchQuery.flagIsSet(Flags.Flag.FLAGGED),
@@ -511,7 +511,7 @@ public class SearchUtilsTest {
     @Test
     public void testShouldMatchFlaggedFlagSet() throws Exception {
         builder.setFlags(false, true, false, false, false, false);
-        Message<Long> row = builder.build();
+        Message<TestId> row = builder.build();
         assertFalse(new MessageSearches().isMatch(SearchQuery.flagIsSet(Flags.Flag.SEEN),
                 row, recent, log));
         assertTrue(new MessageSearches().isMatch(SearchQuery.flagIsSet(Flags.Flag.FLAGGED),
@@ -529,7 +529,7 @@ public class SearchUtilsTest {
     @Test
     public void testShouldMatchDraftFlagSet() throws Exception {
         builder.setFlags(false, false, false, true, false, false);
-        Message<Long> row = builder.build();
+        Message<TestId> row = builder.build();
         assertFalse(new MessageSearches().isMatch(SearchQuery.flagIsSet(Flags.Flag.SEEN),
                 row, recent, log));
         assertFalse(new MessageSearches().isMatch(SearchQuery.flagIsSet(Flags.Flag.FLAGGED),
@@ -548,7 +548,7 @@ public class SearchUtilsTest {
     @Test
     public void testShouldMatchDeletedFlagSet() throws Exception {
         builder.setFlags(false, false, false, false, true, false);
-        Message<Long> row = builder.build();
+        Message<TestId> row = builder.build();
         assertFalse(new MessageSearches().isMatch(SearchQuery.flagIsSet(Flags.Flag.SEEN),
                 row, recent, log));
         assertFalse(new MessageSearches().isMatch(SearchQuery.flagIsSet(Flags.Flag.FLAGGED),
@@ -566,7 +566,7 @@ public class SearchUtilsTest {
     @Test
     public void testShouldMatchSeenRecentSet() throws Exception {
         builder.setFlags(false, false, false, false, false, false);
-        Message<Long> row = builder.build();
+        Message<TestId> row = builder.build();
         recent.add(new Long(row.getUid()));
         assertFalse(new MessageSearches().isMatch(SearchQuery.flagIsSet(Flags.Flag.SEEN),
                 row, recent, log));
@@ -585,7 +585,7 @@ public class SearchUtilsTest {
     @Test
     public void testShouldMatchSeenFlagUnSet() throws Exception {
         builder.setFlags(false, true, true, true, true, true);
-        Message<Long> row = builder.build();
+        Message<TestId> row = builder.build();
         recent.add(new Long(row.getUid()));
         assertTrue(new MessageSearches().isMatch(SearchQuery.flagIsUnSet(Flags.Flag.SEEN),
                 row, recent, log));
@@ -604,7 +604,7 @@ public class SearchUtilsTest {
     @Test
     public void testShouldMatchAnsweredFlagUnSet() throws Exception {
         builder.setFlags(true, true, false, true, true, true);
-        Message<Long> row = builder.build();
+        Message<TestId> row = builder.build();
         recent.add(new Long(row.getUid()));
         assertFalse(new MessageSearches().isMatch(SearchQuery.flagIsUnSet(Flags.Flag.SEEN),
                 row, recent, log));
@@ -623,7 +623,7 @@ public class SearchUtilsTest {
     @Test
     public void testShouldMatchFlaggedFlagUnSet() throws Exception {
         builder.setFlags(true, false, true, true, true, true);
-        Message<Long> row = builder.build();
+        Message<TestId> row = builder.build();
         recent.add(new Long(row.getUid()));
         assertFalse(new MessageSearches().isMatch(SearchQuery.flagIsUnSet(Flags.Flag.SEEN),
                 row, recent, log));
@@ -642,7 +642,7 @@ public class SearchUtilsTest {
     @Test
     public void testShouldMatchDraftFlagUnSet() throws Exception {
         builder.setFlags(true, true, true, false, true, true);
-        Message<Long> row = builder.build();
+        Message<TestId> row = builder.build();
         recent.add(new Long(row.getUid()));
         assertFalse(new MessageSearches().isMatch(SearchQuery.flagIsUnSet(Flags.Flag.SEEN),
                 row, recent, log));
@@ -661,7 +661,7 @@ public class SearchUtilsTest {
     @Test
     public void testShouldMatchDeletedFlagUnSet() throws Exception {
         builder.setFlags(true, true, true, true, false, true);
-        Message<Long> row = builder.build();
+        Message<TestId> row = builder.build();
         recent.add(new Long(row.getUid()));
         assertFalse(new MessageSearches().isMatch(SearchQuery.flagIsUnSet(Flags.Flag.SEEN),
                 row, recent, log));
@@ -680,7 +680,7 @@ public class SearchUtilsTest {
     @Test
     public void testShouldMatchSeenRecentUnSet() throws Exception {
         builder.setFlags(true, true, true, true, true, true);
-        Message<Long> row = builder.build();
+        Message<TestId> row = builder.build();
         recent.add(new Long(row.getUid() + 1));
         assertFalse(new MessageSearches().isMatch(SearchQuery.flagIsUnSet(Flags.Flag.SEEN),
                 row, recent, log));
@@ -698,13 +698,13 @@ public class SearchUtilsTest {
 
     @Test
     public void testShouldMatchAll() throws Exception {
-        Message<Long> row = builder.build();
+        Message<TestId> row = builder.build();
         assertTrue(new MessageSearches().isMatch(SearchQuery.all(), row, recent, log));
     }
 
     @Test
     public void testShouldMatchNot() throws Exception {
-        Message<Long> row = builder.build();
+        Message<TestId> row = builder.build();
         assertFalse(new MessageSearches().isMatch(SearchQuery.not(SearchQuery.all()), row,
                 recent, log));
         assertTrue(new MessageSearches().isMatch(SearchQuery.not(SearchQuery
@@ -713,7 +713,7 @@ public class SearchUtilsTest {
 
     @Test
     public void testShouldMatchOr() throws Exception {
-        Message<Long> row = builder.build();
+        Message<TestId> row = builder.build();
         assertTrue(new MessageSearches().isMatch(SearchQuery.or(SearchQuery.all(),
                 SearchQuery.headerExists(DATE_FIELD)), row, recent, log));
         assertTrue(new MessageSearches().isMatch(SearchQuery.or(SearchQuery
@@ -727,7 +727,7 @@ public class SearchUtilsTest {
 
     @Test
     public void testShouldMatchAnd() throws Exception {
-        Message<Long> row = builder.build();
+        Message<TestId> row = builder.build();
         assertFalse(new MessageSearches().isMatch(SearchQuery.and(SearchQuery.all(),
                 SearchQuery.headerExists(DATE_FIELD)), row, recent, log));
         assertFalse(new MessageSearches().isMatch(SearchQuery.and(SearchQuery
@@ -757,7 +757,7 @@ public class SearchUtilsTest {
     @Test
     public void testMatchHeaderDateOnWithOffset() throws Exception {
         builder.header(DATE_FIELD, "Mon, 26 Mar 2007 00:00:00 +0300");
-        Message<Long> row = builder.build();
+        Message<TestId> row = builder.build();
         assertTrue(new MessageSearches().isMatch(SearchQuery.headerDateOn(DATE_FIELD, getDate(26, 3,
                 2007), DateResolution.Day),row, recent, log));
         
@@ -771,7 +771,7 @@ public class SearchUtilsTest {
     @Test
     public void testShouldMatchHeaderDateBeforeWithOffset() throws Exception {
         builder.header(DATE_FIELD, "Mon, 26 Mar 2007 00:00:00 +0300");
-        Message<Long> row = builder.build();
+        Message<TestId> row = builder.build();
         assertFalse(new MessageSearches().isMatch(SearchQuery.headerDateBefore(DATE_FIELD, getDate(26, 3,
                 2007), DateResolution.Day),row, recent, log));
         
@@ -784,7 +784,7 @@ public class SearchUtilsTest {
     @Test
     public void testShouldMatchHeaderDateAfterWithOffset() throws Exception {
         builder.header(DATE_FIELD, "Mon, 26 Mar 2007 00:00:00 +0300");
-        Message<Long> row = builder.build();
+        Message<TestId> row = builder.build();
         assertFalse(new MessageSearches().isMatch(SearchQuery.headerDateAfter(DATE_FIELD, getDate(26, 3,
                 2007), DateResolution.Day),row, recent, log));
         
@@ -797,7 +797,7 @@ public class SearchUtilsTest {
     @Test
     public void testShouldMatchAddressHeaderWithComments() throws Exception {
         builder.header("To", "<user-from (comment)@ (comment) domain.org>");
-        Message<Long> row = builder.build();
+        Message<TestId> row = builder.build();
         assertTrue(new MessageSearches().isMatch(SearchQuery.address(AddressType.To, "user-from@domain.org"), row, recent, log));
         assertFalse(new MessageSearches().isMatch(SearchQuery.address(AddressType.From, "user-from@domain.org"), row, recent, log));
     }

Modified: james/mailbox/trunk/store/src/test/java/org/apache/james/mailbox/store/SimpleMailboxMembership.java
URL: http://svn.apache.org/viewvc/james/mailbox/trunk/store/src/test/java/org/apache/james/mailbox/store/SimpleMailboxMembership.java?rev=1688109&r1=1688108&r2=1688109&view=diff
==============================================================================
--- james/mailbox/trunk/store/src/test/java/org/apache/james/mailbox/store/SimpleMailboxMembership.java (original)
+++ james/mailbox/trunk/store/src/test/java/org/apache/james/mailbox/store/SimpleMailboxMembership.java Mon Jun 29 08:21:12 2015
@@ -38,11 +38,11 @@ import javax.mail.Flags;
 import org.apache.james.mailbox.store.mail.model.Message;
 import org.apache.james.mailbox.store.mail.model.Property;
 
-public class SimpleMailboxMembership implements Message<Long> {
+public class SimpleMailboxMembership implements Message<TestId> {
     
     private static final String TOSTRING_SEPARATOR = " ";
     
-    public long mailboxId;
+    public TestId mailboxId;
     public long uid;
     public Date internalDate;
     public boolean recent = false;
@@ -52,7 +52,7 @@ public class SimpleMailboxMembership imp
     public boolean flagged = false;
     public boolean seen = false;
 
-    public SimpleMailboxMembership(long mailboxId, long uid, long modSeq, Date internalDate, int size, 
+    public SimpleMailboxMembership(TestId mailboxId, long uid, long modSeq, Date internalDate, int size, 
             Flags flags, byte[] body, final Map<String, String> headers) throws Exception {
         super();
         this.mailboxId = mailboxId;
@@ -81,7 +81,7 @@ public class SimpleMailboxMembership imp
     /**
      * @see org.apache.james.imap.Message.mail.model.Document#getMailboxId()
      */
-    public Long getMailboxId() {
+    public TestId getMailboxId() {
         return mailboxId;
     }
     
@@ -184,7 +184,7 @@ public class SimpleMailboxMembership imp
     public int hashCode() {
         final int PRIME = 31;
         int result = 1;
-        result = PRIME * result + (int) (mailboxId ^ (mailboxId >>> 32));
+        result = PRIME * result + (int) (mailboxId.id ^ (mailboxId.id >>> 32));
         result = PRIME * result + (int) (uid ^ (uid >>> 32));
         return result;
     }
@@ -198,8 +198,8 @@ public class SimpleMailboxMembership imp
             return false;
         if (getClass() != obj.getClass())
             return false;
-        final Message<Long> other = (Message<Long>) obj;
-        if (mailboxId != other.getMailboxId())
+        final Message<TestId> other = (Message<TestId>) obj;
+        if (mailboxId.id != other.getMailboxId().id)
             return false;
         if (uid != other.getUid())
             return false;
@@ -296,7 +296,7 @@ public class SimpleMailboxMembership imp
     /**
      * @see java.lang.Comparable#compareTo(java.lang.Object)
      */
-    public int compareTo(Message<Long> other) {
+    public int compareTo(Message<TestId> other) {
         return (int) (getUid() - other.getUid());
     }
 

Modified: james/mailbox/trunk/store/src/test/java/org/apache/james/mailbox/store/StoreMessageResultIteratorTest.java
URL: http://svn.apache.org/viewvc/james/mailbox/trunk/store/src/test/java/org/apache/james/mailbox/store/StoreMessageResultIteratorTest.java?rev=1688109&r1=1688108&r2=1688109&view=diff
==============================================================================
--- james/mailbox/trunk/store/src/test/java/org/apache/james/mailbox/store/StoreMessageResultIteratorTest.java (original)
+++ james/mailbox/trunk/store/src/test/java/org/apache/james/mailbox/store/StoreMessageResultIteratorTest.java Mon Jun 29 08:21:12 2015
@@ -49,7 +49,7 @@ public class StoreMessageResultIteratorT
     public void testBatching() {
         MessageRange range = MessageRange.range(1, 10);
         int batchSize = 3;
-        StoreMessageResultIterator<Long> it = new StoreMessageResultIterator<Long>(new MessageMapper<Long>() {
+        StoreMessageResultIterator<TestId> it = new StoreMessageResultIterator<TestId>(new MessageMapper<TestId>() {
 
             @Override
             public void endRequest() {
@@ -62,7 +62,7 @@ public class StoreMessageResultIteratorT
             }
 
             @Override
-            public Iterator<Message<Long>> findInMailbox(Mailbox<Long> mailbox, MessageRange set,
+            public Iterator<Message<TestId>> findInMailbox(Mailbox<TestId> mailbox, MessageRange set,
                     org.apache.james.mailbox.store.mail.MessageMapper.FetchType type, int limit)
                     throws MailboxException {
                 long start = set.getUidFrom();
@@ -72,12 +72,12 @@ public class StoreMessageResultIteratorT
                     calcEnd = end;
                 }
 
-                List<Message<Long>> messages = new ArrayList<Message<Long>>();
+                List<Message<TestId>> messages = new ArrayList<Message<TestId>>();
                 long i = start;
                 while (i < calcEnd) {
                     long uid = i;
-                    SimpleMessage<Long> m = new SimpleMessage<Long>(null, 0, 0, new SharedByteArrayInputStream(
-                            "".getBytes()), new Flags(), new PropertyBuilder(), 1L);
+                    SimpleMessage<TestId> m = new SimpleMessage<TestId>(null, 0, 0, new SharedByteArrayInputStream(
+                            "".getBytes()), new Flags(), new PropertyBuilder(), TestId.of(1L));
                     m.setUid(uid);
                     messages.add(m);
                     i++;
@@ -86,68 +86,68 @@ public class StoreMessageResultIteratorT
             }
 
             @Override
-            public Map<Long, MessageMetaData> expungeMarkedForDeletionInMailbox(Mailbox<Long> mailbox, MessageRange set)
+            public Map<Long, MessageMetaData> expungeMarkedForDeletionInMailbox(Mailbox<TestId> mailbox, MessageRange set)
                     throws MailboxException {
                 throw new UnsupportedOperationException();
 
             }
 
             @Override
-            public long countMessagesInMailbox(Mailbox<Long> mailbox) throws MailboxException {
+            public long countMessagesInMailbox(Mailbox<TestId> mailbox) throws MailboxException {
                 throw new UnsupportedOperationException();
 
             }
 
             @Override
-            public long countUnseenMessagesInMailbox(Mailbox<Long> mailbox) throws MailboxException {
+            public long countUnseenMessagesInMailbox(Mailbox<TestId> mailbox) throws MailboxException {
                 throw new UnsupportedOperationException();
             }
 
             @Override
-            public void delete(Mailbox<Long> mailbox, Message<Long> message) throws MailboxException {
+            public void delete(Mailbox<TestId> mailbox, Message<TestId> message) throws MailboxException {
                 throw new UnsupportedOperationException();
             }
 
             @Override
-            public Long findFirstUnseenMessageUid(Mailbox<Long> mailbox) throws MailboxException {
+            public Long findFirstUnseenMessageUid(Mailbox<TestId> mailbox) throws MailboxException {
                 throw new UnsupportedOperationException();
             }
 
             @Override
-            public List<Long> findRecentMessageUidsInMailbox(Mailbox<Long> mailbox) throws MailboxException {
+            public List<Long> findRecentMessageUidsInMailbox(Mailbox<TestId> mailbox) throws MailboxException {
                 throw new UnsupportedOperationException();
 
             }
 
             @Override
-            public MessageMetaData add(Mailbox<Long> mailbox, Message<Long> message) throws MailboxException {
+            public MessageMetaData add(Mailbox<TestId> mailbox, Message<TestId> message) throws MailboxException {
                 throw new UnsupportedOperationException();
             }
 
             @Override
-            public Iterator<UpdatedFlags> updateFlags(Mailbox<Long> mailbox, Flags flags, boolean value,
+            public Iterator<UpdatedFlags> updateFlags(Mailbox<TestId> mailbox, Flags flags, boolean value,
                     boolean replace, MessageRange set) throws MailboxException {
                 throw new UnsupportedOperationException();
             }
 
             @Override
-            public MessageMetaData copy(Mailbox<Long> mailbox, Message<Long> original) throws MailboxException {
+            public MessageMetaData copy(Mailbox<TestId> mailbox, Message<TestId> original) throws MailboxException {
                 throw new UnsupportedOperationException();
 
             }
 
             @Override
-            public long getLastUid(Mailbox<Long> mailbox) throws MailboxException {
+            public long getLastUid(Mailbox<TestId> mailbox) throws MailboxException {
                 throw new UnsupportedOperationException();
             }
 
             @Override
-            public long getHighestModSeq(Mailbox<Long> mailbox) throws MailboxException {
+            public long getHighestModSeq(Mailbox<TestId> mailbox) throws MailboxException {
                 throw new UnsupportedOperationException();
             }
 
             @Override
-            public MessageMetaData move(Mailbox<Long> mailbox, Message<Long> original) throws MailboxException {
+            public MessageMetaData move(Mailbox<TestId> mailbox, Message<TestId> original) throws MailboxException {
                 throw new UnsupportedOperationException();
 
             }

Added: james/mailbox/trunk/store/src/test/java/org/apache/james/mailbox/store/TestId.java
URL: http://svn.apache.org/viewvc/james/mailbox/trunk/store/src/test/java/org/apache/james/mailbox/store/TestId.java?rev=1688109&view=auto
==============================================================================
--- james/mailbox/trunk/store/src/test/java/org/apache/james/mailbox/store/TestId.java (added)
+++ james/mailbox/trunk/store/src/test/java/org/apache/james/mailbox/store/TestId.java Mon Jun 29 08:21:12 2015
@@ -0,0 +1,65 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+package org.apache.james.mailbox.store;
+
+import org.apache.james.mailbox.store.mail.model.MailboxId;
+
+public class TestId implements MailboxId {
+
+    public static TestId of(long id) {
+        return new TestId(id);
+    }
+
+    public final Long id;
+
+    private TestId(long id) {
+        this.id = id;
+    }
+
+    @Override
+    public String serialize() {
+        return String.valueOf(id);
+    }
+
+    @Override
+    public int hashCode() {
+        final int prime = 31;
+        int result = 1;
+        result = prime * result + ((id == null) ? 0 : id.hashCode());
+        return result;
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (this == obj)
+            return true;
+        if (obj == null)
+            return false;
+        if (getClass() != obj.getClass())
+            return false;
+        TestId other = (TestId) obj;
+        if (id == null) {
+            if (other.id != null)
+                return false;
+        } else if (!id.equals(other.id))
+            return false;
+        return true;
+    }
+
+}
\ No newline at end of file

Modified: james/mailbox/trunk/store/src/test/java/org/apache/james/mailbox/store/mail/model/AbstractMailboxMapperTest.java
URL: http://svn.apache.org/viewvc/james/mailbox/trunk/store/src/test/java/org/apache/james/mailbox/store/mail/model/AbstractMailboxMapperTest.java?rev=1688109&r1=1688108&r2=1688109&view=diff
==============================================================================
--- james/mailbox/trunk/store/src/test/java/org/apache/james/mailbox/store/mail/model/AbstractMailboxMapperTest.java (original)
+++ james/mailbox/trunk/store/src/test/java/org/apache/james/mailbox/store/mail/model/AbstractMailboxMapperTest.java Mon Jun 29 08:21:12 2015
@@ -38,7 +38,7 @@ import static org.assertj.core.api.Asser
  * 
  * You then just need to instantiate your mailbox mapper and an IdGenerator.
  */
-public abstract class AbstractMailboxMapperTest<Id> {
+public abstract class AbstractMailboxMapperTest<Id extends MailboxId> {
     
     private final static char DELIMITER = ':';
     private final static char WILDCARD = '%';



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