org.rhq.core.pluginapi.event.log
Class MultiLineLogEntryProcessor

java.lang.Object
  extended by org.rhq.core.pluginapi.event.log.MultiLineLogEntryProcessor
All Implemented Interfaces:
LogEntryProcessor
Direct Known Subclasses:
Log4JLogEntryProcessor

public abstract class MultiLineLogEntryProcessor
extends Object
implements LogEntryProcessor

A LogEntryProcessor for multi-line log files - provides several abstract methods that subclasses must implement.


Nested Class Summary
protected static class MultiLineLogEntryProcessor.LogEntry
           
protected static class MultiLineLogEntryProcessor.ParseException
           
 
Field Summary
protected  DateFormat dateFormat
           
protected  String eventType
           
protected  Pattern includesPattern
           
protected  org.apache.commons.logging.Log log
           
protected  File logFile
           
protected  EventSeverity minimumSeverity
           
 
Constructor Summary
MultiLineLogEntryProcessor(String eventType, File logFile)
           
 
Method Summary
protected abstract  DateFormat getDefaultDateFormat()
           
protected abstract  Pattern getPattern()
           
protected  Date parseDateString(String dateString)
           
protected  MultiLineLogEntryProcessor.LogEntry processLine(String line, Set<Event> events, MultiLineLogEntryProcessor.LogEntry currentEntry)
           
 Set<Event> processLines(BufferedReader bufferedReader)
          Processes the specified lines from a log file, and returns a set of Events if appropriate, or otherwise, null.
protected abstract  MultiLineLogEntryProcessor.LogEntry processPrimaryLine(Matcher matcher)
           
 void setDateFormat(DateFormat dateFormat)
           
protected static void setDateIfNotSet(Date timestamp)
           
 void setIncludesPattern(Pattern includesPattern)
           
 void setMinimumSeverity(EventSeverity minimumSeverity)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected final org.apache.commons.logging.Log log

eventType

protected String eventType

logFile

protected File logFile

minimumSeverity

protected EventSeverity minimumSeverity

includesPattern

protected Pattern includesPattern

dateFormat

protected DateFormat dateFormat
Constructor Detail

MultiLineLogEntryProcessor

public MultiLineLogEntryProcessor(String eventType,
                                  File logFile)
Method Detail

processLines

@Nullable
public Set<Event> processLines(BufferedReader bufferedReader)
                        throws IOException
Description copied from interface: LogEntryProcessor
Processes the specified lines from a log file, and returns a set of Events if appropriate, or otherwise, null.

Specified by:
processLines in interface LogEntryProcessor
Parameters:
bufferedReader - a buffered reader from which the lines can be read
Returns:
a set of Events if appropriate, or otherwise, null
Throws:
IOException - if reading lines from the supplied buffer reader fails

setMinimumSeverity

public void setMinimumSeverity(EventSeverity minimumSeverity)

setIncludesPattern

public void setIncludesPattern(Pattern includesPattern)

setDateFormat

public void setDateFormat(DateFormat dateFormat)

processLine

protected MultiLineLogEntryProcessor.LogEntry processLine(String line,
                                                          Set<Event> events,
                                                          MultiLineLogEntryProcessor.LogEntry currentEntry)

getPattern

protected abstract Pattern getPattern()

processPrimaryLine

protected abstract MultiLineLogEntryProcessor.LogEntry processPrimaryLine(Matcher matcher)
                                                                   throws MultiLineLogEntryProcessor.ParseException
Throws:
MultiLineLogEntryProcessor.ParseException

getDefaultDateFormat

protected abstract DateFormat getDefaultDateFormat()

parseDateString

protected Date parseDateString(String dateString)
                        throws MultiLineLogEntryProcessor.ParseException
Throws:
MultiLineLogEntryProcessor.ParseException

setDateIfNotSet

protected static void setDateIfNotSet(Date timestamp)


Copyright © 2008-2009 RHQ Project Advisory Board (Red Hat, Inc.). All Rights Reserved.