james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rdon...@apache.org
Subject svn commit: r773265 - 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 19:39:44 GMT
Author: rdonkin
Date: Sat May  9 19:39:44 2009
New Revision: 773265

URL: http://svn.apache.org/viewvc?rev=773265&view=rev
Log:
Add isWritable so that Mailbox is not longer required, only MetaData. 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/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=773265&r1=773264&r2=773265&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 19:39:44 2009
@@ -180,5 +180,13 @@
          * @see FetchGroup#FIRST_UNSEEN
          */
         Long getFirstUnseen();
+        
+        /**
+         * Is this mailbox writable?
+         * @return true if read-write, 
+         * false if read only
+         */
+        boolean isWriteable();
+
     }
 }

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=773265&r1=773264&r2=773265&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 19:39:44 2009
@@ -41,6 +41,7 @@
 import org.apache.james.imap.mailbox.MailboxNotFoundException;
 import org.apache.james.imap.mailbox.MailboxSession;
 import org.apache.james.imap.mailbox.MessageResult;
+import org.apache.james.imap.mailbox.Mailbox.MetaData;
 import org.apache.james.imap.mailbox.util.FetchGroupImpl;
 import org.apache.james.imap.mailbox.util.MessageRangeImpl;
 import org.apache.james.imap.message.request.AbstractMailboxSelectionRequest;
@@ -93,7 +94,6 @@
     private void respond(String tag, ImapCommand command, ImapSession session,
             final Mailbox.MetaData metaData, Responder responder) throws MailboxException
{
 
-        Mailbox mailbox = getSelectedMailbox(session);
         final SelectedMailbox selected = session.getSelected();
         
         flags(responder);
@@ -103,7 +103,7 @@
         unseen(responder, metaData, selected);
         permanentFlags(responder, metaData);
         uidNext(responder, metaData);
-        taggedOk(responder, tag, command, mailbox);
+        taggedOk(responder, tag, command, metaData);
     }
 
     private void uidNext(final Responder responder, final Mailbox.MetaData metaData)
@@ -115,8 +115,8 @@
     }
     
     private void taggedOk(final Responder responder, final String tag,
-            final ImapCommand command, final Mailbox mailbox) {
-        final boolean writeable = mailbox.isWriteable() && !openReadOnly;
+            final ImapCommand command, final MetaData metaData) {
+        final boolean writeable = metaData.isWriteable() && !openReadOnly;
         final ResponseCode code;
         if (writeable) {
             code = ResponseCode.readWrite();

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=773265&r1=773264&r2=773265&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 19:39:44 2009
@@ -37,9 +37,10 @@
     private final int messageCount;
     private final int unseenCount;
     private final Long firstUnseen;
+    private final boolean writeable;
     
     public MailboxMetaData(final long[] recent, final Flags premanentFlags, final long uidValidity,
final long nextUid,
-            final int messageCount, final int unseenCount, final Long firstUnseen) {
+            final int messageCount, final int unseenCount, final Long firstUnseen, final
boolean writeable) {
         super();
         if (recent == null) {
             recentCount = 0;
@@ -53,6 +54,7 @@
         this.messageCount = messageCount;
         this.unseenCount = unseenCount;
         this.firstUnseen = firstUnseen;
+        this.writeable = writeable;
     }
 
     /**
@@ -107,4 +109,8 @@
     public Long getFirstUnseen() {
         return firstUnseen;
     }
+
+    public boolean isWriteable() {
+        return writeable;
+    }
 }

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=773265&r1=773264&r2=773265&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 19:39:44 2009
@@ -497,6 +497,6 @@
                 break;
         }
             
-        return new MailboxMetaData(recent, permanentFlags, uidValidity, uidNext, messageCount,
unseenCount, firstUnseen);
+        return new MailboxMetaData(recent, permanentFlags, uidValidity, uidNext, messageCount,
unseenCount, firstUnseen, isWriteable());
     }
 }

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=773265&r1=773264&r2=773265&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 19:39:44 2009
@@ -36,9 +36,10 @@
     private final int messageCount;
     private final int unseenCount;
     private final Long firstUnseen;
+    private final boolean writeable;
     
     public MailboxMetaData(final long[] recent, final Flags premanentFlags, final long uidValidity,
final long nextUid,
-            final int messageCount, final int unseenCount, final Long firstUnseen) {
+            final int messageCount, final int unseenCount, final Long firstUnseen, final
boolean writeable) {
         super();
         if (recent == null) {
             recentCount = 0;
@@ -52,6 +53,7 @@
         this.messageCount = messageCount;
         this.unseenCount = unseenCount;
         this.firstUnseen = firstUnseen;
+        this.writeable = writeable;
     }
 
     /**
@@ -106,4 +108,8 @@
     public Long getFirstUnseen() {
         return firstUnseen;
     }
-}
+
+    public boolean isWriteable() {
+        return writeable;
+    }
+}
\ No newline at end of file

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=773265&r1=773264&r2=773265&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 19:39:44 2009
@@ -834,6 +834,6 @@
                 break;
         }
             
-        return new MailboxMetaData(recent, permanentFlags, uidValidity, uidNext, messageCount,
unseenCount, firstUnseen);
+        return new MailboxMetaData(recent, permanentFlags, uidValidity, uidNext, messageCount,
unseenCount, firstUnseen, isWriteable());
     }
 }



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