1f688bc4bc07500f1548006ebbc4a0bd95f46b106chrismair/*
2f688bc4bc07500f1548006ebbc4a0bd95f46b106chrismair * Copyright 2007 the original author or authors.
3f688bc4bc07500f1548006ebbc4a0bd95f46b106chrismair *
4f688bc4bc07500f1548006ebbc4a0bd95f46b106chrismair * Licensed under the Apache License, Version 2.0 (the "License");
5f688bc4bc07500f1548006ebbc4a0bd95f46b106chrismair * you may not use this file except in compliance with the License.
6f688bc4bc07500f1548006ebbc4a0bd95f46b106chrismair * You may obtain a copy of the License at
7f688bc4bc07500f1548006ebbc4a0bd95f46b106chrismair *
8f688bc4bc07500f1548006ebbc4a0bd95f46b106chrismair *      http://www.apache.org/licenses/LICENSE-2.0
9f688bc4bc07500f1548006ebbc4a0bd95f46b106chrismair *
10f688bc4bc07500f1548006ebbc4a0bd95f46b106chrismair * Unless required by applicable law or agreed to in writing, software
11f688bc4bc07500f1548006ebbc4a0bd95f46b106chrismair * distributed under the License is distributed on an "AS IS" BASIS,
12f688bc4bc07500f1548006ebbc4a0bd95f46b106chrismair * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13f688bc4bc07500f1548006ebbc4a0bd95f46b106chrismair * See the License for the specific language governing permissions and
14f688bc4bc07500f1548006ebbc4a0bd95f46b106chrismair * limitations under the License.
15f688bc4bc07500f1548006ebbc4a0bd95f46b106chrismair */
16f688bc4bc07500f1548006ebbc4a0bd95f46b106chrismairpackage org.mockftpserver.core.command;
17f688bc4bc07500f1548006ebbc4a0bd95f46b106chrismair
18f688bc4bc07500f1548006ebbc4a0bd95f46b106chrismairimport org.mockftpserver.core.session.Session;
19f688bc4bc07500f1548006ebbc4a0bd95f46b106chrismair
20f688bc4bc07500f1548006ebbc4a0bd95f46b106chrismair/**
21f688bc4bc07500f1548006ebbc4a0bd95f46b106chrismair * Interface for classes that can handle an FTP command.
22f688bc4bc07500f1548006ebbc4a0bd95f46b106chrismair *
23f688bc4bc07500f1548006ebbc4a0bd95f46b106chrismair * @version $Revision$ - $Date$
24f688bc4bc07500f1548006ebbc4a0bd95f46b106chrismair *
25f688bc4bc07500f1548006ebbc4a0bd95f46b106chrismair * @author Chris Mair
26f688bc4bc07500f1548006ebbc4a0bd95f46b106chrismair */
27f688bc4bc07500f1548006ebbc4a0bd95f46b106chrismairpublic interface CommandHandler {
28f688bc4bc07500f1548006ebbc4a0bd95f46b106chrismair
29f688bc4bc07500f1548006ebbc4a0bd95f46b106chrismair    /**
30f688bc4bc07500f1548006ebbc4a0bd95f46b106chrismair     * Handle the specified command for the session. This method is declared to throw
31f688bc4bc07500f1548006ebbc4a0bd95f46b106chrismair     * Exception, allowing CommandHandler implementations to avoid unnecessary
32f688bc4bc07500f1548006ebbc4a0bd95f46b106chrismair     * exception-handling. All checked exceptions are expected to be wrapped and handled
33f688bc4bc07500f1548006ebbc4a0bd95f46b106chrismair     * by the caller.
34f688bc4bc07500f1548006ebbc4a0bd95f46b106chrismair     *
35f688bc4bc07500f1548006ebbc4a0bd95f46b106chrismair     * @param command - the Command to be handled
36f688bc4bc07500f1548006ebbc4a0bd95f46b106chrismair     * @param session - the session on which the Command was submitted
37f688bc4bc07500f1548006ebbc4a0bd95f46b106chrismair     *
38f688bc4bc07500f1548006ebbc4a0bd95f46b106chrismair     * @throws Exception
39f688bc4bc07500f1548006ebbc4a0bd95f46b106chrismair     */
40f688bc4bc07500f1548006ebbc4a0bd95f46b106chrismair    public void handleCommand(Command command, Session session) throws Exception;
41f688bc4bc07500f1548006ebbc4a0bd95f46b106chrismair
42f688bc4bc07500f1548006ebbc4a0bd95f46b106chrismair}