thredds.logs
Class LogReader

java.lang.Object
  extended by thredds.logs.LogReader

public class LogReader
extends Object

Superclass to read TDS logs

Since:
Apr 10, 2008
Author:
caron

Nested Class Summary
static interface LogReader.Closure
           
static class LogReader.DateFilter
           
static class LogReader.ErrorOnlyFilter
           
static class LogReader.FilterNoop
           
static class LogReader.IpFilter
           
static class LogReader.Log
           
static interface LogReader.LogFilter
           
static interface LogReader.LogParser
           
static class LogReader.Stats
           
 
Constructor Summary
LogReader(LogReader.LogParser parser)
           
 
Method Summary
static void main(String[] args)
           
 void readAll(File dir, FileFilter ff, LogReader.Closure closure, LogReader.LogFilter logf, LogReader.Stats stat)
          Read all the files in a directory and process them.
 void scanLogFile(File file, LogReader.Closure closure, LogReader.LogFilter logf, LogReader.Stats stat)
          Read a log file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LogReader

public LogReader(LogReader.LogParser parser)
Method Detail

readAll

public void readAll(File dir,
                    FileFilter ff,
                    LogReader.Closure closure,
                    LogReader.LogFilter logf,
                    LogReader.Stats stat)
             throws IOException
Read all the files in a directory and process them. Files are sorted by filename.

Parameters:
dir - read from this directory
ff - files must pass this filter (may be null)
closure - send each Log to this closure
logf - filter out these Logs (may be null)
stat - accumulate statitistics (may be null)
Throws:
IOException - on read error

scanLogFile

public void scanLogFile(File file,
                        LogReader.Closure closure,
                        LogReader.LogFilter logf,
                        LogReader.Stats stat)
                 throws IOException
Read a log file.

Parameters:
file - file to read
closure - send each Log to this closure
logf - filter out these Logs (may be null)
stat - accumulate statitistics (may be null)
Throws:
IOException - on read error

main

public static void main(String[] args)
                 throws IOException
Throws:
IOException


Copyright © 1999-2011 UCAR/Unidata. All Rights Reserved.