|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.xml.sax.helpers.DefaultHandler
net.objectlab.qalab.parser.BuildStatMoverHandler
public class BuildStatMoverHandler
A handler class which uses SAX method to parse the XML file from QALab and extract the files that have seen a change in statistics within the time window.
Constructor Summary | |
---|---|
BuildStatMoverHandler(org.xml.sax.InputSource qaLabSource,
java.lang.String types,
java.io.Writer outputFile,
boolean weekendAdjustment,
TaskLogger log,
boolean noDebug)
Constructor used by ant Task/Maven. |
Method Summary | |
---|---|
void |
calculateCutoffDateTime()
Calculate the cutoff date, ie the earliest date for the stat to be taken into account. |
void |
endDocument()
At the end of parsing the qalab.xml document, generate the up/down report. |
void |
endElement(java.lang.String ignoreNamespaceURI,
java.lang.String ignoreSimplename,
java.lang.String qualifiedname)
At the end of an element, check if it is a file one and add the results found. |
void |
getFileName(org.xml.sax.Attributes attrs)
Gets the filename from the id attribute. |
int |
getHoursOffsetForLastRun()
|
java.lang.String |
getOffsetHours()
|
org.xml.sax.InputSource |
getQalabSource()
Return the input source to the base stats. |
void |
process()
Create an instance of the SAX Parser and process the qalab.xml file. |
void |
setDatecutoff(int offsetInHours)
calculates the datecutoff by adding the number of offset hours. |
void |
setEndTimeWindow(java.util.Date endTime)
|
void |
setHoursOffsetForLastRun(int hoursOffsetForLastRun)
|
void |
setOffsetHours(java.lang.String offset)
|
void |
setStartTimeWindow(java.util.Date startTime)
|
void |
startElement(java.lang.String ignoreNamespaceURI,
java.lang.String localname,
java.lang.String qualifiedname,
org.xml.sax.Attributes attrs)
At the start of a new element, capture the filename and if the element is a result one, create a SingleStat to store for the given type. |
Methods inherited from class org.xml.sax.helpers.DefaultHandler |
---|
characters, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BuildStatMoverHandler(org.xml.sax.InputSource qaLabSource, java.lang.String types, java.io.Writer outputFile, boolean weekendAdjustment, TaskLogger log, boolean noDebug)
qaLabSource
- the original QALab file.types
- the types to extract.outputFile
- the output file.weekendAdjustment
- true if it should adjust for weekends.log
- the logger to use.noDebug
- if true, quiet output (no debug info).Method Detail |
---|
public final void process() throws javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXException, java.io.IOException
javax.xml.parsers.ParserConfigurationException
- cannot create an instance of parser.
org.xml.sax.SAXException
- any SAX issue.
java.io.IOException
- any IO/access to file issue.public final void getFileName(org.xml.sax.Attributes attrs)
attrs
- XML attributes.public final void startElement(java.lang.String ignoreNamespaceURI, java.lang.String localname, java.lang.String qualifiedname, org.xml.sax.Attributes attrs) throws org.xml.sax.SAXException
startElement
in interface org.xml.sax.ContentHandler
startElement
in class org.xml.sax.helpers.DefaultHandler
ignoreNamespaceURI
- ignore (present for interface implementation).localname
- name of the current element.qualifiedname
- element name.attrs
- the XML attribute of the current element.
org.xml.sax.SAXException
- any SAX issuepublic final void endElement(java.lang.String ignoreNamespaceURI, java.lang.String ignoreSimplename, java.lang.String qualifiedname) throws org.xml.sax.SAXException
endElement
in interface org.xml.sax.ContentHandler
endElement
in class org.xml.sax.helpers.DefaultHandler
ignoreNamespaceURI
- ignore (present for interface implementation).ignoreSimplename
- ignore (present for interface implementation).qualifiedname
- the name of the element.
org.xml.sax.SAXException
- any SAX issuepublic final org.xml.sax.InputSource getQalabSource()
public final void endDocument() throws org.xml.sax.SAXException
endDocument
in interface org.xml.sax.ContentHandler
endDocument
in class org.xml.sax.helpers.DefaultHandler
org.xml.sax.SAXException
- any SAX issue.public final void setDatecutoff(int offsetInHours)
offsetInHours
- number of hours from now.public final void calculateCutoffDateTime()
public final void setEndTimeWindow(java.util.Date endTime)
endTime
- The endTimeWindow to set.public final void setStartTimeWindow(java.util.Date startTime)
startTime
- The startTimeWindow to set.public final void setOffsetHours(java.lang.String offset)
offset
- The offsetHours to set.public final java.lang.String getOffsetHours()
public int getHoursOffsetForLastRun()
public void setHoursOffsetForLastRun(int hoursOffsetForLastRun)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |