14bc314fb002f3e5369cd724b91e83e0c71aeeccbchrismair/* 24bc314fb002f3e5369cd724b91e83e0c71aeeccbchrismair * Copyright 2007 the original author or authors. 34bc314fb002f3e5369cd724b91e83e0c71aeeccbchrismair * 44bc314fb002f3e5369cd724b91e83e0c71aeeccbchrismair * Licensed under the Apache License, Version 2.0 (the "License"); 54bc314fb002f3e5369cd724b91e83e0c71aeeccbchrismair * you may not use this file except in compliance with the License. 64bc314fb002f3e5369cd724b91e83e0c71aeeccbchrismair * You may obtain a copy of the License at 74bc314fb002f3e5369cd724b91e83e0c71aeeccbchrismair * 84bc314fb002f3e5369cd724b91e83e0c71aeeccbchrismair * http://www.apache.org/licenses/LICENSE-2.0 94bc314fb002f3e5369cd724b91e83e0c71aeeccbchrismair * 104bc314fb002f3e5369cd724b91e83e0c71aeeccbchrismair * Unless required by applicable law or agreed to in writing, software 114bc314fb002f3e5369cd724b91e83e0c71aeeccbchrismair * distributed under the License is distributed on an "AS IS" BASIS, 124bc314fb002f3e5369cd724b91e83e0c71aeeccbchrismair * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 134bc314fb002f3e5369cd724b91e83e0c71aeeccbchrismair * See the License for the specific language governing permissions and 144bc314fb002f3e5369cd724b91e83e0c71aeeccbchrismair * limitations under the License. 154bc314fb002f3e5369cd724b91e83e0c71aeeccbchrismair */ 164bc314fb002f3e5369cd724b91e83e0c71aeeccbchrismairpackage org.mockftpserver.core.command; 174bc314fb002f3e5369cd724b91e83e0c71aeeccbchrismair 184bc314fb002f3e5369cd724b91e83e0c71aeeccbchrismair/** 194bc314fb002f3e5369cd724b91e83e0c71aeeccbchrismair * Interface for an object that can retrieve and clear the history of InvocationRecords 204bc314fb002f3e5369cd724b91e83e0c71aeeccbchrismair * for a command handler. 214bc314fb002f3e5369cd724b91e83e0c71aeeccbchrismair * 224bc314fb002f3e5369cd724b91e83e0c71aeeccbchrismair * @version $Revision$ - $Date$ 234bc314fb002f3e5369cd724b91e83e0c71aeeccbchrismair * 244bc314fb002f3e5369cd724b91e83e0c71aeeccbchrismair * @author Chris Mair 254bc314fb002f3e5369cd724b91e83e0c71aeeccbchrismair */ 264bc314fb002f3e5369cd724b91e83e0c71aeeccbchrismairpublic interface InvocationHistory { 274bc314fb002f3e5369cd724b91e83e0c71aeeccbchrismair 284bc314fb002f3e5369cd724b91e83e0c71aeeccbchrismair /** 294bc314fb002f3e5369cd724b91e83e0c71aeeccbchrismair * @return the number of invocation records stored for this command handler instance 304bc314fb002f3e5369cd724b91e83e0c71aeeccbchrismair */ 314bc314fb002f3e5369cd724b91e83e0c71aeeccbchrismair public int numberOfInvocations(); 324bc314fb002f3e5369cd724b91e83e0c71aeeccbchrismair 334bc314fb002f3e5369cd724b91e83e0c71aeeccbchrismair /** 344bc314fb002f3e5369cd724b91e83e0c71aeeccbchrismair * Return the InvocationRecord representing the command invoction data for the nth invocation 354bc314fb002f3e5369cd724b91e83e0c71aeeccbchrismair * for this command handler instance. One InvocationRecord should be stored for each invocation 364bc314fb002f3e5369cd724b91e83e0c71aeeccbchrismair * of the CommandHandler. 374bc314fb002f3e5369cd724b91e83e0c71aeeccbchrismair * 384bc314fb002f3e5369cd724b91e83e0c71aeeccbchrismair * @param index - the index of the invocation record to return. The first record is at index zero. 394bc314fb002f3e5369cd724b91e83e0c71aeeccbchrismair * @return the InvocationRecord for the specified index 404bc314fb002f3e5369cd724b91e83e0c71aeeccbchrismair * 414bc314fb002f3e5369cd724b91e83e0c71aeeccbchrismair * @throws AssertFailedException - if there is no invocation record corresponding to the specified index */ 424bc314fb002f3e5369cd724b91e83e0c71aeeccbchrismair public InvocationRecord getInvocation(int index); 434bc314fb002f3e5369cd724b91e83e0c71aeeccbchrismair 444bc314fb002f3e5369cd724b91e83e0c71aeeccbchrismair /** 454bc314fb002f3e5369cd724b91e83e0c71aeeccbchrismair * Clear out the invocation history for this CommandHandler. After invoking this method, the 464bc314fb002f3e5369cd724b91e83e0c71aeeccbchrismair * <code>numberOfInvocations()</code> method will return zero. 474bc314fb002f3e5369cd724b91e83e0c71aeeccbchrismair */ 484bc314fb002f3e5369cd724b91e83e0c71aeeccbchrismair public void clearInvocations(); 494bc314fb002f3e5369cd724b91e83e0c71aeeccbchrismair 504bc314fb002f3e5369cd724b91e83e0c71aeeccbchrismair}