alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

What this is

This file is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Other links

The source code

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

package org.apache.jmeter.protocol.http.util.accesslog;

/**
 * Description:
*
* LogParser is the base interface for classes * implementing concrete parse logic. For an * example of how to use the interface, look * at the Tomcat access log parser.

* The original log parser was written in 2 * hours to parse access logs. Since then, * the design and implementation has been * rewritten from scratch several times to * make it more generic and extensible. The * first version was hard coded and written * over the weekend.

* @author Peter Lin
* @version $Revision: 1.5 $ last updated $Date: 2004/02/13 03:46:14 $ * Created on: Jun 23, 2003
*/ public interface LogParser { /** * close the any streams or readers. */ public void close(); /** * Concrete parsers need to have a generator * to recieve the parsed result. * @param generator */ public void setGenerator(Generator generator); /** * the method will parse the given number of * lines. Pass "-1" to parse the entire file. * @param count * @return int */ public int parse(int count); /** * We allow for filters, so that users can * simply point to an Access log without * having to clean it up. This makes it * significantly easier and reduces the * amount of work. Plus I'm lazy, so going * through a log file to clean it up is a * bit tedious. One example of this is * using the filter to exclude any log * entry that has a 505 response code. * @param filter */ public void setFilter(Filter filter); /** * The method is provided to make it easy to * dynamically create new classes using * Class.newInstance(). Then the access log * file is set using this method. * @param source */ public void setSourceFile(String source); }

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.