public class PlanBranchPullRequestServiceImpl extends Object implements PlanBranchPullRequestService
Constructor and Description |
---|
PlanBranchPullRequestServiceImpl(CachedPlanManager cachedPlanManager,
com.atlassian.event.api.EventPublisher eventPublisher,
PlanBranchPullRequestDao planBranchPullRequestDao,
PlanManager planManager,
VcsPullRequestDao vcsPullRequestDao) |
Modifier and Type | Method and Description |
---|---|
PlanBranchPullRequest |
create(ChainBranch chainBranch,
MutableVcsPullRequest vcsPullRequest)
Creates a new link between chain branch and pull request.
|
PlanBranchPullRequest |
create(PlanKey branchKey,
long pullRequestId)
Creates a new link between chain branch and pull request.
|
boolean |
deleteForChainBranch(long branchId)
Deletes a link for the given plan branch.
|
boolean |
deleteForChainBranch(PlanKey branchKey)
Deletes a link for the given plan branch.
|
int |
deleteForVcsPullRequest(long pullRequestId)
Deletes all links for the given pull request.
|
Optional<PlanBranchPullRequest> |
findForChainAndPullRequest(long chainId,
long pullRequestId)
|
Optional<PlanBranchPullRequest> |
findForChainAndPullRequest(PlanKey chainKey,
long pullRequestId)
|
Optional<PlanBranchPullRequest> |
findForChainBranch(long branchId)
Retrieves a
PlanBranchPullRequest connection for the given plan branch by branch id. |
Optional<PlanBranchPullRequest> |
findForChainBranch(PlanKey branchKey)
Retrieves a
PlanBranchPullRequest connection for the given plan branch by branch key. |
List<PlanBranchPullRequest> |
findForPullRequest(long pullRequestId)
Retrieves all
PlanBranchPullRequest connections for the given pull request by pull
request database id. |
@Inject public PlanBranchPullRequestServiceImpl(CachedPlanManager cachedPlanManager, com.atlassian.event.api.EventPublisher eventPublisher, PlanBranchPullRequestDao planBranchPullRequestDao, PlanManager planManager, VcsPullRequestDao vcsPullRequestDao)
@NotNull public Optional<PlanBranchPullRequest> findForChainBranch(long branchId)
PlanBranchPullRequestService
PlanBranchPullRequest
connection for the given plan branch
by branch id.
Only one VCS pull request may be associated with a plan branch.findForChainBranch
in interface PlanBranchPullRequestService
branchId
- id of the plan branchPlanBranchPullRequest
if found@NotNull public Optional<PlanBranchPullRequest> findForChainBranch(@NotNull PlanKey branchKey)
PlanBranchPullRequestService
PlanBranchPullRequest
connection for the given plan branch
by branch key.
Only one VCS pull request may be associated with a plan branch.findForChainBranch
in interface PlanBranchPullRequestService
branchKey
- key of the plan branchPlanBranchPullRequest
if found@NotNull public Optional<PlanBranchPullRequest> findForChainAndPullRequest(long chainId, long pullRequestId)
PlanBranchPullRequestService
PlanBranchPullRequest
connection for the given chain
and pull request
. Should yield only one result, since a single pull requests should only create a
single plan branch
per plan.findForChainAndPullRequest
in interface PlanBranchPullRequestService
chainId
- id of the top level planpullRequestId
- id of the VCS pull requestPlanBranchPullRequest
if found@NotNull public Optional<PlanBranchPullRequest> findForChainAndPullRequest(@NotNull PlanKey chainKey, long pullRequestId)
PlanBranchPullRequestService
PlanBranchPullRequest
connection for the given chain
and pull request
. Should yield only one result, since a single pull requests should only create a
single plan branch
per plan.findForChainAndPullRequest
in interface PlanBranchPullRequestService
chainKey
- key of the top level planpullRequestId
- id of the VCS pull requestPlanBranchPullRequest
if found@NotNull public List<PlanBranchPullRequest> findForPullRequest(long pullRequestId)
PlanBranchPullRequestService
PlanBranchPullRequest
connections for the given pull request
by pull
request database id. Multiple plan branches may be associated with a single pull request.findForPullRequest
in interface PlanBranchPullRequestService
pullRequestId
- id of the pull requestPlanBranchPullRequest
s@NotNull public PlanBranchPullRequest create(@NotNull PlanKey branchKey, long pullRequestId)
PlanBranchPullRequestService
create
in interface PlanBranchPullRequestService
branchKey
- key of the chain branch to linkpullRequestId
- id of the pull request to link@NotNull public PlanBranchPullRequest create(@NotNull ChainBranch chainBranch, @NotNull MutableVcsPullRequest vcsPullRequest)
PlanBranchPullRequestService
create
in interface PlanBranchPullRequestService
chainBranch
- chain branch to linkvcsPullRequest
- pull request to linkpublic boolean deleteForChainBranch(long branchId)
PlanBranchPullRequestService
deleteForChainBranch
in interface PlanBranchPullRequestService
branchId
- id of the plan branchpublic boolean deleteForChainBranch(@NotNull PlanKey branchKey)
PlanBranchPullRequestService
deleteForChainBranch
in interface PlanBranchPullRequestService
branchKey
- key of the plan branchpublic int deleteForVcsPullRequest(long pullRequestId)
PlanBranchPullRequestService
deleteForVcsPullRequest
in interface PlanBranchPullRequestService
pullRequestId
- id of the vcs pull requestCopyright © 2021 Atlassian Software Systems Pty Ltd. All rights reserved.