com.atlassian.bamboo.repository.cvsimpl
Class CVSRepository

java.lang.Object
  extended by com.atlassian.bamboo.v2.build.BaseBuildConfigurationAwarePlugin
      extended by com.atlassian.bamboo.v2.build.BaseConfigurablePlugin
          extended by com.atlassian.bamboo.repository.AbstractRepository
              extended by com.atlassian.bamboo.repository.AbstractStandaloneRepository
                  extended by com.atlassian.bamboo.repository.cvsimpl.CVSRepository
All Implemented Interfaces:
ConvertibleFromConfig, InitablePluginModule, AdvancedConfigurationAwareRepository, FilterChangesetAwareRepository, IncludeExcludeAwareRepository, MavenPomAccessorCapableRepository, QuietPeriodAwareRepository, Repository, SelectableAuthenticationRepository, StandaloneRepository, DescriptionProvider, NameProvider, BambooPluginModule, BuildConfigurationAwarePlugin, ConfigurablePlugin, RenderableBuildConfiguration, LegacyRepository, RepositoryV2, java.io.Serializable

public class CVSRepository
extends AbstractStandaloneRepository
implements LegacyRepository, SelectableAuthenticationRepository, QuietPeriodAwareRepository, MavenPomAccessorCapableRepository

This class provides a CVS implemention of the Repository interface.

See Also:
Serialized Form

Nested Class Summary
static class CVSRepository.SymbolicNameType
           
 
Field Summary
static java.lang.String BUILD_MODULE_BRANCH
           
static java.lang.String BUILD_MODULE_TRUNK
           
static java.lang.String COMPLETE_PLUGIN_KEY
           
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
           
static java.lang.String TEMPORARY_CVS_PASSWORD
           
 
Fields inherited from class com.atlassian.bamboo.repository.AbstractRepository
BUILD_TRIGGER_IP, buildDirectoryManager, buildLoggerManager, customVariableContext, repositoryModuleDescriptor, templateRenderer, textProvider
 
Fields inherited from class com.atlassian.bamboo.v2.build.BaseBuildConfigurationAwarePlugin
moduleDescriptor
 
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
 
Fields inherited from interface com.atlassian.bamboo.repository.FilterChangesetAwareRepository
CHANGESET_FILTER_PATTERN_REGEX, MAVEN_RELEASE_PLUGIN_EXCLUSION_PATTERN
 
Constructor Summary
CVSRepository()
           
 
Method Summary
 void addDefaultValues(BuildConfiguration buildConfiguration)
          Extension point for adding default values to the form for RenderableBuildConfiguration.getEditHtml(com.atlassian.bamboo.ww2.actions.build.admin.create.BuildConfiguration, com.atlassian.bamboo.plan.Plan)
 BuildRepositoryChanges 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()
          Returns branch name exactly as configured in the UI.
 java.lang.String getCvsRoot()
           
protected  java.lang.String getDecryptedPassphrase()
           
 java.lang.String getEncryptedPassword()
           
 java.lang.String getHost()
          What's the repository server host
 java.lang.String getKeyFile()
           
 java.lang.String getLocationIdentifier()
          A string representing the location of the repository
 java.text.Format getLogDateFormat()
           
 CvsRepositoryMavenPomAccessor getMavenPomAccessor()
           
 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(PlanKey planKey)
          Deprecated. 
 java.lang.String getSubstitutedBranchName()
          Returns branch name with all the variables extrapolated with current values.
 java.lang.String getSubstitutedCvsRoot()
           
 java.lang.String getSubstitutedKeyFile()
           
 CVSRepository.SymbolicNameType getSymbolicNameType()
           
 java.lang.String getUrl()
           
 java.util.Collection<NameValuePair> getVersionTypes()
           
 int hashCode()
           
 boolean isQuietPeriodEnabled()
          Returns true if we were to enable the quiet period
 boolean isRepositoryDifferent(Repository repository)
          Checks if the current repo is the same as the given repository
 boolean isSshAuthType()
           
protected  boolean isWorkspaceEmpty(java.io.File sourceCodeDirectory)
           
 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(BuildContext buildContext, java.lang.String vcsRevisionKey)
          Deprecated. 
protected  void setAuthType(java.lang.String authType)
           
 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)
 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.AbstractStandaloneRepository
getAdvancedEditHtml, getAdvancedViewHtml, getEditHtml, getViewHtml
 
Methods inherited from class com.atlassian.bamboo.repository.AbstractRepository
checkConnection, customizeBuildRequirements, getAdvancedEditHtml, getAdvancedViewHtml, getBranchIntegrationEditHtml, getChangesetFilterPatternRegex, getDescription, getEditHtml, getFilterFilePatternOption, getFilterFilePatternRegex, getKey, getMavenPomCheckoutAccessEditHtml, getMinimalEditHtml, getShortKey, getSystemWideExclusionPatterns, getViewHtml, getWorkingDirectory, init, isAdvancedOptionEnabled, removeBuildRequirements, setBuildDirectoryManager, setBuildLoggerManager, setChangesetFilterPatternRegex, setCustomVariableContext, setFilterFilePatternOption, setFilterFilePatternRegex, setTemplateRenderer, setTextProvider, setWorkingDir, substituteString, toMergeCapableRepository
 
Methods inherited from class com.atlassian.bamboo.v2.build.BaseConfigurablePlugin
customizeBuildRequirements, removeBuildRequirements
 
Methods inherited from class com.atlassian.bamboo.v2.build.BaseBuildConfigurationAwarePlugin
isConfigurationMissing, populateContextForEdit, populateContextForView
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.atlassian.bamboo.repository.Repository
checkConnection, getKey, getMinimalEditHtml, getShortKey
 
Methods inherited from interface com.atlassian.bamboo.v2.build.ConfigurablePlugin
customizeBuildRequirements, removeBuildRequirements
 
Methods inherited from interface com.atlassian.bamboo.v2.build.RenderableBuildConfiguration
getEditHtml, getViewHtml
 
Methods inherited from interface com.atlassian.bamboo.utils.DescriptionProvider
getDescription
 

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

COMPLETE_PLUGIN_KEY

public static final java.lang.String COMPLETE_PLUGIN_KEY
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_VERSION_TYPE

public static final java.lang.String CVS_VERSION_TYPE
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

TEMPORARY_CVS_PASSWORD

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

cvsRepositoryManager

public transient CvsRepositoryManager cvsRepositoryManager
Constructor Detail

CVSRepository

public CVSRepository()
Method Detail

collectChangesSinceLastBuild

@NotNull
public BuildRepositoryChanges collectChangesSinceLastBuild(@NotNull
                                                                   java.lang.String planKey,
                                                                   @Nullable
                                                                   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

@Deprecated
@NotNull
public java.lang.String retrieveSourceCode(@NotNull
                                                              BuildContext buildContext,
                                                              @Nullable
                                                              java.lang.String vcsRevisionKey)
                                    throws RepositoryException
Deprecated. 

Description copied from interface: LegacyRepository
Checks out the latest source code to an appropriate repository to default source code directory.

Specified by:
retrieveSourceCode in interface LegacyRepository
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: RepositoryV2
Checks if the current repo is the same as the given repository

Specified by:
isRepositoryDifferent in interface RepositoryV2
Parameters:
repository - to compare against
Returns:
true of repositories are different, false if the same;

isWorkspaceEmpty

protected boolean isWorkspaceEmpty(java.io.File sourceCodeDirectory)
Overrides:
isWorkspaceEmpty in class AbstractRepository

getMavenPomAccessor

@NotNull
public CvsRepositoryMavenPomAccessor getMavenPomAccessor()
Specified by:
getMavenPomAccessor in interface MavenPomAccessorCapableRepository

addDefaultValues

public void addDefaultValues(@NotNull
                             BuildConfiguration buildConfiguration)
Description copied from interface: BuildConfigurationAwarePlugin
Extension point for adding default values to the form for RenderableBuildConfiguration.getEditHtml(com.atlassian.bamboo.ww2.actions.build.admin.create.BuildConfiguration, com.atlassian.bamboo.plan.Plan)

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

prepareConfigObject

public void prepareConfigObject(@NotNull
                                BuildConfiguration buildConfiguration)
Description copied from interface: BuildConfigurationAwarePlugin
Do any preprocessing work before validation occurs. For repository, builder and web repository plugins this will only be called if the plugin is select by the user.

Specified by:
prepareConfigObject in interface BuildConfigurationAwarePlugin
Overrides:
prepareConfigObject in class BaseBuildConfigurationAwarePlugin
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 BuildConfigurationAwarePlugin
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

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)

setAuthType

protected void setAuthType(java.lang.String authType)

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
Specified by:
getName in interface DescriptionProvider
Specified by:
getName in interface NameProvider

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
Overrides:
getMaxRetries in class AbstractRepository
Returns:

getSourceCodeDirectory

@NotNull
@Deprecated
public java.io.File getSourceCodeDirectory(@NotNull
                                                              PlanKey planKey)
                                    throws RepositoryException
Deprecated. 

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
Throws:
RepositoryException - A generic failure

getModule

public java.lang.String getModule()

setModule

public void setModule(java.lang.String moduleName)

getBranchName

public java.lang.String getBranchName()
Returns branch name exactly as configured in the UI. It means that it can contain unresolved variables. For majority of purposes getSubstitutedBranchName() should be used.

Returns:
branch name as configured in the UI

getSubstitutedBranchName

public java.lang.String getSubstitutedBranchName()
Returns branch name with all the variables extrapolated with current values.

Returns:
branch name with resolved variables

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
Overrides:
isQuietPeriodEnabled in class AbstractRepository
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
Overrides:
getQuietPeriod in class AbstractRepository
Returns:
seconds between retries

getCvsRoot

public java.lang.String getCvsRoot()

getHost

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

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

getLocationIdentifier

@NotNull
public java.lang.String getLocationIdentifier()
Description copied from interface: Repository
A string representing the location of the repository

Specified by:
getLocationIdentifier in interface Repository
Overrides:
getLocationIdentifier in class AbstractRepository
Returns:

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

getVersionTypes

@NotNull
public java.util.Collection<NameValuePair> getVersionTypes()

getLogDateFormat

public java.text.Format getLogDateFormat()

setLogDateFormat

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

getSymbolicNameType

public CVSRepository.SymbolicNameType getSymbolicNameType()


Copyright © 2012 Atlassian. All Rights Reserved.