14531116f8e675a208710e987bfe3b58faeb12db2chrismair/*
24531116f8e675a208710e987bfe3b58faeb12db2chrismair * Copyright 2007 the original author or authors.
34531116f8e675a208710e987bfe3b58faeb12db2chrismair *
44531116f8e675a208710e987bfe3b58faeb12db2chrismair * Licensed under the Apache License, Version 2.0 (the "License");
54531116f8e675a208710e987bfe3b58faeb12db2chrismair * you may not use this file except in compliance with the License.
64531116f8e675a208710e987bfe3b58faeb12db2chrismair * You may obtain a copy of the License at
74531116f8e675a208710e987bfe3b58faeb12db2chrismair *
84531116f8e675a208710e987bfe3b58faeb12db2chrismair *      http://www.apache.org/licenses/LICENSE-2.0
94531116f8e675a208710e987bfe3b58faeb12db2chrismair *
104531116f8e675a208710e987bfe3b58faeb12db2chrismair * Unless required by applicable law or agreed to in writing, software
114531116f8e675a208710e987bfe3b58faeb12db2chrismair * distributed under the License is distributed on an "AS IS" BASIS,
124531116f8e675a208710e987bfe3b58faeb12db2chrismair * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
134531116f8e675a208710e987bfe3b58faeb12db2chrismair * See the License for the specific language governing permissions and
144531116f8e675a208710e987bfe3b58faeb12db2chrismair * limitations under the License.
154531116f8e675a208710e987bfe3b58faeb12db2chrismair */
164531116f8e675a208710e987bfe3b58faeb12db2chrismairpackage org.mockftpserver.core.command;
174531116f8e675a208710e987bfe3b58faeb12db2chrismair
184531116f8e675a208710e987bfe3b58faeb12db2chrismair/**
194531116f8e675a208710e987bfe3b58faeb12db2chrismair * Interface for an object that can retrieve and clear the history of InvocationRecords
204531116f8e675a208710e987bfe3b58faeb12db2chrismair * for a command handler.
214531116f8e675a208710e987bfe3b58faeb12db2chrismair *
224531116f8e675a208710e987bfe3b58faeb12db2chrismair * @version $Revision$ - $Date$
234531116f8e675a208710e987bfe3b58faeb12db2chrismair *
244531116f8e675a208710e987bfe3b58faeb12db2chrismair * @author Chris Mair
254531116f8e675a208710e987bfe3b58faeb12db2chrismair */
264531116f8e675a208710e987bfe3b58faeb12db2chrismairpublic interface InvocationHistory {
274531116f8e675a208710e987bfe3b58faeb12db2chrismair
284531116f8e675a208710e987bfe3b58faeb12db2chrismair    /**
294531116f8e675a208710e987bfe3b58faeb12db2chrismair     * @return the number of invocation records stored for this command handler instance
304531116f8e675a208710e987bfe3b58faeb12db2chrismair     */
314531116f8e675a208710e987bfe3b58faeb12db2chrismair    public int numberOfInvocations();
324531116f8e675a208710e987bfe3b58faeb12db2chrismair
334531116f8e675a208710e987bfe3b58faeb12db2chrismair    /**
344531116f8e675a208710e987bfe3b58faeb12db2chrismair     * Return the InvocationRecord representing the command invoction data for the nth invocation
354531116f8e675a208710e987bfe3b58faeb12db2chrismair     * for this command handler instance. One InvocationRecord should be stored for each invocation
364531116f8e675a208710e987bfe3b58faeb12db2chrismair     * of the CommandHandler.
374531116f8e675a208710e987bfe3b58faeb12db2chrismair     *
384531116f8e675a208710e987bfe3b58faeb12db2chrismair     * @param index - the index of the invocation record to return. The first record is at index zero.
394531116f8e675a208710e987bfe3b58faeb12db2chrismair     * @return the InvocationRecord for the specified index
404531116f8e675a208710e987bfe3b58faeb12db2chrismair     *
414531116f8e675a208710e987bfe3b58faeb12db2chrismair     * @throws AssertFailedException - if there is no invocation record corresponding to the specified index     */
424531116f8e675a208710e987bfe3b58faeb12db2chrismair    public InvocationRecord getInvocation(int index);
434531116f8e675a208710e987bfe3b58faeb12db2chrismair
444531116f8e675a208710e987bfe3b58faeb12db2chrismair    /**
454531116f8e675a208710e987bfe3b58faeb12db2chrismair     * Clear out the invocation history for this CommandHandler. After invoking this method, the
464531116f8e675a208710e987bfe3b58faeb12db2chrismair     * <code>numberOfInvocations()</code> method will return zero.
474531116f8e675a208710e987bfe3b58faeb12db2chrismair     */
484531116f8e675a208710e987bfe3b58faeb12db2chrismair    public void clearInvocations();
494531116f8e675a208710e987bfe3b58faeb12db2chrismair
504531116f8e675a208710e987bfe3b58faeb12db2chrismair}