Class BitbucketSeverMirrorHelper
java.lang.Object
com.atlassian.bamboo.plugins.stash.BitbucketSeverMirrorHelper
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription@NotNull Optional<StashMirrorServerEntity>
findSpecifiedMirror
(com.atlassian.stash.rest.client.api.StashClient stashClient, String projectKey, String repositorySlug, String serverKey, @NotNull com.atlassian.bamboo.specs.model.repository.bitbucket.server.BitbucketServerMirrorProperties mirrorProperties) Finds mirror specified by mirrorProperties on the listgetRepositoryMirrors
(com.atlassian.stash.rest.client.api.StashClient stashClient, String projectKey, String repositorySlug, String serverKey) Reads all mirrors for a given repositorygetRepositoryMirrors
(com.atlassian.stash.rest.client.api.StashClient stashClient, String projectKey, String repositorySlug, String serverKey, 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.
-
Constructor Details
-
BitbucketSeverMirrorHelper
public BitbucketSeverMirrorHelper()
-
-
Method Details
-
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, String serverKey) 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 repositoryserverKey
- key that indicates the bitbucket instance- 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, String serverKey, 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 repositoryserverKey
- key that indicates the bitbucket instancefilter
- 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, String serverKey, @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)
-