net.sf.logdistiller
Class LogEvent

java.lang.Object
  extended by net.sf.logdistiller.LogEvent
Direct Known Subclasses:
JBossLogEvent, Log4jXmlLogEvent, OracleAlertLogEvent, SimpleLineLogEvent, SyslogLogEvent, WeblogicLogEvent

public abstract class LogEvent
extends Object

Log events base class. Every new log type must implement an inherited class, with appropriate:

See Also:
LogType, LogTypes

Nested Class Summary
static class LogEvent.Factory
          The base class for LogEvent factories, responsible for parsing an input stream into LogEvents.
 
Constructor Summary
protected LogEvent(LogEvent.Factory factory, String rawLog)
           
 
Method Summary
protected  void checkInitialized()
           
 String dump()
           
 void dump(PrintWriter out)
           
 String getAttribute(int pos)
          Get a provided attribute value by its position index.
 String getAttribute(String attributeName)
          Extracts an attribute's provided value of the log event.
 String[] getAttributes()
          Get a clone copy of the provided attributes.
 int getAttributesCount()
          Get provided attributes count.
 LogEvent.Factory getFactory()
           
 String getRawLog()
          Get the raw log text from which this event was parsed.
 String getTimestamp()
          Get the timestamp.
 String getValue(LogType.AttributeInfo info)
           
protected  void setAttributes(String[] attributes)
          Set the provided attributes values.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LogEvent

protected LogEvent(LogEvent.Factory factory,
                   String rawLog)
Method Detail

setAttributes

protected void setAttributes(String[] attributes)
Set the provided attributes values.

Parameters:
attributes - attributes values

checkInitialized

protected void checkInitialized()

getRawLog

public String getRawLog()
Get the raw log text from which this event was parsed.

Returns:
String

getAttribute

public String getAttribute(int pos)
Get a provided attribute value by its position index.

Parameters:
pos - the position index of the attribute.
Returns:
the value of the attribute.

getAttributes

public String[] getAttributes()
Get a clone copy of the provided attributes. Note the this method clones the values array.

Returns:
(a copy of) provided attributes

getAttributesCount

public int getAttributesCount()
Get provided attributes count.

Returns:
the count of provided attributes

getAttribute

public String getAttribute(String attributeName)
Extracts an attribute's provided value of the log event.

Parameters:
attributeName - the name of the attribute (provided only)
Returns:
the value

getValue

public String getValue(LogType.AttributeInfo info)

getFactory

public LogEvent.Factory getFactory()

dump

public void dump(PrintWriter out)

dump

public String dump()

getTimestamp

public String getTimestamp()
Get the timestamp.

Returns:
the timestamp or "-" if no this log type does not have a timestamp
See Also:
LogType.Description.getTimestampAttribute()


Copyright © 2004-2009. All Rights Reserved.