Package org.dlese.dpc.index.writer
Class WebLogEntryWriter
java.lang.Object
org.dlese.dpc.index.writer.WebLogEntryWriter
- All Implemented Interfaces:
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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected final voidaddToAdminDefaultField(String value, StringBuffer defaultFieldStringBuffer) Adds the given String to a text field referenced in the index by the field name 'default'.final org.apache.lucene.document.DocumentcreateLogEntryDoc(String logEntry) Create a log entry Document, storing and indexing the given notes.Gets doctype, which is "weblog".Gets the name of the concreteDocReaderclass that is used to read this type ofDocument, which is "WebLogEntryReader".protected final voidOutput a line of text to standard out, with datestamp, if debug is set to true.protected final voidOutput a line of text to error out, with datestamp.static final StringremoveHexChars(String string) Unencodes chars that have been encoded into hex.static final voidsetDebug(boolean db) Sets the debug attribute of the FileIndexingServiceWriter objectstatic final StringtokenizeString(String string) Tokenizes a String by removing all the non-letter/number chars.
-
Constructor Details
-
WebLogEntryWriter
public WebLogEntryWriter()Constructor for the WebLogEntryWriter object
-
-
Method Details
-
getDocType
Gets doctype, which is "weblog".- Specified by:
getDocTypein interfaceDocWriter- Returns:
- The String "weblog".
-
getReaderClass
Gets the name of the concreteDocReaderclass that is used to read this type ofDocument, which is "WebLogEntryReader".- Specified by:
getReaderClassin interfaceDocWriter- Returns:
- The String "WebLogEntryReader".
-
createLogEntryDoc
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
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
Tokenizes a String by removing all the non-letter/number chars.- Parameters:
string- A String- Returns:
- The tokenized String
-
removeHexChars
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
Output a line of text to error out, with datestamp.- Parameters:
s- The text that will be output to error out.
-
prtln
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
-