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
-
Constructor Summary
ConstructorDescriptionRepositoryFinder
(CachedRepositoryDefinitionManager cachedRepositoryDefinitionManager, VcsRepositoryManager vcsLocationConfigurator) -
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>
protected abstract String
Returns the plugin key for the repository.protected abstract String
Returns the repository selector.boolean
isRepositoryMatchingEvent
(@NotNull String repositorySlug, @NotNull VcsRepositoryData vcsRepositoryData) Checks if a given VcsRepositoryData object matches a specified repository slug.
-
Field Details
-
BAMBOO_REMOTE_TRIGGER_KEY
- See Also:
-
vcsLocationConfigurator
-
-
Constructor Details
-
RepositoryFinder
public RepositoryFinder(CachedRepositoryDefinitionManager cachedRepositoryDefinitionManager, VcsRepositoryManager vcsLocationConfigurator)
-
-
Method Details
-
getPluginKey
Returns the plugin key for the repository. This method must be implemented by subclasses.- Returns:
- the plugin key for the repository
-
getRepositorySelector
Returns the repository selector. This method must be implemented by subclasses.- Returns:
- the repository selector
-
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
-
findRepositories
-
isRepositoryMatchingEvent
public boolean isRepositoryMatchingEvent(@NotNull @NotNull String repositorySlug, @NotNull @NotNull VcsRepositoryData vcsRepositoryData) Checks if a given VcsRepositoryData object matches a specified repository slug.- Parameters:
repositorySlug
- the repository slug to matchvcsRepositoryData
- the VcsRepositoryData object to check- Returns:
- true if the VcsRepositoryData object matches the repository slug, false otherwise
-