Class GitTagsHandler
- java.lang.Object
-
- com.atlassian.bamboo.plugins.git.v2.AbstractGitExecutor
-
- com.atlassian.bamboo.plugins.git.v2.GitTagsHandler
-
- All Implemented Interfaces:
IdentifyingExecutor<VcsTagsHandler>,VcsTagsHandler
public class GitTagsHandler extends AbstractGitExecutor implements VcsTagsHandler
-
-
Field Summary
-
Fields inherited from class com.atlassian.bamboo.plugins.git.v2.AbstractGitExecutor
buildDirectoryManager, buildLoggingContext, customVariableContext, DEFAULT_BRANCH, i18nResolver, sshProxyService, trustedKeyHelper
-
-
Constructor Summary
Constructors Constructor Description GitTagsHandler(CapabilityContext capabilityContext, CredentialsAccessor credentialsAccessor, CustomVariableContext customVariableContext, BuildDirectoryManager buildDirectoryManager, com.atlassian.sal.api.message.I18nResolver i18nResolver, TrustedKeyHelper trustedKeyHelper, SshProxyService sshProxyService, BuildLoggingContext buildLoggingContext)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<TagAndRevision>getAllTagsFromRepository(@NotNull VcsRepositoryData vcsRepositoryData)Reads from git repository all tags (with revisions).@Nullable ContextualVcsId<VcsTagsHandler>getVcsIdForExecutor(@NotNull VcsRepositoryData vcsRepositoryData)Returned id has to fulfill the following: Given two VcsRepositoryData objects A and B, and executor e returning equal ContextualVcsId (in terms of equals()), for any operation foo() provided by the executor, the calls e::foo(A) and e::foo(B) should be equivalent.booleanisBranchContainTag(VcsRepositoryData vcsRepositoryData, String branchName, TagAndRevision tagAndRevision)-
Methods inherited from class com.atlassian.bamboo.plugins.git.v2.AbstractGitExecutor
fetchCacheWithRetry, fetchWithRetry, getAccessData, getCacheDirectory, getCachePath, getGitCapability, getSharedCredentialsIdField, getSshCapability, getSubstitutedAccessData, getSubstitutedAccessDataBuilder, getWorkingDirectory, isUsingSharedCredentials, rethrowOrRemoveDirectory, substituteString
-
-
-
-
Constructor Detail
-
GitTagsHandler
@Inject public GitTagsHandler(CapabilityContext capabilityContext, CredentialsAccessor credentialsAccessor, CustomVariableContext customVariableContext, BuildDirectoryManager buildDirectoryManager, com.atlassian.sal.api.message.I18nResolver i18nResolver, TrustedKeyHelper trustedKeyHelper, SshProxyService sshProxyService, BuildLoggingContext buildLoggingContext)
-
-
Method Detail
-
getAllTagsFromRepository
public List<TagAndRevision> getAllTagsFromRepository(@NotNull @NotNull VcsRepositoryData vcsRepositoryData) throws RepositoryException
Description copied from interface:VcsTagsHandlerReads from git repository all tags (with revisions).- Specified by:
getAllTagsFromRepositoryin interfaceVcsTagsHandler- Returns:
- list of tags with revision
- Throws:
RepositoryException
-
isBranchContainTag
public boolean isBranchContainTag(VcsRepositoryData vcsRepositoryData, String branchName, TagAndRevision tagAndRevision) throws RepositoryException
- Specified by:
isBranchContainTagin interfaceVcsTagsHandler- Throws:
RepositoryException
-
getVcsIdForExecutor
@Nullable public @Nullable ContextualVcsId<VcsTagsHandler> getVcsIdForExecutor(@NotNull @NotNull VcsRepositoryData vcsRepositoryData)
Description copied from interface:IdentifyingExecutorReturned id has to fulfill the following: Given two VcsRepositoryData objects A and B, and executor e returning equal ContextualVcsId (in terms of equals()), for any operation foo() provided by the executor, the calls e::foo(A) and e::foo(B) should be equivalent. To be more precise: given any time point t and any variable context v, calling a::foo(A) should yield the same results as calling e::foo(B). Given the above it follows that - calculation of the id should take into account global and plan variables. This means, that calling this method on the same object in different variable context can (possibly must) yield different results. - equal ids need not (and should not) guarantee equal call results over indefinite time. In particular, result of e:foo(A).equals(e::foo(A)) is allowed to be false, since 2 calls to e::foo(A) do not happen at the same time. Example: 2 git repositories with the same url and credentials are considered equal in context ofVcsBranchDetector. If they also point to the same branch, they are considered equal in context ofVcsChangeDetector- Specified by:
getVcsIdForExecutorin interfaceIdentifyingExecutor<VcsTagsHandler>- Returns:
- the id of repository, can be null if no feasible identification algorithm exists
-
-