Class VcsPullRequestServiceImpl
- java.lang.Object
-
- com.atlassian.bamboo.plan.pullrequest.VcsPullRequestServiceImpl
-
- All Implemented Interfaces:
VcsPullRequestService
public class VcsPullRequestServiceImpl extends Object implements VcsPullRequestService
-
-
Constructor Summary
Constructors Constructor Description VcsPullRequestServiceImpl(com.atlassian.event.api.EventPublisher eventPublisher, VcsPullRequestDao vcsPullRequestDao)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
closePullRequest(@NotNull VcsPullRequest pr)
Mark pull request as closed.void
closePullRequestsClosedInRepository(long targetRepositoryId, @NotNull List<VcsPullRequest> openPullRequests)
Synchronize the status of pull requests in DB and in remote repository@NotNull VcsPullRequest
createPullRequest(@NotNull String pullRequestKey, @Nullable Long sourceRepositoryId, @NotNull String source, long targetRepositoryId, @NotNull String target, boolean isOpen)
Create new pull request and save it.@NotNull VcsPullRequest
createPullRequest(@NotNull String pullRequestKey, @Nullable Long sourceRepositoryId, @NotNull String source, long targetRepositoryId, @NotNull String target, boolean isOpen, @NotNull VcsForkDto vcsForkDto)
Create new pull request and save it.VcsPullRequest
findByRepositoryAndKey(long targetRepositoryId, @NotNull String pullRequestKey)
Search pull request by pull request key (unique on repository level) and target repository idList<VcsPullRequest>
findOpenByRepository(long targetRepositoryId)
Search open pull requests by target repository and status.void
updatePullRequest(@NotNull VcsPullRequest pr, @Nullable Long sourceRepositoryId, @NotNull String source, @NotNull String target, boolean isOpen)
Modify pull request.void
updatePullRequest(@NotNull VcsPullRequest pr, @Nullable Long sourceRepositoryId, @NotNull String source, @NotNull String target, boolean isOpen, @NotNull VcsForkDto vcsForkDto)
Modify pull request.
-
-
-
Constructor Detail
-
VcsPullRequestServiceImpl
@Inject public VcsPullRequestServiceImpl(com.atlassian.event.api.EventPublisher eventPublisher, VcsPullRequestDao vcsPullRequestDao)
-
-
Method Detail
-
findByRepositoryAndKey
public VcsPullRequest findByRepositoryAndKey(long targetRepositoryId, @NotNull @NotNull String pullRequestKey)
Description copied from interface:VcsPullRequestService
Search pull request by pull request key (unique on repository level) and target repository id- Specified by:
findByRepositoryAndKey
in interfaceVcsPullRequestService
- Parameters:
targetRepositoryId
- target repository idpullRequestKey
- repository-specific pull request key- Returns:
- pull request or null if not found
-
findOpenByRepository
public List<VcsPullRequest> findOpenByRepository(long targetRepositoryId)
Description copied from interface:VcsPullRequestService
Search open pull requests by target repository and status.- Specified by:
findOpenByRepository
in interfaceVcsPullRequestService
- Parameters:
targetRepositoryId
- target repository id- Returns:
- list of pull requests
-
closePullRequest
public void closePullRequest(@NotNull @NotNull VcsPullRequest pr)
Description copied from interface:VcsPullRequestService
Mark pull request as closed.- Specified by:
closePullRequest
in interfaceVcsPullRequestService
-
createPullRequest
@NotNull public @NotNull VcsPullRequest createPullRequest(@NotNull @NotNull String pullRequestKey, @Nullable @Nullable Long sourceRepositoryId, @NotNull @NotNull String source, long targetRepositoryId, @NotNull @NotNull String target, boolean isOpen)
Description copied from interface:VcsPullRequestService
Create new pull request and save it.- Specified by:
createPullRequest
in interfaceVcsPullRequestService
- Returns:
- created pull request
-
createPullRequest
@NotNull public @NotNull VcsPullRequest createPullRequest(@NotNull @NotNull String pullRequestKey, @Nullable @Nullable Long sourceRepositoryId, @NotNull @NotNull String source, long targetRepositoryId, @NotNull @NotNull String target, boolean isOpen, @NotNull @NotNull VcsForkDto vcsForkDto)
Description copied from interface:VcsPullRequestService
Create new pull request and save it. The method should be used when dealing with pull requests from forked repositories.- Specified by:
createPullRequest
in interfaceVcsPullRequestService
- Returns:
- created pull request
-
updatePullRequest
public void updatePullRequest(@NotNull @NotNull VcsPullRequest pr, @Nullable @Nullable Long sourceRepositoryId, @NotNull @NotNull String source, @NotNull @NotNull String target, boolean isOpen)
Description copied from interface:VcsPullRequestService
Modify pull request.- Specified by:
updatePullRequest
in interfaceVcsPullRequestService
-
updatePullRequest
public void updatePullRequest(@NotNull @NotNull VcsPullRequest pr, @Nullable @Nullable Long sourceRepositoryId, @NotNull @NotNull String source, @NotNull @NotNull String target, boolean isOpen, @NotNull @NotNull VcsForkDto vcsForkDto)
Description copied from interface:VcsPullRequestService
Modify pull request. The method should be used when dealing with pull requests from forked repositories.- Specified by:
updatePullRequest
in interfaceVcsPullRequestService
-
closePullRequestsClosedInRepository
public void closePullRequestsClosedInRepository(long targetRepositoryId, @NotNull @NotNull List<VcsPullRequest> openPullRequests)
Description copied from interface:VcsPullRequestService
Synchronize the status of pull requests in DB and in remote repository- Specified by:
closePullRequestsClosedInRepository
in interfaceVcsPullRequestService
-
-