1b2f4a2dfc590c250e42b21eb40d9539ac135b495chrismair/*
2b2f4a2dfc590c250e42b21eb40d9539ac135b495chrismair * Copyright 2007 the original author or authors.
3b2f4a2dfc590c250e42b21eb40d9539ac135b495chrismair *
4b2f4a2dfc590c250e42b21eb40d9539ac135b495chrismair * Licensed under the Apache License, Version 2.0 (the "License");
5b2f4a2dfc590c250e42b21eb40d9539ac135b495chrismair * you may not use this file except in compliance with the License.
6b2f4a2dfc590c250e42b21eb40d9539ac135b495chrismair * You may obtain a copy of the License at
7b2f4a2dfc590c250e42b21eb40d9539ac135b495chrismair *
8b2f4a2dfc590c250e42b21eb40d9539ac135b495chrismair *      http://www.apache.org/licenses/LICENSE-2.0
9b2f4a2dfc590c250e42b21eb40d9539ac135b495chrismair *
10b2f4a2dfc590c250e42b21eb40d9539ac135b495chrismair * Unless required by applicable law or agreed to in writing, software
11b2f4a2dfc590c250e42b21eb40d9539ac135b495chrismair * distributed under the License is distributed on an "AS IS" BASIS,
12b2f4a2dfc590c250e42b21eb40d9539ac135b495chrismair * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13b2f4a2dfc590c250e42b21eb40d9539ac135b495chrismair * See the License for the specific language governing permissions and
14b2f4a2dfc590c250e42b21eb40d9539ac135b495chrismair * limitations under the License.
15b2f4a2dfc590c250e42b21eb40d9539ac135b495chrismair */
16b2f4a2dfc590c250e42b21eb40d9539ac135b495chrismairpackage org.mockftpserver.core.command;
17b2f4a2dfc590c250e42b21eb40d9539ac135b495chrismair
18b2f4a2dfc590c250e42b21eb40d9539ac135b495chrismair/**
19b2f4a2dfc590c250e42b21eb40d9539ac135b495chrismair * Interface for an object that can retrieve and clear the history of InvocationRecords
20b2f4a2dfc590c250e42b21eb40d9539ac135b495chrismair * for a command handler.
21b2f4a2dfc590c250e42b21eb40d9539ac135b495chrismair *
22b2f4a2dfc590c250e42b21eb40d9539ac135b495chrismair * @version $Revision$ - $Date$
23b2f4a2dfc590c250e42b21eb40d9539ac135b495chrismair *
24b2f4a2dfc590c250e42b21eb40d9539ac135b495chrismair * @author Chris Mair
25b2f4a2dfc590c250e42b21eb40d9539ac135b495chrismair */
26b2f4a2dfc590c250e42b21eb40d9539ac135b495chrismairpublic interface InvocationHistory {
27b2f4a2dfc590c250e42b21eb40d9539ac135b495chrismair
28b2f4a2dfc590c250e42b21eb40d9539ac135b495chrismair    /**
29b2f4a2dfc590c250e42b21eb40d9539ac135b495chrismair     * @return the number of invocation records stored for this command handler instance
30b2f4a2dfc590c250e42b21eb40d9539ac135b495chrismair     */
31b2f4a2dfc590c250e42b21eb40d9539ac135b495chrismair    public int numberOfInvocations();
32b2f4a2dfc590c250e42b21eb40d9539ac135b495chrismair
33b2f4a2dfc590c250e42b21eb40d9539ac135b495chrismair    /**
34b2f4a2dfc590c250e42b21eb40d9539ac135b495chrismair     * Return the InvocationRecord representing the command invoction data for the nth invocation
35b2f4a2dfc590c250e42b21eb40d9539ac135b495chrismair     * for this command handler instance. One InvocationRecord should be stored for each invocation
36b2f4a2dfc590c250e42b21eb40d9539ac135b495chrismair     * of the CommandHandler.
37b2f4a2dfc590c250e42b21eb40d9539ac135b495chrismair     *
38b2f4a2dfc590c250e42b21eb40d9539ac135b495chrismair     * @param index - the index of the invocation record to return. The first record is at index zero.
39b2f4a2dfc590c250e42b21eb40d9539ac135b495chrismair     * @return the InvocationRecord for the specified index
40b2f4a2dfc590c250e42b21eb40d9539ac135b495chrismair     *
41b2f4a2dfc590c250e42b21eb40d9539ac135b495chrismair     * @throws AssertFailedException - if there is no invocation record corresponding to the specified index     */
42b2f4a2dfc590c250e42b21eb40d9539ac135b495chrismair    public InvocationRecord getInvocation(int index);
43b2f4a2dfc590c250e42b21eb40d9539ac135b495chrismair
44b2f4a2dfc590c250e42b21eb40d9539ac135b495chrismair    /**
45b2f4a2dfc590c250e42b21eb40d9539ac135b495chrismair     * Clear out the invocation history for this CommandHandler. After invoking this method, the
46b2f4a2dfc590c250e42b21eb40d9539ac135b495chrismair     * <code>numberOfInvocations()</code> method will return zero.
47b2f4a2dfc590c250e42b21eb40d9539ac135b495chrismair     */
48b2f4a2dfc590c250e42b21eb40d9539ac135b495chrismair    public void clearInvocations();
49b2f4a2dfc590c250e42b21eb40d9539ac135b495chrismair
50b2f4a2dfc590c250e42b21eb40d9539ac135b495chrismair}