Class BitbucketSeverMirrorHelper
- java.lang.Object
-
- com.atlassian.bamboo.plugins.stash.BitbucketSeverMirrorHelper
-
@Service public class BitbucketSeverMirrorHelper extends Object
-
-
Constructor Summary
Constructors Constructor Description BitbucketSeverMirrorHelper()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @NotNull Optional<StashMirrorServerEntity>
findSpecifiedMirror(com.atlassian.stash.rest.client.api.StashClient stashClient, String projectKey, String repositorySlug, @NotNull com.atlassian.bamboo.specs.model.repository.bitbucket.server.BitbucketServerMirrorProperties mirrorProperties)
Finds mirror specified by mirrorProperties on the listList<StashMirrorServerEntity>
getRepositoryMirrors(com.atlassian.stash.rest.client.api.StashClient stashClient, String projectKey, String repositorySlug)
Reads all mirrors for a given repositoryList<StashMirrorServerEntity>
getRepositoryMirrors(com.atlassian.stash.rest.client.api.StashClient stashClient, String projectKey, String repositorySlug, Predicate<com.atlassian.stash.rest.client.api.entity.MirrorServer> filter)
Reads all mirrors for a given repositoryboolean
isBitbucketServerVersionMirrorsSupported(com.atlassian.stash.rest.client.api.StashClient stashClient)
Checks if given Bitbucket Server is supported.
-
-
-
Method Detail
-
isBitbucketServerVersionMirrorsSupported
public boolean isBitbucketServerVersionMirrorsSupported(com.atlassian.stash.rest.client.api.StashClient stashClient)
Checks if given Bitbucket Server is supported.
Smart mirroring is supported only for Bibtucket Server versions >= 5.0.0 with DC license.
-
getRepositoryMirrors
public List<StashMirrorServerEntity> getRepositoryMirrors(com.atlassian.stash.rest.client.api.StashClient stashClient, String projectKey, String repositorySlug) throws IllegalArgumentException
Reads all mirrors for a given repository- Parameters:
stashClient
- stash client corresponding to the BBS instance serving the repositoryprojectKey
- key of the project containing the repositoryrepositorySlug
- slug of the repository- Returns:
- list of mirrors for specified repository
- Throws:
IllegalArgumentException
- when can't find repository by projectKey and repositorySlug.
-
getRepositoryMirrors
public List<StashMirrorServerEntity> getRepositoryMirrors(com.atlassian.stash.rest.client.api.StashClient stashClient, String projectKey, String repositorySlug, Predicate<com.atlassian.stash.rest.client.api.entity.MirrorServer> filter) throws IllegalArgumentException
Reads all mirrors for a given repository- Parameters:
stashClient
- stash client corresponding to the BBS instance serving the repositoryprojectKey
- key of the project containing the repositoryrepositorySlug
- slug of the repositoryfilter
- for mirror. Applied before ssh details fetching from BBS.- Returns:
- list of mirrors for specified repository
- Throws:
IllegalArgumentException
- when can't find repository by projectKey and repositorySlug.
-
findSpecifiedMirror
@NotNull public @NotNull Optional<StashMirrorServerEntity> findSpecifiedMirror(com.atlassian.stash.rest.client.api.StashClient stashClient, String projectKey, String repositorySlug, @NotNull @NotNull com.atlassian.bamboo.specs.model.repository.bitbucket.server.BitbucketServerMirrorProperties mirrorProperties)
Finds mirror specified by mirrorProperties on the list- Parameters:
stashClient
- stash client corresponding to the BBS instance serving the repositoryprojectKey
- key of the project containing the repositoryrepositorySlug
- slug of the repositorymirrorProperties
- mirror specification- Returns:
- optional containing the mirror (if found)
-
-