net.sourceforge.cruisecontrol.util
Class XMLLogHelper

java.lang.Object
  extended bynet.sourceforge.cruisecontrol.util.XMLLogHelper

public class XMLLogHelper
extends java.lang.Object

Wrapper for the cruisecontrol build log. This class serves two purposes:

The CruiseControl log is expected to be in the following format:

      
          
              
              
              
              
              
              
          
          
              
              
          
          
          
      
  
Note: buildtarget is only present when a target is forced via the JMX interface.

Version:
$Id: XMLLogHelper.java 2877 2007-02-26 00:47:47Z jfredrick $
Author:
Alden Almagro, Jonny Boman

Constructor Summary
XMLLogHelper(org.jdom.Element log)
           
 
Method Summary
 java.lang.String getAntProperty(java.lang.String propertyName)
           
 java.util.Set getBuildParticipants()
          Looks in modifications/changelist/ or modifications/modification/user depending on SouceControl implementation.
 java.lang.String getBuildTimestamp()
           
 java.lang.String getCruiseControlInfoProperty(java.lang.String name)
           
 java.lang.String getLabel()
           
 java.lang.String getLogFileName()
           
 java.util.Set getModifications()
           
 java.lang.String getProjectName()
           
 boolean isBuildFix()
           
 boolean isBuildNecessary()
           
 boolean isBuildSuccessful()
           
 boolean wasPreviousBuildSuccessful()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLLogHelper

public XMLLogHelper(org.jdom.Element log)
Method Detail

getLogFileName

public java.lang.String getLogFileName()
                                throws CruiseControlException
Returns:
the build log name
Throws:
CruiseControlException

getLabel

public java.lang.String getLabel()
                          throws CruiseControlException
Returns:
the label for this build
Throws:
CruiseControlException

getBuildTimestamp

public java.lang.String getBuildTimestamp()
                                   throws CruiseControlException
Throws:
CruiseControlException

wasPreviousBuildSuccessful

public boolean wasPreviousBuildSuccessful()
                                   throws CruiseControlException
Returns:
true if the previous build was successful, false if it was not
Throws:
CruiseControlException

isBuildNecessary

public boolean isBuildNecessary()
Returns:
true if the build was necessary

getProjectName

public java.lang.String getProjectName()
                                throws CruiseControlException
Returns:
project name as defined in the ant build file
Throws:
CruiseControlException

isBuildSuccessful

public boolean isBuildSuccessful()
Returns:
true if the build was successful, false otherwise

getBuildParticipants

public java.util.Set getBuildParticipants()
Looks in modifications/changelist/ or modifications/modification/user depending on SouceControl implementation.

Returns:
Set of usernames that have modified code since the last build

getAntProperty

public java.lang.String getAntProperty(java.lang.String propertyName)
                                throws CruiseControlException
Parameters:
propertyName - the name of the ant property
Returns:
the value of the ant property
Throws:
CruiseControlException

getCruiseControlInfoProperty

public java.lang.String getCruiseControlInfoProperty(java.lang.String name)
                                              throws CruiseControlException
Throws:
CruiseControlException

getModifications

public java.util.Set getModifications()

isBuildFix

public boolean isBuildFix()
                   throws CruiseControlException
Throws:
CruiseControlException