com.atlassian.bamboo.repository.cvsimpl
Class CVSRepository

java.lang.Object
  extended by com.atlassian.bamboo.repository.AbstractRepository
      extended by com.atlassian.bamboo.repository.cvsimpl.CVSRepository
All Implemented Interfaces:
ConvertibleFromConfig, CleanCheckoutAwareRepository, IncludeExcludeAwareRepository, QuietPeriodAwareRepository, Repository, SelectableAuthenticationRepository, WebRepositoryEnabledRepository, BambooPluginModule, ConfigurablePlugin, RepositoryV2, java.io.Serializable

public class CVSRepository
extends AbstractRepository
implements SelectableAuthenticationRepository, WebRepositoryEnabledRepository, QuietPeriodAwareRepository

This class provides a CVS implemention of the Repository interface.

See Also:
Serialized Form

Field Summary
static java.lang.String BUILD_MODULE_BRANCH
           
static java.lang.String BUILD_MODULE_TRUNK
           
static java.lang.String CVS_AUTH_TYPE
           
static java.lang.String CVS_BRANCH
           
static java.lang.String CVS_KEY_FILE
           
static java.lang.String CVS_LAST_UPDATE
           
static java.lang.String CVS_MODULE
           
static java.lang.String CVS_PASSPHRASE
           
static java.lang.String CVS_PASSWORD
           
static java.lang.String CVS_QUIET_PERIOD
           
static java.lang.String CVS_ROOT
           
static java.lang.String CVS_VERSION_TYPE
           
 CvsRepositoryManager cvsRepositoryManager
           
static java.lang.String DATE_FORMAT
           
static org.apache.commons.lang.time.FastDateFormat DEFAULT_LOG_DATE_FORMAT
           
static java.lang.String KEY
           
static java.lang.String NAME
           
 
Fields inherited from class com.atlassian.bamboo.repository.AbstractRepository
BUILD_TRIGGER_IP, buildDirectoryManager, buildLoggerManager, CLEAN_CHECKOUT_PARAM, repositoryModuleDescriptor, templateRenderer, textProvider, variableSubstitutionBean, WEB_REPO_MODULE_NAME, WEB_REPO_URL
 
Fields inherited from interface com.atlassian.bamboo.repository.Repository
SELECTED_REPOSITORY, UNKNOWN_HOST
 
Fields inherited from interface com.atlassian.bamboo.repository.IncludeExcludeAwareRepository
FILTER_PATTERN_EXCLUDE, FILTER_PATTERN_INCLUDE, FILTER_PATTERN_OPTION, FILTER_PATTERN_REGEX
 
Constructor Summary
CVSRepository()
           
 
Method Summary
 void addDefaultValues(BuildConfiguration buildConfiguration)
          Extension point for adding default values to the form for #getEditHtml()
 BuildChanges collectChangesSinceLastBuild(java.lang.String planKey, java.lang.String lastVcsRevisionKey)
          Gets the code since the link
 int compareTo(java.lang.Object obj)
           
 boolean equals(java.lang.Object o)
           
 java.util.List<NameValuePair> getAuthenticationTypes()
          List all authentication types supported by repository.
 java.lang.String getAuthType()
           
 java.lang.String getBranchName()
           
 java.lang.String getCvsRoot()
           
protected  java.lang.String getDecryptedPassphrase()
           
 java.lang.String getEncryptedPassword()
           
 java.lang.String getHost()
          What's the repostory server host
 java.lang.String getKeyFile()
           
 java.text.Format getLogDateFormat()
           
 int getMaxRetries()
          Returns the maximum number of times to collect changes
 java.lang.String getModule()
           
 java.lang.String getName()
          The display name for the repository type
protected  java.lang.String getPassphrase()
           
 java.lang.String getPassword()
           
 int getQuietPeriod()
          Returns the number of seconds to wait between each retry
 java.io.File getSourceCodeDirectory(java.lang.String planKey)
          CVS checks out the source into the a subdirectory (named after the build) in the working directory
 java.lang.String getSubstitutedBranchName()
           
 java.lang.String getSubstitutedCvsRoot()
           
 java.lang.String getSubstitutedKeyFile()
           
 java.lang.String getSubstitutedWebRepositoryUrl()
          Return web repository URL with extrapolated Bamboo variables
 java.lang.String getUrl()
           
 java.lang.String getWebRepositoryUrl()
          What's the repository's web url
 java.lang.String getWebRepositoryUrlForDiff(CommitFile file)
           
 java.lang.String getWebRepositoryUrlForFile(CommitFile file)
          Return a link to the given file on a viewcvs web server.
 java.lang.String getWebRepositoryUrlForRevision(CommitFile file)
           
 java.lang.String getWebRepositoryUrlRepoName()
          What's the repository's web url repository
 int hashCode()
           
 boolean hasWebBasedRepositoryAccess()
          Does this recpository provdide a web url intereface?
 boolean isQuietPeriodEnabled()
          Returns true if we were to enable the quiet period
 boolean isRepositoryDifferent(Repository repository)
          Checks if the current repo is the same or not and sets the referencesDifferentRepository flag accordingly
 boolean isSshAuthType()
           
 void populateFromConfig(org.apache.commons.configuration.HierarchicalConfiguration config)
          Update the current object with data in the HierarchicalConfiguration
 void prepareConfigObject(BuildConfiguration buildConfiguration)
          Do any preprocessing work before validation occurs
 java.lang.String retrieveSourceCode(java.lang.String planKey, java.lang.String vcsRevisionKey)
          Checks out the latest source code to an appropriate repository
 void setBranchName(java.lang.String branchName)
           
 void setCvsRepositoryManager(CvsRepositoryManager cvsRepositoryManager)
           
 void setCvsRoot(java.lang.String cvsRoot)
           
 void setEncryptedPassword(java.lang.String encryptedPassword)
           
 void setLogDateFormat(org.apache.commons.lang.time.FastDateFormat logDateFormat)
           
 void setModule(java.lang.String moduleName)
           
 void setPassword(java.lang.String password)
           
 void setQuietPeriod(int i)
           
 void setQuietPeriod(java.lang.String quietPeriod)
          Defines the quiet period for this build (in seconds)
 void setWebRepositoryUrl(java.lang.String url)
          Where should we link to to show build file changes?
 void setWebRepositoryUrlRepoName(java.lang.String repoName)
          This is used to identify the repository on multi-repository configurations.
 org.apache.commons.configuration.HierarchicalConfiguration toConfiguration()
          Generate a HierarchicalConfiguration from the current state of the object
 ErrorCollection validate(BuildConfiguration buildConfiguration)
          Ensure we have the been initialised with the mandatory settings

This is called from the build form.

 
Methods inherited from class com.atlassian.bamboo.repository.AbstractRepository
checkConnection, createStringFromList, customizeBuildRequirements, getEditHtml, getFilterFilePatternOption, getFilterFilePatternRegex, getKey, getTriggerIpAddress, getVariableSubstitutionBean, getViewHtml, getWebRepositoryUrlForCommit, getWorkingDirectory, init, isCleanCheckout, isWorkspaceEmpty, referencesDifferentRepository, setBuildDirectoryManager, setBuildLoggerManager, setCleanCheckout, setFilterFilePatternOption, setFilterFilePatternRegex, setReferencesDifferentRepository, setTemplateRenderer, setTextProvider, setTriggerIpAddress, setVariableSubstitutionBean, setWorkingDir
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.atlassian.bamboo.repository.WebRepositoryEnabledRepository
getWebRepositoryUrlForCommit
 
Methods inherited from interface com.atlassian.bamboo.repository.Repository
checkConnection, getKey, getTriggerIpAddress, setReferencesDifferentRepository
 
Methods inherited from interface com.atlassian.bamboo.v2.build.repository.RepositoryV2
referencesDifferentRepository
 
Methods inherited from interface com.atlassian.bamboo.v2.build.ConfigurablePlugin
customizeBuildRequirements, getEditHtml, getViewHtml, init
 

Field Detail

DATE_FORMAT

public static final java.lang.String DATE_FORMAT
See Also:
Constant Field Values

DEFAULT_LOG_DATE_FORMAT

public static final org.apache.commons.lang.time.FastDateFormat DEFAULT_LOG_DATE_FORMAT

NAME

public static final java.lang.String NAME
See Also:
Constant Field Values

KEY

public static final java.lang.String KEY
See Also:
Constant Field Values

CVS_VERSION_TYPE

public static final java.lang.String CVS_VERSION_TYPE
See Also:
Constant Field Values

BUILD_MODULE_TRUNK

public static final java.lang.String BUILD_MODULE_TRUNK
See Also:
Constant Field Values

BUILD_MODULE_BRANCH

public static final java.lang.String BUILD_MODULE_BRANCH
See Also:
Constant Field Values

CVS_ROOT

public static final java.lang.String CVS_ROOT
See Also:
Constant Field Values

CVS_PASSWORD

public static final java.lang.String CVS_PASSWORD
See Also:
Constant Field Values

CVS_QUIET_PERIOD

public static final java.lang.String CVS_QUIET_PERIOD
See Also:
Constant Field Values

CVS_MODULE

public static final java.lang.String CVS_MODULE
See Also:
Constant Field Values

CVS_BRANCH

public static final java.lang.String CVS_BRANCH
See Also:
Constant Field Values

CVS_AUTH_TYPE

public static final java.lang.String CVS_AUTH_TYPE
See Also:
Constant Field Values

CVS_KEY_FILE

public static final java.lang.String CVS_KEY_FILE
See Also:
Constant Field Values

CVS_PASSPHRASE

public static final java.lang.String CVS_PASSPHRASE
See Also:
Constant Field Values

CVS_LAST_UPDATE

public static final java.lang.String CVS_LAST_UPDATE
See Also:
Constant Field Values

cvsRepositoryManager

public transient CvsRepositoryManager cvsRepositoryManager
Constructor Detail

CVSRepository

public CVSRepository()
Method Detail

collectChangesSinceLastBuild

@NotNull
public BuildChanges collectChangesSinceLastBuild(@NotNull
                                                         java.lang.String planKey,
                                                         @NotNull
                                                         java.lang.String lastVcsRevisionKey)
                                          throws RepositoryException
Gets the code since the link

Specified by:
collectChangesSinceLastBuild in interface RepositoryV2
Parameters:
planKey -
lastVcsRevisionKey -
Returns:
Throws:
RepositoryException

retrieveSourceCode

@NotNull
public java.lang.String retrieveSourceCode(@NotNull
                                                   java.lang.String planKey,
                                                   @Nullable
                                                   java.lang.String vcsRevisionKey)
                                    throws RepositoryException
Description copied from interface: RepositoryV2
Checks out the latest source code to an appropriate repository

Specified by:
retrieveSourceCode in interface RepositoryV2
vcsRevisionKey - - may be null if you want latest code
Returns:
vcsRevisionKey - the revision
Throws:
RepositoryException

isRepositoryDifferent

public boolean isRepositoryDifferent(@NotNull
                                     Repository repository)
Description copied from interface: Repository
Checks if the current repo is the same or not and sets the referencesDifferentRepository flag accordingly

Specified by:
isRepositoryDifferent in interface Repository

addDefaultValues

public void addDefaultValues(@NotNull
                             BuildConfiguration buildConfiguration)
Description copied from interface: ConfigurablePlugin
Extension point for adding default values to the form for #getEditHtml()

Specified by:
addDefaultValues in interface ConfigurablePlugin
Overrides:
addDefaultValues in class AbstractRepository
Parameters:
buildConfiguration - - @NotNull

prepareConfigObject

public void prepareConfigObject(@NotNull
                                BuildConfiguration buildConfiguration)
Description copied from interface: ConfigurablePlugin
Do any preprocessing work before validation occurs

Specified by:
prepareConfigObject in interface ConfigurablePlugin
Parameters:
buildConfiguration - - @NotNull

validate

@NotNull
public ErrorCollection validate(@NotNull
                                        BuildConfiguration buildConfiguration)
Ensure we have the been initialised with the mandatory settings

This is called from the build form.

Specified by:
validate in interface ConfigurablePlugin
Overrides:
validate in class AbstractRepository
Parameters:
buildConfiguration - - @NotNull
Returns:
The collection of configuration errors, to be reported back to the GUI

populateFromConfig

public void populateFromConfig(@NotNull
                               org.apache.commons.configuration.HierarchicalConfiguration config)
Description copied from interface: ConvertibleFromConfig
Update the current object with data in the HierarchicalConfiguration

Specified by:
populateFromConfig in interface ConvertibleFromConfig
Overrides:
populateFromConfig in class AbstractRepository

toConfiguration

@NotNull
public org.apache.commons.configuration.HierarchicalConfiguration toConfiguration()
Description copied from interface: ConvertibleFromConfig
Generate a HierarchicalConfiguration from the current state of the object

Specified by:
toConfiguration in interface ConvertibleFromConfig
Overrides:
toConfiguration in class AbstractRepository
Returns:
Always returns an HierarchicalConfiguration. Never null

getWebRepositoryUrlForFile

public java.lang.String getWebRepositoryUrlForFile(CommitFile file)
Return a link to the given file on a viewcvs web server.

Specified by:
getWebRepositoryUrlForFile in interface WebRepositoryEnabledRepository
Parameters:
file - The file that has been modified
Returns:
The url

getWebRepositoryUrlForDiff

public java.lang.String getWebRepositoryUrlForDiff(CommitFile file)

getWebRepositoryUrlForRevision

public java.lang.String getWebRepositoryUrlForRevision(CommitFile file)

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

compareTo

public int compareTo(java.lang.Object obj)

getKeyFile

public java.lang.String getKeyFile()

getSubstitutedKeyFile

public java.lang.String getSubstitutedKeyFile()

getPassphrase

protected java.lang.String getPassphrase()

getAuthType

public java.lang.String getAuthType()
Specified by:
getAuthType in interface SelectableAuthenticationRepository
Returns:
the authentication type for this repository configuration

getEncryptedPassword

public java.lang.String getEncryptedPassword()

setEncryptedPassword

public void setEncryptedPassword(java.lang.String encryptedPassword)

getName

@NotNull
public java.lang.String getName()
Description copied from interface: Repository
The display name for the repository type

Specified by:
getName in interface Repository
Returns:

getUrl

public java.lang.String getUrl()

getMaxRetries

public int getMaxRetries()
Description copied from interface: QuietPeriodAwareRepository
Returns the maximum number of times to collect changes

Specified by:
getMaxRetries in interface QuietPeriodAwareRepository
Returns:

setWebRepositoryUrl

public void setWebRepositoryUrl(java.lang.String url)
Description copied from interface: WebRepositoryEnabledRepository
Where should we link to to show build file changes?

Specified by:
setWebRepositoryUrl in interface WebRepositoryEnabledRepository
Parameters:
url - The url of the repositories web interface

setWebRepositoryUrlRepoName

public void setWebRepositoryUrlRepoName(java.lang.String repoName)
Description copied from interface: WebRepositoryEnabledRepository
This is used to identify the repository on multi-repository configurations.

Specified by:
setWebRepositoryUrlRepoName in interface WebRepositoryEnabledRepository
Parameters:
repoName - The name of the repository we are viewing

getSourceCodeDirectory

@NotNull
public java.io.File getSourceCodeDirectory(@NotNull
                                                   java.lang.String planKey)
CVS checks out the source into the a subdirectory (named after the build) in the working directory

Specified by:
getSourceCodeDirectory in interface RepositoryV2
Overrides:
getSourceCodeDirectory in class AbstractRepository
Parameters:
planKey -
Returns:
The location of the source code files

getModule

public java.lang.String getModule()

setModule

public void setModule(java.lang.String moduleName)

getBranchName

public java.lang.String getBranchName()

getSubstitutedBranchName

public java.lang.String getSubstitutedBranchName()

setBranchName

public void setBranchName(java.lang.String branchName)

getPassword

public java.lang.String getPassword()

setPassword

public void setPassword(java.lang.String password)

setQuietPeriod

public void setQuietPeriod(java.lang.String quietPeriod)
Defines the quiet period for this build (in seconds)

Parameters:
quietPeriod - the number of seconds to wait for more checkins

setQuietPeriod

public void setQuietPeriod(int i)

isQuietPeriodEnabled

public boolean isQuietPeriodEnabled()
Description copied from interface: QuietPeriodAwareRepository
Returns true if we were to enable the quiet period

Specified by:
isQuietPeriodEnabled in interface QuietPeriodAwareRepository
Returns:

getQuietPeriod

public int getQuietPeriod()
Description copied from interface: QuietPeriodAwareRepository
Returns the number of seconds to wait between each retry

Specified by:
getQuietPeriod in interface QuietPeriodAwareRepository
Returns:
seconds between retries

getCvsRoot

public java.lang.String getCvsRoot()

getHost

public java.lang.String getHost()
Description copied from interface: Repository
What's the repostory server host

Specified by:
getHost in interface Repository
Returns:
The host!

hasWebBasedRepositoryAccess

public boolean hasWebBasedRepositoryAccess()
Description copied from interface: WebRepositoryEnabledRepository
Does this recpository provdide a web url intereface?

Specified by:
hasWebBasedRepositoryAccess in interface WebRepositoryEnabledRepository
Returns:
true if we can link changes to the repositories web interface.

getWebRepositoryUrl

public java.lang.String getWebRepositoryUrl()
Description copied from interface: WebRepositoryEnabledRepository
What's the repository's web url

Specified by:
getWebRepositoryUrl in interface WebRepositoryEnabledRepository
Returns:
The url

getSubstitutedWebRepositoryUrl

public java.lang.String getSubstitutedWebRepositoryUrl()
Return web repository URL with extrapolated Bamboo variables

Returns:
Web repository URL with extrapolated Bamboo variables

getWebRepositoryUrlRepoName

public java.lang.String getWebRepositoryUrlRepoName()
Description copied from interface: WebRepositoryEnabledRepository
What's the repository's web url repository

Specified by:
getWebRepositoryUrlRepoName in interface WebRepositoryEnabledRepository
Returns:
The repository (only used in multi-build repositories). Null if not used.

getSubstitutedCvsRoot

public java.lang.String getSubstitutedCvsRoot()

setCvsRoot

public void setCvsRoot(java.lang.String cvsRoot)

isSshAuthType

public boolean isSshAuthType()

setCvsRepositoryManager

public void setCvsRepositoryManager(CvsRepositoryManager cvsRepositoryManager)

getDecryptedPassphrase

protected java.lang.String getDecryptedPassphrase()

getAuthenticationTypes

@NotNull
public java.util.List<NameValuePair> getAuthenticationTypes()
Description copied from interface: SelectableAuthenticationRepository
List all authentication types supported by repository.

Specified by:
getAuthenticationTypes in interface SelectableAuthenticationRepository
Returns:
List of authentication types supported by repository

getLogDateFormat

public java.text.Format getLogDateFormat()

setLogDateFormat

public void setLogDateFormat(org.apache.commons.lang.time.FastDateFormat logDateFormat)


Copyright © 2009 Atlassian Pty Ltd. All Rights Reserved.