com.atlassian.bamboo.plugins.hg
Class HgRepository

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.plugins.hg.HgRepository
All Implemented Interfaces:
ConvertibleFromConfig, InitablePluginModule, HgRepositoryFacade, AdvancedConfigurationAwareRepository, BranchAwareRepository, BranchDetectionCapableRepository, BranchInformationProvider, BranchMergingAwareRepository, CacheHandler, CachingAwareRepository, CommitIsolationAwareRepository, CustomVariableProviderRepository, DeploymentAwareRepository, FilterChangesetAwareRepository, IncludeExcludeAwareRepository, MavenPomAccessorCapableRepository, OnceOffCapableRepository, PushCapableRepository, QuietPeriodAwareRepository, Repository, StandaloneRepository, UniqueRevisionIdRepository, DescriptionProvider, NameProvider, BambooPluginModule, BuildConfigurationAwarePlugin, ConfigurablePlugin, RenderableBuildConfiguration, CustomSourceDirectoryAwareRepository, RepositoryV2, RequirementsAwareRepository, Serializable

public class HgRepository
extends AbstractStandaloneRepository
implements MavenPomAccessorCapableRepository, CustomVariableProviderRepository, CacheHandler, CustomSourceDirectoryAwareRepository, RequirementsAwareRepository, AdvancedConfigurationAwareRepository, BranchInformationProvider, PushCapableRepository, CachingAwareRepository, BranchMergingAwareRepository, CommitIsolationAwareRepository, DeploymentAwareRepository, HgRepositoryFacade, UniqueRevisionIdRepository

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.atlassian.bamboo.repository.CachingAwareRepository
CachingAwareRepository.CachableOperation
 
Field Summary
 HgRepositoryAccessData accessData
           
static Pattern branchesPattern
           
static String DEFAULT_BRANCH
           
static String REPOSITORY_BRANCH
           
static String REPOSITORY_HG_AUTHENTICATION
           
static String REPOSITORY_HG_BRANCH
           
static String REPOSITORY_HG_COMMAND_TIMEOUT
           
static String REPOSITORY_HG_PASSWORD
           
static String REPOSITORY_HG_REPOSITORY_URL
           
static String REPOSITORY_HG_USERNAME
           
static String REPOSITORY_HG_VERBOSE_LOGS
           
static String REPOSITORY_URL
           
static String REPOSITORY_USERNAME
           
 
Fields inherited from class com.atlassian.bamboo.repository.AbstractRepository
administrationConfigurationAccessor, 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.plugins.hg.HgRepositoryFacade
HG_REPOSITORIES_OF_PLAN
 
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
HgRepository()
           
 
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)
static String branchOrDefault(String branch)
           
 BuildRepositoryChanges collectChangesForRevision(PlanKey planKey, String targetRevision)
          Collects the changes for the targetRevision.
 BuildRepositoryChanges collectChangesSinceLastBuild(String planKey, String lastVcsRevisionKey)
          Collects the changes since the lastVcsRevisionKey.
 String commit(File sourceDirectory, String message)
          Perform a commit (dvcs commit).
 void deleteCaches(Collection<String> keys, com.opensymphony.xwork.ValidationAware feedback)
          Delete the specified caches, handling internal data updates etc.
 void deleteUnusedCaches(com.opensymphony.xwork.ValidationAware feedback)
          Delete all unused caches.
 HgRepositoryAccessData getAccessData()
          Returns raw access data: - repositoryUrl/branch/username are not substituted - password/sshKey/sshPassphrase are not decrypted
 List<AuthenticationType> getAuthenticationTypes()
           
static File getCacheBaseDirectory(BuildDirectoryManager buildDirectoryManager)
          Separate static method so we can define the cache base directory in one place
 Collection<CacheDescription> getCacheDescriptions()
          Collection of cache descriptions to be displayed in the admin UI.
 File getCacheDirectory()
           
static File getCacheDirectory(File baseDirectory, String repositoryUrl, String username)
           
 CacheId getCacheId(CachingAwareRepository.CachableOperation cachableOperation)
          Cache id has to fulfill the following: Given two Repository objects A and B, returning equal CacheId (in terms of equals()) and a cachable operation foo(), in the following sequence of calls made in a short time period: 1.
 Map<String,String> getCustomVariables()
          Return a map containing name->value mapping of the variables.
 CommitContext getFirstCommit()
          Retrieve the commit that created the Branch.
 String getHandlerDescription()
          Additional information about this cache type that would be displayed in UI.
 String getHgExeCapability()
           
 HgRepository getHgRepository()
           
 String getHost()
          What's the repository server host
 CommitContext getLastCommit()
          Retrieve last commit on the branch set on this Repository.
 String getLocationIdentifier()
          A string representing the location of the repository
 MavenPomAccessor getMavenPomAccessor()
           
protected  int getMaxCommitsToReturn()
           
 String getName()
          The display name for the repository type
 List<VcsBranch> getOpenBranches(String context)
          Set of open branches that are discovered in the repository.
 String getOptionDescription()
           
 List<ImmutablePlan> getOtherPlansSharingCache(Plan current)
           
 Map<String,String> getPlanRepositoryVariables()
          Return a map containing name->value mapping of the plan repository format variables.
 URI getRemoteUri()
           
 Set<Requirement> getRequirements()
           
 String getSshExeCapability()
           
 HgRepositoryAccessData getSubstitutedAccessData()
          Returns processed access data: - repositoryUrl/branch/username are substituted - password/sshKey/sshPassphrase are decrypted - username/password are extracted from repositoryUrl if not set explicitly
 VcsBranch getVcsBranch()
           
 boolean isCachingSupportedFor(CachingAwareRepository.CachableOperation cachableOperation)
           
 boolean isCommitIsolationEnabled()
          Whether or not commits will be broken up into individual builds
 boolean isHgExecutableSet()
          For configuration screens
 boolean isMergingSupported()
           
 List<BuildRepositoryChanges> isolateCommits(BuildRepositoryChanges buildChanges)
          Break the single build changes object into a list of BuildRepositoryChanges.
 boolean isRepositoryDifferent(Repository repository)
          Checks if the current repo is the same as the given repository
protected  boolean isWorkspaceEmpty(File sourceCodeDirectory)
           
 boolean mergeWorkspaceWith(BuildContext buildContext, File workspace, String targetRevision)
          Merges a workspace located in checkout directory with the target revision.
 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.
 void pushRevision(File sourceDirectory, String vcsRevisionKey)
          Push the specified revision to the remote directory.
 String retrieveSourceCode(BuildContext buildContext, String vcsRevisionKey, File sourceDirectory)
          Checks out the latest source code from an appropriate repository to specified directory
 String retrieveSourceCode(BuildContext buildContext, String vcsRevisionKey, File sourceDirectory, int depth)
          So far mercurial cannot retrieve a "shallow" clone of repository so we're ignoring depth argument
 void setBranchIntegrationHelper(BranchIntegrationHelper branchIntegrationHelper)
           
 void setCapabilityContext(CapabilityContext capabilityContext)
           
 void setCommitIsolationEnabled(boolean commitIsolationEnabled)
           
 void setEncryptionService(EncryptionService encryptionService)
           
 void setHgCacheHandler(HgCacheHandler hgCacheHandler)
           
 void setI18nResolver(com.atlassian.sal.api.message.I18nResolver i18nResolver)
           
 void setScopedExclusionService(ScopedExclusionService scopedExclusionService)
           
 void setSshProxyService(SshProxyService sshProxyService)
           
 void setVcsBranch(VcsBranch branch)
          Set and prepare the repository for using an arbitrary branch.
 org.apache.commons.configuration.HierarchicalConfiguration toConfiguration()
          Generate a HierarchicalConfiguration from the current state of the object
 boolean usePollingForBranchDetection()
          If Bamboo generic detection polling should be used for this repository
 ErrorCollection validate(BuildConfiguration buildConfiguration)
          Validates the properties in the BuildConfiguration object.
 
Methods inherited from class com.atlassian.bamboo.repository.AbstractStandaloneRepository
getAdvancedEditHtml, getAdvancedViewHtml, getEditHtml, getViewHtml, getViewHtml
 
Methods inherited from class com.atlassian.bamboo.repository.AbstractRepository
checkConnection, customizeBuildRequirements, getAdvancedEditHtml, getAdvancedViewHtml, getBranchIntegrationEditHtml, getChangesetFilterPatternRegex, getDefaultTriggerModule, getDescription, getEditHtml, getFilterFilePatternOption, getFilterFilePatternRegex, getKey, getMavenPomCheckoutAccessEditHtml, getMaxRetries, getMinimalEditHtml, getPollingTriggerModule, getQuietPeriod, getShortKey, getSourceCodeDirectory, getSystemWideExclusionPatterns, getViewHtml, getWorkingDirectory, init, isAdvancedOptionEnabled, isQuietPeriodEnabled, removeBuildRequirements, setAdministrationConfigurationAccessor, setBuildDirectoryManager, setBuildLoggerManager, setChangesetFilterPatternRegex, setCustomVariableContext, setFeatureManager, setFilterFilePatternOption, setFilterFilePatternRegex, setTemplateRenderer, setTextProvider, setWorkingDir, substituteString, toMergeCapableRepository
 
Methods inherited from class com.atlassian.bamboo.v2.build.BaseBuildConfigurationAwarePlugin
isConfigurationMissing, populateContextForEdit, populateContextForView
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.atlassian.bamboo.repository.CacheHandler
getKey
 
Methods inherited from interface com.atlassian.bamboo.repository.AdvancedConfigurationAwareRepository
getAdvancedEditHtml, getAdvancedViewHtml
 
Methods inherited from interface com.atlassian.bamboo.repository.Repository
checkConnection, getKey, getMinimalEditHtml, getShortKey
 
Methods inherited from interface com.atlassian.bamboo.v2.build.repository.RepositoryV2
getSourceCodeDirectory
 
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.BranchMergingAwareRepository
getBranchIntegrationEditHtml
 

Field Detail

DEFAULT_BRANCH

public static final String DEFAULT_BRANCH
See Also:
Constant Field Values

REPOSITORY_URL

public static final String REPOSITORY_URL
See Also:
Constant Field Values

REPOSITORY_HG_REPOSITORY_URL

public static final String REPOSITORY_HG_REPOSITORY_URL
See Also:
Constant Field Values

REPOSITORY_BRANCH

public static final String REPOSITORY_BRANCH
See Also:
Constant Field Values

REPOSITORY_HG_BRANCH

public static final String REPOSITORY_HG_BRANCH
See Also:
Constant Field Values

REPOSITORY_HG_AUTHENTICATION

public static final String REPOSITORY_HG_AUTHENTICATION
See Also:
Constant Field Values

REPOSITORY_USERNAME

public static final String REPOSITORY_USERNAME
See Also:
Constant Field Values

REPOSITORY_HG_USERNAME

public static final String REPOSITORY_HG_USERNAME
See Also:
Constant Field Values

REPOSITORY_HG_PASSWORD

public static final String REPOSITORY_HG_PASSWORD
See Also:
Constant Field Values

REPOSITORY_HG_COMMAND_TIMEOUT

public static final String REPOSITORY_HG_COMMAND_TIMEOUT
See Also:
Constant Field Values

REPOSITORY_HG_VERBOSE_LOGS

public static final String REPOSITORY_HG_VERBOSE_LOGS
See Also:
Constant Field Values

branchesPattern

public static final Pattern branchesPattern

accessData

public HgRepositoryAccessData accessData
Constructor Detail

HgRepository

public HgRepository()
Method Detail

branchOrDefault

public static String branchOrDefault(@Nullable
                                     String branch)

getName

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

Specified by:
getName in interface CacheHandler
Specified by:
getName in interface Repository
Specified by:
getName in interface DescriptionProvider
Specified by:
getName in interface NameProvider
Returns:
name for the supported cache type

getHost

public 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 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:

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;

getCacheDirectory

@NotNull
public File getCacheDirectory()

getCacheBaseDirectory

public static File getCacheBaseDirectory(BuildDirectoryManager buildDirectoryManager)
Separate static method so we can define the cache base directory in one place

Parameters:
buildDirectoryManager - buildDirectoryManager to get the locations from
Returns:
base directory where the caches should be created
See Also:
DeleteHgCacheDirectoryOnAgentMessage

getCacheDirectory

@NotNull
public static File getCacheDirectory(File baseDirectory,
                                             String repositoryUrl,
                                             @Nullable
                                             String username)

commit

@NotNull
public String commit(@NotNull
                             File sourceDirectory,
                             @NotNull
                             String message)
              throws RepositoryException
Description copied from interface: PushCapableRepository
Perform a commit (dvcs commit).

Specified by:
commit in interface PushCapableRepository
Parameters:
sourceDirectory - - which workspace directory to perform the commit
message - - what message use for commit
Returns:
Created commit revision key
Throws:
RepositoryException - - when something goes wrong

pushRevision

public void pushRevision(@NotNull
                         File sourceDirectory,
                         @Nullable
                         String vcsRevisionKey)
                  throws RepositoryException
Description copied from interface: PushCapableRepository
Push the specified revision to the remote directory. Throws RepositoryException when failed due to connection problems or similar.

Specified by:
pushRevision in interface PushCapableRepository
Parameters:
sourceDirectory - - the working directory of the repository we want to push from
vcsRevisionKey - - the revisionKey (usually a branch name) to push
Throws:
RepositoryException - - when something goes wrong

getOpenBranches

@NotNull
public List<VcsBranch> getOpenBranches(@Nullable
                                               String context)
                                throws RepositoryException
Description copied from interface: BranchDetectionCapableRepository
Set of open branches that are discovered in the repository. Returns empty collection if no branches at all (can that happen?). Used for monitoring repositories for new branches. An open branch is a branch that is considered 'open' by underlying VCS - it has nothing to do with the actual development on that branch (recent commits or so).

Specified by:
getOpenBranches in interface BranchDetectionCapableRepository
Returns:
List of branch names. May be empty.
Throws:
RepositoryException

getCacheId

public CacheId getCacheId(@NotNull
                          CachingAwareRepository.CachableOperation cachableOperation)
Description copied from interface: CachingAwareRepository
Cache id has to fulfill the following: Given two Repository objects A and B, returning equal CacheId (in terms of equals()) and a cachable operation foo(), in the following sequence of calls made in a short time period: 1. A::foo() 2. B::foo() 3. A::foo() the result of B::foo() should be the same as either the first or the second call to A::foo().

Specified by:
getCacheId in interface CachingAwareRepository
Returns:
the cache id of repository, null if the supplied operation cannot be cached

isCachingSupportedFor

public boolean isCachingSupportedFor(@NotNull
                                     CachingAwareRepository.CachableOperation cachableOperation)
Specified by:
isCachingSupportedFor in interface CachingAwareRepository
Returns:
true if the repository supports generation of CacheIds for a given operation

getVcsBranch

@NotNull
public VcsBranch getVcsBranch()
Specified by:
getVcsBranch in interface BranchAwareRepository
Returns:
the branch being used currently by this repository.

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

getLastCommit

public CommitContext getLastCommit()
                            throws RepositoryException
Description copied from interface: BranchDetectionCapableRepository
Retrieve last commit on the branch set on this Repository. Method is used by Chain Branch automatic expiry. If this method returns null Chain Branch is not expired.

Specified by:
getLastCommit in interface BranchDetectionCapableRepository
Returns:
the last commit or null if N/A
Throws:
RepositoryException

getFirstCommit

public CommitContext getFirstCommit()
                             throws RepositoryException
Description copied from interface: BranchDetectionCapableRepository
Retrieve the commit that created the Branch.

Specified by:
getFirstCommit in interface BranchDetectionCapableRepository
Returns:
the first commit to the branch
Throws:
RepositoryException

getMaxCommitsToReturn

protected int getMaxCommitsToReturn()
Overrides:
getMaxCommitsToReturn in class AbstractRepository

collectChangesSinceLastBuild

@NotNull
public BuildRepositoryChanges collectChangesSinceLastBuild(@NotNull
                                                                   String planKey,
                                                                   @Nullable
                                                                   String lastVcsRevisionKey)
                                                    throws RepositoryException
Description copied from interface: RepositoryV2
Collects the changes since the lastVcsRevisionKey. This method is called only on server side (never on agent).

Specified by:
collectChangesSinceLastBuild in interface RepositoryV2
lastVcsRevisionKey - can be null, if null you should ensure the correct vcsrevisionkey is returned in the BuildChanges object.
Returns:
A build changes object with the appropriate build changes
Throws:
RepositoryException - if something goes wrong

collectChangesForRevision

@NotNull
public BuildRepositoryChanges collectChangesForRevision(@NotNull
                                                                PlanKey planKey,
                                                                @NotNull
                                                                String targetRevision)
                                                 throws RepositoryException
Description copied from interface: OnceOffCapableRepository
Collects the changes for the targetRevision. This method is called only on server side (never on agent).

Specified by:
collectChangesForRevision in interface OnceOffCapableRepository
Overrides:
collectChangesForRevision in class AbstractRepository
Returns:
A build changes object with the appropriate build changes (that is - with the single commit data relevant for targetRevision)
Throws:
RepositoryException - if something goes wrong

retrieveSourceCode

@NotNull
public String retrieveSourceCode(@NotNull
                                         BuildContext buildContext,
                                         @Nullable
                                         String vcsRevisionKey,
                                         @NotNull
                                         File sourceDirectory)
                          throws RepositoryException
Description copied from interface: CustomSourceDirectoryAwareRepository
Checks out the latest source code from an appropriate repository to specified directory

Specified by:
retrieveSourceCode in interface CustomSourceDirectoryAwareRepository
vcsRevisionKey - - may be null if you want latest code
sourceDirectory - - directory to checkout to
Returns:
vcsRevisionKey - the revision
Throws:
RepositoryException

retrieveSourceCode

@NotNull
public String retrieveSourceCode(@NotNull
                                         BuildContext buildContext,
                                         @Nullable
                                         String vcsRevisionKey,
                                         @NotNull
                                         File sourceDirectory,
                                         int depth)
                          throws RepositoryException
So far mercurial cannot retrieve a "shallow" clone of repository so we're ignoring depth argument

Specified by:
retrieveSourceCode in interface BranchMergingAwareRepository
vcsRevisionKey - - may be null if you want latest code
sourceDirectory - - directory to checkout to
depth - - how many historical revisions we'd like to check out (-1 means all revisions)
Returns:
vcsRevisionKey - the revision
Throws:
RepositoryException

mergeWorkspaceWith

public boolean mergeWorkspaceWith(@NotNull
                                  BuildContext buildContext,
                                  @NotNull
                                  File workspace,
                                  @NotNull
                                  String targetRevision)
                           throws RepositoryException
Description copied from interface: BranchMergingAwareRepository
Merges a workspace located in checkout directory with the target revision.

Specified by:
mergeWorkspaceWith in interface BranchMergingAwareRepository
Parameters:
buildContext - the build context of build doing the merge
workspace - the workspace to use for merge
targetRevision - the revision to merge with
Returns:
true if the result of the merge would result in a non-empty commit
Throws:
RepositoryException

isMergingSupported

public boolean isMergingSupported()
Specified by:
isMergingSupported in interface BranchMergingAwareRepository

getRequirements

@NotNull
public Set<Requirement> getRequirements()
Specified by:
getRequirements in interface RequirementsAwareRepository

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

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

getCustomVariables

@NotNull
public Map<String,String> getCustomVariables()
Description copied from interface: CustomVariableProviderRepository
Return a map containing name->value mapping of the variables.

Null values will be filtered out so it's safe to put them in the map.

Specified by:
getCustomVariables in interface CustomVariableProviderRepository
Returns:
Map with variable substitutions

getPlanRepositoryVariables

@NotNull
public Map<String,String> getPlanRepositoryVariables()
Description copied from interface: CustomVariableProviderRepository
Return a map containing name->value mapping of the plan repository format variables.

Null values will be filtered out so it's safe to put them in the map.

Specified by:
getPlanRepositoryVariables in interface CustomVariableProviderRepository
Returns:
Map with variable substitutions

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 AbstractRepository
Parameters:
buildConfiguration - - @NotNull
Returns:
ErrorCollection keyed by the field name. @NotNull

getMavenPomAccessor

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

isWorkspaceEmpty

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

getHandlerDescription

@NotNull
public String getHandlerDescription()
Description copied from interface: CacheHandler
Additional information about this cache type that would be displayed in UI.

This should include information about any non-obvious details like scheduling remote agent operations.

Specified by:
getHandlerDescription in interface CacheHandler
Returns:
additional information about this cache type that would be displayed in UI

getCacheDescriptions

@NotNull
public Collection<CacheDescription> getCacheDescriptions()
Description copied from interface: CacheHandler
Collection of cache descriptions to be displayed in the admin UI.

Specified by:
getCacheDescriptions in interface CacheHandler
Returns:
collection of all found caches of given type.

deleteCaches

public void deleteCaches(@NotNull
                         Collection<String> keys,
                         @NotNull
                         com.opensymphony.xwork.ValidationAware feedback)
Description copied from interface: CacheHandler
Delete the specified caches, handling internal data updates etc.

Specified by:
deleteCaches in interface CacheHandler
Parameters:
keys - keys from CacheDescription.getKey()
feedback - consumer of UI messages

deleteUnusedCaches

public void deleteUnusedCaches(@NotNull
                               com.opensymphony.xwork.ValidationAware feedback)
Description copied from interface: CacheHandler
Delete all unused caches.

It's the responsibility of the implementing class to figure out which caches are currently unused and optionally delete such caches on remote agents.

Specified by:
deleteUnusedCaches in interface CacheHandler
Parameters:
feedback - consumer of UI messages

isolateCommits

@NotNull
public List<BuildRepositoryChanges> isolateCommits(@NotNull
                                                           BuildRepositoryChanges buildChanges)
Description copied from interface: CommitIsolationAwareRepository
Break the single build changes object into a list of BuildRepositoryChanges. Must not be null. May return an empty list but that doesn't actually make any sense.
The order here matters. The first of the BuildRepositoryChanges will be more likely to be built than lower changes, which may be discarded.

Specified by:
isolateCommits in interface CommitIsolationAwareRepository
Returns:

isCommitIsolationEnabled

public boolean isCommitIsolationEnabled()
Description copied from interface: CommitIsolationAwareRepository
Whether or not commits will be broken up into individual builds

Specified by:
isCommitIsolationEnabled in interface CommitIsolationAwareRepository
Returns:

setCommitIsolationEnabled

public void setCommitIsolationEnabled(boolean commitIsolationEnabled)

getAccessData

public HgRepositoryAccessData getAccessData()
Returns raw access data: - repositoryUrl/branch/username are not substituted - password/sshKey/sshPassphrase are not decrypted

Returns:
raw repository access data

getSubstitutedAccessData

public HgRepositoryAccessData getSubstitutedAccessData()
Returns processed access data: - repositoryUrl/branch/username are substituted - password/sshKey/sshPassphrase are decrypted - username/password are extracted from repositoryUrl if not set explicitly

Returns:
processed repository access data

isHgExecutableSet

public boolean isHgExecutableSet()
For configuration screens

Returns:
true if mercurial capability is set

getHgExeCapability

@Nullable
public String getHgExeCapability()

getSshExeCapability

@Nullable
public String getSshExeCapability()

getRemoteUri

@Nullable
public URI getRemoteUri()

setCapabilityContext

public void setCapabilityContext(CapabilityContext capabilityContext)

setHgCacheHandler

public void setHgCacheHandler(HgCacheHandler hgCacheHandler)

setSshProxyService

public void setSshProxyService(SshProxyService sshProxyService)

getAuthenticationTypes

@NotNull
public List<AuthenticationType> getAuthenticationTypes()

getOtherPlansSharingCache

public List<ImmutablePlan> getOtherPlansSharingCache(Plan current)

setI18nResolver

public void setI18nResolver(com.atlassian.sal.api.message.I18nResolver i18nResolver)

setEncryptionService

public void setEncryptionService(EncryptionService encryptionService)

getOptionDescription

public String getOptionDescription()

setBranchIntegrationHelper

public void setBranchIntegrationHelper(BranchIntegrationHelper branchIntegrationHelper)

setScopedExclusionService

public void setScopedExclusionService(ScopedExclusionService scopedExclusionService)

usePollingForBranchDetection

public boolean usePollingForBranchDetection()
Description copied from interface: BranchInformationProvider
If Bamboo generic detection polling should be used for this repository

Specified by:
usePollingForBranchDetection in interface BranchInformationProvider
Returns:

getHgRepository

@Nullable
public HgRepository getHgRepository()
Specified by:
getHgRepository in interface HgRepositoryFacade


Copyright © 2015 Atlassian Software Systems Pty Ltd. All rights reserved.