james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From adup...@apache.org
Subject [13/13] james-project git commit: JAMES-1733 Remove generics from mailbox API
Date Tue, 17 May 2016 08:14:59 GMT
JAMES-1733 Remove generics from mailbox API


Project: http://git-wip-us.apache.org/repos/asf/james-project/repo
Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/7015d946
Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/7015d946
Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/7015d946

Branch: refs/heads/master
Commit: 7015d9461755089dc2afd9703bc549ec35228eb2
Parents: 52153c4
Author: Antoine Duprat <aduprat@linagora.com>
Authored: Wed May 4 15:38:05 2016 +0200
Committer: Antoine Duprat <aduprat@linagora.com>
Committed: Tue May 17 09:10:01 2016 +0200

----------------------------------------------------------------------
 .../CacheInvalidatingMailboxListener.java       |  10 +-
 .../mailbox/caching/CachingMailboxMapper.java   |  26 ++-
 .../CachingMailboxSessionMapperFactory.java     |  22 ++-
 .../mailbox/caching/CachingMessageMapper.java   |  38 ++--
 .../mailbox/caching/MailboxByPathCache.java     |  10 +-
 .../mailbox/caching/MailboxMetadataCache.java   |  26 ++-
 .../caching/guava/GuavaMailboxByPathCache.java  |  24 ++-
 .../guava/GuavaMailboxMetadataCache.java        |  53 +++---
 .../CassandraMailboxIdDeserializer.java         |   6 +-
 .../cassandra/CassandraMailboxManager.java      |  10 +-
 .../CassandraMailboxSessionMapperFactory.java   |  17 +-
 .../cassandra/CassandraMessageManager.java      |   6 +-
 .../cassandra/mail/CassandraACLMapper.java      |  17 +-
 .../cassandra/mail/CassandraMailboxMapper.java  |  32 ++--
 .../cassandra/mail/CassandraMessageMapper.java  | 140 ++++++++-------
 .../cassandra/mail/CassandraModSeqProvider.java |  29 ++--
 .../cassandra/mail/CassandraUidProvider.java    |  39 +++--
 ...assandraMailboxSessionMapperFactoryTest.java |  12 +-
 ...istributedMailboxDelegatingListenerTest.java |  28 +--
 .../cassandra/mail/CassandraACLMapperTest.java  |  12 +-
 .../mail/CassandraMailboxMapperTest.java        |   3 +-
 .../mail/CassandraMailboxMessageMapperTest.java |   3 +-
 .../cassandra/mail/CassandraMapperProvider.java |   6 +-
 .../mail/CassandraMessageMoveTest.java          |   3 +-
 .../mail/CassandraModSeqProviderTest.java       |   5 +-
 .../mail/CassandraUidProviderTest.java          |   5 +-
 ...lasticSearchListeningMessageSearchIndex.java |  23 ++-
 .../elasticsearch/json/IndexableMessage.java    |  29 ++--
 .../json/MessageToElasticSearchJson.java        |   9 +-
 .../search/ElasticSearchSearcher.java           |   7 +-
 .../ElasticSearchIntegrationTest.java           |  20 +--
 ...hListeningMailboxMessageSearchIndexTest.java |  40 ++---
 .../MailboxMessageToElasticSearchJsonTest.java  |  47 ++---
 .../hbase/HBaseMailboxIdDeserializer.java       |   5 +-
 .../mailbox/hbase/HBaseMailboxManager.java      |   6 +-
 .../hbase/HBaseMailboxSessionMapperFactory.java |  16 +-
 .../mailbox/hbase/HBaseMessageManager.java      |   8 +-
 .../apache/james/mailbox/hbase/HBaseUtils.java  |  14 +-
 .../mailbox/hbase/mail/HBaseMailboxMapper.java  |  25 +--
 .../mailbox/hbase/mail/HBaseMailboxMessage.java |   6 +-
 .../mailbox/hbase/mail/HBaseMessageMapper.java  | 173 ++++++++++---------
 .../mailbox/hbase/mail/HBaseModSeqProvider.java |  12 +-
 .../mailbox/hbase/mail/HBaseUidProvider.java    |  12 +-
 .../mailbox/hbase/mail/model/HBaseMailbox.java  |   2 +-
 .../HBaseMailboxSessionMapperFactoryTest.java   |  30 +++-
 .../james/mailbox/hbase/HBaseUtilsTest.java     |   2 +-
 .../hbase/mail/HBaseMailboxMapperTest.java      |   5 +-
 .../mail/HBaseMailboxMessageMapperTest.java     |  56 +++---
 .../mailbox/jcr/JCRMailboxIdDeserializer.java   |   2 +-
 .../james/mailbox/jcr/JCRMailboxManager.java    |   6 +-
 .../jcr/JCRMailboxSessionMapperFactory.java     |  14 +-
 .../james/mailbox/jcr/JCRMessageManager.java    |  13 +-
 .../mailbox/jcr/mail/JCRMailboxMapper.java      |  21 ++-
 .../mailbox/jcr/mail/JCRMessageMapper.java      |  67 ++++---
 .../mailbox/jcr/mail/JCRModSeqProvider.java     |   7 +-
 .../james/mailbox/jcr/mail/JCRUidProvider.java  |   7 +-
 .../mailbox/jcr/mail/model/JCRMailbox.java      |   2 +-
 .../jcr/mail/model/JCRMailboxMessage.java       |   4 +-
 .../jcr/JCRMailboxIdDeserializerTest.java       |   2 +-
 .../mailbox/jpa/JPAMailboxIdDeserializer.java   |   2 +-
 .../james/mailbox/jpa/JPAMailboxManager.java    |   4 +-
 .../jpa/JPAMailboxSessionMapperFactory.java     |  12 +-
 .../james/mailbox/jpa/JPAMessageManager.java    |  12 +-
 .../mailbox/jpa/mail/JPAMailboxMapper.java      |  24 +--
 .../mailbox/jpa/mail/JPAMessageMapper.java      | 127 +++++++-------
 .../mailbox/jpa/mail/JPAModSeqProvider.java     |  12 +-
 .../james/mailbox/jpa/mail/JPAUidProvider.java  |  12 +-
 .../mailbox/jpa/mail/model/JPAMailbox.java      |   2 +-
 .../openjpa/AbstractJPAMailboxMessage.java      |   8 +-
 .../openjpa/JPAEncryptedMailboxMessage.java     |   2 +-
 .../mail/model/openjpa/JPAMailboxMessage.java   |   2 +-
 .../openjpa/JPAStreamingMailboxMessage.java     |   2 +-
 .../jpa/openjpa/OpenJPAMailboxManager.java      |   3 +-
 .../jpa/openjpa/OpenJPAMessageManager.java      |  17 +-
 .../lucene/search/LuceneMessageSearchIndex.java |  35 ++--
 .../LuceneMailboxMessageSearchIndexTest.java    |   8 +-
 .../maildir/MaildirMailboxIdDeserializer.java   |   2 +-
 .../MaildirMailboxSessionMapperFactory.java     |   6 +-
 .../james/mailbox/maildir/MaildirStore.java     |  22 +--
 .../maildir/mail/MaildirMailboxMapper.java      |  42 ++---
 .../maildir/mail/MaildirMessageMapper.java      |  55 +++---
 .../mail/model/MaildirMailboxMessage.java       |   8 +-
 .../MaildirMailboxIdDeserializerTest.java       |   2 +-
 .../maildir/MaildirMailboxManagerTest.java      |   2 +-
 .../mailbox/maildir/MaildirStressTest.java      |   4 +-
 .../inmemory/InMemoryMailboxIdDeserializer.java |   2 +-
 .../inmemory/InMemoryMailboxManager.java        |   7 +-
 .../InMemoryMailboxSessionMapperFactory.java    |  10 +-
 .../inmemory/InMemoryMessageManager.java        |   4 +-
 .../inmemory/mail/InMemoryMailboxMapper.java    |  40 ++---
 .../inmemory/mail/InMemoryMessageMapper.java    |  76 ++++----
 .../inmemory/mail/InMemoryModSeqProvider.java   |  10 +-
 .../inmemory/mail/InMemoryUidProvider.java      |  10 +-
 .../quota/InMemoryCurrentQuotaManager.java      |  12 +-
 .../InMemoryMailboxIdDeserializerTest.java      |   6 +-
 .../inmemory/InMemoryMailboxManagerTest.java    |   6 +-
 .../inmemory/InMemoryMailboxMapperTest.java     |  21 +--
 .../mail/InMemoryMailboxMapperTest.java         |   3 +-
 .../inmemory/mail/InMemoryMapperProvider.java   |   6 +-
 .../mail/InMemoryMessageMapperTest.java         |   3 +-
 .../inmemory/mail/InMemoryMessageMoveTest.java  |   3 +-
 .../manager/InMemoryIntegrationResources.java   |  11 +-
 .../quota/InMemoryCurrentQuotaManagerTest.java  |   5 +-
 .../mailbox/store/GroupFolderResolver.java      |   2 +-
 .../store/MailboxSessionMapperFactory.java      |  22 +--
 .../james/mailbox/store/MessageResultImpl.java  |   4 +-
 .../apache/james/mailbox/store/ResultUtils.java |  20 +--
 .../mailbox/store/SimpleMessageMetaData.java    |   2 +-
 .../mailbox/store/StoreMailboxManager.java      | 106 ++++++------
 .../james/mailbox/store/StoreMailboxPath.java   |   5 +-
 .../mailbox/store/StoreMessageManager.java      |  93 +++++-----
 .../store/StoreMessageResultIterator.java       |  22 ++-
 .../james/mailbox/store/event/EventFactory.java | 102 +++++------
 .../store/event/MailboxEventDispatcher.java     |  19 +-
 .../store/json/JacksonEventSerializer.java      |  10 +-
 .../mailbox/store/json/JsonEventSerializer.java |   5 +-
 .../store/json/MessagePackEventSerializer.java  |   8 +-
 .../store/json/event/EventConverter.java        |  29 ++--
 .../store/json/event/MailboxConverter.java      |  23 ++-
 .../mail/AbstractLockingModSeqProvider.java     |  10 +-
 .../store/mail/AbstractLockingUidProvider.java  |  10 +-
 .../store/mail/AbstractMessageMapper.java       |  28 ++-
 .../james/mailbox/store/mail/MailboxMapper.java |  17 +-
 .../store/mail/MailboxMapperFactory.java        |   5 +-
 .../james/mailbox/store/mail/MessageMapper.java |  29 ++--
 .../store/mail/MessageMapperFactory.java        |   5 +-
 .../mailbox/store/mail/ModSeqProvider.java      |   8 +-
 .../james/mailbox/store/mail/UidProvider.java   |   8 +-
 .../mail/model/DelegatingMailboxMessage.java    |   4 +-
 .../mailbox/store/mail/model/FlagsBuilder.java  |   2 +-
 .../james/mailbox/store/mail/model/Mailbox.java |   4 +-
 .../store/mail/model/MailboxIdDeserializer.java |   4 +-
 .../store/mail/model/MailboxMessage.java        |   4 +-
 .../mail/model/impl/MessageUidComparator.java   |   8 +-
 .../store/mail/model/impl/SimpleMailbox.java    |  17 +-
 .../mail/model/impl/SimpleMailboxMessage.java   |  17 +-
 .../store/quota/CurrentQuotaCalculator.java     |  39 +++--
 .../store/quota/DefaultQuotaRootResolver.java   |   9 +-
 .../james/mailbox/store/quota/QuotaChecker.java |   5 +-
 .../store/search/LazyMessageSearchIndex.java    |  27 ++-
 .../search/ListeningMessageSearchIndex.java     |  27 ++-
 .../store/search/MessageSearchIndex.java        |   5 +-
 .../mailbox/store/search/MessageSearches.java   |  59 +++----
 .../store/search/SimpleMessageSearchIndex.java  |  20 +--
 .../comparator/AbstractHeaderComparator.java    |   4 +-
 .../comparator/BaseSubjectComparator.java       |   8 +-
 .../search/comparator/CombinedComparator.java   |  16 +-
 .../comparator/HeaderDisplayComparator.java     |  14 +-
 .../comparator/HeaderMailboxComparator.java     |  20 +--
 .../comparator/InternalDateComparator.java      |  10 +-
 .../search/comparator/ReverseComparator.java    |   8 +-
 .../search/comparator/SentDateComparator.java   |  10 +-
 .../store/search/comparator/SizeComparator.java |  10 +-
 .../store/search/comparator/UidComparator.java  |  10 +-
 .../mailbox/store/GroupFolderResolverTest.java  |   8 +-
 .../store/MailboxEventDispatcherTest.java       |  11 +-
 .../store/MailboxMessageResultImplTest.java     |   8 +-
 .../james/mailbox/store/MessageBuilder.java     |   2 +-
 .../store/SearchUtilsMultipartMixedTest.java    |   5 +-
 .../mailbox/store/SearchUtilsRFC822Test.java    |   5 +-
 .../james/mailbox/store/SearchUtilsTest.java    |  91 +++++-----
 .../mailbox/store/SimpleMailboxMembership.java  |   9 +-
 .../mailbox/store/StoreMailboxManagerTest.java  |  26 +--
 .../StoreMailboxMessageResultIteratorTest.java  |  42 ++---
 .../james/mailbox/store/TestIdDeserializer.java |   2 +-
 ...elegatingMailboxListenerIntegrationTest.java |  28 +--
 .../mailbox/store/json/EventSerializerTest.java |  16 +-
 .../store/json/JsonEventSerializerTest.java     |   7 +-
 .../MailboxMessagePackEventSerializerTest.java  |   7 +-
 .../mail/model/AbstractMailboxMapperTest.java   |  58 +++----
 .../mail/model/AbstractMessageMapperTest.java   |  96 +++++-----
 .../mail/model/AbstractMessageMoveTest.java     |  26 +--
 .../model/DelegatingMailboxMessageTest.java     |  18 +-
 .../mailbox/store/mail/model/MailboxAssert.java |   8 +-
 .../store/mail/model/MailboxAssertTests.java    |  24 +--
 .../mail/model/MailboxMessageAssertTest.java    |  24 +--
 .../store/mail/model/MapperProvider.java        |   8 +-
 .../mailbox/store/mail/model/MessageAssert.java |  17 +-
 .../store/mail/model/MetadataMapAssert.java     |   5 +-
 .../store/mail/model/MetadataMapAssertTest.java |  18 +-
 .../model/impl/SimpleMailboxMessageTest.java    |  12 +-
 .../quota/DefaultQuotaRootResolverTest.java     |  25 ++-
 .../mailbox/store/quota/QuotaCheckerTest.java   |  18 +-
 .../james/mailbox/indexer/ReIndexerImpl.java    |  28 +--
 .../james/mailbox/copier/MailboxCopierTest.java |   7 +-
 .../mailbox/indexer/ReIndexerImplTest.java      |  37 ++--
 .../registrations/GlobalRegistrationTest.java   |  12 +-
 .../registrations/MailboxRegistrationTest.java  |  17 +-
 .../mailbox/store/mail/ZooUidProvider.java      |  18 +-
 .../mailbox/store/mail/ZooUidProviderTest.java  |  16 +-
 .../host/ElasticSearchHostSystem.java           |   9 +-
 .../InMemoryEventAsynchronousHostSystem.java    |   7 +-
 .../inmemory/host/InMemoryHostSystem.java       |   3 +-
 .../maildir/host/MaildirHostSystem.java         |   5 +-
 .../smtp/host/CassandraJamesSmtpHostSystem.java |  10 +-
 .../apache/james/CassandraJamesServerMain.java  |   8 +-
 .../modules/mailbox/CassandraMailboxModule.java |  13 +-
 .../mailbox/ElasticSearchMailboxModule.java     |   4 +-
 .../apache/james/CassandraJamesServerTest.java  |   8 +-
 .../james/JamesCapabilitiesServerTest.java      |   7 +-
 .../java/org/apache/james/GuiceJamesServer.java |  32 ++--
 .../java/org/apache/james/jmap/JMAPModule.java  |  11 +-
 .../org/apache/james/jmap/MethodsModule.java    |  45 ++---
 .../james/modules/CommonServicesModule.java     |  12 +-
 .../apache/james/modules/ProtocolsModule.java   |  12 +-
 .../modules/protocols/JMAPServerModule.java     |  12 +-
 .../modules/server/ActiveMQQueueModule.java     |  14 +-
 .../apache/james/utils/ExtendedServerProbe.java |   5 +-
 .../apache/james/utils/GuiceGenericType.java    |  40 -----
 .../apache/james/utils/GuiceServerProbe.java    |  11 +-
 .../apache/james/AbstractJamesServerTest.java   |   7 +-
 .../org/apache/james/MemoryJamesServerMain.java |   8 +-
 .../modules/mailbox/MemoryMailboxModule.java    |  19 +-
 .../modules/server/MemoryMailQueueModule.java   |  15 +-
 .../org/apache/james/MemoryJamesServerTest.java |   9 +-
 .../adapter/mailbox/MailboxManagementTest.java  |  49 +++---
 .../CassandraGetMailboxesMethodTest.java        |   7 +-
 .../CassandraGetMessageListMethodTest.java      |   6 +-
 .../CassandraGetMessagesMethodTest.java         |   6 +-
 .../CassandraGetVacationResponseTest.java       |   6 +-
 .../CassandraJmapAuthenticationTest.java        |   6 +-
 .../CassandraSetMailboxesMethodStepdefs.java    |   2 +-
 .../CassandraSetMailboxesMethodTest.java        |   6 +-
 .../CassandraSetMessagesMethodTest.java         |   6 +-
 .../CassandraSetVacationResponseTest.java       |   6 +-
 .../james/jmap/JMAPAuthenticationTest.java      |   5 +-
 .../integration/GetMailboxesMethodTest.java     |  14 +-
 .../integration/GetMessageListMethodTest.java   |   4 +-
 .../integration/GetMessagesMethodTest.java      |   4 +-
 .../integration/GetVacationResponseTest.java    |   6 +-
 .../integration/SetMailboxesMethodStepdefs.java |  10 +-
 .../integration/SetMailboxesMethodTest.java     |  78 ++++-----
 .../integration/SetMessagesMethodTest.java      |   4 +-
 .../integration/SetVacationResponseTest.java    |   4 +-
 .../memory/MemoryGetMailboxesMethodTest.java    |   4 +-
 .../memory/MemoryGetMessageListMethodTest.java  |   4 +-
 .../memory/MemoryGetMessagesMethodTest.java     |   4 +-
 .../MemoryGetVacationResponseMethodTest.java    |   4 +-
 .../memory/MemoryJmapAuthenticationTest.java    |   4 +-
 .../MemorySetMailboxesMethodStepdefs.java       |   2 +-
 .../memory/MemorySetMailboxesMethodTest.java    |   4 +-
 .../memory/MemorySetMessagesMethodTest.java     |   4 +-
 .../MemorySetVacationResponseMethodTest.java    |   4 +-
 .../james/jmap/methods/GetMailboxesMethod.java  |   7 +-
 .../jmap/methods/GetMessageListMethod.java      |  23 ++-
 .../james/jmap/methods/GetMessagesMethod.java   |  31 ++--
 .../methods/SetMailboxesCreationProcessor.java  |   9 +-
 .../SetMailboxesDestructionProcessor.java       |   7 +-
 .../james/jmap/methods/SetMailboxesMethod.java  |   7 +-
 .../jmap/methods/SetMailboxesProcessor.java     |   3 +-
 .../methods/SetMailboxesUpdateProcessor.java    |   7 +-
 .../methods/SetMessagesCreationProcessor.java   |  36 ++--
 .../SetMessagesDestructionProcessor.java        |  23 ++-
 .../james/jmap/methods/SetMessagesMethod.java   |   7 +-
 .../jmap/methods/SetMessagesProcessor.java      |   3 +-
 .../methods/SetMessagesUpdateProcessor.java     |  32 ++--
 .../org/apache/james/jmap/model/Message.java    |  10 +-
 .../jmap/model/message/IndexableMessage.java    |  27 ++-
 .../org/apache/james/jmap/send/MailFactory.java |   5 +-
 .../james/jmap/send/PostDequeueDecorator.java   |  25 ++-
 .../jmap/send/PostDequeueDecoratorFactory.java  |  16 +-
 .../apache/james/jmap/utils/MailboxUtils.java   |   9 +-
 .../jmap/utils/SortToComparatorConvertor.java   |   8 +-
 .../jmap/methods/GetMailboxesMethodTest.java    |  15 +-
 .../jmap/methods/GetMessagesMethodTest.java     |  29 ++--
 .../SetMailboxesCreationProcessorTest.java      |   8 +-
 .../jmap/methods/SetMailboxesMethodTest.java    |  25 ++-
 .../SetMailboxesUpdateProcessorTest.java        |   8 +-
 .../SetMessagesCreationProcessorTest.java       |  50 +++---
 .../methods/SetMessagesUpdateProcessorTest.java |   5 +-
 .../james/jmap/model/MailboxMessageTest.java    |  12 +-
 .../apache/james/jmap/send/MailFactoryTest.java |   8 +-
 .../jmap/send/PostDequeueDecoratorTest.java     |  51 +++---
 .../james/jmap/utils/MailboxUtilsTest.java      |  32 ++--
 .../utils/SortToComparatorConvertorTest.java    |  29 ++--
 .../apache/james/pop3server/POP3ServerTest.java |   5 +-
 276 files changed, 2286 insertions(+), 2523 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/caching/src/main/java/org/apache/james/mailbox/caching/CacheInvalidatingMailboxListener.java
----------------------------------------------------------------------
diff --git a/mailbox/caching/src/main/java/org/apache/james/mailbox/caching/CacheInvalidatingMailboxListener.java b/mailbox/caching/src/main/java/org/apache/james/mailbox/caching/CacheInvalidatingMailboxListener.java
index 8e2e7aa..3512fd3 100644
--- a/mailbox/caching/src/main/java/org/apache/james/mailbox/caching/CacheInvalidatingMailboxListener.java
+++ b/mailbox/caching/src/main/java/org/apache/james/mailbox/caching/CacheInvalidatingMailboxListener.java
@@ -3,18 +3,16 @@ package org.apache.james.mailbox.caching;
 import org.apache.james.mailbox.MailboxListener;
 import org.apache.james.mailbox.MailboxListenerSupport;
 import org.apache.james.mailbox.exception.MailboxException;
-import org.apache.james.mailbox.store.mail.model.MailboxId;
 /**
  * A MailboxListener that invalidates the configured caches in response to Events
  *
- * @param <Id>
  */
-public class CacheInvalidatingMailboxListener<Id extends MailboxId> implements MailboxListener {
+public class CacheInvalidatingMailboxListener implements MailboxListener {
 
-    private final MailboxByPathCache<Id> mailboxCacheByPath;
-    private final MailboxMetadataCache<Id> mailboxMetadataCache;
+    private final MailboxByPathCache mailboxCacheByPath;
+    private final MailboxMetadataCache mailboxMetadataCache;
 
-    public CacheInvalidatingMailboxListener(MailboxByPathCache<Id> mailboxCacheByPath, MailboxMetadataCache<Id> mailboxMetadataCache) {
+    public CacheInvalidatingMailboxListener(MailboxByPathCache mailboxCacheByPath, MailboxMetadataCache mailboxMetadataCache) {
         this.mailboxCacheByPath = mailboxCacheByPath;
         this.mailboxMetadataCache = mailboxMetadataCache;
     }

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/caching/src/main/java/org/apache/james/mailbox/caching/CachingMailboxMapper.java
----------------------------------------------------------------------
diff --git a/mailbox/caching/src/main/java/org/apache/james/mailbox/caching/CachingMailboxMapper.java b/mailbox/caching/src/main/java/org/apache/james/mailbox/caching/CachingMailboxMapper.java
index 3af549b..8c5ee7f 100644
--- a/mailbox/caching/src/main/java/org/apache/james/mailbox/caching/CachingMailboxMapper.java
+++ b/mailbox/caching/src/main/java/org/apache/james/mailbox/caching/CachingMailboxMapper.java
@@ -6,22 +6,20 @@ 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.MailboxMapper;
-import org.apache.james.mailbox.store.mail.model.MailboxId;
 import org.apache.james.mailbox.store.mail.model.Mailbox;
 
 /**
  * A MailboxMapper implementation that uses a MailboxByPathCache to cache the information
  * from the underlying MailboxMapper
  * 
- * @param <Id>
  */
 
-public class CachingMailboxMapper<Id extends MailboxId> implements MailboxMapper<Id> {
+public class CachingMailboxMapper implements MailboxMapper {
 
-	private final MailboxMapper<Id> underlying;
-	private final MailboxByPathCache<Id> cache;
+	private final MailboxMapper underlying;
+	private final MailboxByPathCache cache;
 
-	public CachingMailboxMapper(MailboxMapper<Id> underlying, MailboxByPathCache<Id> cache) {
+	public CachingMailboxMapper(MailboxMapper underlying, MailboxByPathCache cache) {
 		this.underlying = underlying;
 		this.cache = cache;
 	}
@@ -37,19 +35,19 @@ public class CachingMailboxMapper<Id extends MailboxId> implements MailboxMapper
 	}
 
 	@Override
-	public void save(Mailbox<Id> mailbox) throws MailboxException {
+	public void save(Mailbox mailbox) throws MailboxException {
 		invalidate(mailbox);
 		underlying.save(mailbox);
 	}
 
 	@Override
-	public void delete(Mailbox<Id> mailbox) throws MailboxException {
+	public void delete(Mailbox mailbox) throws MailboxException {
 		invalidate(mailbox);
 		underlying.delete(mailbox);
 	}
 
 	@Override
-	public Mailbox<Id> findMailboxByPath(MailboxPath mailboxName)
+	public Mailbox findMailboxByPath(MailboxPath mailboxName)
 			throws MailboxException, MailboxNotFoundException {
 		try {
 			return cache.findMailboxByPath(mailboxName, underlying);
@@ -60,31 +58,31 @@ public class CachingMailboxMapper<Id extends MailboxId> implements MailboxMapper
 	}
 
 	@Override
-	public List<Mailbox<Id>> findMailboxWithPathLike(MailboxPath mailboxPath)
+	public List<Mailbox> findMailboxWithPathLike(MailboxPath mailboxPath)
 			throws MailboxException {
 		// TODO possible to meaningfully cache it?
 		return underlying.findMailboxWithPathLike(mailboxPath);
 	}
 
 	@Override
-	public boolean hasChildren(Mailbox<Id> mailbox, char delimiter)
+	public boolean hasChildren(Mailbox mailbox, char delimiter)
 			throws MailboxException, MailboxNotFoundException {
 		// TODO possible to meaningfully cache it?
 		return underlying.hasChildren(mailbox, delimiter);
 	}
 
 	@Override
-	public List<Mailbox<Id>> list() throws MailboxException {
+	public List<Mailbox> list() throws MailboxException {
 		// TODO possible to meaningfully cache it? is it used at all?
 		return underlying.list();
 	}
 
 	@Override
-	public void updateACL(Mailbox<Id> mailbox, MailboxACL.MailboxACLCommand mailboxACLCommand) throws MailboxException {
+	public void updateACL(Mailbox mailbox, MailboxACL.MailboxACLCommand mailboxACLCommand) throws MailboxException {
 		mailbox.setACL(mailbox.getACL().apply(mailboxACLCommand));
 	}
 
-	private void invalidate(Mailbox<Id> mailbox) {
+	private void invalidate(Mailbox mailbox) {
 		cache.invalidate(mailbox);
 	}
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/caching/src/main/java/org/apache/james/mailbox/caching/CachingMailboxSessionMapperFactory.java
----------------------------------------------------------------------
diff --git a/mailbox/caching/src/main/java/org/apache/james/mailbox/caching/CachingMailboxSessionMapperFactory.java b/mailbox/caching/src/main/java/org/apache/james/mailbox/caching/CachingMailboxSessionMapperFactory.java
index 21d04c4..d5cb0a9 100644
--- a/mailbox/caching/src/main/java/org/apache/james/mailbox/caching/CachingMailboxSessionMapperFactory.java
+++ b/mailbox/caching/src/main/java/org/apache/james/mailbox/caching/CachingMailboxSessionMapperFactory.java
@@ -6,7 +6,6 @@ import org.apache.james.mailbox.exception.SubscriptionException;
 import org.apache.james.mailbox.store.MailboxSessionMapperFactory;
 import org.apache.james.mailbox.store.mail.MailboxMapper;
 import org.apache.james.mailbox.store.mail.MessageMapper;
-import org.apache.james.mailbox.store.mail.model.MailboxId;
 import org.apache.james.mailbox.store.user.SubscriptionMapper;
 
 /**
@@ -14,31 +13,30 @@ import org.apache.james.mailbox.store.user.SubscriptionMapper;
  * caching variants of MessageMapper and MailboxMapper built around the MessageMapper and MailboxMapper
  * provided by it
  * 
- * @param <Id>
  */
-public class CachingMailboxSessionMapperFactory<Id extends MailboxId> extends
-		MailboxSessionMapperFactory<Id> {
+public class CachingMailboxSessionMapperFactory extends
+		MailboxSessionMapperFactory {
 
-	private final MailboxSessionMapperFactory<Id> underlying;
-	private final MailboxByPathCache<Id> mailboxByPathCache;
-	private final MailboxMetadataCache<Id> mailboxMetadataCache;
+	private final MailboxSessionMapperFactory underlying;
+	private final MailboxByPathCache mailboxByPathCache;
+	private final MailboxMetadataCache mailboxMetadataCache;
 
-	public CachingMailboxSessionMapperFactory(MailboxSessionMapperFactory<Id> underlying, MailboxByPathCache<Id> mailboxByPathCache, MailboxMetadataCache<Id> mailboxMetadataCache) {
+	public CachingMailboxSessionMapperFactory(MailboxSessionMapperFactory underlying, MailboxByPathCache mailboxByPathCache, MailboxMetadataCache mailboxMetadataCache) {
 		this.underlying = underlying;
 		this.mailboxByPathCache = mailboxByPathCache;
 		this.mailboxMetadataCache = mailboxMetadataCache;
 	}
 	
 	@Override
-	public MessageMapper<Id> createMessageMapper(MailboxSession session)
+	public MessageMapper createMessageMapper(MailboxSession session)
 			throws MailboxException {
-		return new CachingMessageMapper<Id>(underlying.createMessageMapper(session), mailboxMetadataCache);
+		return new CachingMessageMapper(underlying.createMessageMapper(session), mailboxMetadataCache);
 	}
 
 	@Override
-	public MailboxMapper<Id> createMailboxMapper(MailboxSession session)
+	public MailboxMapper createMailboxMapper(MailboxSession session)
 			throws MailboxException {
-		return new CachingMailboxMapper<Id>(underlying.createMailboxMapper(session), mailboxByPathCache);
+		return new CachingMailboxMapper(underlying.createMailboxMapper(session), mailboxByPathCache);
 	}
 
 	@Override

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/caching/src/main/java/org/apache/james/mailbox/caching/CachingMessageMapper.java
----------------------------------------------------------------------
diff --git a/mailbox/caching/src/main/java/org/apache/james/mailbox/caching/CachingMessageMapper.java b/mailbox/caching/src/main/java/org/apache/james/mailbox/caching/CachingMessageMapper.java
index 65dbe9f..d27e759 100644
--- a/mailbox/caching/src/main/java/org/apache/james/mailbox/caching/CachingMessageMapper.java
+++ b/mailbox/caching/src/main/java/org/apache/james/mailbox/caching/CachingMessageMapper.java
@@ -9,7 +9,6 @@ import org.apache.james.mailbox.model.MessageRange;
 import org.apache.james.mailbox.model.UpdatedFlags;
 import org.apache.james.mailbox.store.FlagsUpdateCalculator;
 import org.apache.james.mailbox.store.mail.MessageMapper;
-import org.apache.james.mailbox.store.mail.model.MailboxId;
 import org.apache.james.mailbox.store.mail.model.Mailbox;
 import org.apache.james.mailbox.store.mail.model.MailboxMessage;
 
@@ -17,14 +16,13 @@ import org.apache.james.mailbox.store.mail.model.MailboxMessage;
  * A MessageMapper implementation that uses a MailboxMetadataCache to cache the information
  * from the underlying MessageMapper
  * 
- * @param <Id>
  */
-public class CachingMessageMapper<Id extends MailboxId> implements MessageMapper<Id> {
+public class CachingMessageMapper implements MessageMapper {
 
-    private final MessageMapper<Id> underlying;
-    private final MailboxMetadataCache<Id> cache;
+    private final MessageMapper underlying;
+    private final MailboxMetadataCache cache;
 
-    public CachingMessageMapper(MessageMapper<Id> underlying, MailboxMetadataCache<Id> cache) {
+    public CachingMessageMapper(MessageMapper underlying, MailboxMetadataCache cache) {
         this.underlying = underlying;
         this.cache = cache;
     }
@@ -40,7 +38,7 @@ public class CachingMessageMapper<Id extends MailboxId> implements MessageMapper
     }
 
     @Override
-    public Iterator<MailboxMessage<Id>> findInMailbox(Mailbox<Id> mailbox,
+    public Iterator<MailboxMessage> findInMailbox(Mailbox mailbox,
                                                       MessageRange set,
                                                       org.apache.james.mailbox.store.mail.MessageMapper.FetchType type,
                                                       int limit) throws MailboxException {
@@ -49,25 +47,25 @@ public class CachingMessageMapper<Id extends MailboxId> implements MessageMapper
 
     @Override
     public Map<Long, MessageMetaData> expungeMarkedForDeletionInMailbox(
-            Mailbox<Id> mailbox, MessageRange set) throws MailboxException {
+            Mailbox mailbox, MessageRange set) throws MailboxException {
         invalidateMetadata(mailbox);
         return underlying.expungeMarkedForDeletionInMailbox(mailbox, set);
     }
 
     @Override
-    public long countMessagesInMailbox(Mailbox<Id> mailbox)
+    public long countMessagesInMailbox(Mailbox mailbox)
             throws MailboxException {
         return cache.countMessagesInMailbox(mailbox, underlying);
     }
 
     @Override
-    public long countUnseenMessagesInMailbox(Mailbox<Id> mailbox)
+    public long countUnseenMessagesInMailbox(Mailbox mailbox)
             throws MailboxException {
         return cache.countUnseenMessagesInMailbox(mailbox, underlying);
     }
 
     @Override
-    public void delete(Mailbox<Id> mailbox, MailboxMessage<Id> message)
+    public void delete(Mailbox mailbox, MailboxMessage message)
             throws MailboxException {
         invalidateMetadata(mailbox);
         underlying.delete(mailbox, message);
@@ -75,27 +73,27 @@ public class CachingMessageMapper<Id extends MailboxId> implements MessageMapper
     }
 
     @Override
-    public Long findFirstUnseenMessageUid(Mailbox<Id> mailbox)
+    public Long findFirstUnseenMessageUid(Mailbox mailbox)
             throws MailboxException {
         return cache.findFirstUnseenMessageUid(mailbox, underlying);
     }
 
     @Override
-    public List<Long> findRecentMessageUidsInMailbox(Mailbox<Id> mailbox)
+    public List<Long> findRecentMessageUidsInMailbox(Mailbox mailbox)
             throws MailboxException {
         // TODO can be meaningfully cached?
         return underlying.findRecentMessageUidsInMailbox(mailbox);
     }
 
     @Override
-    public MessageMetaData add(Mailbox<Id> mailbox, MailboxMessage<Id> message)
+    public MessageMetaData add(Mailbox mailbox, MailboxMessage message)
             throws MailboxException {
         invalidateMetadata(mailbox);
         return underlying.add(mailbox, message);
     }
 
     @Override
-    public Iterator<UpdatedFlags> updateFlags(Mailbox<Id> mailbox, FlagsUpdateCalculator calculator, MessageRange set)
+    public Iterator<UpdatedFlags> updateFlags(Mailbox mailbox, FlagsUpdateCalculator calculator, MessageRange set)
             throws MailboxException {
         //check if there are in fact any updates
         if (set.iterator().hasNext())
@@ -105,29 +103,29 @@ public class CachingMessageMapper<Id extends MailboxId> implements MessageMapper
 
 
     @Override
-    public MessageMetaData copy(Mailbox<Id> mailbox, MailboxMessage<Id> original)
+    public MessageMetaData copy(Mailbox mailbox, MailboxMessage original)
             throws MailboxException {
         invalidateMetadata(mailbox);
         return underlying.copy(mailbox, original);
     }
 
     @Override
-    public long getLastUid(Mailbox<Id> mailbox) throws MailboxException {
+    public long getLastUid(Mailbox mailbox) throws MailboxException {
         return cache.getLastUid(mailbox, underlying);
     }
 
     @Override
-    public long getHighestModSeq(Mailbox<Id> mailbox) throws MailboxException {
+    public long getHighestModSeq(Mailbox mailbox) throws MailboxException {
         return cache.getHighestModSeq(mailbox, underlying);
     }
 
-    private void invalidateMetadata(Mailbox<Id> mailbox) {
+    private void invalidateMetadata(Mailbox mailbox) {
         cache.invalidate(mailbox);
 
     }
 
     @Override
-    public MessageMetaData move(Mailbox<Id> mailbox, MailboxMessage<Id> original) throws MailboxException {
+    public MessageMetaData move(Mailbox mailbox, MailboxMessage original) throws MailboxException {
         throw new UnsupportedOperationException("Move is not yet supported");
     }
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/caching/src/main/java/org/apache/james/mailbox/caching/MailboxByPathCache.java
----------------------------------------------------------------------
diff --git a/mailbox/caching/src/main/java/org/apache/james/mailbox/caching/MailboxByPathCache.java b/mailbox/caching/src/main/java/org/apache/james/mailbox/caching/MailboxByPathCache.java
index a06cac7..5933786 100644
--- a/mailbox/caching/src/main/java/org/apache/james/mailbox/caching/MailboxByPathCache.java
+++ b/mailbox/caching/src/main/java/org/apache/james/mailbox/caching/MailboxByPathCache.java
@@ -4,21 +4,19 @@ import org.apache.james.mailbox.exception.MailboxException;
 import org.apache.james.mailbox.exception.MailboxNotFoundException;
 import org.apache.james.mailbox.model.MailboxPath;
 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;
 
 /**
  * Caches the MailboxPath -> Mailbox mapping
  * 
- * @param <Id>
  */
-public interface MailboxByPathCache<Id extends MailboxId> {
+public interface MailboxByPathCache {
 
-	Mailbox<Id> findMailboxByPath(MailboxPath mailboxName,
-								  MailboxMapper<Id> underlying) throws MailboxNotFoundException,
+	Mailbox findMailboxByPath(MailboxPath mailboxName,
+								  MailboxMapper underlying) throws MailboxNotFoundException,
 			MailboxException;
 
-	void invalidate(Mailbox<Id> mailbox);
+	void invalidate(Mailbox mailbox);
 	
 	void invalidate(MailboxPath mailboxPath);
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/caching/src/main/java/org/apache/james/mailbox/caching/MailboxMetadataCache.java
----------------------------------------------------------------------
diff --git a/mailbox/caching/src/main/java/org/apache/james/mailbox/caching/MailboxMetadataCache.java b/mailbox/caching/src/main/java/org/apache/james/mailbox/caching/MailboxMetadataCache.java
index 9f27a30..bc58ddd 100644
--- a/mailbox/caching/src/main/java/org/apache/james/mailbox/caching/MailboxMetadataCache.java
+++ b/mailbox/caching/src/main/java/org/apache/james/mailbox/caching/MailboxMetadataCache.java
@@ -2,33 +2,31 @@ package org.apache.james.mailbox.caching;
 
 import org.apache.james.mailbox.exception.MailboxException;
 import org.apache.james.mailbox.store.mail.MessageMapper;
-import org.apache.james.mailbox.store.mail.model.MailboxId;
 import org.apache.james.mailbox.store.mail.model.Mailbox;
 
 /**
  * Caches the simple yet possibly expensive to compute metadata info 
  * about a Mailbox like all/unseen messages count and similar
  * 
- * @param <Id>
  */
-public interface MailboxMetadataCache<Id extends MailboxId> {
+public interface MailboxMetadataCache {
 
-	long countMessagesInMailbox(Mailbox<Id> mailbox,
-								MessageMapper<Id> underlying) throws MailboxException;
+	long countMessagesInMailbox(Mailbox mailbox,
+								MessageMapper underlying) throws MailboxException;
 
-	long countUnseenMessagesInMailbox(Mailbox<Id> mailbox,
-									  MessageMapper<Id> underlying) throws MailboxException;
+	long countUnseenMessagesInMailbox(Mailbox mailbox,
+									  MessageMapper underlying) throws MailboxException;
 
-	Long findFirstUnseenMessageUid(Mailbox<Id> mailbox,
-								   MessageMapper<Id> underlying) throws MailboxException;
+	Long findFirstUnseenMessageUid(Mailbox mailbox,
+								   MessageMapper underlying) throws MailboxException;
 
-	long getLastUid(Mailbox<Id> mailbox,
-					MessageMapper<Id> underlying) throws MailboxException;
+	long getLastUid(Mailbox mailbox,
+					MessageMapper underlying) throws MailboxException;
 
-	long getHighestModSeq(Mailbox<Id> mailbox,
-						  MessageMapper<Id> underlying) throws MailboxException;
+	long getHighestModSeq(Mailbox mailbox,
+						  MessageMapper underlying) throws MailboxException;
 
-	void invalidate(Mailbox<Id> mailbox);
+	void invalidate(Mailbox mailbox);
 
 //	public abstract void invalidate(MailboxPath mailboxPath);
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/caching/src/main/java/org/apache/james/mailbox/caching/guava/GuavaMailboxByPathCache.java
----------------------------------------------------------------------
diff --git a/mailbox/caching/src/main/java/org/apache/james/mailbox/caching/guava/GuavaMailboxByPathCache.java b/mailbox/caching/src/main/java/org/apache/james/mailbox/caching/guava/GuavaMailboxByPathCache.java
index 0fad86b..c6b4e29 100644
--- a/mailbox/caching/src/main/java/org/apache/james/mailbox/caching/guava/GuavaMailboxByPathCache.java
+++ b/mailbox/caching/src/main/java/org/apache/james/mailbox/caching/guava/GuavaMailboxByPathCache.java
@@ -5,7 +5,6 @@ import org.apache.james.mailbox.exception.MailboxException;
 import org.apache.james.mailbox.exception.MailboxNotFoundException;
 import org.apache.james.mailbox.model.MailboxPath;
 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 com.google.common.cache.Cache;
@@ -15,11 +14,10 @@ import com.google.common.cache.Cache;
  * Note: for efficiency/simplicity reasons the cache key is MailboxPath.toString()
  * That may help also make it compatible with other cache backends in the future.
  *
- * @param <Id>
  */
-public class GuavaMailboxByPathCache<Id extends MailboxId> extends AbstractGuavaCache implements MailboxByPathCache<Id> {
+public class GuavaMailboxByPathCache extends AbstractGuavaCache implements MailboxByPathCache {
 	
-	private final Cache<String, Mailbox<Id>> findMailboxByPathCache = BUILDER.build();
+	private final Cache<String, Mailbox> findMailboxByPathCache = BUILDER.build();
 
 	private final MailboxByPathCacheWrapper wrapper;
 
@@ -29,14 +27,14 @@ public class GuavaMailboxByPathCache<Id extends MailboxId> extends AbstractGuava
 	}
 	
 	@Override
-	public Mailbox<Id> findMailboxByPath(MailboxPath mailboxName, MailboxMapper<Id> underlying) throws MailboxNotFoundException, MailboxException {
+	public Mailbox findMailboxByPath(MailboxPath mailboxName, MailboxMapper underlying) throws MailboxNotFoundException, MailboxException {
 		
 		return wrapper.get(mailboxName, underlying);
 	}
 	
 //	alternative plain implementation - review and choose the better
-//	public Mailbox<Id> findMailboxByPath(MailboxPath mailboxName, MailboxMapper<Id> underlying) throws MailboxNotFoundException, MailboxException {
-//		Mailbox<Id> mailbox = findMailboxByPathCache.getIfPresent(mailboxName.toString());
+//	public Mailbox findMailboxByPath(MailboxPath mailboxName, MailboxMapper underlying) throws MailboxNotFoundException, MailboxException {
+//		Mailbox mailbox = findMailboxByPathCache.getIfPresent(mailboxName.toString());
 //		if (mailbox != null)
 //			return mailbox;
 //		else {
@@ -49,7 +47,7 @@ public class GuavaMailboxByPathCache<Id extends MailboxId> extends AbstractGuava
 	
 
 	@Override
-	public void invalidate(Mailbox<Id> mailbox) {
+	public void invalidate(Mailbox mailbox) {
 		invalidate(new MailboxPath(mailbox.getNamespace(), mailbox.getUser(), mailbox.getName()));
 	}
 	
@@ -60,23 +58,23 @@ public class GuavaMailboxByPathCache<Id extends MailboxId> extends AbstractGuava
 
 
 	//Does it make sense to define such loaders as separate classes for reuse?
-//	class MailboxByPathCacheLoaderFromUnderlying implements CacheLoaderFromUnderlying<MailboxPath, Mailbox<Id>, MailboxMapper<Id>, MailboxException> {
+//	class MailboxByPathCacheLoaderFromUnderlying implements CacheLoaderFromUnderlying<MailboxPath, Mailbox, MailboxMapper, MailboxException> {
 //		@Override
-//		public Mailbox<Id> load(MailboxPath mailboxName, MailboxMapper<Id> underlying) throws MailboxException {
+//		public Mailbox load(MailboxPath mailboxName, MailboxMapper underlying) throws MailboxException {
 //			return underlying.findMailboxByPath(mailboxName);
 //		}
 //	}
 
-	class MailboxByPathCacheWrapper extends GuavaCacheWrapper<MailboxPath, Mailbox<Id>, MailboxMapper<Id>, String, MailboxException> {
+	class MailboxByPathCacheWrapper extends GuavaCacheWrapper<MailboxPath, Mailbox, MailboxMapper, String, MailboxException> {
 
 		public MailboxByPathCacheWrapper(
-				Cache<String, Mailbox<Id>> cache/*,
+				Cache<String, Mailbox> cache/*,
 				MailboxByPathCacheLoaderFromUnderlying loader*/) {
 			super(cache);
 		}
 
 		@Override
-		public Mailbox<Id> load(MailboxPath mailboxName, MailboxMapper<Id> underlying) throws MailboxException {
+		public Mailbox load(MailboxPath mailboxName, MailboxMapper underlying) throws MailboxException {
 			return underlying.findMailboxByPath(mailboxName);
 		}
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/caching/src/main/java/org/apache/james/mailbox/caching/guava/GuavaMailboxMetadataCache.java
----------------------------------------------------------------------
diff --git a/mailbox/caching/src/main/java/org/apache/james/mailbox/caching/guava/GuavaMailboxMetadataCache.java b/mailbox/caching/src/main/java/org/apache/james/mailbox/caching/guava/GuavaMailboxMetadataCache.java
index 96b085a..3a49878 100644
--- a/mailbox/caching/src/main/java/org/apache/james/mailbox/caching/guava/GuavaMailboxMetadataCache.java
+++ b/mailbox/caching/src/main/java/org/apache/james/mailbox/caching/guava/GuavaMailboxMetadataCache.java
@@ -3,25 +3,24 @@ package org.apache.james.mailbox.caching.guava;
 import org.apache.james.mailbox.caching.MailboxMetadataCache;
 import org.apache.james.mailbox.exception.MailboxException;
 import org.apache.james.mailbox.store.mail.MessageMapper;
-import org.apache.james.mailbox.store.mail.model.MailboxId;
 import org.apache.james.mailbox.store.mail.model.Mailbox;
+import org.apache.james.mailbox.store.mail.model.MailboxId;
 
 import com.google.common.cache.Cache;
 /**
  * Guava-based implementation of MailboxMetadataCache.
  * Note: for efficiency/simplicity reasons the cache key is Mailbox.getMailboxId()
  *
- * @param <Id>
  */
 
-public class GuavaMailboxMetadataCache<Id extends MailboxId> extends AbstractGuavaCache implements MailboxMetadataCache<Id> {
+public class GuavaMailboxMetadataCache extends AbstractGuavaCache implements MailboxMetadataCache {
 
 	// TODO these can probably be instantiated more elegant way
-	private final Cache<Id, Long> cacheCountMessagesInMailbox = BUILDER.build();
-	private final Cache<Id, Long> cacheCountUnseenMessagesInMailbox = BUILDER.build();
-	private final Cache<Id, Long> cacheFindFirstUnseenMessageUid = BUILDER.build();
-	private final Cache<Id, Long> cacheGetLastUid = BUILDER.build();
-	private final Cache<Id, Long> cacheGetHighestModSeq = BUILDER.build();
+	private final Cache<MailboxId, Long> cacheCountMessagesInMailbox = BUILDER.build();
+	private final Cache<MailboxId, Long> cacheCountUnseenMessagesInMailbox = BUILDER.build();
+	private final Cache<MailboxId, Long> cacheFindFirstUnseenMessageUid = BUILDER.build();
+	private final Cache<MailboxId, Long> cacheGetLastUid = BUILDER.build();
+	private final Cache<MailboxId, Long> cacheGetHighestModSeq = BUILDER.build();
 
 	private final MetadataCacheWrapper countMessagesInMailboxWrapper = new CountMessagesInMailboxWrapper(cacheCountMessagesInMailbox);
 	private final MetadataCacheWrapper countUnseenMessagesInMailboxWrapper = new CountUnseenMessagesInMailboxWrapper(cacheCountUnseenMessagesInMailbox);
@@ -30,35 +29,35 @@ public class GuavaMailboxMetadataCache<Id extends MailboxId> extends AbstractGua
 	private final MetadataCacheWrapper lastUidWrapper = new LastUidCacheWrapper(cacheGetLastUid);
 	
 	@Override
-	public long countMessagesInMailbox(Mailbox<Id> mailbox, MessageMapper<Id> underlying) throws MailboxException {
+	public long countMessagesInMailbox(Mailbox mailbox, MessageMapper underlying) throws MailboxException {
 		return countMessagesInMailboxWrapper.get(mailbox, underlying);
 	}
 	
 	@Override
-	public long countUnseenMessagesInMailbox(Mailbox<Id> mailbox, MessageMapper<Id> underlying)
+	public long countUnseenMessagesInMailbox(Mailbox mailbox, MessageMapper underlying)
 			throws MailboxException {
 		return countUnseenMessagesInMailboxWrapper.get(mailbox, underlying);
 	}
 	
 	@Override
-	public Long findFirstUnseenMessageUid(Mailbox<Id> mailbox, MessageMapper<Id> underlying)
+	public Long findFirstUnseenMessageUid(Mailbox mailbox, MessageMapper underlying)
 			throws MailboxException {
 		return findFirstUnseenMessageUid.get(mailbox, underlying);
 	}
 	
 	@Override
-	public long getLastUid(Mailbox<Id> mailbox, MessageMapper<Id> underlying) throws MailboxException {
+	public long getLastUid(Mailbox mailbox, MessageMapper underlying) throws MailboxException {
 		return lastUidWrapper.get(mailbox, underlying);
 
 	}
 	
 	@Override
-	public long getHighestModSeq(Mailbox<Id> mailbox, MessageMapper<Id> underlying) throws MailboxException {
+	public long getHighestModSeq(Mailbox mailbox, MessageMapper underlying) throws MailboxException {
 		return highestModSeqWrapper.get(mailbox, underlying);
 	}
 	
 	@Override
-	public void invalidate(Mailbox<Id> mailbox) {
+	public void invalidate(Mailbox mailbox) {
 		cacheCountMessagesInMailbox.invalidate(mailbox);
 		cacheCountUnseenMessagesInMailbox.invalidate(mailbox);
 		cacheFindFirstUnseenMessageUid.invalidate(mailbox);
@@ -67,14 +66,14 @@ public class GuavaMailboxMetadataCache<Id extends MailboxId> extends AbstractGua
 	}
 
 	
-	abstract class MetadataCacheWrapper extends GuavaCacheWrapper<Mailbox<Id>, Long, MessageMapper<Id>, Id, MailboxException> {
+	abstract class MetadataCacheWrapper extends GuavaCacheWrapper<Mailbox, Long, MessageMapper, MailboxId, MailboxException> {
 
-		public MetadataCacheWrapper(Cache<Id, Long> cache) {
+		public MetadataCacheWrapper(Cache<MailboxId, Long> cache) {
 			super(cache);
 		}
 
 		@Override
-		public Id getKeyRepresentation(Mailbox<Id> key) {
+		public MailboxId getKeyRepresentation(Mailbox key) {
 			return key.getMailboxId();
 		}		
 		
@@ -82,11 +81,11 @@ public class GuavaMailboxMetadataCache<Id extends MailboxId> extends AbstractGua
 
 	class CountMessagesInMailboxWrapper extends MetadataCacheWrapper {
 
-		public CountMessagesInMailboxWrapper(Cache<Id, Long> cache) {
+		public CountMessagesInMailboxWrapper(Cache<MailboxId, Long> cache) {
 			super(cache);
 		}
 		@Override
-		public Long load(Mailbox<Id> mailbox, MessageMapper<Id> underlying)
+		public Long load(Mailbox mailbox, MessageMapper underlying)
 				throws MailboxException {
 			return underlying.countMessagesInMailbox(mailbox);
 		}
@@ -95,11 +94,11 @@ public class GuavaMailboxMetadataCache<Id extends MailboxId> extends AbstractGua
 	
 	class CountUnseenMessagesInMailboxWrapper extends MetadataCacheWrapper {
 
-		public CountUnseenMessagesInMailboxWrapper(Cache<Id, Long> cache) {
+		public CountUnseenMessagesInMailboxWrapper(Cache<MailboxId, Long> cache) {
 			super(cache);
 		}
 		@Override
-		public Long load(Mailbox<Id> mailbox, MessageMapper<Id> underlying)
+		public Long load(Mailbox mailbox, MessageMapper underlying)
 				throws MailboxException {
 			return underlying.countUnseenMessagesInMailbox(mailbox);
 		}
@@ -108,11 +107,11 @@ public class GuavaMailboxMetadataCache<Id extends MailboxId> extends AbstractGua
 
 	class FindFirstUnseenMessageUidWrapper extends MetadataCacheWrapper {
 
-		public FindFirstUnseenMessageUidWrapper(Cache<Id, Long> cache) {
+		public FindFirstUnseenMessageUidWrapper(Cache<MailboxId, Long> cache) {
 			super(cache);
 		}
 		@Override
-		public Long load(Mailbox<Id> mailbox, MessageMapper<Id> underlying)
+		public Long load(Mailbox mailbox, MessageMapper underlying)
 				throws MailboxException {
 			return underlying.findFirstUnseenMessageUid(mailbox);
 		}
@@ -120,21 +119,21 @@ public class GuavaMailboxMetadataCache<Id extends MailboxId> extends AbstractGua
 	}
 
 	class LastUidCacheWrapper extends MetadataCacheWrapper {
-		public LastUidCacheWrapper(Cache<Id, Long> cache) {
+		public LastUidCacheWrapper(Cache<MailboxId, Long> cache) {
 			super(cache);
 		}
 		@Override
-		public Long load(Mailbox<Id> mailbox, MessageMapper<Id> underlying) throws MailboxException {
+		public Long load(Mailbox mailbox, MessageMapper underlying) throws MailboxException {
 			return underlying.getLastUid(mailbox);
 		}
 	}
 
 	class HighestModseqCacheWrapper extends MetadataCacheWrapper {
-		public HighestModseqCacheWrapper(Cache<Id, Long> cache) {
+		public HighestModseqCacheWrapper(Cache<MailboxId, Long> cache) {
 			super(cache);
 		}
 		@Override
-		public Long load(Mailbox<Id> mailbox, MessageMapper<Id> underlying) throws MailboxException {
+		public Long load(Mailbox mailbox, MessageMapper underlying) throws MailboxException {
 			return underlying.getHighestModSeq(mailbox);
 		}
 	}

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

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/cassandra/src/main/java/org/apache/james/mailbox/cassandra/CassandraMailboxManager.java
----------------------------------------------------------------------
diff --git a/mailbox/cassandra/src/main/java/org/apache/james/mailbox/cassandra/CassandraMailboxManager.java b/mailbox/cassandra/src/main/java/org/apache/james/mailbox/cassandra/CassandraMailboxManager.java
index d404a76..c4cd3a9 100644
--- a/mailbox/cassandra/src/main/java/org/apache/james/mailbox/cassandra/CassandraMailboxManager.java
+++ b/mailbox/cassandra/src/main/java/org/apache/james/mailbox/cassandra/CassandraMailboxManager.java
@@ -44,7 +44,7 @@ import com.google.common.collect.Lists;
  * Cassandra implementation of {@link StoreMailboxManager}
  */
 @Singleton
-public class CassandraMailboxManager extends StoreMailboxManager<CassandraId> {
+public class CassandraMailboxManager extends StoreMailboxManager {
     private final MailboxPathLocker locker;
 
     @Inject
@@ -59,7 +59,7 @@ public class CassandraMailboxManager extends StoreMailboxManager<CassandraId> {
 
     @Override
     @Inject
-    public void setMessageSearchIndex(MessageSearchIndex<CassandraId> index) {
+    public void setMessageSearchIndex(MessageSearchIndex index) {
         super.setMessageSearchIndex(index);
     }
 
@@ -69,14 +69,14 @@ public class CassandraMailboxManager extends StoreMailboxManager<CassandraId> {
     }
 
     @Override
-    protected Mailbox<CassandraId> doCreateMailbox(MailboxPath mailboxPath, MailboxSession session) throws MailboxException {
-        SimpleMailbox<CassandraId> cassandraMailbox = new SimpleMailbox<>(mailboxPath, randomUidValidity());
+    protected Mailbox doCreateMailbox(MailboxPath mailboxPath, MailboxSession session) throws MailboxException {
+        SimpleMailbox cassandraMailbox = new SimpleMailbox(mailboxPath, randomUidValidity());
         cassandraMailbox.setACL(SimpleMailboxACL.EMPTY);
         return cassandraMailbox;
     }
 
     @Override
-    protected StoreMessageManager<CassandraId> createMessageManager(Mailbox<CassandraId> mailboxRow, MailboxSession session) throws MailboxException {
+    protected StoreMessageManager createMessageManager(Mailbox mailboxRow, MailboxSession session) throws MailboxException {
         return new CassandraMessageManager(getMapperFactory(),
             getMessageSearchIndex(),
             getEventDispatcher(),

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/cassandra/src/main/java/org/apache/james/mailbox/cassandra/CassandraMailboxSessionMapperFactory.java
----------------------------------------------------------------------
diff --git a/mailbox/cassandra/src/main/java/org/apache/james/mailbox/cassandra/CassandraMailboxSessionMapperFactory.java b/mailbox/cassandra/src/main/java/org/apache/james/mailbox/cassandra/CassandraMailboxSessionMapperFactory.java
index 9ae3b2d..dd8025d 100644
--- a/mailbox/cassandra/src/main/java/org/apache/james/mailbox/cassandra/CassandraMailboxSessionMapperFactory.java
+++ b/mailbox/cassandra/src/main/java/org/apache/james/mailbox/cassandra/CassandraMailboxSessionMapperFactory.java
@@ -19,8 +19,9 @@
 
 package org.apache.james.mailbox.cassandra;
 
-import org.apache.james.backends.cassandra.init.CassandraTypesProvider;
 import javax.inject.Inject;
+
+import org.apache.james.backends.cassandra.init.CassandraTypesProvider;
 import org.apache.james.mailbox.MailboxSession;
 import org.apache.james.mailbox.cassandra.mail.CassandraMailboxMapper;
 import org.apache.james.mailbox.cassandra.mail.CassandraMessageMapper;
@@ -37,17 +38,17 @@ import com.datastax.driver.core.Session;
  * Cassandra implementation of {@link MailboxSessionMapperFactory}
  * 
  */
-public class CassandraMailboxSessionMapperFactory extends MailboxSessionMapperFactory<CassandraId> {
+public class CassandraMailboxSessionMapperFactory extends MailboxSessionMapperFactory {
     private static final int DEFAULT_MAX_RETRY = 1000;
 
     private final Session session;
-    private final UidProvider<CassandraId> uidProvider;
-    private final ModSeqProvider<CassandraId> modSeqProvider;
+    private final UidProvider uidProvider;
+    private final ModSeqProvider modSeqProvider;
     private final CassandraTypesProvider typesProvider;
     private int maxRetry;
 
     @Inject
-    public CassandraMailboxSessionMapperFactory(UidProvider<CassandraId> uidProvider, ModSeqProvider<CassandraId> modSeqProvider, Session session, CassandraTypesProvider typesProvider) {
+    public CassandraMailboxSessionMapperFactory(UidProvider uidProvider, ModSeqProvider modSeqProvider, Session session, CassandraTypesProvider typesProvider) {
         this.uidProvider = uidProvider;
         this.modSeqProvider = modSeqProvider;
         this.session = session;
@@ -65,7 +66,7 @@ public class CassandraMailboxSessionMapperFactory extends MailboxSessionMapperFa
     }
 
     @Override
-    public MailboxMapper<CassandraId> createMailboxMapper(MailboxSession mailboxSession) {
+    public MailboxMapper createMailboxMapper(MailboxSession mailboxSession) {
         return new CassandraMailboxMapper(session, typesProvider, maxRetry);
     }
 
@@ -74,11 +75,11 @@ public class CassandraMailboxSessionMapperFactory extends MailboxSessionMapperFa
         return new CassandraSubscriptionMapper(session);
     }
 
-    public ModSeqProvider<CassandraId> getModSeqProvider() {
+    public ModSeqProvider getModSeqProvider() {
         return modSeqProvider;
     }
 
-    public UidProvider<CassandraId> getUidProvider() {
+    public UidProvider getUidProvider() {
         return uidProvider;
     }
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/cassandra/src/main/java/org/apache/james/mailbox/cassandra/CassandraMessageManager.java
----------------------------------------------------------------------
diff --git a/mailbox/cassandra/src/main/java/org/apache/james/mailbox/cassandra/CassandraMessageManager.java b/mailbox/cassandra/src/main/java/org/apache/james/mailbox/cassandra/CassandraMessageManager.java
index 51b001a..4c4486b 100644
--- a/mailbox/cassandra/src/main/java/org/apache/james/mailbox/cassandra/CassandraMessageManager.java
+++ b/mailbox/cassandra/src/main/java/org/apache/james/mailbox/cassandra/CassandraMessageManager.java
@@ -28,9 +28,9 @@ import org.apache.james.mailbox.acl.UnionMailboxACLResolver;
 import org.apache.james.mailbox.exception.MailboxException;
 import org.apache.james.mailbox.quota.QuotaManager;
 import org.apache.james.mailbox.quota.QuotaRootResolver;
-import org.apache.james.mailbox.store.event.MailboxEventDispatcher;
 import org.apache.james.mailbox.store.MailboxSessionMapperFactory;
 import org.apache.james.mailbox.store.StoreMessageManager;
+import org.apache.james.mailbox.store.event.MailboxEventDispatcher;
 import org.apache.james.mailbox.store.mail.model.Mailbox;
 import org.apache.james.mailbox.store.search.MessageSearchIndex;
 
@@ -38,9 +38,9 @@ import org.apache.james.mailbox.store.search.MessageSearchIndex;
  * Cassandra implementation of {@link StoreMessageManager}
  * 
  */
-public class CassandraMessageManager extends StoreMessageManager<CassandraId> {
+public class CassandraMessageManager extends StoreMessageManager {
 
-    public CassandraMessageManager(MailboxSessionMapperFactory<CassandraId> mapperFactory, MessageSearchIndex<CassandraId> index, MailboxEventDispatcher<CassandraId> dispatcher, MailboxPathLocker locker, Mailbox<CassandraId> mailbox, QuotaManager quotaManager, QuotaRootResolver quotaRootResolver) throws MailboxException {
+    public CassandraMessageManager(MailboxSessionMapperFactory mapperFactory, MessageSearchIndex index, MailboxEventDispatcher dispatcher, MailboxPathLocker locker, Mailbox mailbox, QuotaManager quotaManager, QuotaRootResolver quotaRootResolver) throws MailboxException {
         super(mapperFactory, index, dispatcher, locker, mailbox, new UnionMailboxACLResolver(), new SimpleGroupMembershipResolver(), quotaManager, quotaRootResolver);
 
     }

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/cassandra/src/main/java/org/apache/james/mailbox/cassandra/mail/CassandraACLMapper.java
----------------------------------------------------------------------
diff --git a/mailbox/cassandra/src/main/java/org/apache/james/mailbox/cassandra/mail/CassandraACLMapper.java b/mailbox/cassandra/src/main/java/org/apache/james/mailbox/cassandra/mail/CassandraACLMapper.java
index 7760aea..378b48b 100644
--- a/mailbox/cassandra/src/main/java/org/apache/james/mailbox/cassandra/mail/CassandraACLMapper.java
+++ b/mailbox/cassandra/src/main/java/org/apache/james/mailbox/cassandra/mail/CassandraACLMapper.java
@@ -29,9 +29,9 @@ import java.io.IOException;
 import java.util.Optional;
 
 import org.apache.james.backends.cassandra.utils.CassandraConstants;
+import org.apache.james.backends.cassandra.utils.FunctionRunnerWithRetry;
 import org.apache.james.backends.cassandra.utils.LightweightTransactionException;
 import org.apache.james.mailbox.cassandra.CassandraId;
-import org.apache.james.backends.cassandra.utils.FunctionRunnerWithRetry;
 import org.apache.james.mailbox.cassandra.table.CassandraACLTable;
 import org.apache.james.mailbox.cassandra.table.CassandraMailboxTable;
 import org.apache.james.mailbox.exception.MailboxException;
@@ -57,18 +57,18 @@ public class CassandraACLMapper {
         void inject();
     }
 
-    private final Mailbox<CassandraId> mailbox;
+    private final Mailbox mailbox;
     private final Session session;
     private final int maxRetry;
     private final CodeInjector codeInjector;
 
     private static final Logger LOG = LoggerFactory.getLogger(CassandraACLMapper.class);
 
-    public CassandraACLMapper(Mailbox<CassandraId> mailbox, Session session, int maxRetry) {
+    public CassandraACLMapper(Mailbox mailbox, Session session, int maxRetry) {
         this(mailbox, session, maxRetry, () -> {});
     }
 
-    public CassandraACLMapper(Mailbox<CassandraId> mailbox, Session session, int maxRetry, CodeInjector codeInjector) {
+    public CassandraACLMapper(Mailbox mailbox, Session session, int maxRetry, CodeInjector codeInjector) {
         Preconditions.checkArgument(maxRetry > 0);
         Preconditions.checkArgument(mailbox.getMailboxId() != null);
         this.mailbox = mailbox;
@@ -112,20 +112,22 @@ public class CassandraACLMapper {
     }
 
     private ResultSet getStoredACLRow() {
+        CassandraId mailboxId = (CassandraId) mailbox.getMailboxId();
         return session.execute(
             select(CassandraACLTable.ACL, CassandraACLTable.VERSION)
                 .from(CassandraACLTable.TABLE_NAME)
-                .where(eq(CassandraMailboxTable.ID, mailbox.getMailboxId().asUuid()))
+                .where(eq(CassandraMailboxTable.ID, mailboxId.asUuid()))
         );
     }
 
     private ResultSet updateStoredACL(ACLWithVersion aclWithVersion) {
         try {
+            CassandraId mailboxId = (CassandraId) mailbox.getMailboxId();
             return session.execute(
                 update(CassandraACLTable.TABLE_NAME)
                     .with(set(CassandraACLTable.ACL, SimpleMailboxACLJsonConverter.toJson(aclWithVersion.mailboxACL)))
                     .and(set(CassandraACLTable.VERSION, aclWithVersion.version + 1))
-                    .where(eq(CassandraACLTable.ID, mailbox.getMailboxId().asUuid()))
+                    .where(eq(CassandraACLTable.ID, mailboxId.asUuid()))
                     .onlyIf(eq(CassandraACLTable.VERSION, aclWithVersion.version))
             );
         } catch (JsonProcessingException exception) {
@@ -135,9 +137,10 @@ public class CassandraACLMapper {
 
     private ResultSet insertACL(MailboxACL acl) {
         try {
+            CassandraId mailboxId = (CassandraId) mailbox.getMailboxId();
             return session.execute(
                 insertInto(CassandraACLTable.TABLE_NAME)
-                    .value(CassandraACLTable.ID, mailbox.getMailboxId().asUuid())
+                    .value(CassandraACLTable.ID, mailboxId.asUuid())
                     .value(CassandraACLTable.ACL, SimpleMailboxACLJsonConverter.toJson(acl))
                     .value(CassandraACLTable.VERSION, 0)
                     .ifNotExists()

http://git-wip-us.apache.org/repos/asf/james-project/blob/7015d946/mailbox/cassandra/src/main/java/org/apache/james/mailbox/cassandra/mail/CassandraMailboxMapper.java
----------------------------------------------------------------------
diff --git a/mailbox/cassandra/src/main/java/org/apache/james/mailbox/cassandra/mail/CassandraMailboxMapper.java b/mailbox/cassandra/src/main/java/org/apache/james/mailbox/cassandra/mail/CassandraMailboxMapper.java
index 1a315e9..853e19c 100644
--- a/mailbox/cassandra/src/main/java/org/apache/james/mailbox/cassandra/mail/CassandraMailboxMapper.java
+++ b/mailbox/cassandra/src/main/java/org/apache/james/mailbox/cassandra/mail/CassandraMailboxMapper.java
@@ -59,7 +59,7 @@ import com.google.common.base.Preconditions;
 /**
  * Data access management for mailbox.
  */
-public class CassandraMailboxMapper implements MailboxMapper<CassandraId> {
+public class CassandraMailboxMapper implements MailboxMapper {
 
     public static final String WILDCARD = "%";
     private final Session session;
@@ -73,15 +73,16 @@ public class CassandraMailboxMapper implements MailboxMapper<CassandraId> {
     }
 
     @Override
-    public void delete(Mailbox<CassandraId> mailbox) throws MailboxException {
+    public void delete(Mailbox mailbox) throws MailboxException {
+        CassandraId mailboxId = (CassandraId) mailbox.getMailboxId();
         session.execute(
             QueryBuilder.delete()
                 .from(TABLE_NAME)
-                .where(eq(ID, mailbox.getMailboxId().asUuid())));
+                .where(eq(ID, mailboxId.asUuid())));
     }
 
     @Override
-    public Mailbox<CassandraId> findMailboxByPath(MailboxPath path) throws MailboxException {
+    public Mailbox findMailboxByPath(MailboxPath path) throws MailboxException {
         ResultSet resultSet = session.execute(select(FIELDS).from(TABLE_NAME).where(eq(PATH, path.toString())));
         if (resultSet.isExhausted()) {
             throw new MailboxNotFoundException(path);
@@ -91,7 +92,7 @@ public class CassandraMailboxMapper implements MailboxMapper<CassandraId> {
     }
 
     @Override
-    public List<Mailbox<CassandraId>> findMailboxWithPathLike(MailboxPath path) throws MailboxException {
+    public List<Mailbox> findMailboxWithPathLike(MailboxPath path) throws MailboxException {
         Pattern regex = Pattern.compile(constructEscapedRegexForMailboxNameMatching(path));
         return getMailboxFilteredByNamespaceAndUserStream(path.getNamespace(), path.getUser())
             .filter((row) -> regex.matcher(row.getString(NAME)).matches())
@@ -100,9 +101,9 @@ public class CassandraMailboxMapper implements MailboxMapper<CassandraId> {
     }
 
     @Override
-    public void save(Mailbox<CassandraId> mailbox) throws MailboxException {
+    public void save(Mailbox mailbox) throws MailboxException {
         Preconditions.checkArgument(mailbox instanceof SimpleMailbox);
-        SimpleMailbox<CassandraId> cassandraMailbox = (SimpleMailbox<CassandraId>) mailbox;
+        SimpleMailbox cassandraMailbox = (SimpleMailbox) mailbox;
         if (cassandraMailbox.getMailboxId() == null) {
             cassandraMailbox.setMailboxId(CassandraId.timeBased());
         }
@@ -110,14 +111,14 @@ public class CassandraMailboxMapper implements MailboxMapper<CassandraId> {
     }
 
     @Override
-    public boolean hasChildren(Mailbox<CassandraId> mailbox, char delimiter) {
+    public boolean hasChildren(Mailbox mailbox, char delimiter) {
         final Pattern regex = Pattern.compile(Pattern.quote( mailbox.getName() + String.valueOf(delimiter)) + ".*");
         return getMailboxFilteredByNamespaceAndUserStream(mailbox.getNamespace(), mailbox.getUser())
             .anyMatch((row) -> regex.matcher(row.getString(NAME)).matches());
     }
 
     @Override
-    public List<Mailbox<CassandraId>> list() throws MailboxException {
+    public List<Mailbox> list() throws MailboxException {
         return CassandraUtils.convertToStream(
             session.execute(
                 select(FIELDS).from(TABLE_NAME)))
@@ -131,7 +132,7 @@ public class CassandraMailboxMapper implements MailboxMapper<CassandraId> {
     }
 
     @Override
-    public void updateACL(Mailbox<CassandraId> mailbox, MailboxACL.MailboxACLCommand mailboxACLCommand) throws MailboxException {
+    public void updateACL(Mailbox mailbox, MailboxACL.MailboxACLCommand mailboxACLCommand) throws MailboxException {
         new CassandraACLMapper(mailbox, session, maxRetry).updateACL(mailboxACLCommand);
     }
 
@@ -140,8 +141,8 @@ public class CassandraMailboxMapper implements MailboxMapper<CassandraId> {
         // Do nothing
     }
 
-    private SimpleMailbox<CassandraId> mailbox(Row row) {
-        SimpleMailbox<CassandraId> mailbox = new SimpleMailbox<>(
+    private SimpleMailbox mailbox(Row row) {
+        SimpleMailbox mailbox = new SimpleMailbox(
             new MailboxPath(
                 row.getUDTValue(MAILBOX_BASE).getString(MailboxBase.NAMESPACE),
                 row.getUDTValue(MAILBOX_BASE).getString(MailboxBase.USER),
@@ -166,10 +167,11 @@ public class CassandraMailboxMapper implements MailboxMapper<CassandraId> {
             ).collect(Collectors.joining());
     }
 
-    private void upsertMailbox(SimpleMailbox<CassandraId> mailbox) throws MailboxException {
+    private void upsertMailbox(SimpleMailbox mailbox) throws MailboxException {
+        CassandraId mailboxId = (CassandraId) mailbox.getMailboxId();
         session.execute(
             insertInto(TABLE_NAME)
-                .value(ID, mailbox.getMailboxId().asUuid())
+                .value(ID, mailboxId.asUuid())
                 .value(NAME, mailbox.getName())
                 .value(UIDVALIDITY, mailbox.getUidValidity())
                 .value(MAILBOX_BASE, typesProvider.getDefinedUserType(CassandraMailboxTable.MAILBOX_BASE)
@@ -180,7 +182,7 @@ public class CassandraMailboxMapper implements MailboxMapper<CassandraId> {
         );
     }
 
-    private MailboxPath path(Mailbox<?> mailbox) {
+    private MailboxPath path(Mailbox mailbox) {
         return new MailboxPath(mailbox.getNamespace(), mailbox.getUser(), mailbox.getName());
     }
 


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