public class DeploymentResultServiceImpl extends Object implements DeploymentResultService
Constructor and Description |
---|
DeploymentResultServiceImpl(BambooPermissionManager bambooPermissionManager,
DeploymentResultDao deploymentResultDao,
DeploymentVersionDao deploymentVersionDao,
EnvironmentDao environmentDao,
EnvironmentService environmentService,
@NotNull VariableContextBaselineDao variableContextBaselineDao,
@NotNull DeploymentsInProgressService deploymentsInProgressService,
@NotNull TriggerManager triggerManager,
com.opensymphony.xwork2.TextProvider textProvider) |
Modifier and Type | Method and Description |
---|---|
int |
countDeploymentResultsForEnvironment(long environmentId)
Count deployment results for deployment.
|
DeploymentResult |
createDeploymentResult(long environmentId,
long deploymentVersionId,
@NotNull VariableContext variableContext,
@NotNull TriggerReason triggerReason) |
@NotNull Set<Long> |
findEnvironmentIdsVersionWasDeployedOn(long deploymentVersionId) |
@Nullable DeploymentResult |
getDeploymentResult(long deploymentResultId)
Retrieve a specific deployment result.
|
@NotNull List<Long> |
getDeploymentResultIdsForDeploymentVersionFinishedBefore(long deploymentVersionId,
@NotNull Date finishDate)
Get ids of all deployment results for deployment version finished before given date.
|
@NotNull List<DeploymentResult> |
getDeploymentResultsByLifeCycleState(Collection<LifeCycleState> lifeCycleStates) |
@NotNull List<DeploymentResult> |
getDeploymentResultsForDeploymentVersion(long deploymentVersionId)
Get all deployment results for deployment version.
|
@NotNull List<DeploymentResult> |
getDeploymentResultsForDeploymentVersionAndEnvironment(long deploymentVersionId,
long environmentId)
Get all deployment results for deployment versions that ran against the specified environment.
|
@NotNull List<DeploymentResult> |
getDeploymentResultsForDeploymentVersionFinishedBefore(long deploymentVersionId,
Date finishDate)
Get all deployment results for deployment version finished before given date.
|
@NotNull List<DeploymentResult> |
getDeploymentResultsForEnvironment(long environmentId)
Get all deployment results for environment.
|
@NotNull List<DeploymentResult> |
getDeploymentResultsForEnvironment(long environmentId,
int offset,
int maxResults)
Get deployment results for environment.
|
@NotNull List<DeploymentResult> |
getDeploymentResultsForEnvironmentWithoutVariables(long environmentId,
int offset,
int maxResults)
Get deployment results for environment.
|
DeploymentResult |
getLastResultBefore(@NotNull DeploymentResult deploymentResult) |
DeploymentResult |
getLastResultInStatesBefore(@NotNull DeploymentResult deploymentResult,
@NotNull EnumSet<BuildState> buildStates) |
@Nullable DeploymentResult |
getLatestDeploymentResult(long environmentId,
long deploymentVersionId)
Retrieve a specific deployment result for an environment and version.
|
@Nullable DeploymentResult |
getLatestDeploymentResultForEnvironment(long environmentId)
Get the latest result that ran against an environment
|
@NotNull List<EnvironmentStatus> |
getLatestKnownDeploymentResultForEnvironments(Iterable<? extends Environment> environments)
Get the latest results that *actually* ran against a list of environments.
|
@NotNull List<EnvironmentStatus> |
getLatestKnownDeploymentResultForEnvironmentsInProject(@NotNull DeploymentProject deploymentProject)
Get the latest results that *actually* ran against a list of environments.
|
Map<Long,EnvironmentStatus> |
getLatestStatusForAllEnvironments(Map<Long,Environment> environmentsById,
Map<Long,DeploymentProject> deploymentProjectsById) |
@NotNull Map<Long,EnvironmentStatusForDashboard> |
getLatestStatusForEnvironments(@NotNull List<Long> environmentIds) |
@NotNull List<DeploymentResult> |
getResultsWhereDeploymentVersionIsDeployedNow(List<Long> environmentsId,
long deploymentVersionId) |
@Nullable DeploymentVersion |
getRollbackVersion(@NotNull DeploymentResult deploymentResult)
For a given deployment result find the version that existed on the environment before that deployment.
|
DeploymentVersion |
getRollbackVersion(long environmentId)
For a given environment find the version that existed on the environment prior to the last deployment.
|
@NotNull List<EnvironmentStatusForAggregation> |
getStatusesForAggregationByProject(@NotNull DeploymentProject deploymentProject) |
@NotNull List<DeploymentResult> |
getSuccessfulDeploymentResultsForEnvironment(long environmentId,
int offset,
int maxResults)
Get successful deployment results for environment.
|
void |
setExecutingAgent(long deploymentResultId,
long agentId)
Set the agent that the deployment is executing on.
|
void |
updateDeploymentState(long deploymentResultId,
@NotNull BuildState deploymentState,
Map<String,String> customData)
Update the build state of the Deployment Result
|
void |
updateLifeCycleState(@NotNull DeploymentTimingPoint timingPoint,
@NotNull LifeCycleState lifeCycleState)
Update lifecycle state of the DeploymentResult
|
void |
updateLifeCycleState(long deploymentResultId,
@NotNull LifeCycleState lifeCycleState)
Update lifecycle state of the DeploymentResult.
|
public DeploymentResultServiceImpl(BambooPermissionManager bambooPermissionManager, DeploymentResultDao deploymentResultDao, DeploymentVersionDao deploymentVersionDao, EnvironmentDao environmentDao, EnvironmentService environmentService, @NotNull @NotNull VariableContextBaselineDao variableContextBaselineDao, @NotNull @NotNull DeploymentsInProgressService deploymentsInProgressService, @NotNull @NotNull TriggerManager triggerManager, com.opensymphony.xwork2.TextProvider textProvider)
public DeploymentResult createDeploymentResult(long environmentId, long deploymentVersionId, @NotNull @NotNull VariableContext variableContext, @NotNull @NotNull TriggerReason triggerReason)
createDeploymentResult
in interface DeploymentResultService
@Nullable public @Nullable DeploymentResult getDeploymentResult(long deploymentResultId)
DeploymentResultService
getDeploymentResult
in interface DeploymentResultService
deploymentResultId
- of the result@Nullable public @Nullable DeploymentResult getLatestDeploymentResult(long environmentId, long deploymentVersionId)
DeploymentResultService
getLatestDeploymentResult
in interface DeploymentResultService
environmentId
- of the environmentdeploymentVersionId
- of the version@Nullable public @Nullable DeploymentResult getLatestDeploymentResultForEnvironment(long environmentId)
DeploymentResultService
getLatestDeploymentResultForEnvironment
in interface DeploymentResultService
environmentId
- id of the environment@NotNull public @NotNull List<EnvironmentStatus> getLatestKnownDeploymentResultForEnvironments(Iterable<? extends Environment> environments)
DeploymentResultService
getLatestKnownDeploymentResultForEnvironments
in interface DeploymentResultService
environments
- we want to retrieve latest DeploymentResult@NotNull public @NotNull List<EnvironmentStatus> getLatestKnownDeploymentResultForEnvironmentsInProject(@NotNull @NotNull DeploymentProject deploymentProject)
DeploymentResultService
getLatestKnownDeploymentResultForEnvironmentsInProject
in interface DeploymentResultService
deploymentProject
- we want to retrieve latest DeploymentResults for@NotNull public @NotNull List<EnvironmentStatusForAggregation> getStatusesForAggregationByProject(@NotNull @NotNull DeploymentProject deploymentProject)
getStatusesForAggregationByProject
in interface DeploymentResultService
@NotNull public @NotNull List<DeploymentResult> getDeploymentResultsForEnvironment(long environmentId)
DeploymentResultService
getDeploymentResultsForEnvironment
in interface DeploymentResultService
environmentId
- id of environment to get results from@NotNull public @NotNull List<DeploymentResult> getDeploymentResultsForEnvironment(long environmentId, int offset, int maxResults)
DeploymentResultService
getDeploymentResultsForEnvironment
in interface DeploymentResultService
environmentId
- id of environment to get results from@NotNull public @NotNull List<DeploymentResult> getDeploymentResultsForEnvironmentWithoutVariables(long environmentId, int offset, int maxResults)
DeploymentResultService
getDeploymentResultsForEnvironmentWithoutVariables
in interface DeploymentResultService
environmentId
- id of environment to get results from@NotNull public @NotNull List<DeploymentResult> getSuccessfulDeploymentResultsForEnvironment(long environmentId, int offset, int maxResults)
DeploymentResultService
getSuccessfulDeploymentResultsForEnvironment
in interface DeploymentResultService
environmentId
- id of environment to get results from@NotNull public @NotNull List<DeploymentResult> getDeploymentResultsForDeploymentVersion(long deploymentVersionId)
DeploymentResultService
getDeploymentResultsForDeploymentVersion
in interface DeploymentResultService
deploymentVersionId
- id of deployment version to get results from@NotNull public @NotNull List<DeploymentResult> getDeploymentResultsForDeploymentVersionAndEnvironment(long deploymentVersionId, long environmentId)
DeploymentResultService
getDeploymentResultsForDeploymentVersionAndEnvironment
in interface DeploymentResultService
deploymentVersionId
- id of deployment versionenvironmentId
- id of environment@NotNull public @NotNull List<DeploymentResult> getDeploymentResultsForDeploymentVersionFinishedBefore(long deploymentVersionId, Date finishDate)
DeploymentResultService
getDeploymentResultsForDeploymentVersionFinishedBefore
in interface DeploymentResultService
deploymentVersionId
- id of deployment version to get results fromfinishDate
- only select results finished before this date@NotNull public @NotNull List<Long> getDeploymentResultIdsForDeploymentVersionFinishedBefore(long deploymentVersionId, @NotNull @NotNull Date finishDate)
DeploymentResultService
getDeploymentResultIdsForDeploymentVersionFinishedBefore
in interface DeploymentResultService
deploymentVersionId
- id of deployment version to get results fromfinishDate
- only select results finished before this datepublic int countDeploymentResultsForEnvironment(long environmentId)
DeploymentResultService
countDeploymentResultsForEnvironment
in interface DeploymentResultService
@NotNull public @NotNull List<DeploymentResult> getDeploymentResultsByLifeCycleState(Collection<LifeCycleState> lifeCycleStates)
getDeploymentResultsByLifeCycleState
in interface DeploymentResultService
public DeploymentVersion getRollbackVersion(long environmentId)
DeploymentResultService
getRollbackVersion
in interface DeploymentResultService
environmentId
- to find rollback version for.@Nullable public @Nullable DeploymentVersion getRollbackVersion(@NotNull @NotNull DeploymentResult deploymentResult)
DeploymentResultService
getRollbackVersion
in interface DeploymentResultService
deploymentResult
- deployment result that was deployed at some time on some environmentpublic void updateDeploymentState(long deploymentResultId, @NotNull @NotNull BuildState deploymentState, Map<String,String> customData)
DeploymentResultService
updateDeploymentState
in interface DeploymentResultService
deploymentResultId
- if of result to updatedeploymentState
- new value of the build state to savepublic void updateLifeCycleState(long deploymentResultId, @NotNull @NotNull LifeCycleState lifeCycleState)
DeploymentResultService
updateLifeCycleState
in interface DeploymentResultService
deploymentResultId
- id of DeploymentResultlifeCycleState
- lifecycle state to be setpublic void updateLifeCycleState(@NotNull @NotNull DeploymentTimingPoint timingPoint, @NotNull @NotNull LifeCycleState lifeCycleState)
DeploymentResultService
updateLifeCycleState
in interface DeploymentResultService
timingPoint
- deployment timing pointlifeCycleState
- lifecycle state to be setpublic void setExecutingAgent(long deploymentResultId, long agentId)
DeploymentResultService
setExecutingAgent
in interface DeploymentResultService
deploymentResultId
- id of the deployment resultagentId
- if of the agent@NotNull public @NotNull Set<Long> findEnvironmentIdsVersionWasDeployedOn(long deploymentVersionId)
findEnvironmentIdsVersionWasDeployedOn
in interface DeploymentResultService
public DeploymentResult getLastResultBefore(@NotNull @NotNull DeploymentResult deploymentResult)
getLastResultBefore
in interface DeploymentResultService
public DeploymentResult getLastResultInStatesBefore(@NotNull @NotNull DeploymentResult deploymentResult, @NotNull @NotNull EnumSet<BuildState> buildStates)
getLastResultInStatesBefore
in interface DeploymentResultService
public Map<Long,EnvironmentStatus> getLatestStatusForAllEnvironments(Map<Long,Environment> environmentsById, Map<Long,DeploymentProject> deploymentProjectsById)
getLatestStatusForAllEnvironments
in interface DeploymentResultService
environmentsById
- pass all visible environments. Any environments not passed will not have results returned. This
can technically be used to retrieve deployment results for a subset of environments but it's
only efficient for significant sets. By definition this should not contain any environments without visible projects.deploymentProjectsById
- All visible deployment projects.@NotNull public @NotNull Map<Long,EnvironmentStatusForDashboard> getLatestStatusForEnvironments(@NotNull @NotNull List<Long> environmentIds) throws AccessDeniedException
getLatestStatusForEnvironments
in interface DeploymentResultService
AccessDeniedException
- if user has no access to requested environment.@NotNull public @NotNull List<DeploymentResult> getResultsWhereDeploymentVersionIsDeployedNow(List<Long> environmentsId, long deploymentVersionId)
getResultsWhereDeploymentVersionIsDeployedNow
in interface DeploymentResultService
environmentsId
- list of environments to checkCopyright © 2022 Atlassian Software Systems Pty Ltd. All rights reserved.