james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nor...@apache.org
Subject svn commit: r951305 - in /james/imap/trunk: jcr/src/main/java/org/apache/james/imap/jcr/ jpa/src/main/java/org/apache/james/imap/jpa/ jpa/src/main/java/org/apache/james/imap/jpa/openjpa/ memory/src/main/java/org/apache/james/imap/inmemory/ store/src/ma...
Date Fri, 04 Jun 2010 07:08:07 GMT
Author: norman
Date: Fri Jun  4 07:08:06 2010
New Revision: 951305

URL: http://svn.apache.org/viewvc?rev=951305&view=rev
Log:
Rename StoreMailbox to StoreMessageMapper, Rename implementations, Change getMailboxRow()
to getMailboxEntity(). This work is part of IMAP-148. Thx to Tim-Christian Mundt for the patch!

Added:
    james/imap/trunk/jcr/src/main/java/org/apache/james/imap/jcr/JCRMessageManager.java
      - copied, changed from r951291, james/imap/trunk/jcr/src/main/java/org/apache/james/imap/jcr/JCRMailbox.java
    james/imap/trunk/jpa/src/main/java/org/apache/james/imap/jpa/JPAMessageManager.java
      - copied, changed from r951291, james/imap/trunk/jpa/src/main/java/org/apache/james/imap/jpa/JPAMailbox.java
    james/imap/trunk/jpa/src/main/java/org/apache/james/imap/jpa/openjpa/OpenJPAMessageManager.java
      - copied, changed from r951291, james/imap/trunk/jpa/src/main/java/org/apache/james/imap/jpa/openjpa/OpenJPAMailbox.java
    james/imap/trunk/memory/src/main/java/org/apache/james/imap/inmemory/InMemoryStoreMessageManager.java
      - copied, changed from r951291, james/imap/trunk/memory/src/main/java/org/apache/james/imap/inmemory/InMemoryStoreMailbox.java
    james/imap/trunk/store/src/main/java/org/apache/james/imap/store/StoreMessageManager.java
      - copied, changed from r951291, james/imap/trunk/store/src/main/java/org/apache/james/imap/store/StoreMailbox.java
Removed:
    james/imap/trunk/jcr/src/main/java/org/apache/james/imap/jcr/JCRMailbox.java
    james/imap/trunk/jpa/src/main/java/org/apache/james/imap/jpa/JPAMailbox.java
    james/imap/trunk/jpa/src/main/java/org/apache/james/imap/jpa/openjpa/OpenJPAMailbox.java
    james/imap/trunk/memory/src/main/java/org/apache/james/imap/inmemory/InMemoryStoreMailbox.java
    james/imap/trunk/store/src/main/java/org/apache/james/imap/store/StoreMailbox.java
Modified:
    james/imap/trunk/jcr/src/main/java/org/apache/james/imap/jcr/JCRMailboxManager.java
    james/imap/trunk/jpa/src/main/java/org/apache/james/imap/jpa/openjpa/OpenJPAMailboxManager.java
    james/imap/trunk/memory/src/main/java/org/apache/james/imap/inmemory/InMemoryMailboxManager.java
    james/imap/trunk/store/src/main/java/org/apache/james/imap/store/StoreMailboxManager.java

Modified: james/imap/trunk/jcr/src/main/java/org/apache/james/imap/jcr/JCRMailboxManager.java
URL: http://svn.apache.org/viewvc/james/imap/trunk/jcr/src/main/java/org/apache/james/imap/jcr/JCRMailboxManager.java?rev=951305&r1=951304&r2=951305&view=diff
==============================================================================
--- james/imap/trunk/jcr/src/main/java/org/apache/james/imap/jcr/JCRMailboxManager.java (original)
+++ james/imap/trunk/jcr/src/main/java/org/apache/james/imap/jcr/JCRMailboxManager.java Fri
Jun  4 07:08:06 2010
@@ -34,7 +34,7 @@ import org.apache.james.imap.mailbox.Mai
 import org.apache.james.imap.mailbox.util.MailboxEventDispatcher;
 import org.apache.james.imap.store.Authenticator;
 import org.apache.james.imap.store.PasswordAwareMailboxSession;
-import org.apache.james.imap.store.StoreMailbox;
+import org.apache.james.imap.store.StoreMessageManager;
 import org.apache.james.imap.store.StoreMailboxManager;
 import org.apache.james.imap.store.Subscriber;
 import org.apache.james.imap.store.UidConsumer;
@@ -59,8 +59,8 @@ public class JCRMailboxManager extends S
 
 
     @Override
-    protected StoreMailbox<String> createMailbox(MailboxEventDispatcher dispatcher,
UidConsumer<String> consumer,Mailbox<String> mailboxRow, MailboxSession session)
throws MailboxException{
-        return new JCRMailbox(dispatcher, consumer, (org.apache.james.imap.jcr.mail.model.JCRMailbox)
mailboxRow, repository, getLog(), getDelimiter());    
+    protected StoreMessageManager<String> createMailbox(MailboxEventDispatcher dispatcher,
UidConsumer<String> consumer,Mailbox<String> mailboxRow, MailboxSession session)
throws MailboxException{
+        return new JCRMessageManager(dispatcher, consumer, (org.apache.james.imap.jcr.mail.model.JCRMailbox)
mailboxRow, repository, getLog(), getDelimiter());    
     }
 
     @Override

Copied: james/imap/trunk/jcr/src/main/java/org/apache/james/imap/jcr/JCRMessageManager.java
(from r951291, james/imap/trunk/jcr/src/main/java/org/apache/james/imap/jcr/JCRMailbox.java)
URL: http://svn.apache.org/viewvc/james/imap/trunk/jcr/src/main/java/org/apache/james/imap/jcr/JCRMessageManager.java?p2=james/imap/trunk/jcr/src/main/java/org/apache/james/imap/jcr/JCRMessageManager.java&p1=james/imap/trunk/jcr/src/main/java/org/apache/james/imap/jcr/JCRMailbox.java&r1=951291&r2=951305&rev=951305&view=diff
==============================================================================
--- james/imap/trunk/jcr/src/main/java/org/apache/james/imap/jcr/JCRMailbox.java (original)
+++ james/imap/trunk/jcr/src/main/java/org/apache/james/imap/jcr/JCRMessageManager.java Fri
Jun  4 07:08:06 2010
@@ -35,7 +35,7 @@ import org.apache.james.imap.jcr.mail.mo
 import org.apache.james.imap.mailbox.MailboxException;
 import org.apache.james.imap.mailbox.MailboxSession;
 import org.apache.james.imap.mailbox.util.MailboxEventDispatcher;
-import org.apache.james.imap.store.StoreMailbox;
+import org.apache.james.imap.store.StoreMessageManager;
 import org.apache.james.imap.store.UidConsumer;
 import org.apache.james.imap.store.mail.MessageMapper;
 import org.apache.james.imap.store.mail.model.Header;
@@ -43,16 +43,16 @@ import org.apache.james.imap.store.mail.
 import org.apache.james.imap.store.mail.model.PropertyBuilder;
 
 /**
- * JCR implementation of a {@link StoreMailbox}
+ * JCR implementation of a {@link StoreMessageManager}
  *
  */
-public class JCRMailbox extends StoreMailbox<String>{
+public class JCRMessageManager extends StoreMessageManager<String>{
 
     private final MailboxSessionJCRRepository repos;
     private final Log log;
     private char delimiter;
 
-    public JCRMailbox(final MailboxEventDispatcher dispatcher, UidConsumer<String>
consumer, final org.apache.james.imap.jcr.mail.model.JCRMailbox mailbox, final MailboxSessionJCRRepository
repos, final Log log, final char delimiter) {
+    public JCRMessageManager(final MailboxEventDispatcher dispatcher, UidConsumer<String>
consumer, final org.apache.james.imap.jcr.mail.model.JCRMailbox mailbox, final MailboxSessionJCRRepository
repos, final Log log, final char delimiter) {
         super(dispatcher, consumer, mailbox);
         this.log = log;
         this.repos = repos;

Copied: james/imap/trunk/jpa/src/main/java/org/apache/james/imap/jpa/JPAMessageManager.java
(from r951291, james/imap/trunk/jpa/src/main/java/org/apache/james/imap/jpa/JPAMailbox.java)
URL: http://svn.apache.org/viewvc/james/imap/trunk/jpa/src/main/java/org/apache/james/imap/jpa/JPAMessageManager.java?p2=james/imap/trunk/jpa/src/main/java/org/apache/james/imap/jpa/JPAMessageManager.java&p1=james/imap/trunk/jpa/src/main/java/org/apache/james/imap/jpa/JPAMailbox.java&r1=951291&r2=951305&rev=951305&view=diff
==============================================================================
--- james/imap/trunk/jpa/src/main/java/org/apache/james/imap/jpa/JPAMailbox.java (original)
+++ james/imap/trunk/jpa/src/main/java/org/apache/james/imap/jpa/JPAMessageManager.java Fri
Jun  4 07:08:06 2010
@@ -33,7 +33,7 @@ import org.apache.james.imap.jpa.mail.mo
 import org.apache.james.imap.mailbox.MailboxException;
 import org.apache.james.imap.mailbox.MailboxSession;
 import org.apache.james.imap.mailbox.util.MailboxEventDispatcher;
-import org.apache.james.imap.store.StoreMailbox;
+import org.apache.james.imap.store.StoreMessageManager;
 import org.apache.james.imap.store.UidConsumer;
 import org.apache.james.imap.store.mail.MailboxMapper;
 import org.apache.james.imap.store.mail.MessageMapper;
@@ -48,11 +48,11 @@ import org.apache.james.imap.store.mail.
  * 
  *
  */
-public class JPAMailbox extends StoreMailbox<Long> {
+public class JPAMessageManager extends StoreMessageManager<Long> {
 
     protected final MailboxSessionEntityManagerFactory entityManagerFactory;
     
-    public JPAMailbox(final MailboxEventDispatcher dispatcher, final UidConsumer<Long>
consumer,final Mailbox<Long> mailbox, final MailboxSessionEntityManagerFactory entityManagerFactory)
{
+    public JPAMessageManager(final MailboxEventDispatcher dispatcher, final UidConsumer<Long>
consumer,final Mailbox<Long> mailbox, final MailboxSessionEntityManagerFactory entityManagerFactory)
{
         super(dispatcher, consumer, mailbox);
         this.entityManagerFactory = entityManagerFactory;        
     }  

Modified: james/imap/trunk/jpa/src/main/java/org/apache/james/imap/jpa/openjpa/OpenJPAMailboxManager.java
URL: http://svn.apache.org/viewvc/james/imap/trunk/jpa/src/main/java/org/apache/james/imap/jpa/openjpa/OpenJPAMailboxManager.java?rev=951305&r1=951304&r2=951305&view=diff
==============================================================================
--- james/imap/trunk/jpa/src/main/java/org/apache/james/imap/jpa/openjpa/OpenJPAMailboxManager.java
(original)
+++ james/imap/trunk/jpa/src/main/java/org/apache/james/imap/jpa/openjpa/OpenJPAMailboxManager.java
Fri Jun  4 07:08:06 2010
@@ -25,7 +25,7 @@ import org.apache.james.imap.jpa.Mailbox
 import org.apache.james.imap.mailbox.MailboxSession;
 import org.apache.james.imap.mailbox.util.MailboxEventDispatcher;
 import org.apache.james.imap.store.Authenticator;
-import org.apache.james.imap.store.StoreMailbox;
+import org.apache.james.imap.store.StoreMessageManager;
 import org.apache.james.imap.store.Subscriber;
 import org.apache.james.imap.store.UidConsumer;
 import org.apache.james.imap.store.mail.model.Mailbox;
@@ -47,8 +47,8 @@ public class OpenJPAMailboxManager exten
         this(authenticator, subscriber, entityManagerFactory, false);
     }
 
-    protected StoreMailbox<Long> createMailbox(MailboxEventDispatcher dispatcher, UidConsumer<Long>
consumer, Mailbox<Long> mailboxRow, MailboxSession session) {
-        StoreMailbox<Long> result =  new OpenJPAMailbox(dispatcher, consumer, mailboxRow,entityManagerFactory,
useStreaming);
+    protected StoreMessageManager<Long> createMailbox(MailboxEventDispatcher dispatcher,
UidConsumer<Long> consumer, Mailbox<Long> mailboxRow, MailboxSession session)
{
+        StoreMessageManager<Long> result =  new OpenJPAMessageManager(dispatcher, consumer,
mailboxRow,entityManagerFactory, useStreaming);
         return result;
     }
 }

Copied: james/imap/trunk/jpa/src/main/java/org/apache/james/imap/jpa/openjpa/OpenJPAMessageManager.java
(from r951291, james/imap/trunk/jpa/src/main/java/org/apache/james/imap/jpa/openjpa/OpenJPAMailbox.java)
URL: http://svn.apache.org/viewvc/james/imap/trunk/jpa/src/main/java/org/apache/james/imap/jpa/openjpa/OpenJPAMessageManager.java?p2=james/imap/trunk/jpa/src/main/java/org/apache/james/imap/jpa/openjpa/OpenJPAMessageManager.java&p1=james/imap/trunk/jpa/src/main/java/org/apache/james/imap/jpa/openjpa/OpenJPAMailbox.java&r1=951291&r2=951305&rev=951305&view=diff
==============================================================================
--- james/imap/trunk/jpa/src/main/java/org/apache/james/imap/jpa/openjpa/OpenJPAMailbox.java
(original)
+++ james/imap/trunk/jpa/src/main/java/org/apache/james/imap/jpa/openjpa/OpenJPAMessageManager.java
Fri Jun  4 07:08:06 2010
@@ -26,7 +26,7 @@ import java.util.List;
 
 import javax.mail.Flags;
 
-import org.apache.james.imap.jpa.JPAMailbox;
+import org.apache.james.imap.jpa.JPAMessageManager;
 import org.apache.james.imap.jpa.MailboxSessionEntityManagerFactory;
 import org.apache.james.imap.jpa.mail.model.AbstractJPAMailboxMembership;
 import org.apache.james.imap.jpa.mail.model.JPAHeader;
@@ -44,15 +44,15 @@ import org.apache.james.imap.store.mail.
  * OpenJPA implementation of Mailbox
  *
  */
-public class OpenJPAMailbox extends JPAMailbox{
+public class OpenJPAMessageManager extends JPAMessageManager{
 
     private final boolean useStreaming;
 
-    public OpenJPAMailbox(MailboxEventDispatcher dispatcher, UidConsumer<Long> consumer,
Mailbox<Long> mailbox, MailboxSessionEntityManagerFactory entityManagerFactory) {
+    public OpenJPAMessageManager(MailboxEventDispatcher dispatcher, UidConsumer<Long>
consumer, Mailbox<Long> mailbox, MailboxSessionEntityManagerFactory entityManagerFactory)
{
         this(dispatcher, consumer, mailbox, entityManagerFactory, false);
     }
 
-    public OpenJPAMailbox(MailboxEventDispatcher dispatcher, UidConsumer<Long> consumer,
Mailbox<Long> mailbox, MailboxSessionEntityManagerFactory entityManagerFactory, final
boolean useStreaming) {
+    public OpenJPAMessageManager(MailboxEventDispatcher dispatcher, UidConsumer<Long>
consumer, Mailbox<Long> mailbox, MailboxSessionEntityManagerFactory entityManagerFactory,
final boolean useStreaming) {
         super(dispatcher, consumer, mailbox, entityManagerFactory);
         this.useStreaming = useStreaming;
     }

Modified: james/imap/trunk/memory/src/main/java/org/apache/james/imap/inmemory/InMemoryMailboxManager.java
URL: http://svn.apache.org/viewvc/james/imap/trunk/memory/src/main/java/org/apache/james/imap/inmemory/InMemoryMailboxManager.java?rev=951305&r1=951304&r2=951305&view=diff
==============================================================================
--- james/imap/trunk/memory/src/main/java/org/apache/james/imap/inmemory/InMemoryMailboxManager.java
(original)
+++ james/imap/trunk/memory/src/main/java/org/apache/james/imap/inmemory/InMemoryMailboxManager.java
Fri Jun  4 07:08:06 2010
@@ -30,7 +30,7 @@ import org.apache.james.imap.mailbox.Mai
 import org.apache.james.imap.mailbox.StorageException;
 import org.apache.james.imap.mailbox.util.MailboxEventDispatcher;
 import org.apache.james.imap.store.Authenticator;
-import org.apache.james.imap.store.StoreMailbox;
+import org.apache.james.imap.store.StoreMessageManager;
 import org.apache.james.imap.store.StoreMailboxManager;
 import org.apache.james.imap.store.Subscriber;
 import org.apache.james.imap.store.UidConsumer;
@@ -42,7 +42,7 @@ public class InMemoryMailboxManager exte
 
     private static final int INITIAL_SIZE = 128;
     private Map<Long, InMemoryMailbox> mailboxesById;
-    private Map<String, InMemoryStoreMailbox> storeMailboxByName;
+    private Map<String, InMemoryStoreMessageManager> storeMailboxByName;
     private Map<Long, String> idNameMap;
     private MailboxSession session;
 
@@ -55,15 +55,15 @@ public class InMemoryMailboxManager exte
             }
         });
         mailboxesById = new ConcurrentHashMap<Long, InMemoryMailbox>(INITIAL_SIZE);
-        storeMailboxByName = new ConcurrentHashMap<String, InMemoryStoreMailbox>(INITIAL_SIZE);
+        storeMailboxByName = new ConcurrentHashMap<String, InMemoryStoreMessageManager>(INITIAL_SIZE);
         idNameMap = new ConcurrentHashMap<Long, String>(INITIAL_SIZE);
     }
 
     @Override
-    protected StoreMailbox<Long> createMailbox(MailboxEventDispatcher dispatcher, UidConsumer<Long>
consumer, Mailbox<Long> mailboxRow, MailboxSession session) {
-        InMemoryStoreMailbox storeMailbox = storeMailboxByName.get(mailboxRow.getName());
+    protected StoreMessageManager<Long> createMailbox(MailboxEventDispatcher dispatcher,
UidConsumer<Long> consumer, Mailbox<Long> mailboxRow, MailboxSession session)
{
+        InMemoryStoreMessageManager storeMailbox = storeMailboxByName.get(mailboxRow.getName());
         if (storeMailbox == null) {
-            storeMailbox = new InMemoryStoreMailbox(dispatcher, consumer, (InMemoryMailbox)mailboxRow);
+            storeMailbox = new InMemoryStoreMessageManager(dispatcher, consumer, (InMemoryMailbox)mailboxRow);
             storeMailboxByName.put(mailboxRow.getName(), storeMailbox);
         }
         
@@ -176,10 +176,10 @@ public class InMemoryMailboxManager exte
         mailboxesById.put(mailbox.getMailboxId(), (InMemoryMailbox) mailbox);
         String name = idNameMap.remove(mailbox.getMailboxId());
         if (name != null) {
-            InMemoryStoreMailbox m = storeMailboxByName.remove(name);
+            InMemoryStoreMessageManager m = storeMailboxByName.remove(name);
             if (m!= null) {
                 try {
-                    m.getMailboxRow(session).setName(mailbox.getName());
+                    m.getMailboxEntity(session).setName(mailbox.getName());
                     storeMailboxByName.put(mailbox.getName(), m);
                 } catch (MailboxException e) {
                     throw new StorageException(e.getKey(), e);

Copied: james/imap/trunk/memory/src/main/java/org/apache/james/imap/inmemory/InMemoryStoreMessageManager.java
(from r951291, james/imap/trunk/memory/src/main/java/org/apache/james/imap/inmemory/InMemoryStoreMailbox.java)
URL: http://svn.apache.org/viewvc/james/imap/trunk/memory/src/main/java/org/apache/james/imap/inmemory/InMemoryStoreMessageManager.java?p2=james/imap/trunk/memory/src/main/java/org/apache/james/imap/inmemory/InMemoryStoreMessageManager.java&p1=james/imap/trunk/memory/src/main/java/org/apache/james/imap/inmemory/InMemoryStoreMailbox.java&r1=951291&r2=951305&rev=951305&view=diff
==============================================================================
--- james/imap/trunk/memory/src/main/java/org/apache/james/imap/inmemory/InMemoryStoreMailbox.java
(original)
+++ james/imap/trunk/memory/src/main/java/org/apache/james/imap/inmemory/InMemoryStoreMessageManager.java
Fri Jun  4 07:08:06 2010
@@ -38,7 +38,7 @@ import org.apache.james.imap.mailbox.Sea
 import org.apache.james.imap.mailbox.StorageException;
 import org.apache.james.imap.mailbox.util.MailboxEventDispatcher;
 import org.apache.james.imap.store.MailboxMembershipComparator;
-import org.apache.james.imap.store.StoreMailbox;
+import org.apache.james.imap.store.StoreMessageManager;
 import org.apache.james.imap.store.UidConsumer;
 import org.apache.james.imap.store.mail.MailboxMapper;
 import org.apache.james.imap.store.mail.MessageMapper;
@@ -47,13 +47,13 @@ import org.apache.james.imap.store.mail.
 import org.apache.james.imap.store.mail.model.MailboxMembership;
 import org.apache.james.imap.store.mail.model.PropertyBuilder;
 
-public class InMemoryStoreMailbox extends StoreMailbox<Long> implements MessageMapper<Long>
{
+public class InMemoryStoreMessageManager extends StoreMessageManager<Long> implements
MessageMapper<Long> {
     
     private static final int INITIAL_SIZE = 256;
     private Map<Long, MailboxMembership<Long>> membershipByUid;
     private InMemoryMailbox mailbox;
 
-    public InMemoryStoreMailbox(MailboxEventDispatcher dispatcher, UidConsumer<Long>
consumer, InMemoryMailbox mailbox) {
+    public InMemoryStoreMessageManager(MailboxEventDispatcher dispatcher, UidConsumer<Long>
consumer, InMemoryMailbox mailbox) {
         super(dispatcher, consumer, mailbox);
         this.mailbox = mailbox;
         this.membershipByUid = new ConcurrentHashMap<Long, MailboxMembership<Long>>(INITIAL_SIZE);
@@ -256,7 +256,7 @@ public class InMemoryStoreMailbox extend
 
 
     @Override
-    protected Mailbox<Long> getMailboxRow(MailboxSession session) throws MailboxException
{
+    protected Mailbox<Long> getMailboxEntity(MailboxSession session) throws MailboxException
{
         return mailbox;
     }
 

Modified: james/imap/trunk/store/src/main/java/org/apache/james/imap/store/StoreMailboxManager.java
URL: http://svn.apache.org/viewvc/james/imap/trunk/store/src/main/java/org/apache/james/imap/store/StoreMailboxManager.java?rev=951305&r1=951304&r2=951305&view=diff
==============================================================================
--- james/imap/trunk/store/src/main/java/org/apache/james/imap/store/StoreMailboxManager.java
(original)
+++ james/imap/trunk/store/src/main/java/org/apache/james/imap/store/StoreMailboxManager.java
Fri Jun  4 07:08:06 2010
@@ -92,7 +92,7 @@ public abstract class StoreMailboxManage
      * @param mailboxRow
      * @return storeMailbox
      */
-    protected abstract StoreMailbox<Id> createMailbox(MailboxEventDispatcher dispatcher,
UidConsumer<Id> consumer, Mailbox<Id> mailboxRow, MailboxSession session) throws
MailboxException;
+    protected abstract StoreMessageManager<Id> createMailbox(MailboxEventDispatcher
dispatcher, UidConsumer<Id> consumer, Mailbox<Id> mailboxRow, MailboxSession session)
throws MailboxException;
     
     /**
      * Create the MailboxMapper
@@ -126,7 +126,7 @@ public abstract class StoreMailboxManage
      * @return mailbox the mailbox for the given name
      * @throws MailboxException get thrown if no Mailbox could be found for the given name
      */
-    private StoreMailbox<Id> doGetMailbox(String mailboxName, MailboxSession session)
throws MailboxException {
+    private StoreMessageManager<Id> doGetMailbox(String mailboxName, MailboxSession
session) throws MailboxException {
         synchronized (mutex) {
             final MailboxMapper<Id> mapper = createMailboxMapper(session);
             Mailbox<Id> mailboxRow = mapper.findMailboxByName(mailboxName);
@@ -138,7 +138,7 @@ public abstract class StoreMailboxManage
             } else {
                 getLog().debug("Loaded mailbox " + mailboxName);
 
-                StoreMailbox<Id> result = createMailbox(dispatcher, consumer, mailboxRow,
session);
+                StoreMessageManager<Id> result = createMailbox(dispatcher, consumer,
mailboxRow, session);
                 result.addListener(delegatingListener);
                 return result;
             }
@@ -288,8 +288,8 @@ public abstract class StoreMailboxManage
             MailboxSession session) throws MailboxException {
         synchronized (mutex) {
 
-        StoreMailbox<Id> toMailbox = doGetMailbox(to, session);
-        StoreMailbox<Id> fromMailbox = doGetMailbox(from, session);
+        StoreMessageManager<Id> toMailbox = doGetMailbox(to, session);
+        StoreMessageManager<Id> fromMailbox = doGetMailbox(from, session);
             fromMailbox.copyTo(set, toMailbox, session);
         }
     }

Copied: james/imap/trunk/store/src/main/java/org/apache/james/imap/store/StoreMessageManager.java
(from r951291, james/imap/trunk/store/src/main/java/org/apache/james/imap/store/StoreMailbox.java)
URL: http://svn.apache.org/viewvc/james/imap/trunk/store/src/main/java/org/apache/james/imap/store/StoreMessageManager.java?p2=james/imap/trunk/store/src/main/java/org/apache/james/imap/store/StoreMessageManager.java&p1=james/imap/trunk/store/src/main/java/org/apache/james/imap/store/StoreMailbox.java&r1=951291&r2=951305&rev=951305&view=diff
==============================================================================
--- james/imap/trunk/store/src/main/java/org/apache/james/imap/store/StoreMailbox.java (original)
+++ james/imap/trunk/store/src/main/java/org/apache/james/imap/store/StoreMessageManager.java
Fri Jun  4 07:08:06 2010
@@ -73,7 +73,7 @@ import com.sun.mail.imap.protocol.Messag
  * 
  *
  */
-public abstract class StoreMailbox<Id> implements org.apache.james.imap.mailbox.Mailbox,
StoreConstants {
+public abstract class StoreMessageManager<Id> implements org.apache.james.imap.mailbox.Mailbox,
StoreConstants {
 
     private static final int INITIAL_SIZE_FLAGS = 32;
 
@@ -86,7 +86,7 @@ public abstract class StoreMailbox<Id> i
     private UidConsumer<Id> consumer;
     
     
-    public StoreMailbox(final MailboxEventDispatcher dispatcher, UidConsumer<Id> consumer,
final Mailbox<Id> mailbox) {
+    public StoreMessageManager(final MailboxEventDispatcher dispatcher, UidConsumer<Id>
consumer, final Mailbox<Id> mailbox) {
         this.mailboxId = mailbox.getMailboxId();
         this.dispatcher = dispatcher;
         this.consumer = consumer;
@@ -126,7 +126,7 @@ public abstract class StoreMailbox<Id> i
      * @throws MailboxException
      */
     
-    protected Mailbox<Id> getMailboxRow(MailboxSession session) throws MailboxException
{
+    protected Mailbox<Id> getMailboxEntity(MailboxSession session) throws MailboxException
{
         final MailboxMapper<Id> mapper = createMailboxMapper(session);
         return mapper.findMailboxById(getMailboxId());
     }
@@ -159,7 +159,7 @@ public abstract class StoreMailbox<Id> i
         // this will hold the uid after the transaction was complete
         final MessageMapper<Id> mapper = createMessageMapper(mailboxSession);
         
-        final long uid = consumer.reserveNextUid(getMailboxRow(mailboxSession), mailboxSession);
+        final long uid = consumer.reserveNextUid(getMailboxEntity(mailboxSession), mailboxSession);
         
         
         File file = null;
@@ -289,7 +289,7 @@ public abstract class StoreMailbox<Id> i
                 }
             });
            
-            dispatcher.added(uid, mailboxSession.getSessionId(), getMailboxRow(mailboxSession).getName());
+            dispatcher.added(uid, mailboxSession.getSessionId(), getMailboxEntity(mailboxSession).getName());
             return uid;
         } catch (IOException e) {
             e.printStackTrace();
@@ -495,7 +495,7 @@ public abstract class StoreMailbox<Id> i
         
         Iterator<Long> uidIt = uids.iterator();
         while(uidIt.hasNext()) {
-            dispatcher.expunged(uidIt.next(), mailboxSession.getSessionId(), getMailboxRow(mailboxSession).getName());
+            dispatcher.expunged(uidIt.next(), mailboxSession.getSessionId(), getMailboxEntity(mailboxSession).getName());
         }
         return uids.iterator();
     }
@@ -541,7 +541,7 @@ public abstract class StoreMailbox<Id> i
         Iterator<Long> it = newFlagsByUid.keySet().iterator();
         while (it.hasNext()) {
             Long uid = it.next();
-            dispatcher.flagsUpdated(uid, mailboxSession.getSessionId(), getMailboxRow(mailboxSession).getName(),
originalFlagsByUid.get(uid), newFlagsByUid.get(uid));
+            dispatcher.flagsUpdated(uid, mailboxSession.getSessionId(), getMailboxEntity(mailboxSession).getName(),
originalFlagsByUid.get(uid), newFlagsByUid.get(uid));
 
         }
         return newFlagsByUid;
@@ -552,12 +552,12 @@ public abstract class StoreMailbox<Id> i
     }
 
     private long getUidValidity(MailboxSession mailboxSession) throws MailboxException {
-        final long result = getMailboxRow(mailboxSession).getUidValidity();
+        final long result = getMailboxEntity(mailboxSession).getUidValidity();
         return result;
     }
 
     private long getUidNext(MailboxSession mailboxSession) throws MailboxException {
-        Mailbox<Id> mailbox = getMailboxRow(mailboxSession);
+        Mailbox<Id> mailbox = getMailboxEntity(mailboxSession);
         if (mailbox == null) {
             throw new MailboxNotFoundException("Mailbox has been deleted");
         } else {
@@ -610,7 +610,7 @@ public abstract class StoreMailbox<Id> i
             
 
             for (final MailboxMembership<Id> originalMessage:originalRows) {
-                final long uid = consumer.reserveNextUid(getMailboxRow(session),session);
+                final long uid = consumer.reserveNextUid(getMailboxEntity(session),session);
                 
                 mapper.execute(new TransactionalMapper.Transaction() {
 
@@ -631,7 +631,7 @@ public abstract class StoreMailbox<Id> i
             
             // Wait until commit before issuing events
             for (MailboxMembership<Id> newMember:copiedRows) {
-                dispatcher.added(newMember.getUid(), session.getSessionId(), getMailboxRow(session).getName());
+                dispatcher.added(newMember.getUid(), session.getSessionId(), getMailboxEntity(session).getName());
             }
             
         } catch (MessagingException e) {
@@ -640,14 +640,14 @@ public abstract class StoreMailbox<Id> i
     }
 
     /**
-     * Copy the {@link MessageSet} to the {@link StoreMailbox}
+     * Copy the {@link MessageSet} to the {@link StoreMessageManager}
      * 
      * @param set
      * @param toMailbox
      * @param session
      * @throws MailboxException
      */
-    public void copyTo(MessageRange set, StoreMailbox<Id> toMailbox, MailboxSession
session) throws MailboxException {
+    public void copyTo(MessageRange set, StoreMessageManager<Id> toMailbox, MailboxSession
session) throws MailboxException {
         try {
             final MessageMapper<Id> mapper = createMessageMapper(session);
             



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