com.atlassian.bamboo.deployments.results.service
Interface DeploymentResultService

All Known Implementing Classes:
DeploymentResultServiceImpl

public interface DeploymentResultService


Method Summary
 DeploymentResult createDeploymentResult(long environmentId, long deploymentVersionId, VariableContext variableContext, TriggerReason triggerReason)
           
 java.util.Set<java.lang.Long> findEnvironmentIdsVersionWasDeployedOn(long deploymentVersionId)
           
 DeploymentResult getDeploymentResult(long deploymentResultId)
          Retrieve a specific deployment result.
 java.util.List<DeploymentResult> getDeploymentResultsForEnvironment(long environmentId)
          Get all deployment results for deployment.
 DeploymentResult getLastResultBefore(DeploymentResult deploymentResult)
           
 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
 java.util.List<EnvironmentStatus> getLatestKnownDeploymentResultForEnvironments(java.lang.Iterable<? extends Environment> environments)
          Get the latest results that *actually* ran against a list of environments.
 DeploymentVersion getRollbackVersion(long environmentId)
          For a given environment find the version that existed on the environment prior to the last deployment.
 void logSubstitutedVariables(long deploymentResultId, java.util.Map<java.lang.String,VariableSubstitutionContext> substitutions)
          Adds variable substitution result to DeploymentResult This method logs substitution after it was performed and will use only REALLY substituted values
 void setExecutingAgent(long deploymentResultId, long agentId)
          Set the agent that the deployment is executing on.
 void updateDeploymentState(long deploymentResultId, BuildState buildState, java.util.Map<java.lang.String,java.lang.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.
 

Method Detail

createDeploymentResult

DeploymentResult createDeploymentResult(long environmentId,
                                        long deploymentVersionId,
                                        @NotNull
                                        VariableContext variableContext,
                                        @NotNull
                                        TriggerReason triggerReason)

getDeploymentResult

@Nullable
DeploymentResult getDeploymentResult(long deploymentResultId)
Retrieve a specific deployment result.

Parameters:
deploymentResultId - of the result
Returns:
deployment result with given id

getLatestDeploymentResult

@Nullable
DeploymentResult getLatestDeploymentResult(long environmentId,
                                                    long deploymentVersionId)
Retrieve a specific deployment result for an environment and version. There should only be one result per environment/version combination. Entirely possible it has not executed yet so will return null;

Parameters:
environmentId - of the environment
deploymentVersionId - of the version
Returns:
deployment result for a version against an environment.

getDeploymentResultsForEnvironment

@NotNull
java.util.List<DeploymentResult> getDeploymentResultsForEnvironment(long environmentId)
Get all deployment results for deployment. Sorted by started date, newest first. todo pagination

Parameters:
environmentId - id of environment to get results fro.
Returns:
List of deployment results

getLatestDeploymentResultForEnvironment

@Nullable
DeploymentResult getLatestDeploymentResultForEnvironment(long environmentId)
Get the latest result that ran against an environment

Parameters:
environmentId - id of the environment
Returns:
the latest result. Null if not run

getLatestKnownDeploymentResultForEnvironments

@NotNull
java.util.List<EnvironmentStatus> getLatestKnownDeploymentResultForEnvironments(java.lang.Iterable<? extends Environment> environments)
Get the latest results that *actually* ran against a list of environments. Any NOT_BUILT results are skipped, so you can see the state of that particular environment. Wraps the return into EnvironmentStatus'

Parameters:
environments - we want to retrieve latest DeploymentResult
Returns:
the List of EnvironmentStatus that contain latest results.

updateLifeCycleState

void updateLifeCycleState(long deploymentResultId,
                          @NotNull
                          LifeCycleState lifeCycleState)
Update lifecycle state of the DeploymentResult. This method expects only PENDING and NOT_BUILD lifeCycleState.

Parameters:
deploymentResultId - id of DeploymentResult
lifeCycleState - lifecycle state to be set

updateLifeCycleState

void updateLifeCycleState(@NotNull
                          DeploymentTimingPoint timingPoint,
                          @NotNull
                          LifeCycleState lifeCycleState)
Update lifecycle state of the DeploymentResult

Parameters:
timingPoint - deployment timing point
lifeCycleState - lifecycle state to be set

setExecutingAgent

void setExecutingAgent(long deploymentResultId,
                       long agentId)
Set the agent that the deployment is executing on.

Parameters:
deploymentResultId - id of the deployment result
agentId - if of the agent

updateDeploymentState

void updateDeploymentState(long deploymentResultId,
                           @NotNull
                           BuildState buildState,
                           java.util.Map<java.lang.String,java.lang.String> customData)
Update the build state of the Deployment Result

Parameters:
deploymentResultId - if of result to update
buildState - new value of the build state to save
customData -

logSubstitutedVariables

void logSubstitutedVariables(long deploymentResultId,
                             java.util.Map<java.lang.String,VariableSubstitutionContext> substitutions)
Adds variable substitution result to DeploymentResult This method logs substitution after it was performed and will use only REALLY substituted values


getRollbackVersion

@Nullable
DeploymentVersion getRollbackVersion(long environmentId)
For a given environment find the version that existed on the environment prior to the last deployment. This is the version that you would "Roll back" to in the case of problems.

Parameters:
environmentId - to find rollback version for.
Returns:
the version that is considered the rollback version for this environment

findEnvironmentIdsVersionWasDeployedOn

@NotNull
java.util.Set<java.lang.Long> findEnvironmentIdsVersionWasDeployedOn(long deploymentVersionId)
Parameters:
deploymentVersionId -
Returns:
ids of all environments a version was ever deployed on

getLastResultBefore

@Nullable
DeploymentResult getLastResultBefore(@NotNull
                                              DeploymentResult deploymentResult)
Returns:
result of the last deployment performed on an environment before given result


Copyright © 2013 Atlassian Software Systems Pty Ltd. All Rights Reserved.