net.sourceforge.cruisecontrol.sourcecontrols
Class TeamFoundationServer

java.lang.Object
  extended bynet.sourceforge.cruisecontrol.sourcecontrols.TeamFoundationServer
All Implemented Interfaces:
java.io.Serializable, SourceControl

public class TeamFoundationServer
extends java.lang.Object
implements SourceControl

The class implements the SourceControl interface to allow communication with Microsoft Visual Studio Team Foundation Server

Author:
Martin Woodward
See Also:
Serialized Form

Constructor Summary
TeamFoundationServer()
           
 
Method Summary
 java.util.List getModifications(java.util.Date lastBuild, java.util.Date now)
          The main getModification method called by the build loop.
 java.util.Map getProperties()
          Any properties that have been set in this sourcecontrol.
 void setOptions(java.lang.String options)
          An optional argument to add to the end of the history command that is generated
 void setPassword(java.lang.String password)
          If the username or password is not supplied, then none will be passed to the command.
 void setProjectPath(java.lang.String projectPath)
          Mandatory.
 void setServer(java.lang.String server)
          The server to talk to.
 void setTfPath(java.lang.String tfPath)
          The path to the tf command.
 void setUsername(java.lang.String username)
          The username to use when talking to TFS.
 void validate()
          Validates that the plug-in has its mandatory inputs satisfied.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TeamFoundationServer

public TeamFoundationServer()
Method Detail

getModifications

public java.util.List getModifications(java.util.Date lastBuild,
                                       java.util.Date now)
The main getModification method called by the build loop. Responsible for querying history from TFS, parsing the results and then transforming that into a list of CruiseControl Modification objects.

Specified by:
getModifications in interface SourceControl
Parameters:
lastBuild -
now -
Returns:
List of Modification objects
See Also:
getModifications(java.util.Date, java.util.Date)

getProperties

public java.util.Map getProperties()
Description copied from interface: SourceControl
Any properties that have been set in this sourcecontrol. Will be passed onto the Builder, which may then pass the properties to the underlying build implementation. For example, the Ant builder will define these properties so that the underlying Ant script can use them.

Specified by:
getProperties in interface SourceControl
See Also:
SourceControl.getProperties()

validate

public void validate()
              throws CruiseControlException
Validates that the plug-in has its mandatory inputs satisfied. The only mandatory requirements are a server and project path.

Specified by:
validate in interface SourceControl
Throws:
CruiseControlException
See Also:
SourceControl.validate()

setPassword

public void setPassword(java.lang.String password)
If the username or password is not supplied, then none will be passed to the command. On windows system using the Microsoft tf.exe command line client, the credential of that the CruiseControl process is running as will be used for the connection to the server.

Parameters:
password - the password to set

setProjectPath

public void setProjectPath(java.lang.String projectPath)
Mandatory. The path from which you want to check for modifications. Usually something like "$/TeamProjectName/path/to/project" Any changes in and folder in that path or below will register as modifications.

Parameters:
projectPath - the projectPath to set

setServer

public void setServer(java.lang.String server)
The server to talk to. The easiest way to define this is in the URL format http://servername:8080 where the URL is that to the TFS Application Tier. On windows systems running in an environment where the server has already been registered (using the Microsoft graphical client for example) and the tf command being used is the Microsoft one, then the servername only could be used as it will resolve this in the registry - however the URL syntax is preferred as it is more accurate and easier to change.

Parameters:
server - the server to set

setUsername

public void setUsername(java.lang.String username)
The username to use when talking to TFS. This should be in the format DOMAIN\name or name@DOMAIN if the domain portion is required. Note that name@DOMAIN is the easiest format to use from Unix based systems. If the username contains characters likely to cause problems when passed to the command line then they can be escaped in quotes by passing the following into the config.xml:- "name" If the username or password is not supplied, then none will be passed to the command. On windows system using the Microsoft tf.exe command line client, the credential of that the CruiseControl process is running as will be used for the connection to the server.

Parameters:
username - the username to set

setTfPath

public void setTfPath(java.lang.String tfPath)
The path to the tf command. Either the "tf.exe" command provided by Microsoft in the Team Explorer Client can be used or the "tf" command line client provided by Teamprise can be used. The Teamprise client works cross-platform. Both clients are free to use provided the developers using CruiseControl have a TFS Client Access License (and in the case of Teamprise a license to the Teamprise command line client). If not supplied then the command "tf" will be called and CruiseControl will rely on that command being able to be found in the path.

Parameters:
tfPath - the path where the tf command resides

setOptions

public void setOptions(java.lang.String options)
An optional argument to add to the end of the history command that is generated

Parameters:
options - the options to set