com.atlassian.bamboo.studio.scm
Class AppLinksSvnRepository

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.svn.SvnRepository
                      extended by com.atlassian.bamboo.studio.scm.AppLinksSvnRepository
All Implemented Interfaces:
ConvertibleFromConfig, InitablePluginModule, AdvancedConfigurationAwareRepository, BranchAwareRepository, BranchDetectionCapableRepository, BranchingAwareRepository, CachingAwareRepository, CommitIsolationAwareRepository, CustomRevisionDataAwareRepository, CustomVariableProviderRepository, FilterChangesetAwareRepository, IncludeExcludeAwareRepository, InitialBuildAwareRepository, MandatoryCleanCheckoutAwareRepository, MavenPomAccessorCapableRepository, OnceOffCapableRepository, PreparableRepository, QuietPeriodAwareRepository, Repository, SelectableAuthenticationRepository, StandaloneRepository, TaggingAwareRepository, DescriptionProvider, NameProvider, BambooPluginModule, BuildConfigurationAwarePlugin, ConfigurablePlugin, RenderableBuildConfiguration, CustomSourceDirectoryAwareRepository, PostConfigurableRepository, RepositoryEventAware, RepositoryV2, java.io.Serializable

public class AppLinksSvnRepository
extends SvnRepository
implements PreparableRepository, PostConfigurableRepository

This repository is a hack that uses applinks and inbuilt Bamboo SVN username/password for Bamboo.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.atlassian.bamboo.repository.CachingAwareRepository
CachingAwareRepository.CachableOperation
 
Field Summary
static java.lang.String APPLINKS_PROJECT_KEY
           
static java.lang.String BAMBOO_SVN_PASSWORD_KEY
           
static java.lang.String BAMBOO_SVN_PASSWORD_STUDIOPROPS_KEY
           
static java.lang.String BAMBOO_SVN_USERNAME_STUDIOPROPS_KEY
           
static java.lang.String DEFAULT_BAMBOO_SVN_USERNAME
           
 
Fields inherited from class com.atlassian.bamboo.repository.svn.SvnRepository
BRANCHES_DETECTION_BRANCHES_ROOT, BRANCHES_DETECTION_BRANCHES_ROOT_OVERRIDDEN, COMPLETE_PLUGIN_KEY, DEFAULT_SVN_OPTIONS, encryptionService, KEY, NAME, SVN_AUTH_TYPE, SVN_KEYFILE, SVN_PASSPHRASE, SVN_PASSWORD, SVN_REPO_PREFIX, SVN_REPO_URL, SVN_SSL_KEYFILE, SVN_SSL_PASSPHRASE, SVN_USERNAME, TEMPORARY_SVN_PASSWORD, TEMPORARY_SVN_REPO_PREFIX
 
Fields inherited from class com.atlassian.bamboo.repository.AbstractRepository
BUILD_TRIGGER_IP, buildDirectoryManager, buildLoggerManager, customVariableContext, featureManager, REPO_PREFIX, 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.CommitIsolationAwareRepository
COMMIT_ISOLATION_OPTION
 
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
AppLinksSvnRepository()
           
 
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)
protected  java.lang.String getBambooSvnPassword()
           
protected  java.lang.String getBambooSvnUsername()
           
 java.lang.String getName()
          What's the name of the plugin - appears in the GUI dropdown
protected  java.lang.String getRepoPrefix()
           
protected  java.lang.String getTemporaryPrefix()
           
 void onPrepare(org.apache.commons.configuration.HierarchicalConfiguration configuration)
           
 void performPostConfiguration(BuildConfiguration buildConfiguration, Plan plan)
          Allows any other configuration to be performed after another repository has been created.
 void performPostConfigurationForSelectedRepository(BuildConfiguration buildConfiguration, Plan plan)
          Allows any other configuration to be performed after this repository has been created
 void populateFromConfig(org.apache.commons.configuration.HierarchicalConfiguration hierarchicalConfiguration)
          Update the current object with data in the HierarchicalConfiguration
 void prepareConfigObject(BuildConfiguration buildConfiguration)
          This method needs to be overriden because when you have a Job that doesn't inherits the source repository configuration from the parent Plan, the way Bamboo handles its BuildConfiguration objects will lead to a empty SVN repository url because the way Studio handles the url configuration, via applinks.
 void setOsgiContainerManager(com.atlassian.plugin.osgi.container.OsgiContainerManager osgiContainerManager)
           
 void setStudioPlugins2BridgeFactory(StudioPlugins2BridgeFactory studioPlugins2BridgeFactory)
          For testing
 void setVcsBranch(VcsBranch branch)
          Set and prepare the repository for using an arbitrary branch.
 org.apache.commons.configuration.HierarchicalConfiguration toConfiguration()
          Store SvnRepository data into configuration object.
 ErrorCollection validate(BuildConfiguration buildConfiguration)
          Validates the properties in the BuildConfiguration object.
 
Methods inherited from class com.atlassian.bamboo.repository.svn.SvnRepository
checkout, collectChangesForRevision, collectChangesSinceLastBuild, collectChangesSinceLastBuild, compareTo, createBranch, createTag, equals, export, getAuthenticationTypes, getAuthType, getBranchRootUrl, getCacheId, getConfigConstant, getCustomVariables, getEncryptedPassphrase, getEncryptedPassword, getFirstCommit, getHost, getHost, getKeyFile, getLastCommit, getLocationIdentifier, getManualBranchRootUrl, getManualTagRootUrl, getMavenPomAccessor, getOpenBranches, getPassphrase, getRepositoryUrl, getSubstitutedKeyFile, getSubstitutedRepositoryUrl, getSubstitutedSvnUrl, getSvnClientManager, getTemporaryConstant, getUrl, getUsername, getUserPassword, getVcsBranch, hashCode, info, isAdvancedOptionEnabled, isAutodetectBranchRootUrl, isAutodetectTagRootUrl, isCachingSupportedFor, isCleanCheckoutRequired, isCommitIsolationEnabled, isolateCommits, isRecoverableException, isRepositoryDifferent, isUseExport, isUseExternals, onInitialBuild, postRetrieveSourceCode, postRetrieveSourceCode, preRetrieveSourceCode, preRetrieveSourceCode, retrieveSourceCode, setAdministrationConfigurationManager, setAuthType, setAutodetectBranchRoot, setCommitIsolationEnabled, setEncryptedPassphrase, setEncryptedPassword, setEncryptionService, setKeyFile, setManualBranchRootUrl, setPassphrase, setRepositoryUrl, setSvnClientManagerFactory, setUseExport, setUseExternals, setUsername, setUserPassword, setVcsBranch
 
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, getMaxCommitsToReturn, getMaxRetries, getMinimalEditHtml, getQuietPeriod, getShortKey, getSourceCodeDirectory, getSystemWideExclusionPatterns, getViewHtml, getWorkingDirectory, init, isQuietPeriodEnabled, isWorkspaceEmpty, removeBuildRequirements, setBuildDirectoryManager, setBuildLoggerManager, setChangesetFilterPatternRegex, setCustomVariableContext, setFeatureManager, 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, getHost, getKey, getLocationIdentifier, getMinimalEditHtml, getShortKey
 
Methods inherited from interface com.atlassian.bamboo.v2.build.repository.RepositoryV2
collectChangesSinceLastBuild, getSourceCodeDirectory, isRepositoryDifferent
 
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
 
Methods inherited from interface com.atlassian.bamboo.repository.AdvancedConfigurationAwareRepository
getAdvancedEditHtml, getAdvancedViewHtml
 

Field Detail

DEFAULT_BAMBOO_SVN_USERNAME

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

BAMBOO_SVN_PASSWORD_KEY

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

BAMBOO_SVN_USERNAME_STUDIOPROPS_KEY

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

BAMBOO_SVN_PASSWORD_STUDIOPROPS_KEY

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

APPLINKS_PROJECT_KEY

public static final java.lang.String APPLINKS_PROJECT_KEY
See Also:
Constant Field Values
Constructor Detail

AppLinksSvnRepository

public AppLinksSvnRepository()
Method Detail

getName

@NotNull
public java.lang.String getName()
Description copied from class: SvnRepository
What's the name of the plugin - appears in the GUI dropdown

Specified by:
getName in interface Repository
Specified by:
getName in interface DescriptionProvider
Specified by:
getName in interface NameProvider
Overrides:
getName in class SvnRepository
Returns:
The name

validate

@NotNull
public ErrorCollection validate(@NotNull
                                        BuildConfiguration buildConfiguration)
Description copied from interface: BuildConfigurationAwarePlugin
Validates the properties in the BuildConfiguration object. The name of the properties match those passed in through the form fragments in RenderableBuildConfiguration.getEditHtml(com.atlassian.bamboo.ww2.actions.build.admin.create.BuildConfiguration, com.atlassian.bamboo.plan.Plan) template.

Specified by:
validate in interface BuildConfigurationAwarePlugin
Overrides:
validate in class SvnRepository
Parameters:
buildConfiguration - - @NotNull
Returns:
ErrorCollection keyed by the field name. @NotNull

toConfiguration

@NotNull
public org.apache.commons.configuration.HierarchicalConfiguration toConfiguration()
Description copied from class: SvnRepository
Store SvnRepository data into configuration object.

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

populateFromConfig

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

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

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 SvnRepository
Parameters:
buildConfiguration - - @NotNull

prepareConfigObject

public void prepareConfigObject(@NotNull
                                BuildConfiguration buildConfiguration)
This method needs to be overriden because when you have a Job that doesn't inherits the source repository configuration from the parent Plan, the way Bamboo handles its BuildConfiguration objects will lead to a empty SVN repository url because the way Studio handles the url configuration, via applinks. See JST-4959.

Specified by:
prepareConfigObject in interface BuildConfigurationAwarePlugin
Overrides:
prepareConfigObject in class SvnRepository
Parameters:
buildConfiguration -

setVcsBranch

public void setVcsBranch(@NotNull
                         VcsBranch branch)
Description copied from interface: BranchAwareRepository
Set and prepare the repository for using an arbitrary branch. Generally the subsequent getVcsBranch should return the same branch name.

Specified by:
setVcsBranch in interface BranchAwareRepository
Overrides:
setVcsBranch in class SvnRepository

getBambooSvnPassword

@Nullable
protected java.lang.String getBambooSvnPassword()

getBambooSvnUsername

protected java.lang.String getBambooSvnUsername()

setOsgiContainerManager

public void setOsgiContainerManager(com.atlassian.plugin.osgi.container.OsgiContainerManager osgiContainerManager)

setStudioPlugins2BridgeFactory

public void setStudioPlugins2BridgeFactory(StudioPlugins2BridgeFactory studioPlugins2BridgeFactory)
For testing


onPrepare

public void onPrepare(org.apache.commons.configuration.HierarchicalConfiguration configuration)
Specified by:
onPrepare in interface PreparableRepository
Parameters:
configuration - configuration to modify

getRepoPrefix

protected java.lang.String getRepoPrefix()
Overrides:
getRepoPrefix in class SvnRepository

getTemporaryPrefix

protected java.lang.String getTemporaryPrefix()
Overrides:
getTemporaryPrefix in class SvnRepository

performPostConfiguration

public void performPostConfiguration(BuildConfiguration buildConfiguration,
                                     Plan plan)
Description copied from interface: PostConfigurableRepository
Allows any other configuration to be performed after another repository has been created.

Specified by:
performPostConfiguration in interface PostConfigurableRepository

performPostConfigurationForSelectedRepository

public void performPostConfigurationForSelectedRepository(BuildConfiguration buildConfiguration,
                                                          Plan plan)
Description copied from interface: PostConfigurableRepository
Allows any other configuration to be performed after this repository has been created

Specified by:
performPostConfigurationForSelectedRepository in interface PostConfigurableRepository


Copyright © 2012 Atlassian. All Rights Reserved.