james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rdon...@apache.org
Subject svn commit: r730818 - in /james/protocols/imap/trunk/message/src: main/java/org/apache/james/imap/encode/ main/java/org/apache/james/imap/encode/base/ test/java/org/apache/james/imap/encode/
Date Fri, 02 Jan 2009 19:11:12 GMT
Author: rdonkin
Date: Fri Jan  2 11:11:11 2009
New Revision: 730818

URL: http://svn.apache.org/viewvc?rev=730818&view=rev
Log:
Prune unused methods

Removed:
    james/protocols/imap/trunk/message/src/test/java/org/apache/james/imap/encode/ImapResponseCommandTest.java
Modified:
    james/protocols/imap/trunk/message/src/main/java/org/apache/james/imap/encode/ImapResponseComposer.java
    james/protocols/imap/trunk/message/src/main/java/org/apache/james/imap/encode/base/ImapResponseComposerImpl.java
    james/protocols/imap/trunk/message/src/test/java/org/apache/james/imap/encode/ImapResponseTest.java

Modified: james/protocols/imap/trunk/message/src/main/java/org/apache/james/imap/encode/ImapResponseComposer.java
URL: http://svn.apache.org/viewvc/james/protocols/imap/trunk/message/src/main/java/org/apache/james/imap/encode/ImapResponseComposer.java?rev=730818&r1=730817&r2=730818&view=diff
==============================================================================
--- james/protocols/imap/trunk/message/src/main/java/org/apache/james/imap/encode/ImapResponseComposer.java
(original)
+++ james/protocols/imap/trunk/message/src/main/java/org/apache/james/imap/encode/ImapResponseComposer.java
Fri Jan  2 11:11:11 2009
@@ -31,80 +31,6 @@
 public interface ImapResponseComposer {
 
     /**
-     * Writes a standard NO response on command failure, together with a
-     * descriptive message. Response is writen as:
-     * 
-     * <pre>
-     *        a01 NO COMMAND_NAME failed. &lt;reason&gt;
-     * </pre>
-     * 
-     * @param command
-     *            The ImapCommand which failed.
-     * @param reason
-     *            A message describing why the command failed.
-     */
-    public abstract void commandFailed(final ImapCommand command,
-            final String reason, final String tag) throws IOException;
-
-    /**
-     * Writes a standard NO response on command failure, together with a
-     * descriptive message. Response is writen as:
-     * 
-     * <pre>
-     *        a01 NO [responseCode] COMMAND_NAME failed. &lt;reason&gt;
-     * </pre>
-     * 
-     * @param command
-     *            The ImapCommand which failed.
-     * @param responseCode
-     *            The Imap response code to send.
-     * @param reason
-     *            A message describing why the command failed.
-     */
-    public abstract void commandFailed(ImapCommand command,
-            String responseCode, String reason, final String tag)
-            throws IOException;
-
-    /**
-     * Writes a standard BAD response on command error, together with a
-     * descriptive message. Response is writen as:
-     * 
-     * <pre>
-     *        a01 BAD &lt;message&gt;
-     * </pre>
-     * 
-     * @param message
-     *            The descriptive error message.
-     */
-    public abstract void commandError(final String message, final String tag)
-            throws IOException;
-
-    /**
-     * Writes a standard untagged BAD response, together with a descriptive
-     * message.
-     */
-    public abstract void badResponse(String message) throws IOException;
-
-    /**
-     * Writes a standard untagged BAD response, together with a descriptive
-     * message.
-     */
-    public abstract void badResponse(String message, String tag)
-            throws IOException;
-
-    /**
-     * Writes an untagged OK response, with the supplied response code, and an
-     * optional message.
-     * 
-     * @param responseCode
-     *            The response code, included in [].
-     * @param message
-     *            The message to follow the []
-     */
-    public abstract void okResponse(String responseCode, String message)
-            throws IOException;
-
-    /**
      * Writes an untagged NO response. Indicates that a warning. The command may
      * still complete sucessfully.
      * 

Modified: james/protocols/imap/trunk/message/src/main/java/org/apache/james/imap/encode/base/ImapResponseComposerImpl.java
URL: http://svn.apache.org/viewvc/james/protocols/imap/trunk/message/src/main/java/org/apache/james/imap/encode/base/ImapResponseComposerImpl.java?rev=730818&r1=730817&r2=730818&view=diff
==============================================================================
--- james/protocols/imap/trunk/message/src/main/java/org/apache/james/imap/encode/base/ImapResponseComposerImpl.java
(original)
+++ james/protocols/imap/trunk/message/src/main/java/org/apache/james/imap/encode/base/ImapResponseComposerImpl.java
Fri Jan  2 11:11:11 2009
@@ -26,7 +26,6 @@
 
 import javax.mail.Flags;
 
-import org.apache.commons.logging.Log;
 import org.apache.james.api.imap.AbstractLogEnabled;
 import org.apache.james.api.imap.ImapCommand;
 import org.apache.james.api.imap.ImapConstants;
@@ -76,99 +75,7 @@
         message("completed.");
         end();
     }
-
-    /**
-     * @throws IOException
-     * @see org.apache.james.imap.encode.ImapResponseComposer#commandFailed(org.apache.james.api.imap.ImapCommand,
-     *      java.lang.String, java.lang.String)
-     */
-    public void commandFailed(final ImapCommand command, final String reason,
-            final String tag) throws IOException {
-        commandFailed(command, null, reason, tag);
-    }
-
-    /**
-     * @throws IOException
-     * @see org.apache.james.imap.encode.ImapResponseComposer#commandFailed(org.apache.james.api.imap.ImapCommand,
-     *      java.lang.String, java.lang.String, java.lang.String)
-     */
-    public void commandFailed(ImapCommand command, String responseCode,
-            String reason, final String tag) throws IOException {
-        tag(tag);
-        message(NO);
-        responseCode(responseCode);
-        commandName(command);
-        message(FAILED);
-        message(reason);
-        end();
-        final Log logger = getLog();
-        if (logger != null && logger.isInfoEnabled()) {
-            logger.info("COMMAND FAILED [" + responseCode + "] - " + reason);
-        }
-    }
-
-    /**
-     * @throws IOException
-     * @see org.apache.james.imap.encode.ImapResponseComposer#commandError(java.lang.String,
-     *      java.lang.String)
-     */
-    public void commandError(final String message, final String tag)
-            throws IOException {
-        tag(tag);
-        message(BAD);
-        message(message);
-        end();
-        final Log logger = getLog();
-        if (logger != null && logger.isInfoEnabled()) {
-            logger.info("ERROR - " + message);
-        }
-    }
-
-    /**
-     * @throws IOException
-     * @see org.apache.james.imap.encode.ImapResponseComposer#badResponse(java.lang.String)
-     */
-    public void badResponse(String message) throws IOException {
-        untagged();
-        message(BAD);
-        message(message);
-        end();
-        final Log logger = getLog();
-        if (logger != null && logger.isInfoEnabled()) {
-            logger.info("BAD - " + message);
-        }
-    }
-
-    /**
-     * @throws IOException
-     * @see org.apache.james.imap.encode.ImapResponseComposer#badResponse(java.lang.String,
-     *      java.lang.String)
-     */
-    public void badResponse(String message, String tag) throws IOException {
-        tag(tag);
-        message(BAD);
-        message(message);
-        end();
-        final Log logger = getLog();
-        if (logger != null && logger.isInfoEnabled()) {
-            logger.info("BAD - " + message);
-        }
-    }
-
-    /**
-     * @throws IOException
-     * @see org.apache.james.imap.encode.ImapResponseComposer#okResponse(java.lang.String,
-     *      java.lang.String)
-     */
-    public void okResponse(String responseCode, String message)
-            throws IOException {
-        untagged();
-        message(OK);
-        responseCode(responseCode);
-        message(message);
-        end();
-    }
-
+    
     /**
      * @throws IOException
      * @see org.apache.james.imap.encode.ImapResponseComposer#untaggedNoResponse(java.lang.String,

Modified: james/protocols/imap/trunk/message/src/test/java/org/apache/james/imap/encode/ImapResponseTest.java
URL: http://svn.apache.org/viewvc/james/protocols/imap/trunk/message/src/test/java/org/apache/james/imap/encode/ImapResponseTest.java?rev=730818&r1=730817&r2=730818&view=diff
==============================================================================
--- james/protocols/imap/trunk/message/src/test/java/org/apache/james/imap/encode/ImapResponseTest.java
(original)
+++ james/protocols/imap/trunk/message/src/test/java/org/apache/james/imap/encode/ImapResponseTest.java
Fri Jan  2 11:11:11 2009
@@ -45,51 +45,6 @@
         super.tearDown();
     }
 
-    public void testCommandError() throws Exception {
-        String message = "A message";
-        response.commandError(message, TAG);
-        assertEquals(4, writer.operations.size());
-        assertEquals(new MockImapResponseWriter.TagOperation(TAG),
-                writer.operations.get(0));
-        assertEquals(new MockImapResponseWriter.TextMessageOperation(
-                ImapConstants.BAD), writer.operations.get(1));
-        assertEquals(new MockImapResponseWriter.TextMessageOperation(message),
-                writer.operations.get(2));
-        assertEquals(new MockImapResponseWriter.EndOperation(),
-                writer.operations.get(3));
-    }
-
-    public void testBadResponse() throws Exception {
-        String message = "A message";
-        response.badResponse(message);
-        assertEquals(4, writer.operations.size());
-        assertEquals(new MockImapResponseWriter.UntaggedOperation(),
-                writer.operations.get(0));
-        assertEquals(new MockImapResponseWriter.TextMessageOperation(
-                ImapConstants.BAD), writer.operations.get(1));
-        assertEquals(new MockImapResponseWriter.TextMessageOperation(message),
-                writer.operations.get(2));
-        assertEquals(new MockImapResponseWriter.EndOperation(),
-                writer.operations.get(3));
-    }
-
-    public void testOkResponse() throws Exception {
-        String message = "A message";
-        String code = "A code";
-        response.okResponse(code, message);
-        assertEquals(5, writer.operations.size());
-        assertEquals(new MockImapResponseWriter.UntaggedOperation(),
-                writer.operations.get(0));
-        assertEquals(new MockImapResponseWriter.TextMessageOperation(
-                ImapConstants.OK), writer.operations.get(1));
-        assertEquals(new MockImapResponseWriter.ResponseCodeOperation(code),
-                writer.operations.get(2));
-        assertEquals(new MockImapResponseWriter.TextMessageOperation(message),
-                writer.operations.get(3));
-        assertEquals(new MockImapResponseWriter.EndOperation(),
-                writer.operations.get(4));
-    }
-
     public void testFlagsResponse() throws Exception {
         Flags flags = new Flags();
         response.flagsResponse(flags);



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