KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > jmeter > protocol > http > util > accesslog > Filter


1 // $Header: /home/cvs/jakarta-jmeter/src/protocol/http/org/apache/jmeter/protocol/http/util/accesslog/Filter.java,v 1.5 2004/02/13 03:46:14 sebb Exp $
2
/*
3  * Copyright 2003-2004 The Apache Software Foundation.
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17 */

18
19 package org.apache.jmeter.protocol.http.util.accesslog;
20
21 /**
22  * Description:<br>
23  * <br>
24  * Filter interface is designed to make it easier
25  * to use Access Logs for JMeter test plans.
26  * Normally, a person would have to clean a log
27  * file manually and create the JMeter requests.
28  * The access log parse utility uses the filter
29  * to include/exclude files by either file name
30  * or regular expression pattern.<p>
31  * It will also be used by HttpSamplers that use
32  * access logs. Using access logs is intended as
33  * a way to simulate production traffic. For
34  * functional testing, it is better to use the
35  * standard functional testing tools in JMeter.
36  * Using access logs can also reduce the amount
37  * of memory needed to run large test plans.
38  * <br>
39  * @author Peter Lin<br>
40  * @version $Revision: 1.5 $ last updated $Date: 2004/02/13 03:46:14 $
41  * Created on: Jun 26, 2003<br>
42  */

43
44 public interface Filter {
45
46     /**
47      * @param oldextension
48      * @param newextension
49      */

50     public void setReplaceExtension(String JavaDoc oldextension, String JavaDoc newextension);
51     
52     /**
53      * Include all files in the array.
54      * @param filenames
55      */

56     public void includeFiles(String JavaDoc[] filenames);
57     
58     /**
59      * Exclude all files in the array
60      * @param filenames
61      */

62     public void excludeFiles(String JavaDoc[] filenames);
63     
64     /**
65      * Include any log entry that contains
66      * the following regular expression
67      * pattern.
68      * @param regexp
69      */

70     public void includePattern(String JavaDoc[] regexp);
71     
72     /**
73      * Exclude any log entry that contains
74      * the following regular expression
75      * pattern.
76      * @param regexp
77      */

78     public void excludePattern(String JavaDoc[] regexp);
79     
80     /**
81      * Log parser will call this method to
82      * see if a particular entry should be
83      * filtered or not.
84      * @param path
85      * @return boolean
86      */

87     public boolean isFiltered(String JavaDoc path);
88     
89     /**
90      * In case the user wants to replace
91      * the file extension, log parsers
92      * should call this method. This is
93      * useful for regression test plans.
94      * If a website is migrating from one
95      * platform to another and the file
96      * extension changes, the filter
97      * provides an easy way to do it
98      * without spending a lot of time.
99      * @param text
100      * @return String
101      */

102     public String JavaDoc filter(String JavaDoc text);
103     
104 }
105
Popular Tags