james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rdon...@apache.org
Subject svn commit: r515230 [4/4] - in /james/server/sandbox/seda-imap/src: java/org/apache/james/imapserver/ java/org/apache/james/imapserver/commands/ java/org/apache/james/imapserver/decode/ java/org/apache/james/imapserver/encode/ java/org/apache/james/ima...
Date Tue, 06 Mar 2007 17:59:12 GMT
Copied: james/server/sandbox/seda-imap/src/java/org/apache/james/imapserver/message/StatusCommandMessage.java
(from r514100, james/server/sandbox/seda-imap/src/java/org/apache/james/imapserver/commands/StatusCommandMessage.java)
URL: http://svn.apache.org/viewvc/james/server/sandbox/seda-imap/src/java/org/apache/james/imapserver/message/StatusCommandMessage.java?view=diff&rev=515230&p1=james/server/sandbox/seda-imap/src/java/org/apache/james/imapserver/commands/StatusCommandMessage.java&r1=514100&p2=james/server/sandbox/seda-imap/src/java/org/apache/james/imapserver/message/StatusCommandMessage.java&r2=515230
==============================================================================
--- james/server/sandbox/seda-imap/src/java/org/apache/james/imapserver/commands/StatusCommandMessage.java
(original)
+++ james/server/sandbox/seda-imap/src/java/org/apache/james/imapserver/message/StatusCommandMessage.java
Tue Mar  6 09:59:02 2007
@@ -16,12 +16,14 @@
  * specific language governing permissions and limitations      *
  * under the License.                                           *
  ****************************************************************/
-package org.apache.james.imapserver.commands;
+package org.apache.james.imapserver.message;
 
 import org.apache.avalon.framework.logger.Logger;
 import org.apache.james.imapserver.AuthorizationException;
+import org.apache.james.imapserver.ImapConstants;
 import org.apache.james.imapserver.ImapSession;
 import org.apache.james.imapserver.ProtocolException;
+import org.apache.james.imapserver.commands.ImapCommand;
 import org.apache.james.imapserver.store.MailboxException;
 import org.apache.james.mailboxmanager.MailboxManagerException;
 import org.apache.james.mailboxmanager.mailbox.ImapMailboxSession;
@@ -39,8 +41,10 @@
     protected ImapResponseMessage doProcess(ImapSession session, String tag, ImapCommand
command) throws MailboxException, AuthorizationException, ProtocolException {
         final Logger logger = getLogger(); 
 
+        // TODO: response should not be prepared in process
+        // TODO: return a transfer object
         StringBuffer buffer = new StringBuffer( mailboxName );
-        buffer.append( StatusCommand.SP );
+        buffer.append( ImapConstants.SP );
         buffer.append( "(" );
         try {
             String fullMailboxName= session.buildFullName(mailboxName);
@@ -51,41 +55,41 @@
             
             ImapMailboxSession mailbox = session.getMailboxManager().getImapMailboxSession(fullMailboxName);
             
-            if (statusDataItems.messages) {
-                buffer.append(StatusCommand.MESSAGES);
-                buffer.append(StatusCommand.SP);
+            if (statusDataItems.isMessages()) {
+                buffer.append(ImapConstants.STATUS_MESSAGES);
+                buffer.append(ImapConstants.SP);
 
                 buffer.append(mailbox.getMessageCount());
 
-                buffer.append(StatusCommand.SP);
+                buffer.append(ImapConstants.SP);
             }
 
-            if (statusDataItems.recent) {
-                buffer.append(StatusCommand.RECENT);
-                buffer.append(StatusCommand.SP);
+            if (statusDataItems.isRecent()) {
+                buffer.append(ImapConstants.STATUS_RECENT);
+                buffer.append(ImapConstants.SP);
                 buffer.append(mailbox.getRecentCount(false));
-                buffer.append(StatusCommand.SP);
+                buffer.append(ImapConstants.SP);
             }
 
-            if (statusDataItems.uidNext) {
-                buffer.append(StatusCommand.UIDNEXT);
-                buffer.append(StatusCommand.SP);
+            if (statusDataItems.isUidNext()) {
+                buffer.append(ImapConstants.STATUS_UIDNEXT);
+                buffer.append(ImapConstants.SP);
                 buffer.append(mailbox.getUidNext());
-                buffer.append(StatusCommand.SP);
+                buffer.append(ImapConstants.SP);
             }
 
-            if (statusDataItems.uidValidity) {
-                buffer.append(StatusCommand.UIDVALIDITY);
-                buffer.append(StatusCommand.SP);
+            if (statusDataItems.isUidValidity()) {
+                buffer.append(ImapConstants.STATUS_UIDVALIDITY);
+                buffer.append(ImapConstants.SP);
                 buffer.append(mailbox.getUidValidity());
-                buffer.append(StatusCommand.SP);
+                buffer.append(ImapConstants.SP);
             }
 
-            if (statusDataItems.unseen) {
-                buffer.append(StatusCommand.UNSEEN);
-                buffer.append(StatusCommand.SP);
+            if (statusDataItems.isUnseen()) {
+                buffer.append(ImapConstants.STATUS_UNSEEN);
+                buffer.append(ImapConstants.SP);
                 buffer.append(mailbox.getUnseenCount());
-                buffer.append(StatusCommand.SP);
+                buffer.append(ImapConstants.SP);
             }
         } catch (MailboxManagerException e) {
             if (logger != null && logger.isDebugEnabled()) { 

Copied: james/server/sandbox/seda-imap/src/java/org/apache/james/imapserver/message/StatusDataItems.java
(from r514100, james/server/sandbox/seda-imap/src/java/org/apache/james/imapserver/commands/StatusDataItems.java)
URL: http://svn.apache.org/viewvc/james/server/sandbox/seda-imap/src/java/org/apache/james/imapserver/message/StatusDataItems.java?view=diff&rev=515230&p1=james/server/sandbox/seda-imap/src/java/org/apache/james/imapserver/commands/StatusDataItems.java&r1=514100&p2=james/server/sandbox/seda-imap/src/java/org/apache/james/imapserver/message/StatusDataItems.java&r2=515230
==============================================================================
--- james/server/sandbox/seda-imap/src/java/org/apache/james/imapserver/commands/StatusDataItems.java
(original)
+++ james/server/sandbox/seda-imap/src/java/org/apache/james/imapserver/message/StatusDataItems.java
Tue Mar  6 09:59:02 2007
@@ -16,13 +16,46 @@
  * specific language governing permissions and limitations      *
  * under the License.                                           *
  ****************************************************************/
-package org.apache.james.imapserver.commands;
+package org.apache.james.imapserver.message;
 
-class StatusDataItems
+public class StatusDataItems
 {
-    boolean messages;
-    boolean recent;
-    boolean uidNext;
-    boolean uidValidity;
-    boolean unseen;
+    private boolean messages;
+    private boolean recent;
+    private boolean uidNext;
+    private boolean uidValidity;
+    private boolean unseen;
+    
+    public boolean isMessages() {
+        return messages;
+    }
+    public void setMessages(boolean messages) {
+        this.messages = messages;
+    }
+    public boolean isRecent() {
+        return recent;
+    }
+    public void setRecent(boolean recent) {
+        this.recent = recent;
+    }
+    public boolean isUidNext() {
+        return uidNext;
+    }
+    public void setUidNext(boolean uidNext) {
+        this.uidNext = uidNext;
+    }
+    public boolean isUidValidity() {
+        return uidValidity;
+    }
+    public void setUidValidity(boolean uidValidity) {
+        this.uidValidity = uidValidity;
+    }
+    public boolean isUnseen() {
+        return unseen;
+    }
+    public void setUnseen(boolean unseen) {
+        this.unseen = unseen;
+    }
+    
+    
 }

Copied: james/server/sandbox/seda-imap/src/java/org/apache/james/imapserver/message/StatusResponseMessage.java
(from r514100, james/server/sandbox/seda-imap/src/java/org/apache/james/imapserver/commands/StatusResponseMessage.java)
URL: http://svn.apache.org/viewvc/james/server/sandbox/seda-imap/src/java/org/apache/james/imapserver/message/StatusResponseMessage.java?view=diff&rev=515230&p1=james/server/sandbox/seda-imap/src/java/org/apache/james/imapserver/commands/StatusResponseMessage.java&r1=514100&p2=james/server/sandbox/seda-imap/src/java/org/apache/james/imapserver/message/StatusResponseMessage.java&r2=515230
==============================================================================
--- james/server/sandbox/seda-imap/src/java/org/apache/james/imapserver/commands/StatusResponseMessage.java
(original)
+++ james/server/sandbox/seda-imap/src/java/org/apache/james/imapserver/message/StatusResponseMessage.java
Tue Mar  6 09:59:02 2007
@@ -16,10 +16,11 @@
  * specific language governing permissions and limitations      *
  * under the License.                                           *
  ****************************************************************/
-package org.apache.james.imapserver.commands;
+package org.apache.james.imapserver.message;
 
 import org.apache.james.imapserver.ImapResponse;
 import org.apache.james.imapserver.ImapSession;
+import org.apache.james.imapserver.commands.ImapCommand;
 import org.apache.james.imapserver.store.MailboxException;
 
 class StatusResponseMessage extends AbstractCommandResponseMessage {

Copied: james/server/sandbox/seda-imap/src/java/org/apache/james/imapserver/message/StoreCommandMessage.java
(from r514100, james/server/sandbox/seda-imap/src/java/org/apache/james/imapserver/commands/StoreCommandMessage.java)
URL: http://svn.apache.org/viewvc/james/server/sandbox/seda-imap/src/java/org/apache/james/imapserver/message/StoreCommandMessage.java?view=diff&rev=515230&p1=james/server/sandbox/seda-imap/src/java/org/apache/james/imapserver/commands/StoreCommandMessage.java&r1=514100&p2=james/server/sandbox/seda-imap/src/java/org/apache/james/imapserver/message/StoreCommandMessage.java&r2=515230
==============================================================================
--- james/server/sandbox/seda-imap/src/java/org/apache/james/imapserver/commands/StoreCommandMessage.java
(original)
+++ james/server/sandbox/seda-imap/src/java/org/apache/james/imapserver/message/StoreCommandMessage.java
Tue Mar  6 09:59:02 2007
@@ -16,13 +16,14 @@
  * specific language governing permissions and limitations      *
  * under the License.                                           *
  ****************************************************************/
-package org.apache.james.imapserver.commands;
+package org.apache.james.imapserver.message;
 
 import javax.mail.Flags;
 
 import org.apache.james.imapserver.AuthorizationException;
 import org.apache.james.imapserver.ImapSession;
 import org.apache.james.imapserver.ProtocolException;
+import org.apache.james.imapserver.commands.ImapCommand;
 import org.apache.james.imapserver.store.MailboxException;
 import org.apache.james.mailboxmanager.GeneralMessageSet;
 import org.apache.james.mailboxmanager.MailboxListener;

Copied: james/server/sandbox/seda-imap/src/java/org/apache/james/imapserver/message/StoreDirective.java
(from r514100, james/server/sandbox/seda-imap/src/java/org/apache/james/imapserver/commands/StoreDirective.java)
URL: http://svn.apache.org/viewvc/james/server/sandbox/seda-imap/src/java/org/apache/james/imapserver/message/StoreDirective.java?view=diff&rev=515230&p1=james/server/sandbox/seda-imap/src/java/org/apache/james/imapserver/commands/StoreDirective.java&r1=514100&p2=james/server/sandbox/seda-imap/src/java/org/apache/james/imapserver/message/StoreDirective.java&r2=515230
==============================================================================
--- james/server/sandbox/seda-imap/src/java/org/apache/james/imapserver/commands/StoreDirective.java
(original)
+++ james/server/sandbox/seda-imap/src/java/org/apache/james/imapserver/message/StoreDirective.java
Tue Mar  6 09:59:02 2007
@@ -16,9 +16,9 @@
  * specific language governing permissions and limitations      *
  * under the License.                                           *
  ****************************************************************/
-package org.apache.james.imapserver.commands;
+package org.apache.james.imapserver.message;
 
-class StoreDirective
+public class StoreDirective
 {
     private int sign;
     private boolean silent;

Copied: james/server/sandbox/seda-imap/src/java/org/apache/james/imapserver/message/StoreResponseMessage.java
(from r514100, james/server/sandbox/seda-imap/src/java/org/apache/james/imapserver/commands/StoreResponseMessage.java)
URL: http://svn.apache.org/viewvc/james/server/sandbox/seda-imap/src/java/org/apache/james/imapserver/message/StoreResponseMessage.java?view=diff&rev=515230&p1=james/server/sandbox/seda-imap/src/java/org/apache/james/imapserver/commands/StoreResponseMessage.java&r1=514100&p2=james/server/sandbox/seda-imap/src/java/org/apache/james/imapserver/message/StoreResponseMessage.java&r2=515230
==============================================================================
--- james/server/sandbox/seda-imap/src/java/org/apache/james/imapserver/commands/StoreResponseMessage.java
(original)
+++ james/server/sandbox/seda-imap/src/java/org/apache/james/imapserver/message/StoreResponseMessage.java
Tue Mar  6 09:59:02 2007
@@ -16,10 +16,11 @@
  * specific language governing permissions and limitations      *
  * under the License.                                           *
  ****************************************************************/
-package org.apache.james.imapserver.commands;
+package org.apache.james.imapserver.message;
 
 import org.apache.james.imapserver.ImapResponse;
 import org.apache.james.imapserver.ImapSession;
+import org.apache.james.imapserver.commands.ImapCommand;
 import org.apache.james.imapserver.store.MailboxException;
 
 class StoreResponseMessage extends AbstractCommandResponseMessage {

Copied: james/server/sandbox/seda-imap/src/java/org/apache/james/imapserver/message/SubscribeCommandMessage.java
(from r514100, james/server/sandbox/seda-imap/src/java/org/apache/james/imapserver/commands/SubscribeCommandMessage.java)
URL: http://svn.apache.org/viewvc/james/server/sandbox/seda-imap/src/java/org/apache/james/imapserver/message/SubscribeCommandMessage.java?view=diff&rev=515230&p1=james/server/sandbox/seda-imap/src/java/org/apache/james/imapserver/commands/SubscribeCommandMessage.java&r1=514100&p2=james/server/sandbox/seda-imap/src/java/org/apache/james/imapserver/message/SubscribeCommandMessage.java&r2=515230
==============================================================================
--- james/server/sandbox/seda-imap/src/java/org/apache/james/imapserver/commands/SubscribeCommandMessage.java
(original)
+++ james/server/sandbox/seda-imap/src/java/org/apache/james/imapserver/message/SubscribeCommandMessage.java
Tue Mar  6 09:59:02 2007
@@ -16,11 +16,12 @@
  * specific language governing permissions and limitations      *
  * under the License.                                           *
  ****************************************************************/
-package org.apache.james.imapserver.commands;
+package org.apache.james.imapserver.message;
 
 import org.apache.james.imapserver.AuthorizationException;
 import org.apache.james.imapserver.ImapSession;
 import org.apache.james.imapserver.ProtocolException;
+import org.apache.james.imapserver.commands.ImapCommand;
 import org.apache.james.imapserver.store.MailboxException;
 import org.apache.james.mailboxmanager.MailboxManagerException;
 

Copied: james/server/sandbox/seda-imap/src/java/org/apache/james/imapserver/message/UnsubscribeCommandMessage.java
(from r514100, james/server/sandbox/seda-imap/src/java/org/apache/james/imapserver/commands/UnsubscribeCommandMessage.java)
URL: http://svn.apache.org/viewvc/james/server/sandbox/seda-imap/src/java/org/apache/james/imapserver/message/UnsubscribeCommandMessage.java?view=diff&rev=515230&p1=james/server/sandbox/seda-imap/src/java/org/apache/james/imapserver/commands/UnsubscribeCommandMessage.java&r1=514100&p2=james/server/sandbox/seda-imap/src/java/org/apache/james/imapserver/message/UnsubscribeCommandMessage.java&r2=515230
==============================================================================
--- james/server/sandbox/seda-imap/src/java/org/apache/james/imapserver/commands/UnsubscribeCommandMessage.java
(original)
+++ james/server/sandbox/seda-imap/src/java/org/apache/james/imapserver/message/UnsubscribeCommandMessage.java
Tue Mar  6 09:59:02 2007
@@ -16,11 +16,12 @@
  * specific language governing permissions and limitations      *
  * under the License.                                           *
  ****************************************************************/
-package org.apache.james.imapserver.commands;
+package org.apache.james.imapserver.message;
 
 import org.apache.james.imapserver.AuthorizationException;
 import org.apache.james.imapserver.ImapSession;
 import org.apache.james.imapserver.ProtocolException;
+import org.apache.james.imapserver.commands.ImapCommand;
 import org.apache.james.imapserver.store.MailboxException;
 import org.apache.james.mailboxmanager.MailboxManagerException;
 

Modified: james/server/sandbox/seda-imap/src/test/org/apache/james/imapserver/commands/MockCommand.java
URL: http://svn.apache.org/viewvc/james/server/sandbox/seda-imap/src/test/org/apache/james/imapserver/commands/MockCommand.java?view=diff&rev=515230&r1=515229&r2=515230
==============================================================================
--- james/server/sandbox/seda-imap/src/test/org/apache/james/imapserver/commands/MockCommand.java
(original)
+++ james/server/sandbox/seda-imap/src/test/org/apache/james/imapserver/commands/MockCommand.java
Tue Mar  6 09:59:02 2007
@@ -2,6 +2,7 @@
 
 import org.apache.james.imapserver.ImapRequestLineReader;
 import org.apache.james.imapserver.ProtocolException;
+import org.apache.james.imapserver.message.ImapCommandMessage;
 
 public class MockCommand extends CommandTemplate {
 
@@ -15,7 +16,7 @@
         return NAME;
     }
 
-    protected AbstractImapCommandMessage decode(ImapRequestLineReader request, String tag)
throws ProtocolException {
+    protected ImapCommandMessage decode(ImapRequestLineReader request, String tag) throws
ProtocolException {
         // TODO implementation
         return null;
     }

Copied: james/server/sandbox/seda-imap/src/test/org/apache/james/imapserver/message/BadResponseMessageTest.java
(from r514102, james/server/sandbox/seda-imap/src/test/org/apache/james/imapserver/commands/BadResponseMessageTest.java)
URL: http://svn.apache.org/viewvc/james/server/sandbox/seda-imap/src/test/org/apache/james/imapserver/message/BadResponseMessageTest.java?view=diff&rev=515230&p1=james/server/sandbox/seda-imap/src/test/org/apache/james/imapserver/commands/BadResponseMessageTest.java&r1=514102&p2=james/server/sandbox/seda-imap/src/test/org/apache/james/imapserver/message/BadResponseMessageTest.java&r2=515230
==============================================================================
--- james/server/sandbox/seda-imap/src/test/org/apache/james/imapserver/commands/BadResponseMessageTest.java
(original)
+++ james/server/sandbox/seda-imap/src/test/org/apache/james/imapserver/message/BadResponseMessageTest.java
Tue Mar  6 09:59:02 2007
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations      *
  * under the License.                                           *
  ****************************************************************/
-package org.apache.james.imapserver.commands;
+package org.apache.james.imapserver.message;
 
 import org.apache.james.imapserver.ImapConstants;
 import org.apache.james.imapserver.ImapResponse;

Copied: james/server/sandbox/seda-imap/src/test/org/apache/james/imapserver/message/CommandFailedResponseMessageTest.java
(from r514100, james/server/sandbox/seda-imap/src/test/org/apache/james/imapserver/commands/CommandFailedResponseMessageTest.java)
URL: http://svn.apache.org/viewvc/james/server/sandbox/seda-imap/src/test/org/apache/james/imapserver/message/CommandFailedResponseMessageTest.java?view=diff&rev=515230&p1=james/server/sandbox/seda-imap/src/test/org/apache/james/imapserver/commands/CommandFailedResponseMessageTest.java&r1=514100&p2=james/server/sandbox/seda-imap/src/test/org/apache/james/imapserver/message/CommandFailedResponseMessageTest.java&r2=515230
==============================================================================
--- james/server/sandbox/seda-imap/src/test/org/apache/james/imapserver/commands/CommandFailedResponseMessageTest.java
(original)
+++ james/server/sandbox/seda-imap/src/test/org/apache/james/imapserver/message/CommandFailedResponseMessageTest.java
Tue Mar  6 09:59:02 2007
@@ -17,13 +17,15 @@
  * under the License.                                           *
  ****************************************************************/
 
-package org.apache.james.imapserver.commands;
+package org.apache.james.imapserver.message;
 
 import org.apache.james.imapserver.ImapConstants;
 import org.apache.james.imapserver.ImapResponse;
 import org.apache.james.imapserver.ImapSession;
 import org.apache.james.imapserver.MockImapResponseWriter;
 import org.apache.james.imapserver.MockImapSession;
+import org.apache.james.imapserver.commands.MockCommand;
+import org.apache.james.imapserver.message.CommandFailedResponseMessage;
 
 import junit.framework.TestCase;
 

Copied: james/server/sandbox/seda-imap/src/test/org/apache/james/imapserver/message/ErrorResponseMessageTest.java
(from r514100, james/server/sandbox/seda-imap/src/test/org/apache/james/imapserver/commands/ErrorResponseMessageTest.java)
URL: http://svn.apache.org/viewvc/james/server/sandbox/seda-imap/src/test/org/apache/james/imapserver/message/ErrorResponseMessageTest.java?view=diff&rev=515230&p1=james/server/sandbox/seda-imap/src/test/org/apache/james/imapserver/commands/ErrorResponseMessageTest.java&r1=514100&p2=james/server/sandbox/seda-imap/src/test/org/apache/james/imapserver/message/ErrorResponseMessageTest.java&r2=515230
==============================================================================
--- james/server/sandbox/seda-imap/src/test/org/apache/james/imapserver/commands/ErrorResponseMessageTest.java
(original)
+++ james/server/sandbox/seda-imap/src/test/org/apache/james/imapserver/message/ErrorResponseMessageTest.java
Tue Mar  6 09:59:02 2007
@@ -17,11 +17,12 @@
  * under the License.                                           *
  ****************************************************************/
 
-package org.apache.james.imapserver.commands;
+package org.apache.james.imapserver.message;
 
 import org.apache.james.imapserver.ImapConstants;
 import org.apache.james.imapserver.ImapResponse;
 import org.apache.james.imapserver.MockImapResponseWriter;
+import org.apache.james.imapserver.message.ErrorResponseMessage;
 
 import junit.framework.TestCase;
 



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