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