com.sonyericsson.jenkins.plugins.bfa.model
Class FailureReader

java.lang.Object
  extended by com.sonyericsson.jenkins.plugins.bfa.model.FailureReader
Direct Known Subclasses:
BuildLogFailureReader, MultilineBuildLogFailureReader

public abstract class FailureReader
extends Object

Reader used to find indications of a failure cause.

Author:
Tomas Westling <tomas.westling@sonymobile.com>

Nested Class Summary
static class FailureReader.InterruptibleCharSequence
          CharSequence that notices thread interrupts -- as might be necessary to recover from a loose regex on unexpected challenging input.
 
Field Summary
protected  Indication indication
          The indication we are looking for.
 
Constructor Summary
FailureReader(Indication indication)
          Standard constructor.
 
Method Summary
abstract  FoundIndication scan(hudson.model.AbstractBuild build)
          Scans a build log.
abstract  FoundIndication scan(hudson.model.AbstractBuild build, PrintStream buildLog)
          Scans for indications of a failure cause.
protected  FoundIndication scanMultiLineOneFile(hudson.model.AbstractBuild build, BufferedReader reader, String currentFile)
          Scans one file for the required multi-line pattern.
protected  FoundIndication scanOneFile(hudson.model.AbstractBuild build, BufferedReader reader, String currentFile)
          Scans one file for the required pattern.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

indication

protected Indication indication
The indication we are looking for.

Constructor Detail

FailureReader

public FailureReader(Indication indication)
Standard constructor.

Parameters:
indication - the indication to look for.
Method Detail

scan

public abstract FoundIndication scan(hudson.model.AbstractBuild build)
                              throws IOException
Scans a build log.

Parameters:
build - - the build whose log should be scanned.
Returns:
a FoundIndication if the pattern given by this FailureReader is found in the log of the given build; return null otherwise.
Throws:
IOException - if so.

scan

public abstract FoundIndication scan(hudson.model.AbstractBuild build,
                                     PrintStream buildLog)
Scans for indications of a failure cause.

Parameters:
build - the build to scan for indications.
buildLog - the log of the build.
Returns:
a FoundIndication if something was found, null if not.

scanOneFile

protected FoundIndication scanOneFile(hudson.model.AbstractBuild build,
                                      BufferedReader reader,
                                      String currentFile)
                               throws IOException
Scans one file for the required pattern.

Parameters:
build - the build we are processing.
reader - the reader to read from.
currentFile - the file path of the file we want to scan.
Returns:
a FoundIndication if we find the pattern, null if not.
Throws:
IOException - if problems occur in the reader handling.

scanMultiLineOneFile

protected FoundIndication scanMultiLineOneFile(hudson.model.AbstractBuild build,
                                               BufferedReader reader,
                                               String currentFile)
                                        throws IOException
Scans one file for the required multi-line pattern.

Parameters:
build - the build we are processing.
reader - the reader to read from.
currentFile - the file path of the file we want to scan.
Returns:
a FoundIndication if we find the pattern, null if not.
Throws:
IOException - if problems occur in the reader handling.


Copyright © 2004-2014. All Rights Reserved.