Class RepositoryFinder
java.lang.Object
com.atlassian.bamboo.plugins.git.api.RepositoryFinder
- Direct Known Subclasses:
BitbucketRepositoryFinder,GithubRepositoryFinder
The RepositoryFinder class is an abstract class that provides methods to find and filter repositories based on certain criteria.
It is used in the context of handling webhooks for Git-based repositories in Bamboo.
- Since:
- 10.1
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionRepositoryFinder(CachedRepositoryDefinitionManager cachedRepositoryDefinitionManager, VcsRepositoryManager vcsRepositoryManager) -
Method Summary
Modifier and TypeMethodDescription@NotNull Stream<VcsRepositoryData> findMatchingRepositories(@NotNull String repositorySlug, @NotNull Collection<GitRef> refs) Finds and returns a Stream of VcsRepositoryData objects that match the specified repository slug and collection of GitRef objects.protected Stream<VcsRepositoryData> findRepositories(@NotNull String repositorySlug) protected @Nullable VcsLocationIndexKeygetIndexKey(@NotNull VcsRepositoryData repositoryData) Returns the repository index key based on stored data.protected abstract VcsLocationIndexKeygetIndexKeyFromSlug(@NotNull String repositorySlug) Returns the indexing key based on repositorySlug.protected abstract StringReturns the plugin key for the repository.static @NotNull Predicate<? super VcsRepositoryData> repoMatchesBranch(BambooStringUtils.AffixFilteringTree refsFilteringTree)
-
Field Details
-
BAMBOO_REMOTE_TRIGGER_KEY
- See Also:
-
vcsRepositoryManager
-
-
Constructor Details
-
RepositoryFinder
public RepositoryFinder(CachedRepositoryDefinitionManager cachedRepositoryDefinitionManager, VcsRepositoryManager vcsRepositoryManager)
-
-
Method Details
-
getPluginKey
Returns the plugin key for the repository. This method must be implemented by subclasses.- Returns:
- the plugin key for the repository
-
getIndexKeyFromSlug
Returns the indexing key based on repositorySlug.- Since:
- 12.0
-
getIndexKey
@Nullable protected @Nullable VcsLocationIndexKey getIndexKey(@NotNull @NotNull VcsRepositoryData repositoryData) Returns the repository index key based on stored data.- Since:
- 12.0
-
findMatchingRepositories
@NotNull public @NotNull Stream<VcsRepositoryData> findMatchingRepositories(@NotNull @NotNull String repositorySlug, @NotNull @NotNull Collection<GitRef> refs) Finds and returns a Stream of VcsRepositoryData objects that match the specified repository slug and collection of GitRef objects.- Parameters:
repositorySlug- the repository slug to matchrefs- the collection of GitRef objects to match- Returns:
- a Stream of matching VcsRepositoryData objects
-
repoMatchesBranch
@NotNull public static @NotNull Predicate<? super VcsRepositoryData> repoMatchesBranch(@NotNull BambooStringUtils.AffixFilteringTree refsFilteringTree) -
findRepositories
-