160b81e2faf8511148f0d1e8f296e0b40ce9c7971chrismair/*
260b81e2faf8511148f0d1e8f296e0b40ce9c7971chrismair * Copyright 2007 the original author or authors.
360b81e2faf8511148f0d1e8f296e0b40ce9c7971chrismair *
460b81e2faf8511148f0d1e8f296e0b40ce9c7971chrismair * Licensed under the Apache License, Version 2.0 (the "License");
560b81e2faf8511148f0d1e8f296e0b40ce9c7971chrismair * you may not use this file except in compliance with the License.
660b81e2faf8511148f0d1e8f296e0b40ce9c7971chrismair * You may obtain a copy of the License at
760b81e2faf8511148f0d1e8f296e0b40ce9c7971chrismair *
860b81e2faf8511148f0d1e8f296e0b40ce9c7971chrismair *      http://www.apache.org/licenses/LICENSE-2.0
960b81e2faf8511148f0d1e8f296e0b40ce9c7971chrismair *
1060b81e2faf8511148f0d1e8f296e0b40ce9c7971chrismair * Unless required by applicable law or agreed to in writing, software
1160b81e2faf8511148f0d1e8f296e0b40ce9c7971chrismair * distributed under the License is distributed on an "AS IS" BASIS,
1260b81e2faf8511148f0d1e8f296e0b40ce9c7971chrismair * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1360b81e2faf8511148f0d1e8f296e0b40ce9c7971chrismair * See the License for the specific language governing permissions and
1460b81e2faf8511148f0d1e8f296e0b40ce9c7971chrismair * limitations under the License.
1560b81e2faf8511148f0d1e8f296e0b40ce9c7971chrismair */
1660b81e2faf8511148f0d1e8f296e0b40ce9c7971chrismairpackage org.mockftpserver.core.command;
1760b81e2faf8511148f0d1e8f296e0b40ce9c7971chrismair
1860b81e2faf8511148f0d1e8f296e0b40ce9c7971chrismair/**
1960b81e2faf8511148f0d1e8f296e0b40ce9c7971chrismair * Interface for an object that can retrieve and clear the history of InvocationRecords
2060b81e2faf8511148f0d1e8f296e0b40ce9c7971chrismair * for a command handler.
2160b81e2faf8511148f0d1e8f296e0b40ce9c7971chrismair *
2260b81e2faf8511148f0d1e8f296e0b40ce9c7971chrismair * @version $Revision$ - $Date$
2360b81e2faf8511148f0d1e8f296e0b40ce9c7971chrismair *
2460b81e2faf8511148f0d1e8f296e0b40ce9c7971chrismair * @author Chris Mair
2560b81e2faf8511148f0d1e8f296e0b40ce9c7971chrismair */
2660b81e2faf8511148f0d1e8f296e0b40ce9c7971chrismairpublic interface InvocationHistory {
2760b81e2faf8511148f0d1e8f296e0b40ce9c7971chrismair
2860b81e2faf8511148f0d1e8f296e0b40ce9c7971chrismair    /**
2960b81e2faf8511148f0d1e8f296e0b40ce9c7971chrismair     * @return the number of invocation records stored for this command handler instance
3060b81e2faf8511148f0d1e8f296e0b40ce9c7971chrismair     */
3160b81e2faf8511148f0d1e8f296e0b40ce9c7971chrismair    public int numberOfInvocations();
3260b81e2faf8511148f0d1e8f296e0b40ce9c7971chrismair
3360b81e2faf8511148f0d1e8f296e0b40ce9c7971chrismair    /**
3460b81e2faf8511148f0d1e8f296e0b40ce9c7971chrismair     * Return the InvocationRecord representing the command invoction data for the nth invocation
3560b81e2faf8511148f0d1e8f296e0b40ce9c7971chrismair     * for this command handler instance. One InvocationRecord should be stored for each invocation
3660b81e2faf8511148f0d1e8f296e0b40ce9c7971chrismair     * of the CommandHandler.
3760b81e2faf8511148f0d1e8f296e0b40ce9c7971chrismair     *
3860b81e2faf8511148f0d1e8f296e0b40ce9c7971chrismair     * @param index - the index of the invocation record to return. The first record is at index zero.
3960b81e2faf8511148f0d1e8f296e0b40ce9c7971chrismair     * @return the InvocationRecord for the specified index
4060b81e2faf8511148f0d1e8f296e0b40ce9c7971chrismair     *
4160b81e2faf8511148f0d1e8f296e0b40ce9c7971chrismair     * @throws AssertFailedException - if there is no invocation record corresponding to the specified index     */
4260b81e2faf8511148f0d1e8f296e0b40ce9c7971chrismair    public InvocationRecord getInvocation(int index);
4360b81e2faf8511148f0d1e8f296e0b40ce9c7971chrismair
4460b81e2faf8511148f0d1e8f296e0b40ce9c7971chrismair    /**
4560b81e2faf8511148f0d1e8f296e0b40ce9c7971chrismair     * Clear out the invocation history for this CommandHandler. After invoking this method, the
4660b81e2faf8511148f0d1e8f296e0b40ce9c7971chrismair     * <code>numberOfInvocations()</code> method will return zero.
4760b81e2faf8511148f0d1e8f296e0b40ce9c7971chrismair     */
4860b81e2faf8511148f0d1e8f296e0b40ce9c7971chrismair    public void clearInvocations();
4960b81e2faf8511148f0d1e8f296e0b40ce9c7971chrismair
5060b81e2faf8511148f0d1e8f296e0b40ce9c7971chrismair}