james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rdon...@apache.org
Subject svn commit: r731026 - in /james/protocols/imap/trunk/processor/src/main/java/org/apache/james/imap/processor: base/ imap4rev1/ imap4rev1/fetch/
Date Sat, 03 Jan 2009 17:19:17 GMT
Author: rdonkin
Date: Sat Jan  3 09:19:16 2009
New Revision: 731026

URL: http://svn.apache.org/viewvc?rev=731026&view=rev
Log:
Relocate getMailbox

Modified:
    james/protocols/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/base/AbstractMailboxAwareProcessor.java
    james/protocols/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/base/ImapSessionUtils.java
    james/protocols/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/imap4rev1/AbstractMailboxSelectionProcessor.java
    james/protocols/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/imap4rev1/CloseProcessor.java
    james/protocols/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/imap4rev1/ExpungeProcessor.java
    james/protocols/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/imap4rev1/SearchProcessor.java
    james/protocols/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/imap4rev1/StoreProcessor.java
    james/protocols/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/imap4rev1/fetch/FetchProcessor.java
    james/protocols/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/imap4rev1/fetch/FetchResponseBuilder.java

Modified: james/protocols/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/base/AbstractMailboxAwareProcessor.java
URL: http://svn.apache.org/viewvc/james/protocols/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/base/AbstractMailboxAwareProcessor.java?rev=731026&r1=731025&r2=731026&view=diff
==============================================================================
--- james/protocols/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/base/AbstractMailboxAwareProcessor.java
(original)
+++ james/protocols/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/base/AbstractMailboxAwareProcessor.java
Sat Jan  3 09:19:16 2009
@@ -346,4 +346,10 @@
         return result;
     }
 
+    public Mailbox getSelectedMailbox(final ImapSession session) {
+        Mailbox result = (Mailbox) session
+                .getAttribute(ImapSessionUtils.SELECTED_MAILBOX_ATTRIBUTE_SESSION_KEY);
+        return result;
+    }
+
 }

Modified: james/protocols/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/base/ImapSessionUtils.java
URL: http://svn.apache.org/viewvc/james/protocols/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/base/ImapSessionUtils.java?rev=731026&r1=731025&r2=731026&view=diff
==============================================================================
--- james/protocols/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/base/ImapSessionUtils.java
(original)
+++ james/protocols/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/base/ImapSessionUtils.java
Sat Jan  3 09:19:16 2009
@@ -20,7 +20,6 @@
 package org.apache.james.imap.processor.base;
 
 import org.apache.james.api.imap.process.ImapSession;
-import org.apache.james.imap.mailbox.Mailbox;
 import org.apache.james.imap.mailbox.MailboxSession;
 
 public class ImapSessionUtils {
@@ -33,12 +32,6 @@
 
     public static final String MAILBOX_SESSION_ATTRIBUTE_SESSION_KEY = "org.apache.james.api.imap.MAILBOX_SESSION_ATTRIBUTE_SESSION_KEY";
 
-    public static Mailbox getMailbox(final ImapSession session) {
-        Mailbox result = (Mailbox) session
-                .getAttribute(SELECTED_MAILBOX_ATTRIBUTE_SESSION_KEY);
-        return result;
-    }
-
     public static MailboxSession getMailboxSession(final ImapSession session) {
         final MailboxSession result = (MailboxSession) session
                 .getAttribute(ImapSessionUtils.MAILBOX_SESSION_ATTRIBUTE_SESSION_KEY);

Modified: james/protocols/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/imap4rev1/AbstractMailboxSelectionProcessor.java
URL: http://svn.apache.org/viewvc/james/protocols/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/imap4rev1/AbstractMailboxSelectionProcessor.java?rev=731026&r1=731025&r2=731026&view=diff
==============================================================================
--- james/protocols/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/imap4rev1/AbstractMailboxSelectionProcessor.java
(original)
+++ james/protocols/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/imap4rev1/AbstractMailboxSelectionProcessor.java
Sat Jan  3 09:19:16 2009
@@ -95,7 +95,7 @@
     private void respond(String tag, ImapCommand command, ImapSession session,
             Responder responder) throws MailboxException {
 
-        Mailbox mailbox = ImapSessionUtils.getMailbox(session);
+        Mailbox mailbox = getSelectedMailbox(session);
         final MailboxSession mailboxSession = ImapSessionUtils
                 .getMailboxSession(session);
         final SelectedImapMailbox selected = session.getSelected();

Modified: james/protocols/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/imap4rev1/CloseProcessor.java
URL: http://svn.apache.org/viewvc/james/protocols/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/imap4rev1/CloseProcessor.java?rev=731026&r1=731025&r2=731026&view=diff
==============================================================================
--- james/protocols/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/imap4rev1/CloseProcessor.java
(original)
+++ james/protocols/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/imap4rev1/CloseProcessor.java
Sat Jan  3 09:19:16 2009
@@ -48,7 +48,7 @@
 
     protected void doProcess(ImapRequest message, ImapSession session,
             String tag, ImapCommand command, Responder responder) {
-        Mailbox mailbox = ImapSessionUtils.getMailbox(session);
+        Mailbox mailbox = getSelectedMailbox(session);
         if (mailbox.isWriteable()) {
             try {
                 final MailboxSession mailboxSession = ImapSessionUtils

Modified: james/protocols/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/imap4rev1/ExpungeProcessor.java
URL: http://svn.apache.org/viewvc/james/protocols/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/imap4rev1/ExpungeProcessor.java?rev=731026&r1=731025&r2=731026&view=diff
==============================================================================
--- james/protocols/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/imap4rev1/ExpungeProcessor.java
(original)
+++ james/protocols/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/imap4rev1/ExpungeProcessor.java
Sat Jan  3 09:19:16 2009
@@ -53,7 +53,7 @@
 
     protected void doProcess(ImapRequest message, ImapSession session,
             String tag, ImapCommand command, Responder responder) {
-        Mailbox mailbox = ImapSessionUtils.getMailbox(session);
+        Mailbox mailbox = getSelectedMailbox(session);
         if (!mailbox.isWriteable()) {
             no(command, tag, responder,
                     HumanReadableTextKey.MAILBOX_IS_READ_ONLY);

Modified: james/protocols/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/imap4rev1/SearchProcessor.java
URL: http://svn.apache.org/viewvc/james/protocols/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/imap4rev1/SearchProcessor.java?rev=731026&r1=731025&r2=731026&view=diff
==============================================================================
--- james/protocols/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/imap4rev1/SearchProcessor.java
(original)
+++ james/protocols/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/imap4rev1/SearchProcessor.java
Sat Jan  3 09:19:16 2009
@@ -68,7 +68,7 @@
             final SearchRequest request = (SearchRequest) message;
             final SearchKey searchKey = request.getSearchKey();
             final boolean useUids = request.isUseUids();
-            Mailbox mailbox = ImapSessionUtils.getMailbox(session);
+            Mailbox mailbox = getSelectedMailbox(session);
             final FetchGroup fetchGroup = FetchGroupImpl.MINIMAL;
 
             final SearchQuery query = toQuery(searchKey, session);

Modified: james/protocols/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/imap4rev1/StoreProcessor.java
URL: http://svn.apache.org/viewvc/james/protocols/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/imap4rev1/StoreProcessor.java?rev=731026&r1=731025&r2=731026&view=diff
==============================================================================
--- james/protocols/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/imap4rev1/StoreProcessor.java
(original)
+++ james/protocols/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/imap4rev1/StoreProcessor.java
Sat Jan  3 09:19:16 2009
@@ -19,6 +19,7 @@
 
 package org.apache.james.imap.processor.imap4rev1;
 
+import java.util.ArrayList;
 import java.util.Iterator;
 
 import javax.mail.Flags;
@@ -68,7 +69,7 @@
         final boolean isSignedPlus = request.isSignedPlus();
         final boolean isSignedMinus = request.isSignedMinus();
 
-        Mailbox mailbox = ImapSessionUtils.getMailbox(session);
+        Mailbox mailbox = getSelectedMailbox(session);
 
         final boolean replace;
         final boolean value;

Modified: james/protocols/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/imap4rev1/fetch/FetchProcessor.java
URL: http://svn.apache.org/viewvc/james/protocols/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/imap4rev1/fetch/FetchProcessor.java?rev=731026&r1=731025&r2=731026&view=diff
==============================================================================
--- james/protocols/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/imap4rev1/fetch/FetchProcessor.java
(original)
+++ james/protocols/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/imap4rev1/fetch/FetchProcessor.java
Sat Jan  3 09:19:16 2009
@@ -69,7 +69,7 @@
         final FetchData fetch = request.getFetch();
         try {
             FetchGroup resultToFetch = getFetchGroup(fetch);
-            Mailbox mailbox = ImapSessionUtils.getMailbox(session);
+            Mailbox mailbox = getSelectedMailbox(session);
             for (int i = 0; i < idSet.length; i++) {
                 final FetchResponseBuilder builder = new FetchResponseBuilder(
                         getLog(), new EnvelopeBuilder(getLog()));
@@ -92,7 +92,7 @@
                         resultToFetch, mailboxSession);
                 while (it.hasNext()) {
                     final MessageResult result = (MessageResult) it.next();
-                    final FetchResponse response = builder.build(fetch, result,
+                    final FetchResponse response = builder.build(fetch, result, mailbox,

                             session, useUids);
                     responder.respond(response);
                 }

Modified: james/protocols/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/imap4rev1/fetch/FetchResponseBuilder.java
URL: http://svn.apache.org/viewvc/james/protocols/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/imap4rev1/fetch/FetchResponseBuilder.java?rev=731026&r1=731025&r2=731026&view=diff
==============================================================================
--- james/protocols/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/imap4rev1/fetch/FetchResponseBuilder.java
(original)
+++ james/protocols/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/imap4rev1/fetch/FetchResponseBuilder.java
Sat Jan  3 09:19:16 2009
@@ -103,10 +103,9 @@
         return result;
     }
 
-    public FetchResponse build(FetchData fetch, MessageResult result,
+    public FetchResponse build(FetchData fetch, MessageResult result, Mailbox mailbox, 
             ImapSession session, boolean useUids) throws MessagingException,
             ParseException {
-        Mailbox mailbox = ImapSessionUtils.getMailbox(session);
         final SelectedImapMailbox selected = session.getSelected();
         final long resultUid = result.getUid();
         final int resultMsn = selected.msn(resultUid);



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