public class DeploymentResultDaoImpl extends StatelessSessionHibernateDaoSupport implements DeploymentResultDao
Constructor and Description |
---|
DeploymentResultDaoImpl(TransactionAndHibernateTemplate transactionTemplate) |
Modifier and Type | Method and Description |
---|---|
int |
countDeploymentResultsForEnvironment(long environmentId)
Count deployment results for deployment.
|
int |
delete(DeploymentResultDeletionAdapter deletionAdapter)
Delete
- DEPLOYMENT_RESULT_CUSTOMDATA (manual, JDBC)
- DEPLOYMENT_RESULT (manual, JDBC)
|
int |
delete(EnvironmentDeletionAdapter environmentDeletionAdapter)
Delete
- DEPLOYMENT_RESULT_CUSTOMDATA (manual, JDBC)
- DEPLOYMENT_RESULT (manual, JDBC)
|
void |
delete(MutableDeploymentResult deploymentResult)
Delete Deployment Result.
|
Set<Long> |
findEnvironmentIdsVersionWasDeployedOn(long deploymentVersionId) |
MutableDeploymentResult |
getDeploymentResult(long deploymentResultId)
Get DeploymentResult by id
|
List<Long> |
getDeploymentResultIdsForDeploymentVersionFinishedBefore(long deploymentVersionId,
Date finishDate)
Get a list of result ids for a DeploymentVersion.
|
List<MutableDeploymentResult> |
getDeploymentResults(long environmentId,
long deploymentVersionId)
Retrieve all deployment results that exist for an environment and version.
|
List<MutableDeploymentResult> |
getDeploymentResultsByLifeCycleState(Collection<LifeCycleState> lifeCycleStates) |
List<MutableDeploymentResult> |
getDeploymentResultsForDeploymentVersion(long deploymentVersionId)
Get a list of DeploymentResults for a DeploymentVersion.
|
List<MutableDeploymentResult> |
getDeploymentResultsForDeploymentVersionFinishedBefore(long deploymentVersionId,
Date finishedDate)
Get a list of DeploymentResults for a DeploymentVersion.
|
List<MutableDeploymentResult> |
getDeploymentResultsForEnvironment(long environmentId)
Get a list of DeploymentResults for a Environment
WARNING: This method will fetch all results, potentially creating performance problem.
|
List<MutableDeploymentResult> |
getDeploymentResultsForEnvironment(long environmentId,
int offset,
int maxResults)
Get a list of DeploymentResults for a Environment
|
MutableDeploymentResult |
getLastResultBefore(DeploymentResult deploymentResult) |
MutableDeploymentResult |
getLastResultInStatesBefore(DeploymentResult deploymentResult,
EnumSet<BuildState> buildStates) |
MutableDeploymentResult |
getLatestDeploymentResult(long environmentId,
long deploymentVersionId)
Retrieve the latest deployment result that exists for a version on an environment.
|
MutableDeploymentResult |
getLatestDeploymentResultForEnvironment(long environmentId)
Get the latest result that ran against an environment
|
Collection<DeploymentResultDto> |
getLatestDeploymentResultsForAllEnvironments()
Retrieve the latest deployment result for every deployment environment.
|
List<MutableDeploymentResult> |
getLatestDeploymentResultsForEnvironment(long environmentId,
int startIndex,
int maxResults)
Get the latest deployment results for an Environment, limited to requested amount starting from requested start index.
|
MutableDeploymentResult |
getLatestKnownDeploymentResultForEnvironment(long environmentId)
Get the latest result that *actually* ran against an environments.
|
MutableDeploymentResult |
getRollbackDeploymentResultBeforeStartedDate(DeploymentResult deploymentResult)
Find the result successfully deployed on same environment before given deployment result coming from different deployment version
|
MutableDeploymentResult |
getRollbackDeploymentResultForEnvironment(long environmentId,
long latestVersionId)
Find the result that you are trying to replicate by doing a rollback.
|
List<MutableDeploymentResult> |
getSuccessfulDeploymentResultsForEnvironment(long environmentId,
int offset,
int maxResults)
Get a list of DeploymentResults successfully deployed to an Environment
|
long |
iterateResultsForExport(Consumer<MutableDeploymentResult> consumer)
Iterate through and execute function for each of MutableDeploymentResult
|
void |
save(MutableDeploymentResult deploymentResult)
Save DeploymentResult
|
int |
unlinkFromVersion(DeploymentVersionDeletionAdapter deletionAdapter)
Unlink DeploymentResults records limited by
DeletionSQLAdapter.getInClause() from deployment version. |
void |
updateVersionName(long deploymentVersionId,
String newVersionName)
Updates version name in all results related to a vesion
|
getCacheAwareHibernateTemplate
public DeploymentResultDaoImpl(TransactionAndHibernateTemplate transactionTemplate)
@Nullable public MutableDeploymentResult getDeploymentResult(long deploymentResultId)
DeploymentResultDao
getDeploymentResult
in interface DeploymentResultDao
@NotNull public List<MutableDeploymentResult> getDeploymentResultsByLifeCycleState(Collection<LifeCycleState> lifeCycleStates)
getDeploymentResultsByLifeCycleState
in interface DeploymentResultDao
public void save(MutableDeploymentResult deploymentResult)
DeploymentResultDao
save
in interface DeploymentResultDao
@NotNull public List<MutableDeploymentResult> getDeploymentResultsForEnvironment(long environmentId)
DeploymentResultDao
getDeploymentResultsForEnvironment
in interface DeploymentResultDao
environmentId
- id of Environment@NotNull public List<MutableDeploymentResult> getDeploymentResultsForEnvironment(long environmentId, int offset, int maxResults)
DeploymentResultDao
getDeploymentResultsForEnvironment
in interface DeploymentResultDao
environmentId
- id of Environment@NotNull public List<MutableDeploymentResult> getSuccessfulDeploymentResultsForEnvironment(long environmentId, int offset, int maxResults)
DeploymentResultDao
getSuccessfulDeploymentResultsForEnvironment
in interface DeploymentResultDao
environmentId
- id of Environmentpublic int countDeploymentResultsForEnvironment(long environmentId)
DeploymentResultDao
countDeploymentResultsForEnvironment
in interface DeploymentResultDao
@NotNull public List<MutableDeploymentResult> getLatestDeploymentResultsForEnvironment(long environmentId, int startIndex, int maxResults)
DeploymentResultDao
getLatestDeploymentResultsForEnvironment
in interface DeploymentResultDao
environmentId
- of the environmentstartIndex
- the index to which start. Latest deployment is at index 0; (ignored if below zero)maxResults
- how many results to retrieve, (ignored if equal to or below zero)@NotNull public List<MutableDeploymentResult> getDeploymentResultsForDeploymentVersion(long deploymentVersionId)
DeploymentResultDao
getDeploymentResultsForDeploymentVersion
in interface DeploymentResultDao
deploymentVersionId
- id of DeploymentVersion@NotNull public List<MutableDeploymentResult> getDeploymentResultsForDeploymentVersionFinishedBefore(long deploymentVersionId, Date finishedDate)
DeploymentResultDao
getDeploymentResultsForDeploymentVersionFinishedBefore
in interface DeploymentResultDao
deploymentVersionId
- id of DeploymentVersionfinishedDate
- only select results finished before this date@NotNull public List<Long> getDeploymentResultIdsForDeploymentVersionFinishedBefore(long deploymentVersionId, @NotNull Date finishDate)
DeploymentResultDao
DeploymentResultDao.getDeploymentResultIdsForDeploymentVersionFinishedBefore(long, Date)
instead.getDeploymentResultIdsForDeploymentVersionFinishedBefore
in interface DeploymentResultDao
deploymentVersionId
- id of DeploymentVersionfinishDate
- only select results finished before this date@NotNull public List<MutableDeploymentResult> getDeploymentResults(long environmentId, long deploymentVersionId)
DeploymentResultDao
getDeploymentResults
in interface DeploymentResultDao
environmentId
- of the environmentdeploymentVersionId
- of the version@Nullable public MutableDeploymentResult getLatestDeploymentResult(long environmentId, long deploymentVersionId)
DeploymentResultDao
getLatestDeploymentResult
in interface DeploymentResultDao
environmentId
- of the environmentdeploymentVersionId
- of the version@Nullable public MutableDeploymentResult getLatestDeploymentResultForEnvironment(long environmentId)
DeploymentResultDao
getLatestDeploymentResultForEnvironment
in interface DeploymentResultDao
environmentId
- id of the environment@Nullable public MutableDeploymentResult getLatestKnownDeploymentResultForEnvironment(long environmentId)
DeploymentResultDao
getLatestKnownDeploymentResultForEnvironment
in interface DeploymentResultDao
environmentId
- id of the environment@Nullable public MutableDeploymentResult getRollbackDeploymentResultForEnvironment(long environmentId, long latestVersionId)
DeploymentResultDao
getRollbackDeploymentResultForEnvironment
in interface DeploymentResultDao
environmentId
- if the environment to find rollback forlatestVersionId
- id of the version currently on the environment@Nullable public MutableDeploymentResult getRollbackDeploymentResultBeforeStartedDate(@NotNull DeploymentResult deploymentResult)
DeploymentResultDao
getRollbackDeploymentResultBeforeStartedDate
in interface DeploymentResultDao
public void delete(MutableDeploymentResult deploymentResult)
DeploymentResultDao
delete
in interface DeploymentResultDao
deploymentResult
- to be deletedpublic int delete(@NotNull DeploymentResultDeletionAdapter deletionAdapter)
delete
in interface DeploymentResultDao
deletionAdapter
- DeletionSQLAdapter.getInClause()
should provide range of DeploymentResultspublic int delete(@NotNull EnvironmentDeletionAdapter environmentDeletionAdapter)
delete
in interface DeploymentResultDao
environmentDeletionAdapter
- EnvironmentDeletionAdapter
should provide range of DeploymentResultspublic int unlinkFromVersion(@NotNull DeploymentVersionDeletionAdapter deletionAdapter)
DeploymentResultDao
DeletionSQLAdapter.getInClause()
from deployment version.
Unlinking is performed using UPDATE queriesunlinkFromVersion
in interface DeploymentResultDao
deletionAdapter
- DeletionSQLAdapter.getInClause()
should provide range of DeploymentVersions to unlink frompublic long iterateResultsForExport(@NotNull Consumer<MutableDeploymentResult> consumer)
DeploymentResultDao
iterateResultsForExport
in interface DeploymentResultDao
consumer
- consumer to accept each of the MutableDeploymentResult@NotNull public Set<Long> findEnvironmentIdsVersionWasDeployedOn(long deploymentVersionId)
findEnvironmentIdsVersionWasDeployedOn
in interface DeploymentResultDao
@Nullable public MutableDeploymentResult getLastResultBefore(@NotNull DeploymentResult deploymentResult)
getLastResultBefore
in interface DeploymentResultDao
@Nullable public MutableDeploymentResult getLastResultInStatesBefore(@NotNull DeploymentResult deploymentResult, @NotNull EnumSet<BuildState> buildStates)
getLastResultInStatesBefore
in interface DeploymentResultDao
public void updateVersionName(long deploymentVersionId, @NotNull String newVersionName)
DeploymentResultDao
updateVersionName
in interface DeploymentResultDao
public Collection<DeploymentResultDto> getLatestDeploymentResultsForAllEnvironments()
DeploymentResultDao
getLatestDeploymentResultsForAllEnvironments
in interface DeploymentResultDao
Copyright © 2017 Atlassian Software Systems Pty Ltd. All rights reserved.