net.sf.logdistiller
Class LogType.Description

java.lang.Object
  extended by net.sf.logdistiller.LogType.Description
Enclosing class:
LogType

public abstract static class LogType.Description
extends Object

Description of a log format corresponding to a log type. It must be subclassed for every log type to implement specialized newFactory(Reader, String) method.


Constructor Summary
LogType.Description(LogType logtype, String[] attributeNames)
          Create a new LogType description.
 
Method Summary
 int getAttributeIndex(String name)
          Find the attribute index corresponding to an attribute name (provided attributes only).
 LogType.AttributeInfo getAttributeInfo(String name)
           
 String getAttributeName(int pos)
           
 List getAttributeNames()
           
 int getAttributesCount()
           
 String getDefaultSamplingAttributes()
          Get the attributes that can be used as a sorting key to get useful event sampling in the last "unknown" group (separated with a quote when multiple attributes).
 String getDefaultSpecificGroups()
          Get the group definitions specific to this log type that will be added to the generated rules configuration generated by the GUI.
 int getExtensionIndex(String attribute)
          Gets the extension index position which defines corresponding attribute.
 Attributes.Extension[] getExtensions()
           
 LogType getLogType()
           
 int getTimestampAttribute()
          Get the attribute that represents the timestamp.
abstract  LogEvent.Factory newFactory(Reader reader, String logSource)
          Create a new LogEvent factory for a log stream corresponding to this log description.
 void setExtensions(Attributes.Extension[] extensions)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LogType.Description

public LogType.Description(LogType logtype,
                           String[] attributeNames)
Create a new LogType description. By convention, the first attribute should be logSource and the second should be the timestamp (if this notion is relevant for the log type).

Parameters:
logtype -
attributeNames -
See Also:
getTimestampAttribute(), LogEvent.getTimestamp()
Method Detail

getLogType

public LogType getLogType()

getAttributeNames

public List getAttributeNames()

getAttributesCount

public int getAttributesCount()

getAttributeName

public String getAttributeName(int pos)

setExtensions

public void setExtensions(Attributes.Extension[] extensions)
Since:
1.1

getExtensions

public Attributes.Extension[] getExtensions()
Since:
1.1

getExtensionIndex

public int getExtensionIndex(String attribute)
Gets the extension index position which defines corresponding attribute.

Returns:
the extension index, or -1 if not found
Since:
1.1

getTimestampAttribute

public int getTimestampAttribute()
Get the attribute that represents the timestamp.

Returns:
the attribute count, or -1 if this logtype does not have a timestamp

getDefaultSpecificGroups

public String getDefaultSpecificGroups()
Get the group definitions specific to this log type that will be added to the generated rules configuration generated by the GUI.

Returns:
an XML fragment containing group definitions

getDefaultSamplingAttributes

public String getDefaultSamplingAttributes()
Get the attributes that can be used as a sorting key to get useful event sampling in the last "unknown" group (separated with a quote when multiple attributes). They will be used as a default sampling rule configuration.

Returns:
"attr1[,attr2[,...]]"

getAttributeIndex

public int getAttributeIndex(String name)
Find the attribute index corresponding to an attribute name (provided attributes only).

Parameters:
name - String the attribute name to search for
Returns:
int the index of the attribute, or -1 if not found
See Also:
to find an extension attribute index

getAttributeInfo

public LogType.AttributeInfo getAttributeInfo(String name)

newFactory

public abstract LogEvent.Factory newFactory(Reader reader,
                                            String logSource)
                                     throws IOException
Create a new LogEvent factory for a log stream corresponding to this log description.

Parameters:
reader - the stream containing to parse
logSource - a textual description of the stream's source (useful when LogDistiller works on multiple simultaneous log sources)
Throws:
IOException


Copyright © 2004-2009. All Rights Reserved.