001    /*
002     * Copyright 1999-2002,2004 The Apache Software Foundation.
003     * 
004     * Licensed under the Apache License, Version 2.0 (the "License");
005     * you may not use this file except in compliance with the License.
006     * You may obtain a copy of the License at
007     * 
008     *      http://www.apache.org/licenses/LICENSE-2.0
009     * 
010     * Unless required by applicable law or agreed to in writing, software
011     * distributed under the License is distributed on an "AS IS" BASIS,
012     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013     * See the License for the specific language governing permissions and
014     * limitations under the License.
015     */
016    
017    package org.apache.commons.latka.event;
018    
019    import java.util.List;
020    
021    import org.apache.commons.latka.http.Request;
022    import org.apache.commons.latka.http.Session;
023    
024    /**
025     * An extension to LatkaEventListener that stores the success or
026     * failure of all requests.  
027     * All of these events should report true by default.  They
028     * should only report false once an unsuccessful request
029     * is reported to the listener.
030     *
031     * @author Morgan Delagrange
032     * @version $Id: LatkaEventInfo.java 155424 2005-02-26 13:09:29Z dirkv $
033     */
034    public interface LatkaEventInfo extends LatkaEventListener {
035    
036      /**
037       * Check to see if a particular Request succeeded or failed.
038       *
039       * @param request the request to check for success or
040       * failure
041       * @return true if request succeeded
042       */
043      boolean didRequestSucceed(Request request);
044    
045      /**
046       * Check to see if a particular Session succeeded or failed.
047       * Once a request inside a session fails, the session itself
048       * is marked as a failure.
049       *
050       * @param session the session to check for success or
051       * failure
052       * @return true if all requests in the session succeeded
053       */
054      boolean didSessionSucceed(Session session);
055    
056      /**
057       * Returns true if all Requests in the suite succeed.
058       *
059       * @return true if all Requests have succeeded
060       */
061      boolean didSuiteSucceed();
062    
063      /**
064       * Returns a List of all responses that failed
065       * validation.
066       *
067       * @return List of failed Responses
068       */
069      List getFailedResponses();
070    }