19d9aece7b2c2865253fdd2946a4d11a4f642c5aechrismair/* 29d9aece7b2c2865253fdd2946a4d11a4f642c5aechrismair * Copyright 2007 the original author or authors. 39d9aece7b2c2865253fdd2946a4d11a4f642c5aechrismair * 49d9aece7b2c2865253fdd2946a4d11a4f642c5aechrismair * Licensed under the Apache License, Version 2.0 (the "License"); 59d9aece7b2c2865253fdd2946a4d11a4f642c5aechrismair * you may not use this file except in compliance with the License. 69d9aece7b2c2865253fdd2946a4d11a4f642c5aechrismair * You may obtain a copy of the License at 79d9aece7b2c2865253fdd2946a4d11a4f642c5aechrismair * 89d9aece7b2c2865253fdd2946a4d11a4f642c5aechrismair * http://www.apache.org/licenses/LICENSE-2.0 99d9aece7b2c2865253fdd2946a4d11a4f642c5aechrismair * 109d9aece7b2c2865253fdd2946a4d11a4f642c5aechrismair * Unless required by applicable law or agreed to in writing, software 119d9aece7b2c2865253fdd2946a4d11a4f642c5aechrismair * distributed under the License is distributed on an "AS IS" BASIS, 129d9aece7b2c2865253fdd2946a4d11a4f642c5aechrismair * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 139d9aece7b2c2865253fdd2946a4d11a4f642c5aechrismair * See the License for the specific language governing permissions and 149d9aece7b2c2865253fdd2946a4d11a4f642c5aechrismair * limitations under the License. 159d9aece7b2c2865253fdd2946a4d11a4f642c5aechrismair */ 169d9aece7b2c2865253fdd2946a4d11a4f642c5aechrismairpackage org.mockftpserver.core.command; 179d9aece7b2c2865253fdd2946a4d11a4f642c5aechrismair 189d9aece7b2c2865253fdd2946a4d11a4f642c5aechrismair/** 199d9aece7b2c2865253fdd2946a4d11a4f642c5aechrismair * Interface for an object that can retrieve and clear the history of InvocationRecords 209d9aece7b2c2865253fdd2946a4d11a4f642c5aechrismair * for a command handler. 219d9aece7b2c2865253fdd2946a4d11a4f642c5aechrismair * 229d9aece7b2c2865253fdd2946a4d11a4f642c5aechrismair * @version $Revision$ - $Date$ 239d9aece7b2c2865253fdd2946a4d11a4f642c5aechrismair * 249d9aece7b2c2865253fdd2946a4d11a4f642c5aechrismair * @author Chris Mair 259d9aece7b2c2865253fdd2946a4d11a4f642c5aechrismair */ 269d9aece7b2c2865253fdd2946a4d11a4f642c5aechrismairpublic interface InvocationHistory { 279d9aece7b2c2865253fdd2946a4d11a4f642c5aechrismair 289d9aece7b2c2865253fdd2946a4d11a4f642c5aechrismair /** 299d9aece7b2c2865253fdd2946a4d11a4f642c5aechrismair * @return the number of invocation records stored for this command handler instance 309d9aece7b2c2865253fdd2946a4d11a4f642c5aechrismair */ 319d9aece7b2c2865253fdd2946a4d11a4f642c5aechrismair public int numberOfInvocations(); 329d9aece7b2c2865253fdd2946a4d11a4f642c5aechrismair 339d9aece7b2c2865253fdd2946a4d11a4f642c5aechrismair /** 349d9aece7b2c2865253fdd2946a4d11a4f642c5aechrismair * Return the InvocationRecord representing the command invoction data for the nth invocation 359d9aece7b2c2865253fdd2946a4d11a4f642c5aechrismair * for this command handler instance. One InvocationRecord should be stored for each invocation 369d9aece7b2c2865253fdd2946a4d11a4f642c5aechrismair * of the CommandHandler. 379d9aece7b2c2865253fdd2946a4d11a4f642c5aechrismair * 389d9aece7b2c2865253fdd2946a4d11a4f642c5aechrismair * @param index - the index of the invocation record to return. The first record is at index zero. 399d9aece7b2c2865253fdd2946a4d11a4f642c5aechrismair * @return the InvocationRecord for the specified index 409d9aece7b2c2865253fdd2946a4d11a4f642c5aechrismair * 419d9aece7b2c2865253fdd2946a4d11a4f642c5aechrismair * @throws AssertFailedException - if there is no invocation record corresponding to the specified index */ 429d9aece7b2c2865253fdd2946a4d11a4f642c5aechrismair public InvocationRecord getInvocation(int index); 439d9aece7b2c2865253fdd2946a4d11a4f642c5aechrismair 449d9aece7b2c2865253fdd2946a4d11a4f642c5aechrismair /** 459d9aece7b2c2865253fdd2946a4d11a4f642c5aechrismair * Clear out the invocation history for this CommandHandler. After invoking this method, the 469d9aece7b2c2865253fdd2946a4d11a4f642c5aechrismair * <code>numberOfInvocations()</code> method will return zero. 479d9aece7b2c2865253fdd2946a4d11a4f642c5aechrismair */ 489d9aece7b2c2865253fdd2946a4d11a4f642c5aechrismair public void clearInvocations(); 499d9aece7b2c2865253fdd2946a4d11a4f642c5aechrismair 509d9aece7b2c2865253fdd2946a4d11a4f642c5aechrismair}