DLESE Tools
v1.6.0

org.dlese.dpc.index.writer
Class WebLogEntryWriter

java.lang.Object
  extended by org.dlese.dpc.index.writer.WebLogEntryWriter
All Implemented Interfaces:
DocWriter

public class WebLogEntryWriter
extends Object
implements DocWriter

Writes a Lucene Document for data in a single web log entry. Uderstands a log file in the format of the 'Combined Log Format' extension of the Common Log Format (CLF) with additional extensions added by the DLESE query logger. See the Apache logs docs for info about the Combined Log Format, ClfLogger and DDSQueryAction method logQuery() for info about the DLESE query log extensions.

Author:
John Weatherley

Constructor Summary
WebLogEntryWriter()
          Constructor for the WebLogEntryWriter object
 
Method Summary
protected  void addToAdminDefaultField(String value, StringBuffer defaultFieldStringBuffer)
          Adds the given String to a text field referenced in the index by the field name 'default'.
 org.apache.lucene.document.Document createLogEntryDoc(String logEntry)
          Create a log entry Document, storing and indexing the given notes.
 String getDocType()
          Gets doctype, which is "weblog".
 String getReaderClass()
          Gets the name of the concrete DocReader class that is used to read this type of Document, which is "WebLogEntryReader".
protected  void prtln(String s)
          Output a line of text to standard out, with datestamp, if debug is set to true.
protected  void prtlnErr(String s)
          Output a line of text to error out, with datestamp.
static String removeHexChars(String string)
          Unencodes chars that have been encoded into hex.
static void setDebug(boolean db)
          Sets the debug attribute of the FileIndexingServiceWriter object
static String tokenizeString(String string)
          Tokenizes a String by removing all the non-letter/number chars.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WebLogEntryWriter

public WebLogEntryWriter()
Constructor for the WebLogEntryWriter object

Method Detail

getDocType

public String getDocType()
Gets doctype, which is "weblog".

Specified by:
getDocType in interface DocWriter
Returns:
The String "weblog".

getReaderClass

public String getReaderClass()
Gets the name of the concrete DocReader class that is used to read this type of Document, which is "WebLogEntryReader".

Specified by:
getReaderClass in interface DocWriter
Returns:
The String "WebLogEntryReader".

createLogEntryDoc

public final org.apache.lucene.document.Document createLogEntryDoc(String logEntry)
Create a log entry Document, storing and indexing the given notes.

Parameters:
logEntry - A single logEntry line
Returns:
A Document for indexing the request.

addToAdminDefaultField

protected final void addToAdminDefaultField(String value,
                                            StringBuffer defaultFieldStringBuffer)
Adds the given String to a text field referenced in the index by the field name 'default'. The default field may be used in queries to quickly search for text across fields. This method should be called from the addCustomFields of implementing classes.

Parameters:
value - A text string to be added to the indexed field named 'default.'
defaultFieldStringBuffer - The feature to be added to the ToDefaultField attribute

tokenizeString

public static final String tokenizeString(String string)
Tokenizes a String by removing all the non-letter/number chars.

Parameters:
string - A String
Returns:
The tokenized String

removeHexChars

public static final String removeHexChars(String string)
Unencodes chars that have been encoded into hex. These include the space ' ' %20, and quote '"' %22.

Parameters:
string - A String
Returns:
The clean String

prtlnErr

protected final void prtlnErr(String s)
Output a line of text to error out, with datestamp.

Parameters:
s - The text that will be output to error out.

prtln

protected final void prtln(String s)
Output a line of text to standard out, with datestamp, if debug is set to true.

Parameters:
s - The String that will be output.

setDebug

public static final void setDebug(boolean db)
Sets the debug attribute of the FileIndexingServiceWriter object

Parameters:
db - The new debug value

DLESE Tools
v1.6.0