james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rdon...@apache.org
Subject svn commit: r773256 - in /james/imap/trunk: mailbox/src/main/java/org/apache/james/imap/mailbox/ processor/src/main/java/org/apache/james/imap/processor/ store/src/main/java/org/apache/james/imap/store/ torque/src/main/java/org/apache/james/mailboxmana...
Date Sat, 09 May 2009 18:00:23 GMT
Author: rdonkin
Date: Sat May  9 18:00:23 2009
New Revision: 773256

URL: http://svn.apache.org/viewvc?rev=773256&view=rev
Log:
Consolidate UIDNEXT into a single MetaData for the Mailbox. IMAP-79 https://issues.apache.org/jira/browse/IMAP-79

Modified:
    james/imap/trunk/mailbox/src/main/java/org/apache/james/imap/mailbox/Mailbox.java
    james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/AbstractSelectionProcessor.java
    james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/StatusProcessor.java
    james/imap/trunk/store/src/main/java/org/apache/james/imap/store/MailboxMetaData.java
    james/imap/trunk/store/src/main/java/org/apache/james/imap/store/StoreMailbox.java
    james/imap/trunk/torque/src/main/java/org/apache/james/mailboxmanager/torque/MailboxMetaData.java
    james/imap/trunk/torque/src/main/java/org/apache/james/mailboxmanager/torque/TorqueMailbox.java

Modified: james/imap/trunk/mailbox/src/main/java/org/apache/james/imap/mailbox/Mailbox.java
URL: http://svn.apache.org/viewvc/james/imap/trunk/mailbox/src/main/java/org/apache/james/imap/mailbox/Mailbox.java?rev=773256&r1=773255&r2=773256&view=diff
==============================================================================
--- james/imap/trunk/mailbox/src/main/java/org/apache/james/imap/mailbox/Mailbox.java (original)
+++ james/imap/trunk/mailbox/src/main/java/org/apache/james/imap/mailbox/Mailbox.java Sat
May  9 18:00:23 2009
@@ -47,15 +47,6 @@
      */
     Iterator<Long> search(SearchQuery searchQuery, MailboxSession mailboxSession) throws
MailboxException;
 
-    /**
-     * 
-     * @param mailboxSession not null
-     * @return the uid that will be assigned to the next appended message
-     * @throws MailboxException
-     */
-
-    long getUidNext(MailboxSession mailboxSession) throws MailboxException;
-
     int getUnseenCount(MailboxSession mailboxSession) throws MailboxException;
 
     /**
@@ -159,5 +150,14 @@
          * @return UIDVALIDITY
          */
         long getUidValidity();
+        
+
+        /**
+         * Gets the next UID predicted.
+         * @param mailboxSession not null
+         * @return the uid that will be assigned to the next appended message
+         * @throws MailboxException
+         */
+        long getUidNext();
     }
 }

Modified: james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/AbstractSelectionProcessor.java
URL: http://svn.apache.org/viewvc/james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/AbstractSelectionProcessor.java?rev=773256&r1=773255&r2=773256&view=diff
==============================================================================
--- james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/AbstractSelectionProcessor.java
(original)
+++ james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/AbstractSelectionProcessor.java
Sat May  9 18:00:23 2009
@@ -106,14 +106,13 @@
         uidValidity(responder, metaData);
         unseen(responder, mailbox, mailboxSession, selected);
         permanentFlags(responder, metaData);
-        uidNext(responder, mailboxSession, mailbox);
+        uidNext(responder, metaData);
         taggedOk(responder, tag, command, mailbox);
     }
 
-    private void uidNext(final Responder responder,
-            final MailboxSession mailboxSession, final Mailbox mailbox)
+    private void uidNext(final Responder responder, final Mailbox.MetaData metaData)
     throws MailboxException {
-        final long uid = mailbox.getUidNext(mailboxSession);
+        final long uid = metaData.getUidNext();
         final StatusResponse untaggedOk = statusResponseFactory.untaggedOk(
                 HumanReadableTextKey.UNSEEN, ResponseCode.uidNext(uid));
         responder.respond(untaggedOk);

Modified: james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/StatusProcessor.java
URL: http://svn.apache.org/viewvc/james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/StatusProcessor.java?rev=773256&r1=773255&r2=773256&view=diff
==============================================================================
--- james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/StatusProcessor.java
(original)
+++ james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/StatusProcessor.java
Sat May  9 18:00:23 2009
@@ -71,8 +71,7 @@
             
             final Long messages = messages(statusDataItems, mailboxSession, mailbox);
             final Long recent = recent(statusDataItems, metaData, mailbox);
-            final Long uidNext = uidNext(statusDataItems, mailboxSession,
-                    mailbox);
+            final Long uidNext = uidNext(statusDataItems, metaData);
             final Long uidValidity = uidValidity(statusDataItems, metaData);
             final Long unseen = unseen(statusDataItems, mailboxSession, mailbox);
 
@@ -112,12 +111,11 @@
         return uidValidity;
     }
 
-    private Long uidNext(final StatusDataItems statusDataItems,
-            final MailboxSession mailboxSession, final Mailbox mailbox)
+    private Long uidNext(final StatusDataItems statusDataItems, final Mailbox.MetaData metaData)
             throws MailboxException {
         final Long uidNext;
         if (statusDataItems.isUidNext()) {
-            final long uidNextValue = mailbox.getUidNext(mailboxSession);
+            final long uidNextValue = metaData.getUidNext();
             uidNext = new Long(uidNextValue);
         } else {
             uidNext = null;

Modified: james/imap/trunk/store/src/main/java/org/apache/james/imap/store/MailboxMetaData.java
URL: http://svn.apache.org/viewvc/james/imap/trunk/store/src/main/java/org/apache/james/imap/store/MailboxMetaData.java?rev=773256&r1=773255&r2=773256&view=diff
==============================================================================
--- james/imap/trunk/store/src/main/java/org/apache/james/imap/store/MailboxMetaData.java
(original)
+++ james/imap/trunk/store/src/main/java/org/apache/james/imap/store/MailboxMetaData.java
Sat May  9 18:00:23 2009
@@ -23,6 +23,7 @@
 
 import org.apache.james.imap.mailbox.Mailbox;
 
+
 /**
  * Describes the current state of a mailbox.
  */
@@ -32,9 +33,9 @@
     private final long[] recent;
     private final Flags premanentFlags;
     private final long uidValidity;
+    private final long nextUid;
     
-    
-    public MailboxMetaData(final long[] recent, final Flags premanentFlags, final long uidValidity)
{
+    public MailboxMetaData(final long[] recent, final Flags premanentFlags, final long uidValidity,
final long nextUid) {
         super();
         if (recent == null) {
             recentCount = 0;
@@ -44,6 +45,7 @@
         this.recent = recent;
         this.premanentFlags = premanentFlags;
         this.uidValidity = uidValidity;
+        this.nextUid = nextUid;
     }
 
     /**
@@ -74,4 +76,10 @@
         return uidValidity;
     }
 
+    /**
+     * @see {@link Mailbox.MetaData#getUidNext()}
+     */
+    public long getUidNext() {
+        return nextUid;
+    }
 }

Modified: 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/StoreMailbox.java?rev=773256&r1=773255&r2=773256&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/StoreMailbox.java Sat
May  9 18:00:23 2009
@@ -477,6 +477,7 @@
         final long[] recent = recent(resetRecent, mailboxSession);
         final Flags permanentFlags = getPermanentFlags();
         final long uidValidity = getUidValidity(mailboxSession);
-        return new MailboxMetaData(recent, permanentFlags, uidValidity);
+        final long uidNext = getUidNext(mailboxSession);
+        return new MailboxMetaData(recent, permanentFlags, uidValidity, uidNext);
     }
 }

Modified: james/imap/trunk/torque/src/main/java/org/apache/james/mailboxmanager/torque/MailboxMetaData.java
URL: http://svn.apache.org/viewvc/james/imap/trunk/torque/src/main/java/org/apache/james/mailboxmanager/torque/MailboxMetaData.java?rev=773256&r1=773255&r2=773256&view=diff
==============================================================================
--- james/imap/trunk/torque/src/main/java/org/apache/james/mailboxmanager/torque/MailboxMetaData.java
(original)
+++ james/imap/trunk/torque/src/main/java/org/apache/james/mailboxmanager/torque/MailboxMetaData.java
Sat May  9 18:00:23 2009
@@ -32,9 +32,9 @@
     private final long[] recent;
     private final Flags premanentFlags;
     private final long uidValidity;
+    private final long nextUid;
     
-    
-    public MailboxMetaData(final long[] recent, final Flags premanentFlags, final long uidValidity)
{
+    public MailboxMetaData(final long[] recent, final Flags premanentFlags, final long uidValidity,
final long nextUid) {
         super();
         if (recent == null) {
             recentCount = 0;
@@ -44,6 +44,7 @@
         this.recent = recent;
         this.premanentFlags = premanentFlags;
         this.uidValidity = uidValidity;
+        this.nextUid = nextUid;
     }
 
     /**
@@ -74,4 +75,11 @@
         return uidValidity;
     }
 
+    /**
+     * @see {@link Mailbox.MetaData#getUidNext()}
+     */
+    public long getUidNext() {
+        return nextUid;
+    }
+
 }

Modified: james/imap/trunk/torque/src/main/java/org/apache/james/mailboxmanager/torque/TorqueMailbox.java
URL: http://svn.apache.org/viewvc/james/imap/trunk/torque/src/main/java/org/apache/james/mailboxmanager/torque/TorqueMailbox.java?rev=773256&r1=773255&r2=773256&view=diff
==============================================================================
--- james/imap/trunk/torque/src/main/java/org/apache/james/mailboxmanager/torque/TorqueMailbox.java
(original)
+++ james/imap/trunk/torque/src/main/java/org/apache/james/mailboxmanager/torque/TorqueMailbox.java
Sat May  9 18:00:23 2009
@@ -815,6 +815,7 @@
         final long[] recent = recent(resetRecent, mailboxSession);
         final Flags permanentFlags = getPermanentFlags();
         final long uidValidity = getUidValidity(mailboxSession);
-        return new MailboxMetaData(recent, permanentFlags, uidValidity);
+        final long uidNext = getUidNext(mailboxSession);
+        return new MailboxMetaData(recent, permanentFlags, uidValidity, uidNext);
     }
 }



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