1 /*
2 * Copyright (c) 2004-2007 Creative Sphere Limited.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
7 *
8 * Contributors:
9 *
10 * Creative Sphere - initial API and implementation
11 *
12 */
13 package org.abstracthorizon.mercury.smtp.command;
14
15 import java.io.IOException;
16
17 import org.abstracthorizon.mercury.common.command.CommandException;
18 import org.abstracthorizon.mercury.smtp.SMTPResponses;
19 import org.abstracthorizon.mercury.smtp.SMTPSession;
20 import org.abstracthorizon.mercury.smtp.exception.ParserException;
21
22 /**
23 * Artificial command representing unknown command
24 *
25 * @author Daniel Sendula
26 */
27 public class NotImplementedCommand extends SMTPCommand {
28
29 /** Error string */
30 protected String error;
31
32 /**
33 * Constructor
34 */
35 public NotImplementedCommand() {
36 }
37
38 /**
39 * Sets error string
40 * @param error error string
41 */
42 public void setErrorString(String error) {
43 this.error = error;
44 }
45
46 /**
47 * Executed the command
48 * @param connection smtp session
49 * @throws CommandException
50 * @throws IOException
51 * @throws ParserException
52 */
53 protected void execute(SMTPSession connection) throws CommandException, IOException, ParserException {
54 connection.getScanner().skip_line();
55 connection.sendResponse(SMTPResponses.COMMAND_NOT_IMPLEMENTED_RESPONSE);
56 }
57
58 }