org.hackystat.sensor.ant.svn
Class SVNCommitProcessor

java.lang.Object
  extended by org.hackystat.sensor.ant.svn.SVNCommitProcessor

public class SVNCommitProcessor
extends java.lang.Object

SVN Repository processor to extract commit information.

Version:
$Id$
Author:
(Cedric) Qin ZHANG

Constructor Summary
SVNCommitProcessor(java.lang.String repositoryUrl, java.lang.String userName, java.lang.String password)
          Constructs this instance.
 
Method Summary
 CommitRecord getCommitRecord(long revision)
          Gets commit record for a specified revision.
 long getRevisionNumber(java.util.Date date)
          Gets the largest revision number at the date specified.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SVNCommitProcessor

public SVNCommitProcessor(java.lang.String repositoryUrl,
                          java.lang.String userName,
                          java.lang.String password)
                   throws java.lang.Exception
Constructs this instance.

Parameters:
repositoryUrl - The svn repository url. It can points to a subdirectory in the repository.
userName - The user name. Null is a valid value. If either user name or password is null, then anonymous credential is used to access the svn repository.
password - The password. Null is a valid value.
Throws:
java.lang.Exception - If there is any error.
Method Detail

getRevisionNumber

public long getRevisionNumber(java.util.Date date)
                       throws java.lang.Exception
Gets the largest revision number at the date specified.

Parameters:
date - The date.
Returns:
The revision number.
Throws:
java.lang.Exception - If there is any error.

getCommitRecord

public CommitRecord getCommitRecord(long revision)
                             throws java.lang.Exception
Gets commit record for a specified revision. Note that if the repository url supplied in the constructor points to a subdirectory of the repository root or a file, then there might not be any commits for the revision. In this case, null is returned.

Parameters:
revision - The revision number.
Returns:
The commit record or null.
Throws:
java.lang.Exception - If there is any error.