james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rdon...@apache.org
Subject svn commit: r537970 [1/2] - in /james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src: main/java/org/apache/james/experimental/imapserver/message/ main/java/org/apache/james/experimental/imapserver/message/response/ main/java/org/a...
Date Mon, 14 May 2007 20:17:41 GMT
Author: rdonkin
Date: Mon May 14 13:17:38 2007
New Revision: 537970

URL: http://svn.apache.org/viewvc?view=rev&rev=537970
Log:
Repackage responses.

Added:
    james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/message/response/AbstractImapResponse.java
    james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/message/response/imap4rev1/BadResponse.java
    james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/message/response/imap4rev1/CapabilityReponse.java
    james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/message/response/imap4rev1/CloseResponse.java
    james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/message/response/imap4rev1/CommandCompleteResponse.java
    james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/message/response/imap4rev1/CommandFailedResponse.java
    james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/message/response/imap4rev1/ErrorResponse.java
    james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/message/response/imap4rev1/ExamineAndSelectResponse.java
    james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/message/response/imap4rev1/FetchResponse.java
    james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/message/response/imap4rev1/ListResponse.java
    james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/message/response/imap4rev1/LogoutResponse.java
    james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/message/response/imap4rev1/SearchResponse.java
    james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/message/response/imap4rev1/StatusResponse.java
    james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/message/response/imap4rev1/StoreResponse.java
Removed:
    james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/message/AbstractCommandResponseMessage.java
    james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/message/BadResponseMessage.java
    james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/message/CapabilityReponseMessage.java
    james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/message/CloseResponseMessage.java
    james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/message/CommandCompleteResponseMessage.java
    james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/message/CommandFailedResponseMessage.java
    james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/message/ErrorResponseMessage.java
    james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/message/ExamineAndSelectResponseMessage.java
    james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/message/FetchResponseMessage.java
    james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/message/ListResponseMessage.java
    james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/message/LogoutResponseMessage.java
    james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/message/SearchResponseMessage.java
    james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/message/StatusResponseMessage.java
    james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/message/StoreResponseMessage.java
Modified:
    james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/message/BaseImapMessageFactory.java
    james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/processor/AbstractImapRequestProcessor.java
    james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/processor/imap4rev1/AbstractListingProcessor.java
    james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/processor/imap4rev1/AppendProcessor.java
    james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/processor/imap4rev1/AuthenticateProcessor.java
    james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/processor/imap4rev1/CapabilityProcessor.java
    james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/processor/imap4rev1/CheckProcessor.java
    james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/processor/imap4rev1/CloseProcessor.java
    james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/processor/imap4rev1/CopyProcessor.java
    james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/processor/imap4rev1/CreateProcessor.java
    james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/processor/imap4rev1/DeleteProcessor.java
    james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/processor/imap4rev1/ExamineAndSelectProcessor.java
    james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/processor/imap4rev1/ExpungeProcessor.java
    james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/processor/imap4rev1/FetchProcessor.java
    james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/processor/imap4rev1/ListProcessor.java
    james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/processor/imap4rev1/LoginProcessor.java
    james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/processor/imap4rev1/LogoutProcessor.java
    james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/processor/imap4rev1/LsubProcessor.java
    james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/processor/imap4rev1/NoopProcessor.java
    james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/processor/imap4rev1/RenameProcessor.java
    james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/processor/imap4rev1/SearchProcessor.java
    james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/processor/imap4rev1/StatusProcessor.java
    james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/processor/imap4rev1/StoreProcessor.java
    james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/processor/imap4rev1/SubscribeProcessor.java
    james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/processor/imap4rev1/UnsubscribeProcessor.java
    james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/test/java/org/apache/james/experimental/imapserver/message/BadResponseMessageTest.java
    james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/test/java/org/apache/james/experimental/imapserver/message/CommandFailedResponseMessageTest.java
    james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/test/java/org/apache/james/experimental/imapserver/message/ErrorResponseMessageTest.java

Modified: james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/message/BaseImapMessageFactory.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/BaseImapMessageFactory.java?view=diff&rev=537970&r1=537969&r2=537970
==============================================================================
--- james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/message/BaseImapMessageFactory.java (original)
+++ james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/message/BaseImapMessageFactory.java Mon May 14 13:17:38 2007
@@ -48,6 +48,8 @@
 import org.apache.james.experimental.imapserver.message.request.imap4rev1.StoreRequest;
 import org.apache.james.experimental.imapserver.message.request.imap4rev1.SubscribeRequest;
 import org.apache.james.experimental.imapserver.message.request.imap4rev1.UnsubscribeRequest;
+import org.apache.james.experimental.imapserver.message.response.imap4rev1.BadResponse;
+import org.apache.james.experimental.imapserver.message.response.imap4rev1.ErrorResponse;
 
 /**
  * Naive, factory creates unpooled instances.
@@ -55,7 +57,7 @@
 public class BaseImapMessageFactory implements ImapMessageFactory {
 
     public ImapRequestMessage createErrorMessage(String message, String tag) {
-        return new ErrorResponseMessage( message, tag );
+        return new ErrorResponse( message, tag );
     }
 
     public ImapRequestMessage createAppendMessage(ImapCommand command, String mailboxName, Flags flags, Date datetime, MimeMessage message, String tag) {
@@ -148,7 +150,7 @@
     }
 
     public ImapRequestMessage createBadRequestMessage(String message) {
-        return new BadResponseMessage(message);
+        return new BadResponse(message);
     }
 
     public ImapRequestMessage createCheckMessage(ImapCommand command, String tag) {

Added: james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/message/response/AbstractImapResponse.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/AbstractImapResponse.java?view=auto&rev=537970
==============================================================================
--- james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/message/response/AbstractImapResponse.java (added)
+++ james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/message/response/AbstractImapResponse.java Mon May 14 13:17:38 2007
@@ -0,0 +1,61 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+
+package org.apache.james.experimental.imapserver.message.response;
+
+import org.apache.avalon.framework.logger.AbstractLogEnabled;
+import org.apache.avalon.framework.logger.Logger;
+import org.apache.james.experimental.imapserver.ImapResponse;
+import org.apache.james.experimental.imapserver.ImapSession;
+import org.apache.james.experimental.imapserver.commands.ImapCommand;
+import org.apache.james.experimental.imapserver.message.ImapResponseMessage;
+import org.apache.james.experimental.imapserver.store.MailboxException;
+
+abstract public class AbstractImapResponse extends AbstractLogEnabled implements ImapResponseMessage {
+
+    private final ImapCommand command;
+    private final String tag;
+
+    public AbstractImapResponse(final ImapCommand command, final String tag) {
+        super();
+        this.command = command;
+        this.tag = tag;
+    }
+    
+    public ImapCommand getCommand() {
+        return command;
+    }
+
+    public void encode(ImapResponse response, ImapSession session) {
+        try {
+            doEncode(response, session, command, tag);
+        } catch (MailboxException e) {
+            // TODO: it seems wrong for session to throw a mailbox exception
+            // TODO: really, errors in unsolicited response should not
+            // TODO: impact the execution of this command
+            final Logger logger = getLogger();
+            if (logger != null) {
+                logger.debug("error processing command ", e);
+            }
+            response.commandFailed( command, e.getResponseCode(), e.getMessage(), tag );            
+        }
+    }
+    protected abstract void doEncode(ImapResponse response, ImapSession session, ImapCommand command, String tag) throws MailboxException;
+
+}

Added: james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/message/response/imap4rev1/BadResponse.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/BadResponse.java?view=auto&rev=537970
==============================================================================
--- james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/message/response/imap4rev1/BadResponse.java (added)
+++ james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/message/response/imap4rev1/BadResponse.java Mon May 14 13:17:38 2007
@@ -0,0 +1,61 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+
+package org.apache.james.experimental.imapserver.message.response.imap4rev1;
+
+import org.apache.james.experimental.imapserver.ImapResponse;
+import org.apache.james.experimental.imapserver.ImapSession;
+import org.apache.james.experimental.imapserver.message.ImapRequestMessage;
+import org.apache.james.experimental.imapserver.message.ImapResponseMessage;
+
+/**
+ * Carries the response to a request with bad syntax..
+ * 
+ */
+public class BadResponse implements ImapRequestMessage,
+        ImapResponseMessage {
+
+    private final String message;
+    private final String tag;
+    
+    public BadResponse(final String message) {
+    	// TODO: check calls that use this are specficiation compliant
+    	this(message, null);
+    }
+    
+    public BadResponse(final String message, final String tag) {
+        super();
+        this.message = message;
+        this.tag = tag;
+    }
+    
+
+    public ImapResponseMessage process(ImapSession session) {
+        return this;
+    }
+
+    public void encode(ImapResponse response, ImapSession session) {
+    	if (tag == null) {
+    		response.badResponse(message);
+    	} else {
+    		response.badResponse(message, tag);
+    	}
+    }
+
+}

Added: james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/message/response/imap4rev1/CapabilityReponse.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/CapabilityReponse.java?view=auto&rev=537970
==============================================================================
--- james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/message/response/imap4rev1/CapabilityReponse.java (added)
+++ james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/message/response/imap4rev1/CapabilityReponse.java Mon May 14 13:17:38 2007
@@ -0,0 +1,40 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+package org.apache.james.experimental.imapserver.message.response.imap4rev1;
+
+import org.apache.james.experimental.imapserver.ImapConstants;
+import org.apache.james.experimental.imapserver.ImapResponse;
+import org.apache.james.experimental.imapserver.ImapSession;
+import org.apache.james.experimental.imapserver.commands.ImapCommand;
+import org.apache.james.experimental.imapserver.message.response.AbstractImapResponse;
+import org.apache.james.experimental.imapserver.store.MailboxException;
+
+public class CapabilityReponse extends AbstractImapResponse {
+
+    public CapabilityReponse(ImapCommand command, String tag) {
+        super(command, tag);
+    }
+
+    protected void doEncode(ImapResponse response, ImapSession session, ImapCommand command, String tag) throws MailboxException {
+        response.untaggedResponse( ImapConstants.CAPABILITY_RESPONSE );
+        session.unsolicitedResponses( response, false);
+        response.commandComplete( command , tag );            
+    }
+    
+}

Added: james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/message/response/imap4rev1/CloseResponse.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/CloseResponse.java?view=auto&rev=537970
==============================================================================
--- james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/message/response/imap4rev1/CloseResponse.java (added)
+++ james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/message/response/imap4rev1/CloseResponse.java Mon May 14 13:17:38 2007
@@ -0,0 +1,41 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+package org.apache.james.experimental.imapserver.message.response.imap4rev1;
+
+import org.apache.james.experimental.imapserver.ImapResponse;
+import org.apache.james.experimental.imapserver.ImapSession;
+import org.apache.james.experimental.imapserver.commands.ImapCommand;
+import org.apache.james.experimental.imapserver.message.response.AbstractImapResponse;
+import org.apache.james.experimental.imapserver.store.MailboxException;
+
+public class CloseResponse extends AbstractImapResponse {
+        public CloseResponse(ImapCommand command, String tag) {
+            super(command, tag);
+        }
+
+        protected void doEncode(ImapResponse response, ImapSession session, ImapCommand command, String tag) throws MailboxException {
+            //TODO: the following comment was present in the code before refactoring
+            //TODO: doesn't seem to match the implementation
+            //TODO: check that implementation is correct
+//          Don't send unsolicited responses on close.
+            session.unsolicitedResponses( response, false );
+            response.commandComplete( command , tag);
+            //TODO: what about the bye?
+        }
+    }

Added: james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/message/response/imap4rev1/CommandCompleteResponse.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/CommandCompleteResponse.java?view=auto&rev=537970
==============================================================================
--- james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/message/response/imap4rev1/CommandCompleteResponse.java (added)
+++ james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/message/response/imap4rev1/CommandCompleteResponse.java Mon May 14 13:17:38 2007
@@ -0,0 +1,75 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+
+package org.apache.james.experimental.imapserver.message.response.imap4rev1;
+
+import org.apache.james.experimental.imapserver.ImapResponse;
+import org.apache.james.experimental.imapserver.ImapSession;
+import org.apache.james.experimental.imapserver.commands.ImapCommand;
+import org.apache.james.experimental.imapserver.message.ImapResponseMessage;
+import org.apache.james.experimental.imapserver.message.response.AbstractImapResponse;
+import org.apache.james.experimental.imapserver.store.MailboxException;
+
+/**
+ * 
+ * TODO: replace this with ok response?
+ */
+public class CommandCompleteResponse extends AbstractImapResponse implements ImapResponseMessage {
+
+    /**
+     * Creates a command completed response message that
+     * does not write unsolicited responses.
+     * @param command <code>ImapCommand</code>, not null
+     * @return <code>ImapResponseMessage</code>, not null
+     */
+    public static final ImapResponseMessage createWithNoUnsolictedResponses(final ImapCommand command, String tag) {
+        final CommandCompleteResponse result = new CommandCompleteResponse(command, tag);
+        return result;
+    }
+    
+    private final boolean useUids;
+    private final boolean writeUnsolicited;
+    
+    private CommandCompleteResponse(final ImapCommand command, String tag) {
+        super(command, tag);
+        writeUnsolicited = false;
+        this.useUids = false;
+    }
+    
+    /**
+     * Constructs a command completed response message
+     * that writes unsolicited responses.
+     * 
+     * @see #createWithNoUnsolictedResponses(ImapCommand)
+     * @param useUids true if uids should be used, false otherwise
+     * @param command <code>ImapCommand</code>, not null
+     */
+    public CommandCompleteResponse(final boolean useUids, final ImapCommand command, final String tag) {
+        super(command, tag);
+        writeUnsolicited = true;
+        this.useUids = useUids;
+    }
+
+    protected void doEncode(ImapResponse response, ImapSession session, ImapCommand command, String tag) throws MailboxException {
+        if (writeUnsolicited) {
+            session.unsolicitedResponses( response, useUids);
+        }
+        response.commandComplete( command , tag );
+    }
+}

Added: james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/message/response/imap4rev1/CommandFailedResponse.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/CommandFailedResponse.java?view=auto&rev=537970
==============================================================================
--- james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/message/response/imap4rev1/CommandFailedResponse.java (added)
+++ james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/message/response/imap4rev1/CommandFailedResponse.java Mon May 14 13:17:38 2007
@@ -0,0 +1,54 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+
+package org.apache.james.experimental.imapserver.message.response.imap4rev1;
+
+import org.apache.james.experimental.imapserver.ImapResponse;
+import org.apache.james.experimental.imapserver.ImapSession;
+import org.apache.james.experimental.imapserver.commands.ImapCommand;
+import org.apache.james.experimental.imapserver.message.ImapResponseMessage;
+
+public class CommandFailedResponse implements ImapResponseMessage {
+
+    private final ImapCommand command;
+    private final String responseCode;
+    private final String reason;
+    private final String tag;
+    
+    public CommandFailedResponse(final ImapCommand command, final String reason, String tag) {
+        this(command, null, reason, tag);
+    }
+        
+    public CommandFailedResponse(final ImapCommand command, final String responseCode, final String reason, String tag) {
+        super();
+        this.command = command;
+        this.responseCode = responseCode;
+        this.reason = reason;
+        this.tag = tag;
+    }
+
+    public void encode(ImapResponse response, ImapSession session) {
+        if (responseCode == null) {
+            response.commandFailed(command, reason, tag);
+        } else {
+            response.commandFailed(command, responseCode, reason, tag);
+        }
+    }
+
+}

Added: james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/message/response/imap4rev1/ErrorResponse.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/ErrorResponse.java?view=auto&rev=537970
==============================================================================
--- james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/message/response/imap4rev1/ErrorResponse.java (added)
+++ james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/message/response/imap4rev1/ErrorResponse.java Mon May 14 13:17:38 2007
@@ -0,0 +1,49 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+
+package org.apache.james.experimental.imapserver.message.response.imap4rev1;
+
+import org.apache.james.experimental.imapserver.ImapResponse;
+import org.apache.james.experimental.imapserver.ImapSession;
+import org.apache.james.experimental.imapserver.message.ImapRequestMessage;
+import org.apache.james.experimental.imapserver.message.ImapResponseMessage;
+
+/**
+ * Carries an error response.
+ * TODO: this response is not listed in the specification
+ * TODO: and should be replaced
+ */
+public class ErrorResponse implements ImapResponseMessage, ImapRequestMessage {
+
+    private final String message;
+    private final String tag;
+    
+    public ErrorResponse(final String message, String tag) {
+        this.message = message;
+        this.tag = tag;
+    }
+    
+    public void encode(ImapResponse response, ImapSession session) {
+        response.commandError(message, tag);
+    }
+
+    public ImapResponseMessage process(ImapSession session) {
+        return this;
+    }
+}

Added: james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/message/response/imap4rev1/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/ExamineAndSelectResponse.java?view=auto&rev=537970
==============================================================================
--- james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/message/response/imap4rev1/ExamineAndSelectResponse.java (added)
+++ james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/message/response/imap4rev1/ExamineAndSelectResponse.java Mon May 14 13:17:38 2007
@@ -0,0 +1,69 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+package org.apache.james.experimental.imapserver.message.response.imap4rev1;
+
+import javax.mail.Flags;
+
+import org.apache.james.experimental.imapserver.ImapResponse;
+import org.apache.james.experimental.imapserver.ImapSession;
+import org.apache.james.experimental.imapserver.commands.ImapCommand;
+import org.apache.james.experimental.imapserver.message.response.AbstractImapResponse;
+import org.apache.james.experimental.imapserver.store.MailboxException;
+import org.apache.james.mailboxmanager.MessageResult;
+
+public class ExamineAndSelectResponse extends AbstractImapResponse {
+    private final Flags permanentFlags;
+    private final boolean writeable ;
+    private final int recentCount;
+    private final long uidValidity;
+    private final MessageResult firstUnseen;
+    private final int messageCount;
+
+    public ExamineAndSelectResponse(ImapCommand command, final Flags permanentFlags,
+            final boolean writeable, final int recentCount, 
+            final long uidValidity, final MessageResult firstUnseen,
+            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.messageCount = messageCount;
+    }        
+    
+    protected void doEncode(ImapResponse response, ImapSession session, ImapCommand command, String tag) throws MailboxException {
+        response.flagsResponse(permanentFlags);
+        response.recentResponse(recentCount);
+        response.okResponse("UIDVALIDITY " + uidValidity, null);
+        response.existsResponse(messageCount);
+        if (firstUnseen != null) {
+            response.okResponse("UNSEEN " + firstUnseen.getMsn(), "Message "
+                    + firstUnseen.getMsn() + " is the first unseen");
+        } else {
+            response.okResponse(null, "No messages unseen");
+        }
+        response.permanentFlagsResponse(permanentFlags);
+        if (!writeable) {
+            response.commandComplete(command, "READ-ONLY", tag);
+        } else {
+            response.commandComplete(command, "READ-WRITE", tag);
+        }
+    }
+}

Added: james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/message/response/imap4rev1/FetchResponse.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/FetchResponse.java?view=auto&rev=537970
==============================================================================
--- james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/message/response/imap4rev1/FetchResponse.java (added)
+++ james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/message/response/imap4rev1/FetchResponse.java Mon May 14 13:17:38 2007
@@ -0,0 +1,75 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+package org.apache.james.experimental.imapserver.message.response.imap4rev1;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.apache.james.experimental.imapserver.ImapResponse;
+import org.apache.james.experimental.imapserver.ImapSession;
+import org.apache.james.experimental.imapserver.commands.ImapCommand;
+import org.apache.james.experimental.imapserver.message.response.AbstractImapResponse;
+import org.apache.james.experimental.imapserver.store.MailboxException;
+
+public class FetchResponse extends AbstractImapResponse {
+
+    private final boolean useUids;
+    
+    public FetchResponse(final ImapCommand command, final boolean useUids, 
+            final String tag) {
+        super(command, tag);
+        this.useUids = useUids;
+    }
+
+    private List messages = new ArrayList();
+    
+    public void addMessageData(int number, String messageData) {
+        final MessageData data = new MessageData(number, messageData);
+        messages.add(data);
+    }
+    
+    protected void doEncode(ImapResponse response, ImapSession session, ImapCommand command, String tag) throws MailboxException {
+        for (final Iterator it=messages.iterator();it.hasNext();) {
+            MessageData data = (MessageData) it.next();
+            data.encode(response);
+        }
+        boolean omitExpunged = (!useUids);
+        session.unsolicitedResponses( response, omitExpunged , useUids);
+        response.commandComplete( command, tag );
+        
+    }
+    
+    private class MessageData {
+        // TODO: this is not an efficient solution
+        // TODO: would be better to lazy load and stream on output
+        // TODO: this is just a transitional solution
+        private final int number;
+        private final String data;
+        public MessageData(final int number, final String data) {
+            super();
+            this.number = number;
+            this.data = data;
+        }
+        
+        public void encode(ImapResponse response) {
+            response.fetchResponse(number, data);
+        }
+    }
+}

Added: james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/message/response/imap4rev1/ListResponse.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/ListResponse.java?view=auto&rev=537970
==============================================================================
--- james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/message/response/imap4rev1/ListResponse.java (added)
+++ james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/message/response/imap4rev1/ListResponse.java Mon May 14 13:17:38 2007
@@ -0,0 +1,54 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+package org.apache.james.experimental.imapserver.message.response.imap4rev1;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.apache.james.experimental.imapserver.ImapResponse;
+import org.apache.james.experimental.imapserver.ImapSession;
+import org.apache.james.experimental.imapserver.commands.ImapCommand;
+import org.apache.james.experimental.imapserver.message.response.AbstractImapResponse;
+import org.apache.james.experimental.imapserver.store.MailboxException;
+
+public class ListResponse extends AbstractImapResponse {
+    private List messages = new ArrayList();
+    
+    public ListResponse(final ImapCommand command, final String tag) {
+        super(command, tag);
+    }
+    
+    public void addMessageData(String message) {
+        // TODO: this isn't efficient
+        // TODO: better to stream results
+    	// TODO: pass data objects back and then encode
+        messages.add(message);
+    }
+    
+    protected void doEncode(ImapResponse response, ImapSession session, ImapCommand command, String tag) throws MailboxException {
+        for (final Iterator it=messages.iterator();it.hasNext();) {
+            String message = (String) it.next();
+            response.commandResponse(command, message);
+        }
+        session.unsolicitedResponses( response, false );
+        response.commandComplete( command, tag );
+    }
+    
+}

Added: james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/message/response/imap4rev1/LogoutResponse.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/LogoutResponse.java?view=auto&rev=537970
==============================================================================
--- james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/message/response/imap4rev1/LogoutResponse.java (added)
+++ james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/message/response/imap4rev1/LogoutResponse.java Mon May 14 13:17:38 2007
@@ -0,0 +1,49 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+package org.apache.james.experimental.imapserver.message.response.imap4rev1;
+
+import org.apache.james.experimental.imapserver.ImapConstants;
+import org.apache.james.experimental.imapserver.ImapResponse;
+import org.apache.james.experimental.imapserver.ImapSession;
+import org.apache.james.experimental.imapserver.commands.ImapCommand;
+import org.apache.james.experimental.imapserver.message.ImapRequestMessage;
+import org.apache.james.experimental.imapserver.message.ImapResponseMessage;
+import org.apache.james.experimental.imapserver.message.response.AbstractImapResponse;
+import org.apache.james.experimental.imapserver.store.MailboxException;
+
+public class LogoutResponse extends AbstractImapResponse implements ImapRequestMessage {
+
+
+    public static final String BYE_MESSAGE = ImapConstants.VERSION + ImapConstants.SP + "Server logging out";
+    
+    public LogoutResponse(final ImapCommand command, final String tag) {
+        super(command, tag);
+    }
+
+    protected void doEncode(ImapResponse response, ImapSession session, ImapCommand command, String tag) throws MailboxException {
+        response.byeResponse( BYE_MESSAGE );
+        response.commandComplete( command, tag );
+        // TODO: think about how this will work with SEDA
+        session.closeConnection();            
+    }
+
+    public ImapResponseMessage process(ImapSession session) {
+        return this;
+    }
+}

Added: james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/message/response/imap4rev1/SearchResponse.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/SearchResponse.java?view=auto&rev=537970
==============================================================================
--- james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/message/response/imap4rev1/SearchResponse.java (added)
+++ james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/message/response/imap4rev1/SearchResponse.java Mon May 14 13:17:38 2007
@@ -0,0 +1,46 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+package org.apache.james.experimental.imapserver.message.response.imap4rev1;
+
+import org.apache.james.experimental.imapserver.ImapResponse;
+import org.apache.james.experimental.imapserver.ImapSession;
+import org.apache.james.experimental.imapserver.commands.ImapCommand;
+import org.apache.james.experimental.imapserver.message.response.AbstractImapResponse;
+import org.apache.james.experimental.imapserver.store.MailboxException;
+
+public class SearchResponse extends AbstractImapResponse {
+    private final String idList;
+    private final boolean useUids;
+    
+    public SearchResponse(final ImapCommand command, final String idList, 
+            final boolean useUids, final String tag) {
+        super(command, tag);
+        this.idList = idList;
+        this.useUids = useUids;
+    }
+    
+    protected void doEncode(ImapResponse response, ImapSession session, ImapCommand command, String tag) throws MailboxException {
+        
+        response.commandResponse( command, idList );
+        boolean omitExpunged = (!useUids);
+        session.unsolicitedResponses( response, omitExpunged, useUids );
+        response.commandComplete( command, tag );  
+    }
+    
+}

Added: james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/message/response/imap4rev1/StatusResponse.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/StatusResponse.java?view=auto&rev=537970
==============================================================================
--- james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/message/response/imap4rev1/StatusResponse.java (added)
+++ james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/message/response/imap4rev1/StatusResponse.java Mon May 14 13:17:38 2007
@@ -0,0 +1,40 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+package org.apache.james.experimental.imapserver.message.response.imap4rev1;
+
+import org.apache.james.experimental.imapserver.ImapResponse;
+import org.apache.james.experimental.imapserver.ImapSession;
+import org.apache.james.experimental.imapserver.commands.ImapCommand;
+import org.apache.james.experimental.imapserver.message.response.AbstractImapResponse;
+import org.apache.james.experimental.imapserver.store.MailboxException;
+
+public class StatusResponse extends AbstractImapResponse {
+    private final String message;
+    
+    public StatusResponse(ImapCommand command, final String message, final String tag) {
+        super(command, tag);
+        this.message = message;
+    }
+
+    protected void doEncode(ImapResponse response, ImapSession session, ImapCommand command, String tag) throws MailboxException {
+        response.commandResponse( command, message);
+        session.unsolicitedResponses( response, false );
+        response.commandComplete( command, tag );
+    }
+}

Added: james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/message/response/imap4rev1/StoreResponse.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/StoreResponse.java?view=auto&rev=537970
==============================================================================
--- james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/message/response/imap4rev1/StoreResponse.java (added)
+++ james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/message/response/imap4rev1/StoreResponse.java Mon May 14 13:17:38 2007
@@ -0,0 +1,44 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+package org.apache.james.experimental.imapserver.message.response.imap4rev1;
+
+import org.apache.james.experimental.imapserver.ImapResponse;
+import org.apache.james.experimental.imapserver.ImapSession;
+import org.apache.james.experimental.imapserver.commands.ImapCommand;
+import org.apache.james.experimental.imapserver.message.response.AbstractImapResponse;
+import org.apache.james.experimental.imapserver.store.MailboxException;
+
+/**
+ * TODO: this is probably redundent 
+ */
+public class StoreResponse extends AbstractImapResponse {
+    private final boolean useUids;
+    
+    public StoreResponse(ImapCommand command, final boolean useUids, final String tag) {
+        super(command, tag);
+        this.useUids = useUids;
+    }
+
+    protected void doEncode(ImapResponse response, ImapSession session, ImapCommand command, String tag) throws MailboxException {
+        boolean omitExpunged = (!useUids);
+        session.unsolicitedResponses( response, omitExpunged , useUids);
+        response.commandComplete( command, tag );            
+    }
+    
+}

Modified: james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/processor/AbstractImapRequestProcessor.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/AbstractImapRequestProcessor.java?view=diff&rev=537970&r1=537969&r2=537970
==============================================================================
--- james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/processor/AbstractImapRequestProcessor.java (original)
+++ james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/processor/AbstractImapRequestProcessor.java Mon May 14 13:17:38 2007
@@ -24,10 +24,10 @@
 import org.apache.james.experimental.imapserver.ImapSession;
 import org.apache.james.experimental.imapserver.ProtocolException;
 import org.apache.james.experimental.imapserver.commands.ImapCommand;
-import org.apache.james.experimental.imapserver.message.CommandFailedResponseMessage;
-import org.apache.james.experimental.imapserver.message.ErrorResponseMessage;
 import org.apache.james.experimental.imapserver.message.ImapResponseMessage;
 import org.apache.james.experimental.imapserver.message.request.AbstractImapRequest;
+import org.apache.james.experimental.imapserver.message.response.imap4rev1.CommandFailedResponse;
+import org.apache.james.experimental.imapserver.message.response.imap4rev1.ErrorResponse;
 import org.apache.james.experimental.imapserver.store.MailboxException;
 
 abstract public class AbstractImapRequestProcessor extends AbstractLogEnabled implements ImapRequestProcessor {
@@ -44,7 +44,7 @@
             if (logger != null) {
                 logger.debug("error processing command ", e);
             }
-            result = new CommandFailedResponseMessage( command, e.getResponseCode(), 
+            result = new CommandFailedResponse( command, e.getResponseCode(), 
                     e.getMessage(), tag );
         }
         catch ( AuthorizationException e ) {
@@ -52,7 +52,7 @@
                 logger.debug("error processing command ", e);
             }
             String msg = "Authorization error: Lacking permissions to perform requested operation.";
-            result = new CommandFailedResponseMessage( command, null, 
+            result = new CommandFailedResponse( command, null, 
                     msg, tag );
         }
         catch ( ProtocolException e ) {
@@ -61,7 +61,7 @@
             }
             String msg = e.getMessage() + " Command should be '" +
                     command.getExpectedMessage() + "'";
-            result = new ErrorResponseMessage( msg, tag );
+            result = new ErrorResponse( msg, tag );
         }
         return result;
     }
@@ -71,7 +71,7 @@
         ImapResponseMessage result;
         if ( !command.validForState( session.getState() ) ) {
             result = 
-                new CommandFailedResponseMessage(command, 
+                new CommandFailedResponse(command, 
                         "Command not valid in this state", tag );
         } else {
             result = doProcess( message, session, tag, command );

Modified: james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/processor/imap4rev1/AbstractListingProcessor.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/AbstractListingProcessor.java?view=diff&rev=537970&r1=537969&r2=537970
==============================================================================
--- james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/processor/imap4rev1/AbstractListingProcessor.java (original)
+++ james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/processor/imap4rev1/AbstractListingProcessor.java Mon May 14 13:17:38 2007
@@ -25,7 +25,7 @@
 import org.apache.james.experimental.imapserver.ProtocolException;
 import org.apache.james.experimental.imapserver.commands.ImapCommand;
 import org.apache.james.experimental.imapserver.message.ImapResponseMessage;
-import org.apache.james.experimental.imapserver.message.ListResponseMessage;
+import org.apache.james.experimental.imapserver.message.response.imap4rev1.ListResponse;
 import org.apache.james.experimental.imapserver.processor.AbstractImapRequestProcessor;
 import org.apache.james.experimental.imapserver.store.MailboxException;
 import org.apache.james.mailboxmanager.ListResult;
@@ -38,7 +38,7 @@
 	protected final ImapResponseMessage doProcess(final String baseReferenceName, final String mailboxPattern,
 			ImapSession session, String tag, ImapCommand command) throws MailboxException, AuthorizationException, ProtocolException {
 
-        final ListResponseMessage result = new ListResponseMessage(command, tag);
+        final ListResponse result = new ListResponse(command, tag);
         String referenceName = baseReferenceName;
         // Should the #user.userName section be removed from names returned?
         boolean removeUserPrefix;

Modified: james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/processor/imap4rev1/AppendProcessor.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/AppendProcessor.java?view=diff&rev=537970&r1=537969&r2=537970
==============================================================================
--- james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/processor/imap4rev1/AppendProcessor.java (original)
+++ james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/processor/imap4rev1/AppendProcessor.java Mon May 14 13:17:38 2007
@@ -28,11 +28,11 @@
 import org.apache.james.experimental.imapserver.ImapSession;
 import org.apache.james.experimental.imapserver.ProtocolException;
 import org.apache.james.experimental.imapserver.commands.ImapCommand;
-import org.apache.james.experimental.imapserver.message.BadResponseMessage;
-import org.apache.james.experimental.imapserver.message.CommandCompleteResponseMessage;
 import org.apache.james.experimental.imapserver.message.ImapResponseMessage;
 import org.apache.james.experimental.imapserver.message.request.AbstractImapRequest;
 import org.apache.james.experimental.imapserver.message.request.imap4rev1.AppendRequest;
+import org.apache.james.experimental.imapserver.message.response.imap4rev1.BadResponse;
+import org.apache.james.experimental.imapserver.message.response.imap4rev1.CommandCompleteResponse;
 import org.apache.james.experimental.imapserver.processor.AbstractImapRequestProcessor;
 import org.apache.james.experimental.imapserver.store.MailboxException;
 import org.apache.james.mailboxmanager.MailboxManagerException;
@@ -52,7 +52,7 @@
 			{
 				logger.debug("Expected AppendRequest, was " + message);
 			}
-			result = new BadResponseMessage("Command unknown by Append processor.");
+			result = new BadResponse("Command unknown by Append processor.");
 		}
 		
 		return result;
@@ -86,6 +86,6 @@
             // TODO why not TRYCREATE?
             throw new MailboxException(e);
         }
-        return new CommandCompleteResponseMessage(false, command, tag);
+        return new CommandCompleteResponse(false, command, tag);
 	}
 }

Modified: james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/processor/imap4rev1/AuthenticateProcessor.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/AuthenticateProcessor.java?view=diff&rev=537970&r1=537969&r2=537970
==============================================================================
--- james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/processor/imap4rev1/AuthenticateProcessor.java (original)
+++ james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/processor/imap4rev1/AuthenticateProcessor.java Mon May 14 13:17:38 2007
@@ -24,11 +24,11 @@
 import org.apache.james.experimental.imapserver.ImapSession;
 import org.apache.james.experimental.imapserver.ProtocolException;
 import org.apache.james.experimental.imapserver.commands.ImapCommand;
-import org.apache.james.experimental.imapserver.message.BadResponseMessage;
-import org.apache.james.experimental.imapserver.message.CommandFailedResponseMessage;
 import org.apache.james.experimental.imapserver.message.ImapResponseMessage;
 import org.apache.james.experimental.imapserver.message.request.AbstractImapRequest;
 import org.apache.james.experimental.imapserver.message.request.imap4rev1.AuthenticateRequest;
+import org.apache.james.experimental.imapserver.message.response.imap4rev1.BadResponse;
+import org.apache.james.experimental.imapserver.message.response.imap4rev1.CommandFailedResponse;
 import org.apache.james.experimental.imapserver.processor.AbstractImapRequestProcessor;
 import org.apache.james.experimental.imapserver.store.MailboxException;
 
@@ -46,7 +46,7 @@
 			{
 				logger.debug("Expected AuthenticateRequest, was " + message);
 			}
-			result = new BadResponseMessage("Command unknown by Authenticate processor.");
+			result = new BadResponse("Command unknown by Authenticate processor.");
 		}
 		
 		return result;
@@ -60,7 +60,7 @@
 	
 	private ImapResponseMessage doProcess(String authType, 
 			ImapSession session, String tag, ImapCommand command) throws MailboxException, AuthorizationException, ProtocolException {
-        final CommandFailedResponseMessage result = new CommandFailedResponseMessage(command, 
+        final CommandFailedResponse result = new CommandFailedResponse(command, 
                 "Unsupported authentication mechanism '" + authType + "'", tag);
         return result;
 	}

Modified: james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/processor/imap4rev1/CapabilityProcessor.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/CapabilityProcessor.java?view=diff&rev=537970&r1=537969&r2=537970
==============================================================================
--- james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/processor/imap4rev1/CapabilityProcessor.java (original)
+++ james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/processor/imap4rev1/CapabilityProcessor.java Mon May 14 13:17:38 2007
@@ -24,11 +24,11 @@
 import org.apache.james.experimental.imapserver.ImapSession;
 import org.apache.james.experimental.imapserver.ProtocolException;
 import org.apache.james.experimental.imapserver.commands.ImapCommand;
-import org.apache.james.experimental.imapserver.message.BadResponseMessage;
-import org.apache.james.experimental.imapserver.message.CapabilityReponseMessage;
 import org.apache.james.experimental.imapserver.message.ImapResponseMessage;
 import org.apache.james.experimental.imapserver.message.request.AbstractImapRequest;
 import org.apache.james.experimental.imapserver.message.request.imap4rev1.CapabilityRequest;
+import org.apache.james.experimental.imapserver.message.response.imap4rev1.BadResponse;
+import org.apache.james.experimental.imapserver.message.response.imap4rev1.CapabilityReponse;
 import org.apache.james.experimental.imapserver.processor.AbstractImapRequestProcessor;
 import org.apache.james.experimental.imapserver.store.MailboxException;
 
@@ -46,7 +46,7 @@
 			{
 				logger.debug("Expected CapabilityRequest, was " + message);
 			}
-			result = new BadResponseMessage("Command unknown by Capability processor.");
+			result = new BadResponse("Command unknown by Capability processor.");
 		}
 		return result;
 	}
@@ -58,7 +58,7 @@
 	
 	private ImapResponseMessage doProcess(ImapSession session, String tag, ImapCommand command) throws MailboxException, AuthorizationException, ProtocolException {
         // TODO: accurately report the capabilities of the server
-		final CapabilityReponseMessage result = new CapabilityReponseMessage(command, tag);
+		final CapabilityReponse result = new CapabilityReponse(command, tag);
         return result;
 	}
 }

Modified: james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/processor/imap4rev1/CheckProcessor.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/CheckProcessor.java?view=diff&rev=537970&r1=537969&r2=537970
==============================================================================
--- james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/processor/imap4rev1/CheckProcessor.java (original)
+++ james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/processor/imap4rev1/CheckProcessor.java Mon May 14 13:17:38 2007
@@ -24,11 +24,11 @@
 import org.apache.james.experimental.imapserver.ImapSession;
 import org.apache.james.experimental.imapserver.ProtocolException;
 import org.apache.james.experimental.imapserver.commands.ImapCommand;
-import org.apache.james.experimental.imapserver.message.BadResponseMessage;
-import org.apache.james.experimental.imapserver.message.CommandCompleteResponseMessage;
 import org.apache.james.experimental.imapserver.message.ImapResponseMessage;
 import org.apache.james.experimental.imapserver.message.request.AbstractImapRequest;
 import org.apache.james.experimental.imapserver.message.request.imap4rev1.CheckRequest;
+import org.apache.james.experimental.imapserver.message.response.imap4rev1.BadResponse;
+import org.apache.james.experimental.imapserver.message.response.imap4rev1.CommandCompleteResponse;
 import org.apache.james.experimental.imapserver.processor.AbstractImapRequestProcessor;
 import org.apache.james.experimental.imapserver.store.MailboxException;
 
@@ -46,7 +46,7 @@
 			{
 				logger.debug("Expected CheckRequest, was " + message);
 			}
-			result = new BadResponseMessage("Command unknown by Check processor.");
+			result = new BadResponse("Command unknown by Check processor.");
 		}
 		return result;
 	}
@@ -57,7 +57,7 @@
 	}
 	
 	private ImapResponseMessage doProcess(ImapSession session, String tag, ImapCommand command) throws MailboxException, AuthorizationException, ProtocolException {
-        final CommandCompleteResponseMessage result = new CommandCompleteResponseMessage(false, command, tag);
+        final CommandCompleteResponse result = new CommandCompleteResponse(false, command, tag);
         return result;
 	}
 }

Modified: james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/processor/imap4rev1/CloseProcessor.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/CloseProcessor.java?view=diff&rev=537970&r1=537969&r2=537970
==============================================================================
--- james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/processor/imap4rev1/CloseProcessor.java (original)
+++ james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/processor/imap4rev1/CloseProcessor.java Mon May 14 13:17:38 2007
@@ -24,11 +24,11 @@
 import org.apache.james.experimental.imapserver.ImapSession;
 import org.apache.james.experimental.imapserver.ProtocolException;
 import org.apache.james.experimental.imapserver.commands.ImapCommand;
-import org.apache.james.experimental.imapserver.message.BadResponseMessage;
-import org.apache.james.experimental.imapserver.message.CloseResponseMessage;
 import org.apache.james.experimental.imapserver.message.ImapResponseMessage;
 import org.apache.james.experimental.imapserver.message.request.AbstractImapRequest;
 import org.apache.james.experimental.imapserver.message.request.imap4rev1.CloseRequest;
+import org.apache.james.experimental.imapserver.message.response.imap4rev1.BadResponse;
+import org.apache.james.experimental.imapserver.message.response.imap4rev1.CloseResponse;
 import org.apache.james.experimental.imapserver.processor.AbstractImapRequestProcessor;
 import org.apache.james.experimental.imapserver.store.MailboxException;
 import org.apache.james.mailboxmanager.MailboxManagerException;
@@ -50,7 +50,7 @@
 			{
 				logger.debug("Expected CloseRequest, was " + message);
 			}
-			result = new BadResponseMessage("Command unknown by Close processor.");
+			result = new BadResponse("Command unknown by Close processor.");
 		}
 		return result;
 	}
@@ -70,7 +70,7 @@
             }
         }
         session.deselect();
-        final CloseResponseMessage result = new CloseResponseMessage(command, tag);
+        final CloseResponse result = new CloseResponse(command, tag);
         return result;
 	}
 }

Modified: james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/processor/imap4rev1/CopyProcessor.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/CopyProcessor.java?view=diff&rev=537970&r1=537969&r2=537970
==============================================================================
--- james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/processor/imap4rev1/CopyProcessor.java (original)
+++ james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/processor/imap4rev1/CopyProcessor.java Mon May 14 13:17:38 2007
@@ -24,12 +24,12 @@
 import org.apache.james.experimental.imapserver.ImapSession;
 import org.apache.james.experimental.imapserver.ProtocolException;
 import org.apache.james.experimental.imapserver.commands.ImapCommand;
-import org.apache.james.experimental.imapserver.message.BadResponseMessage;
-import org.apache.james.experimental.imapserver.message.CommandCompleteResponseMessage;
 import org.apache.james.experimental.imapserver.message.IdRange;
 import org.apache.james.experimental.imapserver.message.ImapResponseMessage;
 import org.apache.james.experimental.imapserver.message.request.AbstractImapRequest;
 import org.apache.james.experimental.imapserver.message.request.imap4rev1.CopyRequest;
+import org.apache.james.experimental.imapserver.message.response.imap4rev1.BadResponse;
+import org.apache.james.experimental.imapserver.message.response.imap4rev1.CommandCompleteResponse;
 import org.apache.james.experimental.imapserver.processor.AbstractImapRequestProcessor;
 import org.apache.james.experimental.imapserver.store.MailboxException;
 import org.apache.james.mailboxmanager.GeneralMessageSet;
@@ -51,7 +51,7 @@
 			{
 				logger.debug("Expected CopyRequest, was " + message);
 			}
-			result = new BadResponseMessage("Command unknown by Copy processor.");
+			result = new BadResponse("Command unknown by Copy processor.");
 		}
 		
 		return result;
@@ -82,8 +82,8 @@
         } catch (MailboxManagerException e) {
             throw new MailboxException(e);
         } 
-        final CommandCompleteResponseMessage result = 
-            new CommandCompleteResponseMessage(useUids, command, tag);
+        final CommandCompleteResponse result = 
+            new CommandCompleteResponse(useUids, command, tag);
         return result;
 	}
 }

Modified: james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/processor/imap4rev1/CreateProcessor.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/CreateProcessor.java?view=diff&rev=537970&r1=537969&r2=537970
==============================================================================
--- james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/processor/imap4rev1/CreateProcessor.java (original)
+++ james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/processor/imap4rev1/CreateProcessor.java Mon May 14 13:17:38 2007
@@ -24,11 +24,11 @@
 import org.apache.james.experimental.imapserver.ImapSession;
 import org.apache.james.experimental.imapserver.ProtocolException;
 import org.apache.james.experimental.imapserver.commands.ImapCommand;
-import org.apache.james.experimental.imapserver.message.BadResponseMessage;
-import org.apache.james.experimental.imapserver.message.CommandCompleteResponseMessage;
 import org.apache.james.experimental.imapserver.message.ImapResponseMessage;
 import org.apache.james.experimental.imapserver.message.request.AbstractImapRequest;
 import org.apache.james.experimental.imapserver.message.request.imap4rev1.CreateRequest;
+import org.apache.james.experimental.imapserver.message.response.imap4rev1.BadResponse;
+import org.apache.james.experimental.imapserver.message.response.imap4rev1.CommandCompleteResponse;
 import org.apache.james.experimental.imapserver.processor.AbstractImapRequestProcessor;
 import org.apache.james.experimental.imapserver.store.MailboxException;
 import org.apache.james.mailboxmanager.MailboxManagerException;
@@ -47,7 +47,7 @@
 			{
 				logger.debug("Expected CreateRequest, was " + message);
 			}
-			result = new BadResponseMessage("Command unknown by Create processor.");
+			result = new BadResponse("Command unknown by Create processor.");
 		}
 		
 		return result;
@@ -68,6 +68,6 @@
         } catch (MailboxManagerException e) {
            throw new MailboxException(e);
         }
-        return new CommandCompleteResponseMessage(false, command, tag);
+        return new CommandCompleteResponse(false, command, tag);
 	}
 }

Modified: james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/processor/imap4rev1/DeleteProcessor.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/DeleteProcessor.java?view=diff&rev=537970&r1=537969&r2=537970
==============================================================================
--- james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/processor/imap4rev1/DeleteProcessor.java (original)
+++ james/server/sandbox/seda-imap-modular/experimental-seda-imap-function/src/main/java/org/apache/james/experimental/imapserver/processor/imap4rev1/DeleteProcessor.java Mon May 14 13:17:38 2007
@@ -24,11 +24,11 @@
 import org.apache.james.experimental.imapserver.ImapSession;
 import org.apache.james.experimental.imapserver.ProtocolException;
 import org.apache.james.experimental.imapserver.commands.ImapCommand;
-import org.apache.james.experimental.imapserver.message.BadResponseMessage;
-import org.apache.james.experimental.imapserver.message.CommandCompleteResponseMessage;
 import org.apache.james.experimental.imapserver.message.ImapResponseMessage;
 import org.apache.james.experimental.imapserver.message.request.AbstractImapRequest;
 import org.apache.james.experimental.imapserver.message.request.imap4rev1.DeleteRequest;
+import org.apache.james.experimental.imapserver.message.response.imap4rev1.BadResponse;
+import org.apache.james.experimental.imapserver.message.response.imap4rev1.CommandCompleteResponse;
 import org.apache.james.experimental.imapserver.processor.AbstractImapRequestProcessor;
 import org.apache.james.experimental.imapserver.store.MailboxException;
 import org.apache.james.mailboxmanager.MailboxManagerException;
@@ -47,7 +47,7 @@
 			{
 				logger.debug("Expected DeleteRequest, was " + message);
 			}
-			result = new BadResponseMessage("Command unknown by Delete processor.");
+			result = new BadResponse("Command unknown by Delete processor.");
 		}
 		
 		return result;
@@ -74,8 +74,8 @@
             throw new MailboxException(e);
         }
 
-        final CommandCompleteResponseMessage result = 
-            new CommandCompleteResponseMessage(false, command, tag);
+        final CommandCompleteResponse result = 
+            new CommandCompleteResponse(false, command, tag);
         return result;
 	}
 }



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