Class DeploymentProjectDaoImpl
java.lang.Object
org.springframework.dao.support.DaoSupport
org.springframework.orm.hibernate5.support.HibernateDaoSupport
com.atlassian.bamboo.persistence3.StatelessSessionHibernateDaoSupport
com.atlassian.bamboo.deployments.projects.persistence.DeploymentProjectDaoImpl
- All Implemented Interfaces:
DeploymentProjectDao
,org.springframework.beans.factory.InitializingBean
public class DeploymentProjectDaoImpl
extends StatelessSessionHibernateDaoSupport
implements DeploymentProjectDao
-
Field Summary
Fields inherited from class org.springframework.dao.support.DaoSupport
logger
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionlong
@NotNull MutableDeploymentProject
@NotNull MutableVersionNamingScheme
void
delete
(MutableDeploymentProjectItem deploymentProjectItem) Delete DeploymentProjectItemvoid
delete
(MutableDeploymentProject deploymentProject) Delete DeploymentProject and related DeploymentProjectItemsvoid
delete
(MutableVersionNamingScheme versionNamingScheme) Delete the version naming Schemeboolean
doesArtifactProjectItemExist
(long deploymentProjectId, long artifactId) Check for existence of DeploymentProjectItem by DB id of the DeploymentProject and ArtifactDefinitionfindAllByIds
(@NotNull Collection<Long> ids) Returns a list of Deployment Projects which id values are in the deploymentsIds collection@Nullable MutableDeploymentProject
@Nullable MutableDeploymentProject
@NotNull Collection<Long>
@NotNull List<MutableDeploymentProject>
findDeploymentProjectsRelatedToArtifact
(long artifactId) @NotNull List<MutableDeploymentProject>
@NotNull List<MutableDeploymentProject>
getAllDeploymentProjects
(int firstResult, int maxResults) @Nullable MutableDeploymentProjectItem
getArtifactProjectItem
(long deploymentProjectId, long artifactId) Get DeploymentProjectItem by DB id of the DeploymentProject and ArtifactDefinitiongetDeploymentProject
(long deploymentProjectId) Get DeploymentProject by DB id@Nullable MutableDeploymentProject
getDeploymentProject
(@NotNull DeploymentKey key) Get DeploymentProject by keyint
@Nullable MutableDeploymentProject
getDeploymentProjectForEnvironment
(long environmentId) Get DeploymentProject associated with Environment@Nullable MutableDeploymentProject
getDeploymentProjectForVersion
(long versionId) Get DeploymentProject associated with VersiongetDeploymentProjectsReferencingArtifact
(long artifactId) Get all deployment projects that contain a version that uses specified artifact@NotNull List<MutableDeploymentProject>
getDeploymentProjectsRelatedToPlan
(@NotNull PlanKey planKey) Get DeploymentProjects linked to Plan with planKey.@NotNull List<MutableDeploymentProject>
getDeploymentProjectsRelatedToPlans
(@NotNull Set<PlanKey> planKeyFamily) Get DeploymentProjects linked to Plan identified with any of plan keys.@NotNull BambooEntityOid
getMaxDeploymentProjectOid
(int serverKey) getPaginatedDeploymentsWithEnvironments
(int start, int limit, String filter) Retrieves paginated list of pairs of MutableDeploymentProject and MutableEnvironment ordered byInternalDeploymentProject.getName()
andInternalEnvironment.getPosition()
getPaginatedDeploymentsWithEnvironmentsOnlyIds
(int start, int limit, String filter) Retrieves paginated list of pairs of MutableDeploymentProject.id and MutableEnvironment.id ordered byInternalDeploymentProject.getName()
andInternalEnvironment.getPosition()
.getProjectItem
(long deploymentProjectItemId) Get DeploymentProjectItem by DB id@NotNull List<MutableDeploymentProjectItem>
getProjectItems
(long deploymentProjectId) Get list of DeploymentProject items@Nullable MutableVersionNamingScheme
getVersionNamingSchemeForProject
(long deploymentProjectId) Get the version naming configuration for a specific projectboolean
isDeploymentProjectNameConflicting
(@NotNull String name) Deployment Project Names need to be unique within the system.void
void
save
(@NotNull MutableDeploymentProject deploymentProject) Save DeploymentProjectvoid
save
(MutableDeploymentProjectItem deploymentProjectItem) Save DeploymentProjectItemvoid
save
(MutableVersionNamingScheme versionNamingScheme) Save the version naming SchemeMethods inherited from class com.atlassian.bamboo.persistence3.StatelessSessionHibernateDaoSupport
getCacheAwareHibernateTemplate
Methods inherited from class org.springframework.orm.hibernate5.support.HibernateDaoSupport
checkDaoConfig, createHibernateTemplate, currentSession, getHibernateTemplate, getSessionFactory, setHibernateTemplate, setSessionFactory
Methods inherited from class org.springframework.dao.support.DaoSupport
afterPropertiesSet, initDao
-
Constructor Details
-
DeploymentProjectDaoImpl
public DeploymentProjectDaoImpl()
-
-
Method Details
-
countAllDeploymentProjects
public long countAllDeploymentProjects()- Specified by:
countAllDeploymentProjects
in interfaceDeploymentProjectDao
- Returns:
- number of deployment projects in the system
-
getAllDeploymentProjects
- Specified by:
getAllDeploymentProjects
in interfaceDeploymentProjectDao
- Returns:
- list of all DeploymentProjects
-
getAllDeploymentProjects
@NotNull public @NotNull List<MutableDeploymentProject> getAllDeploymentProjects(int firstResult, int maxResults) - Specified by:
getAllDeploymentProjects
in interfaceDeploymentProjectDao
- Returns:
- paginated list of deployment projects,
firstResult
starts from 0
-
getDeploymentProjectsRelatedToPlan
@NotNull public @NotNull List<MutableDeploymentProject> getDeploymentProjectsRelatedToPlan(@NotNull @NotNull PlanKey planKey) Description copied from interface:DeploymentProjectDao
Get DeploymentProjects linked to Plan with planKey. This method will not perform any master-branch matching, returned DeploymentProjects will be linked to exact planKey regardless if it identifies master plan or branch.- Specified by:
getDeploymentProjectsRelatedToPlan
in interfaceDeploymentProjectDao
- Parameters:
planKey
- of the linked Plan
-
getDeploymentProjectsRelatedToPlans
@NotNull public @NotNull List<MutableDeploymentProject> getDeploymentProjectsRelatedToPlans(@NotNull @NotNull Set<PlanKey> planKeyFamily) Description copied from interface:DeploymentProjectDao
Get DeploymentProjects linked to Plan identified with any of plan keys.- Specified by:
getDeploymentProjectsRelatedToPlans
in interfaceDeploymentProjectDao
- Parameters:
planKeyFamily
- set of plan keys, usually it is set of all branch keys + master plan key
-
findDeploymentProjectsRelatedToArtifact
@NotNull public @NotNull List<MutableDeploymentProject> findDeploymentProjectsRelatedToArtifact(long artifactId) - Specified by:
findDeploymentProjectsRelatedToArtifact
in interfaceDeploymentProjectDao
-
save
Description copied from interface:DeploymentProjectDao
Save DeploymentProject- Specified by:
save
in interfaceDeploymentProjectDao
-
getDeploymentProject
Description copied from interface:DeploymentProjectDao
Get DeploymentProject by DB id- Specified by:
getDeploymentProject
in interfaceDeploymentProjectDao
-
getDeploymentProject
@Nullable public @Nullable MutableDeploymentProject getDeploymentProject(@NotNull @NotNull DeploymentKey key) Description copied from interface:DeploymentProjectDao
Get DeploymentProject by key- Specified by:
getDeploymentProject
in interfaceDeploymentProjectDao
-
getDeploymentProjectForEnvironment
@Nullable public @Nullable MutableDeploymentProject getDeploymentProjectForEnvironment(long environmentId) Description copied from interface:DeploymentProjectDao
Get DeploymentProject associated with Environment- Specified by:
getDeploymentProjectForEnvironment
in interfaceDeploymentProjectDao
- Parameters:
environmentId
- Environment id
-
getDeploymentProjectForVersion
Description copied from interface:DeploymentProjectDao
Get DeploymentProject associated with Version- Specified by:
getDeploymentProjectForVersion
in interfaceDeploymentProjectDao
- Parameters:
versionId
- Version id
-
isDeploymentProjectNameConflicting
Description copied from interface:DeploymentProjectDao
Deployment Project Names need to be unique within the system. This method checks if a name is already being used- Specified by:
isDeploymentProjectNameConflicting
in interfaceDeploymentProjectDao
- Parameters:
name
- to check- Returns:
- true if the name is already being used, otherwise false.
-
findDeploymentProjectByOid
- Specified by:
findDeploymentProjectByOid
in interfaceDeploymentProjectDao
-
findDeploymentProjectByName
- Specified by:
findDeploymentProjectByName
in interfaceDeploymentProjectDao
-
getProjectItems
@NotNull public @NotNull List<MutableDeploymentProjectItem> getProjectItems(long deploymentProjectId) Description copied from interface:DeploymentProjectDao
Get list of DeploymentProject items- Specified by:
getProjectItems
in interfaceDeploymentProjectDao
-
getProjectItem
Description copied from interface:DeploymentProjectDao
Get DeploymentProjectItem by DB id- Specified by:
getProjectItem
in interfaceDeploymentProjectDao
-
getArtifactProjectItem
@Nullable public @Nullable MutableDeploymentProjectItem getArtifactProjectItem(long deploymentProjectId, long artifactId) Description copied from interface:DeploymentProjectDao
Get DeploymentProjectItem by DB id of the DeploymentProject and ArtifactDefinition- Specified by:
getArtifactProjectItem
in interfaceDeploymentProjectDao
-
doesArtifactProjectItemExist
public boolean doesArtifactProjectItemExist(long deploymentProjectId, long artifactId) Description copied from interface:DeploymentProjectDao
Check for existence of DeploymentProjectItem by DB id of the DeploymentProject and ArtifactDefinition- Specified by:
doesArtifactProjectItemExist
in interfaceDeploymentProjectDao
-
save
Description copied from interface:DeploymentProjectDao
Save DeploymentProjectItem- Specified by:
save
in interfaceDeploymentProjectDao
-
delete
Description copied from interface:DeploymentProjectDao
Delete DeploymentProjectItem- Specified by:
delete
in interfaceDeploymentProjectDao
-
delete
Description copied from interface:DeploymentProjectDao
Delete DeploymentProject and related DeploymentProjectItems- Specified by:
delete
in interfaceDeploymentProjectDao
-
getVersionNamingSchemeForProject
@Nullable public @Nullable MutableVersionNamingScheme getVersionNamingSchemeForProject(long deploymentProjectId) Description copied from interface:DeploymentProjectDao
Get the version naming configuration for a specific project- Specified by:
getVersionNamingSchemeForProject
in interfaceDeploymentProjectDao
- Parameters:
deploymentProjectId
- of the project
-
save
Description copied from interface:DeploymentProjectDao
Save the version naming Scheme- Specified by:
save
in interfaceDeploymentProjectDao
- Parameters:
versionNamingScheme
- to save
-
delete
Description copied from interface:DeploymentProjectDao
Delete the version naming Scheme- Specified by:
delete
in interfaceDeploymentProjectDao
- Parameters:
versionNamingScheme
- to delete
-
getDeploymentProjectCount
public int getDeploymentProjectCount()- Specified by:
getDeploymentProjectCount
in interfaceDeploymentProjectDao
- Returns:
- number of all deployment projects
-
getDeploymentProjectsReferencingArtifact
Description copied from interface:DeploymentProjectDao
Get all deployment projects that contain a version that uses specified artifact- Specified by:
getDeploymentProjectsReferencingArtifact
in interfaceDeploymentProjectDao
- Returns:
-
getMaxDeploymentProjectOid
- Specified by:
getMaxDeploymentProjectOid
in interfaceDeploymentProjectDao
-
createNewDeploymentProjectInstance
- Specified by:
createNewDeploymentProjectInstance
in interfaceDeploymentProjectDao
-
createNewVersionNamingSchemeInstance
- Specified by:
createNewVersionNamingSchemeInstance
in interfaceDeploymentProjectDao
-
findDeploymentProjectsInOtherStates
@NotNull public @NotNull Collection<Long> findDeploymentProjectsInOtherStates(VcsLocationBambooSpecsState specsState) - Specified by:
findDeploymentProjectsInOtherStates
in interfaceDeploymentProjectDao
-
findSpecsStateIdsReferencedByDeployments
- Specified by:
findSpecsStateIdsReferencedByDeployments
in interfaceDeploymentProjectDao
-
removeAbstractProjectItems
public void removeAbstractProjectItems()- Specified by:
removeAbstractProjectItems
in interfaceDeploymentProjectDao
-
getPaginatedDeploymentsWithEnvironments
public List<Pair<MutableDeploymentProject,MutableEnvironment>> getPaginatedDeploymentsWithEnvironments(int start, int limit, String filter) Description copied from interface:DeploymentProjectDao
Retrieves paginated list of pairs of MutableDeploymentProject and MutableEnvironment ordered byInternalDeploymentProject.getName()
andInternalEnvironment.getPosition()
- Specified by:
getPaginatedDeploymentsWithEnvironments
in interfaceDeploymentProjectDao
- Returns:
- list of pair MutableDeploymentProject with zero of one MutableEnvironment
-
getPaginatedDeploymentsWithEnvironmentsOnlyIds
public List<Pair<Long,Long>> getPaginatedDeploymentsWithEnvironmentsOnlyIds(int start, int limit, String filter) Description copied from interface:DeploymentProjectDao
Retrieves paginated list of pairs of MutableDeploymentProject.id and MutableEnvironment.id ordered byInternalDeploymentProject.getName()
andInternalEnvironment.getPosition()
. If DeploymentProject has 0 Environments then there will be one pair with DeploymentProject id and second value as a null.- Specified by:
getPaginatedDeploymentsWithEnvironmentsOnlyIds
in interfaceDeploymentProjectDao
- Returns:
- list of pair (MutableDeploymentProject id, MutableEnvironment id)
-
findAllByIds
Description copied from interface:DeploymentProjectDao
Returns a list of Deployment Projects which id values are in the deploymentsIds collection- Specified by:
findAllByIds
in interfaceDeploymentProjectDao
- Parameters:
ids
- list of id values- Returns:
- list of Deployment Projects
-