net.sourceforge.cruisecontrol.sourcecontrols
Class AlienBrainCore

java.lang.Object
  extended bynet.sourceforge.cruisecontrol.sourcecontrols.AlienBrainCore
Direct Known Subclasses:
AlienBrain, AlienBrainBootstrapper

public class AlienBrainCore
extends java.lang.Object

This class implements the SourceControl methods for an AlienBrain repository. It does this by taking advantage of the AlienBrain command- line utility. Obviously, the command line utility must be installed and working in order for this class to work. This class is based very heavily on P4.java.

Author:
Scott Jacobs

Field Summary
protected static java.lang.String AB_NO_SESSION
           
 
Constructor Summary
AlienBrainCore()
           
 
Method Summary
protected  void addArgumentIfSet(Commandline cmdLine, java.lang.String argument, java.lang.String flag)
          Try to add flagged argument to a Commandline
protected  void addFlagIfSet(Commandline cmdLine, boolean flagValue, java.lang.String flagName)
          Try to add a flag to a Commandline
protected  ManagedCommandline buildCommonCommand()
          Construct a ManagedCommandline preset with arguments applicable to any AlienBrain command that we wish to run.
 java.lang.String getBranch()
           
 java.lang.String getDatabase()
           
 java.lang.String getPassword()
           
 java.lang.String getPath()
           
 java.lang.String getServer()
           
 java.lang.String getUser()
           
protected  void setActiveBranch(java.lang.String branch)
          Sets the active branch to the provided branch name.
 void setBranch(java.lang.String branch)
          Sets the path to the project within the AlienBrain repository.
 void setDatabase(java.lang.String database)
          Sets the name of the project database.
 void setPassword(java.lang.String password)
          Sets the password of the AlienBrain user account used to connect.
 void setPath(java.lang.String path)
          Sets the path to the project within the AlienBrain repository.
 void setServer(java.lang.String server)
          Sets the hostname of the server hosting the AlienBrain repository.
 void setUser(java.lang.String user)
          Sets the name of the AlienBrain user account used to connect.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

AB_NO_SESSION

protected static final java.lang.String AB_NO_SESSION
See Also:
Constant Field Values
Constructor Detail

AlienBrainCore

public AlienBrainCore()
Method Detail

setServer

public void setServer(java.lang.String server)
Sets the hostname of the server hosting the AlienBrain repository.

Parameters:
server - The AlienBrain server's hostname.

getServer

public java.lang.String getServer()

setDatabase

public void setDatabase(java.lang.String database)
Sets the name of the project database.

Parameters:
database - The name of the project database.

getDatabase

public java.lang.String getDatabase()

setUser

public void setUser(java.lang.String user)
Sets the name of the AlienBrain user account used to connect.

Parameters:
user - The name of the AlienBrin user account.

getUser

public java.lang.String getUser()

setPassword

public void setPassword(java.lang.String password)
Sets the password of the AlienBrain user account used to connect.

Parameters:
password - The password of the AlienBrin user account.

getPassword

public java.lang.String getPassword()

setPath

public void setPath(java.lang.String path)
Sets the path to the project within the AlienBrain repository.

Parameters:
path - The path within the project database to check for modifications. Typically something like alienbrain://path/to/project

getPath

public java.lang.String getPath()

setBranch

public void setBranch(java.lang.String branch)
Sets the path to the project within the AlienBrain repository.

Parameters:
branch - The branch within the AlienBrain project.

getBranch

public java.lang.String getBranch()

addFlagIfSet

protected void addFlagIfSet(Commandline cmdLine,
                            boolean flagValue,
                            java.lang.String flagName)
Try to add a flag to a Commandline

Parameters:
cmdLine - The Commandline object to possibly add arguments
flagValue - Whether or not to add the flag.
flagName - The flag to use if the argument is added.

addArgumentIfSet

protected void addArgumentIfSet(Commandline cmdLine,
                                java.lang.String argument,
                                java.lang.String flag)
Try to add flagged argument to a Commandline

Parameters:
cmdLine - The Commandline object to possibly add arguments
argument - The argument to possibly add.
flag - The flag to use if the argument is added.

buildCommonCommand

protected ManagedCommandline buildCommonCommand()
Construct a ManagedCommandline preset with arguments applicable to any AlienBrain command that we wish to run.


setActiveBranch

protected void setActiveBranch(java.lang.String branch)
                        throws java.io.IOException,
                               CruiseControlException
Sets the active branch to the provided branch name.

Parameters:
branch - The branch name.
Throws:
CruiseControlException
java.io.IOException