org.hackystat.sensor.ant.javancss
Class JavaNcssSensor

java.lang.Object
  extended by org.apache.tools.ant.ProjectComponent
      extended by org.apache.tools.ant.Task
          extended by org.hackystat.sensor.ant.task.HackystatSensorTask
              extended by org.hackystat.sensor.ant.javancss.JavaNcssSensor
All Implemented Interfaces:
java.lang.Cloneable

public class JavaNcssSensor
extends HackystatSensorTask

Implements an Ant task that parses the XML files generated by JavaNCSS. The Ant Task sends the FileMetric data to a Hackystat server.

Author:
Philip Johnson

Field Summary
 
Fields inherited from class org.hackystat.sensor.ant.task.HackystatSensorTask
dataFilesList, errMsgPrefix, failOnError, msgPrefix, runtime, sensorProps, sensorShell, sourceFilesList, toolAccount, tstampSet, verbose
 
Fields inherited from class org.apache.tools.ant.Task
target, taskName, taskType, wrapper
 
Fields inherited from class org.apache.tools.ant.ProjectComponent
description, location, project
 
Constructor Summary
JavaNcssSensor()
          Initialize a new instance of a JavaNcssSensor.
JavaNcssSensor(java.lang.String host, java.lang.String email, java.lang.String password)
          Initialize a new instance of a JavaNcssSensor for testing purposes.
 
Method Summary
 void executeInternal()
          Parses the JavaNCSS XML file and sends the resulting FileMetric data to the SensorBase server.
(package private)  int processJavaNcssXmlFile(java.io.File xmlFile)
          Processes the JavaNCSS XML data file, generating sensor data.
 
Methods inherited from class org.hackystat.sensor.ant.task.HackystatSensorTask
createDataFiles, createSourceFiles, execute, getDataFiles, getFiles, getSourceFiles, info, isUsingUserMap, sendAndQuit, setFailOnError, setRetryAttempts, setRetryWaitInterval, setupSensorShell, setUserMapTool, setUserMapToolAccount, setVerbose, signalError, summaryInfo, verboseInfo
 
Methods inherited from class org.apache.tools.ant.Task
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
 
Methods inherited from class org.apache.tools.ant.ProjectComponent
clone, getDescription, getLocation, getProject, setDescription, setLocation, setProject
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JavaNcssSensor

public JavaNcssSensor()
Initialize a new instance of a JavaNcssSensor.


JavaNcssSensor

public JavaNcssSensor(java.lang.String host,
                      java.lang.String email,
                      java.lang.String password)
Initialize a new instance of a JavaNcssSensor for testing purposes.

Parameters:
host - The SensorBase host URL.
email - The SensorBase email to use.
password - The SensorBase password to use.
Method Detail

executeInternal

public void executeInternal()
                     throws org.apache.tools.ant.BuildException
Parses the JavaNCSS XML file and sends the resulting FileMetric data to the SensorBase server.

Specified by:
executeInternal in class HackystatSensorTask
Throws:
org.apache.tools.ant.BuildException - If there is an error.

processJavaNcssXmlFile

int processJavaNcssXmlFile(java.io.File xmlFile)
                     throws org.apache.tools.ant.BuildException
Processes the JavaNCSS XML data file, generating sensor data.

Parameters:
xmlFile - The file containing the JavaNCSS data.
Returns:
The number of FileMetrics instances generated.
Throws:
org.apache.tools.ant.BuildException - If problems occur.