net.sourceforge.cruisecontrol.publishers
Class CMSynergyPublisher

java.lang.Object
  extended bynet.sourceforge.cruisecontrol.publishers.CMSynergyPublisher
All Implemented Interfaces:
Publisher, java.io.Serializable
Direct Known Subclasses:
CMSynergyBaselinePublisher, CMSynergyTaskPublisher

public abstract class CMSynergyPublisher
extends java.lang.Object
implements Publisher

Provides an abstract base class to handle the functionality common to all CM Synergy publishers.

Author:
Robert J. Smith
See Also:
Serialized Form

Constructor Summary
CMSynergyPublisher()
           
 
Method Summary
 java.util.Properties getBuildProperties(org.jdom.Element log)
          Extracts the build properties from the Cruise Control log
 java.lang.String getCcmExe()
          Gets the full path of the ccm command line executable.
 java.util.List getNewTasks(org.jdom.Element log)
          Extract a list of CM Synergy modifications from the Cruise Control log
 java.lang.String getProject()
          Gets the CM Synergy project to be used with this publisher.
 java.io.File getSessionFile()
          Returns the session file which maps CM Synergy session names to CM Synergy session IDs.
 java.lang.String getSessionName()
          Returns the name of the CM Synergy session used with this publisher.
 void setCcmExe(java.lang.String ccmExe)
          Sets the name of the CM Synergy executable to use when issuing commands.
 void setProject(java.lang.String projectSpec)
          Sets the CM Synergy project to be used with this publisher.
 void setSessionFile(java.lang.String sessionFile)
          Sets the file which contains the mapping between CM Synergy session names and IDs.
 void setSessionName(java.lang.String sessionName)
          Sets the name of the CM Synergy session to use with this plugin.
 boolean shouldPublish(org.jdom.Element log)
          Determines if the publish should take place.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.sourceforge.cruisecontrol.Publisher
publish, validate
 

Constructor Detail

CMSynergyPublisher

public CMSynergyPublisher()
Method Detail

setSessionFile

public void setSessionFile(java.lang.String sessionFile)
Sets the file which contains the mapping between CM Synergy session names and IDs. This file should be in the standard properties file format. Each line should map one name to a CM Synergy session ID (as returned by the "ccm status" command).

example:

session1=localhost:65024:192.168.1.17

Parameters:
sessionFile - The session file

getSessionFile

public java.io.File getSessionFile()
Returns the session file which maps CM Synergy session names to CM Synergy session IDs.

Returns:
The session file.

setSessionName

public void setSessionName(java.lang.String sessionName)
Sets the name of the CM Synergy session to use with this plugin. This name should appear in the specified session file.

Parameters:
sessionName - The session name
See Also:
setSessionFile(String)

getSessionName

public java.lang.String getSessionName()
Returns the name of the CM Synergy session used with this publisher.

Returns:
The CM Synergy session name.

setProject

public void setProject(java.lang.String projectSpec)
Sets the CM Synergy project to be used with this publisher.

Parameters:
projectSpec - The project spec (in 2 part name format).

getProject

public java.lang.String getProject()
Gets the CM Synergy project to be used with this publisher.

Returns:
The CM Synergy project (in 2 part name format), or null if it was not set.

setCcmExe

public void setCcmExe(java.lang.String ccmExe)
Sets the name of the CM Synergy executable to use when issuing commands.

Parameters:
ccmExe - the name of the CM Synergy executable

getCcmExe

public java.lang.String getCcmExe()
Gets the full path of the ccm command line executable.

Returns:
The full path of the ccm command line executable, or null if it was not set.

getBuildProperties

public java.util.Properties getBuildProperties(org.jdom.Element log)
Extracts the build properties from the Cruise Control log

Parameters:
log - The log
Returns:
The properties set within the current build.

getNewTasks

public java.util.List getNewTasks(org.jdom.Element log)
Extract a list of CM Synergy modifications from the Cruise Control log

Parameters:
log - The Cruise Control log (as a JDOM element).
Returns:
A List of new CM Synergy tasks

shouldPublish

public boolean shouldPublish(org.jdom.Element log)
Determines if the publish should take place.

Parameters:
log - The Cruise Control log (as a JDOM element).
Returns:
true if the build was successful and new CM Synergy tasks were found, false otherwise.