117f899cea435aaf91624af2a93bc24bcfcd5fc2dchrismair/*
217f899cea435aaf91624af2a93bc24bcfcd5fc2dchrismair * Copyright 2007 the original author or authors.
317f899cea435aaf91624af2a93bc24bcfcd5fc2dchrismair *
417f899cea435aaf91624af2a93bc24bcfcd5fc2dchrismair * Licensed under the Apache License, Version 2.0 (the "License");
517f899cea435aaf91624af2a93bc24bcfcd5fc2dchrismair * you may not use this file except in compliance with the License.
617f899cea435aaf91624af2a93bc24bcfcd5fc2dchrismair * You may obtain a copy of the License at
717f899cea435aaf91624af2a93bc24bcfcd5fc2dchrismair *
817f899cea435aaf91624af2a93bc24bcfcd5fc2dchrismair *      http://www.apache.org/licenses/LICENSE-2.0
917f899cea435aaf91624af2a93bc24bcfcd5fc2dchrismair *
1017f899cea435aaf91624af2a93bc24bcfcd5fc2dchrismair * Unless required by applicable law or agreed to in writing, software
1117f899cea435aaf91624af2a93bc24bcfcd5fc2dchrismair * distributed under the License is distributed on an "AS IS" BASIS,
1217f899cea435aaf91624af2a93bc24bcfcd5fc2dchrismair * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1317f899cea435aaf91624af2a93bc24bcfcd5fc2dchrismair * See the License for the specific language governing permissions and
1417f899cea435aaf91624af2a93bc24bcfcd5fc2dchrismair * limitations under the License.
1517f899cea435aaf91624af2a93bc24bcfcd5fc2dchrismair */
1617f899cea435aaf91624af2a93bc24bcfcd5fc2dchrismairpackage org.mockftpserver.core.command;
1717f899cea435aaf91624af2a93bc24bcfcd5fc2dchrismair
1817f899cea435aaf91624af2a93bc24bcfcd5fc2dchrismair/**
1917f899cea435aaf91624af2a93bc24bcfcd5fc2dchrismair * Interface for an object that can retrieve and clear the history of InvocationRecords
2017f899cea435aaf91624af2a93bc24bcfcd5fc2dchrismair * for a command handler.
2117f899cea435aaf91624af2a93bc24bcfcd5fc2dchrismair *
2217f899cea435aaf91624af2a93bc24bcfcd5fc2dchrismair * @version $Revision$ - $Date$
2317f899cea435aaf91624af2a93bc24bcfcd5fc2dchrismair *
2417f899cea435aaf91624af2a93bc24bcfcd5fc2dchrismair * @author Chris Mair
2517f899cea435aaf91624af2a93bc24bcfcd5fc2dchrismair */
2617f899cea435aaf91624af2a93bc24bcfcd5fc2dchrismairpublic interface InvocationHistory {
2717f899cea435aaf91624af2a93bc24bcfcd5fc2dchrismair
2817f899cea435aaf91624af2a93bc24bcfcd5fc2dchrismair    /**
2917f899cea435aaf91624af2a93bc24bcfcd5fc2dchrismair     * @return the number of invocation records stored for this command handler instance
3017f899cea435aaf91624af2a93bc24bcfcd5fc2dchrismair     */
3117f899cea435aaf91624af2a93bc24bcfcd5fc2dchrismair    public int numberOfInvocations();
3217f899cea435aaf91624af2a93bc24bcfcd5fc2dchrismair
3317f899cea435aaf91624af2a93bc24bcfcd5fc2dchrismair    /**
3417f899cea435aaf91624af2a93bc24bcfcd5fc2dchrismair     * Return the InvocationRecord representing the command invoction data for the nth invocation
3517f899cea435aaf91624af2a93bc24bcfcd5fc2dchrismair     * for this command handler instance. One InvocationRecord should be stored for each invocation
3617f899cea435aaf91624af2a93bc24bcfcd5fc2dchrismair     * of the CommandHandler.
3717f899cea435aaf91624af2a93bc24bcfcd5fc2dchrismair     *
3817f899cea435aaf91624af2a93bc24bcfcd5fc2dchrismair     * @param index - the index of the invocation record to return. The first record is at index zero.
3917f899cea435aaf91624af2a93bc24bcfcd5fc2dchrismair     * @return the InvocationRecord for the specified index
4017f899cea435aaf91624af2a93bc24bcfcd5fc2dchrismair     *
4117f899cea435aaf91624af2a93bc24bcfcd5fc2dchrismair     * @throws AssertFailedException - if there is no invocation record corresponding to the specified index     */
4217f899cea435aaf91624af2a93bc24bcfcd5fc2dchrismair    public InvocationRecord getInvocation(int index);
4317f899cea435aaf91624af2a93bc24bcfcd5fc2dchrismair
4417f899cea435aaf91624af2a93bc24bcfcd5fc2dchrismair    /**
4517f899cea435aaf91624af2a93bc24bcfcd5fc2dchrismair     * Clear out the invocation history for this CommandHandler. After invoking this method, the
4617f899cea435aaf91624af2a93bc24bcfcd5fc2dchrismair     * <code>numberOfInvocations()</code> method will return zero.
4717f899cea435aaf91624af2a93bc24bcfcd5fc2dchrismair     */
4817f899cea435aaf91624af2a93bc24bcfcd5fc2dchrismair    public void clearInvocations();
4917f899cea435aaf91624af2a93bc24bcfcd5fc2dchrismair
5017f899cea435aaf91624af2a93bc24bcfcd5fc2dchrismair}