james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rdon...@apache.org
Subject svn commit: r543873 - in /james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver: encode/imap4rev1/legacy/ message/response/imap4rev1/legacy/ processor/imap4rev1/
Date Sun, 03 Jun 2007 10:19:38 GMT
Author: rdonkin
Date: Sun Jun  3 03:19:38 2007
New Revision: 543873

URL: http://svn.apache.org/viewvc?view=rev&rev=543873
Log:
Extract required data during processing.

Modified:
    james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/encode/imap4rev1/legacy/ExamineAndSelectResponseEncoder.java
    james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/message/response/imap4rev1/legacy/ExamineAndSelectResponse.java
    james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/processor/imap4rev1/AbstractMailboxSelectionProcessor.java

Modified: james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/encode/imap4rev1/legacy/ExamineAndSelectResponseEncoder.java
URL: http://svn.apache.org/viewvc/james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/encode/imap4rev1/legacy/ExamineAndSelectResponseEncoder.java?view=diff&rev=543873&r1=543872&r2=543873
==============================================================================
--- james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/encode/imap4rev1/legacy/ExamineAndSelectResponseEncoder.java
(original)
+++ james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/encode/imap4rev1/legacy/ExamineAndSelectResponseEncoder.java
Sun Jun  3 03:19:38 2007
@@ -49,10 +49,10 @@
         composer.okResponse("UIDVALIDITY " + uidValidity, null);
         final int messageCount = response.getMessageCount();
         composer.existsResponse(messageCount);
-        final MessageResult firstUnseen = response.getFirstUnseen();
-        if (firstUnseen != null) {
-            composer.okResponse("UNSEEN " + firstUnseen.getMsn(), "Message "
-                    + firstUnseen.getMsn() + " is the first unseen");
+        final int msn = response.getFirstUnseenMessageNumber();
+        if (msn > 0) {
+            composer.okResponse("UNSEEN " + msn, "Message "
+                    + msn + " is the first unseen");
         } else {
             composer.okResponse(null, "No messages unseen");
         }

Modified: james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/message/response/imap4rev1/legacy/ExamineAndSelectResponse.java
URL: http://svn.apache.org/viewvc/james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/message/response/imap4rev1/legacy/ExamineAndSelectResponse.java?view=diff&rev=543873&r1=543872&r2=543873
==============================================================================
--- james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/message/response/imap4rev1/legacy/ExamineAndSelectResponse.java
(original)
+++ james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/message/response/imap4rev1/legacy/ExamineAndSelectResponse.java
Sun Jun  3 03:19:38 2007
@@ -22,7 +22,6 @@
 
 import org.apache.james.api.imap.ImapCommand;
 import org.apache.james.experimental.imapserver.message.response.AbstractImapResponse;
-import org.apache.james.mailboxmanager.MessageResult;
 
 /**
  * @deprecated responses should correspond directly to the specification
@@ -32,24 +31,24 @@
     private final boolean writeable ;
     private final int recentCount;
     private final long uidValidity;
-    private final MessageResult firstUnseen;
+    private final int firstUnseenMessageNumber;
     private final int messageCount;
 
     public ExamineAndSelectResponse(ImapCommand command, final Flags permanentFlags,
             final boolean writeable, final int recentCount, 
-            final long uidValidity, final MessageResult firstUnseen,
+            final long uidValidity, final int firstUnseenMessageNumber,
             final int messageCount, final String tag) {
         super(command, tag);
         this.permanentFlags = permanentFlags;
         this.writeable = writeable;
         this.recentCount = recentCount;
         this.uidValidity = uidValidity;
-        this.firstUnseen = firstUnseen;
+        this.firstUnseenMessageNumber = firstUnseenMessageNumber;
         this.messageCount = messageCount;
     }
 
-    public final MessageResult getFirstUnseen() {
-        return firstUnseen;
+    public final int getFirstUnseenMessageNumber() {
+        return firstUnseenMessageNumber;
     }
 
     public final int getMessageCount() {

Modified: james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/processor/imap4rev1/AbstractMailboxSelectionProcessor.java
URL: http://svn.apache.org/viewvc/james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/processor/imap4rev1/AbstractMailboxSelectionProcessor.java?view=diff&rev=543873&r1=543872&r2=543873
==============================================================================
--- james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/processor/imap4rev1/AbstractMailboxSelectionProcessor.java
(original)
+++ james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/processor/imap4rev1/AbstractMailboxSelectionProcessor.java
Sun Jun  3 03:19:38 2007
@@ -59,8 +59,14 @@
             final long uidValidity = mailbox.getUidValidity();
             final MessageResult firstUnseen = mailbox.getFirstUnseen(MessageResult.MSN);
             final int messageCount = mailbox.getMessageCount();
+            final int msn;
+            if (firstUnseen == null) {
+                msn = -1;
+            } else {
+                msn = firstUnseen.getMsn();
+            }
             result = new ExamineAndSelectResponse(command, permanentFlags, 
-                    writeable, recentCount, uidValidity, firstUnseen, messageCount,
+                    writeable, recentCount, uidValidity, msn, messageCount,
                     tag);
         } catch (MailboxManagerException e) {
             throw new MailboxException(e);



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