public class DeploymentResultServiceImpl extends Object implements DeploymentResultService
Constructor and Description |
---|
DeploymentResultServiceImpl(DeploymentResultDao deploymentResultDao,
DeploymentVersionDao deploymentVersionDao,
EnvironmentDao environmentDao,
EnvironmentService environmentService,
VariableContextBaselineDao variableContextBaselineDao,
DeploymentsInProgressService deploymentsInProgressService,
TriggerManager triggerManager) |
Modifier and Type | Method and Description |
---|---|
int |
countDeploymentResultsForEnvironment(long environmentId)
Count deployment results for deployment.
|
DeploymentResult |
createDeploymentResult(long environmentId,
long deploymentVersionId,
VariableContext variableContext,
TriggerReason triggerReason) |
Set<Long> |
findEnvironmentIdsVersionWasDeployedOn(long deploymentVersionId) |
DeploymentResult |
getDeploymentResult(long deploymentResultId)
Retrieve a specific deployment result.
|
List<Long> |
getDeploymentResultIdsForDeploymentVersionFinishedBefore(long deploymentVersionId,
Date finishDate)
Get ids of all deployment results for deployment version finished before given date.
|
List<DeploymentResult> |
getDeploymentResultsByLifeCycleState(Collection<LifeCycleState> lifeCycleStates) |
List<DeploymentResult> |
getDeploymentResultsForDeploymentVersion(long deploymentVersionId)
Get all deployment results for deployment version.
|
List<DeploymentResult> |
getDeploymentResultsForDeploymentVersionAndEnvironment(long deploymentVersionId,
long environmentId)
Get all deployment results for deployment versions that ran against the specified environment.
|
List<DeploymentResult> |
getDeploymentResultsForDeploymentVersionFinishedBefore(long deploymentVersionId,
Date finishDate)
Get all deployment results for deployment version finished before given date.
|
List<DeploymentResult> |
getDeploymentResultsForEnvironment(long environmentId)
Get all deployment results for environment.
|
List<DeploymentResult> |
getDeploymentResultsForEnvironment(long environmentId,
int offset,
int maxResults)
Get deployment results for environment.
|
DeploymentResult |
getLastResultBefore(DeploymentResult deploymentResult) |
DeploymentResult |
getLastResultInStatesBefore(DeploymentResult deploymentResult,
EnumSet<BuildState> buildStates) |
DeploymentResult |
getLatestDeploymentResult(long environmentId,
long deploymentVersionId)
Retrieve a specific deployment result for an environment and version.
|
DeploymentResult |
getLatestDeploymentResultForEnvironment(long environmentId)
Get the latest result that ran against an environment
|
List<EnvironmentStatus> |
getLatestKnownDeploymentResultForEnvironments(Iterable<? extends Environment> environments)
Get the latest results that *actually* ran against a list of environments.
|
Map<Long,EnvironmentStatus> |
getLatestStatusForAllEnvironments(Map<Long,Environment> allVisibleEnvironmentsById,
Map<Long,DeploymentProject> allVisibleDeploymentProjectsById) |
List<DeploymentResult> |
getResultsWhereDeploymentVersionIsDeployedNow(List<Long> environmentsId,
long deploymentVersionId) |
DeploymentVersion |
getRollbackVersion(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.
|
List<DeploymentResult> |
getSuccessfulDeploymentResultsForEnvironment(long environmentId,
int offset,
int maxResults)
Get successful deployment results for environment.
|
void |
logSubstitutedVariables(long deploymentResultId,
Map<String,VariableSubstitutionContext> substitutions) |
void |
setExecutingAgent(long deploymentResultId,
long agentId)
Set the agent that the deployment is executing on.
|
void |
updateDeploymentState(long deploymentResultId,
BuildState deploymentState,
Map<String,String> customData)
Update the build state of the Deployment Result
|
void |
updateLifeCycleState(DeploymentTimingPoint timingPoint,
LifeCycleState lifeCycleState)
Update lifecycle state of the DeploymentResult
|
void |
updateLifeCycleState(long deploymentResultId,
LifeCycleState lifeCycleState)
Update lifecycle state of the DeploymentResult.
|
public DeploymentResultServiceImpl(DeploymentResultDao deploymentResultDao, DeploymentVersionDao deploymentVersionDao, EnvironmentDao environmentDao, EnvironmentService environmentService, @NotNull VariableContextBaselineDao variableContextBaselineDao, @NotNull DeploymentsInProgressService deploymentsInProgressService, @NotNull TriggerManager triggerManager)
public DeploymentResult createDeploymentResult(long environmentId, long deploymentVersionId, @NotNull VariableContext variableContext, @NotNull TriggerReason triggerReason)
createDeploymentResult
in interface DeploymentResultService
@Nullable public DeploymentResult getDeploymentResult(long deploymentResultId)
DeploymentResultService
getDeploymentResult
in interface DeploymentResultService
deploymentResultId
- of the result@Nullable public DeploymentResult getLatestDeploymentResult(long environmentId, long deploymentVersionId)
DeploymentResultService
getLatestDeploymentResult
in interface DeploymentResultService
environmentId
- of the environmentdeploymentVersionId
- of the version@Nullable public DeploymentResult getLatestDeploymentResultForEnvironment(long environmentId)
DeploymentResultService
getLatestDeploymentResultForEnvironment
in interface DeploymentResultService
environmentId
- id of the environment@NotNull public List<EnvironmentStatus> getLatestKnownDeploymentResultForEnvironments(Iterable<? extends Environment> environments)
DeploymentResultService
getLatestKnownDeploymentResultForEnvironments
in interface DeploymentResultService
environments
- we want to retrieve latest DeploymentResult@NotNull public List<DeploymentResult> getDeploymentResultsForEnvironment(long environmentId)
DeploymentResultService
getDeploymentResultsForEnvironment
in interface DeploymentResultService
environmentId
- id of environment to get results from@NotNull public List<DeploymentResult> getDeploymentResultsForEnvironment(long environmentId, int offset, int maxResults)
DeploymentResultService
getDeploymentResultsForEnvironment
in interface DeploymentResultService
environmentId
- id of environment to get results from@NotNull public List<DeploymentResult> getSuccessfulDeploymentResultsForEnvironment(long environmentId, int offset, int maxResults)
DeploymentResultService
getSuccessfulDeploymentResultsForEnvironment
in interface DeploymentResultService
environmentId
- id of environment to get results from@NotNull public List<DeploymentResult> getDeploymentResultsForDeploymentVersion(long deploymentVersionId)
DeploymentResultService
getDeploymentResultsForDeploymentVersion
in interface DeploymentResultService
deploymentVersionId
- id of deployment version to get results from@NotNull public List<DeploymentResult> getDeploymentResultsForDeploymentVersionAndEnvironment(long deploymentVersionId, long environmentId)
DeploymentResultService
getDeploymentResultsForDeploymentVersionAndEnvironment
in interface DeploymentResultService
deploymentVersionId
- id of deployment versionenvironmentId
- id of environment@NotNull public 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 List<Long> getDeploymentResultIdsForDeploymentVersionFinishedBefore(long deploymentVersionId, @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 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 DeploymentVersion getRollbackVersion(@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 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 LifeCycleState lifeCycleState)
DeploymentResultService
updateLifeCycleState
in interface DeploymentResultService
deploymentResultId
- id of DeploymentResultlifeCycleState
- lifecycle state to be setpublic void updateLifeCycleState(@NotNull DeploymentTimingPoint timingPoint, @NotNull LifeCycleState lifeCycleState)
DeploymentResultService
updateLifeCycleState
in interface DeploymentResultService
timingPoint
- deployment timing pointlifeCycleState
- lifecycle state to be setpublic void logSubstitutedVariables(long deploymentResultId, Map<String,VariableSubstitutionContext> substitutions)
logSubstitutedVariables
in interface DeploymentResultService
public void setExecutingAgent(long deploymentResultId, long agentId)
DeploymentResultService
setExecutingAgent
in interface DeploymentResultService
deploymentResultId
- id of the deployment resultagentId
- if of the agent@NotNull public Set<Long> findEnvironmentIdsVersionWasDeployedOn(long deploymentVersionId)
findEnvironmentIdsVersionWasDeployedOn
in interface DeploymentResultService
public DeploymentResult getLastResultBefore(@NotNull DeploymentResult deploymentResult)
getLastResultBefore
in interface DeploymentResultService
public DeploymentResult getLastResultInStatesBefore(@NotNull DeploymentResult deploymentResult, @NotNull EnumSet<BuildState> buildStates)
getLastResultInStatesBefore
in interface DeploymentResultService
public Map<Long,EnvironmentStatus> getLatestStatusForAllEnvironments(Map<Long,Environment> allVisibleEnvironmentsById, Map<Long,DeploymentProject> allVisibleDeploymentProjectsById)
getLatestStatusForAllEnvironments
in interface DeploymentResultService
allVisibleEnvironmentsById
- 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.allVisibleDeploymentProjectsById
- All visible deployment projects.public List<DeploymentResult> getResultsWhereDeploymentVersionIsDeployedNow(List<Long> environmentsId, long deploymentVersionId)
getResultsWhereDeploymentVersionIsDeployedNow
in interface DeploymentResultService
environmentsId
- list of environments to checkCopyright © 2017 Atlassian Software Systems Pty Ltd. All rights reserved.