Class DeploymentProjectDaoImpl
java.lang.Object
org.springframework.dao.support.DaoSupport
org.springframework.orm.hibernate5.support.HibernateDaoSupport
com.atlassian.bamboo.deployments.projects.persistence.DeploymentProjectDaoImpl
- All Implemented Interfaces:
DeploymentProjectDao,org.springframework.beans.factory.InitializingBean
public class DeploymentProjectDaoImpl
extends org.springframework.orm.hibernate5.support.HibernateDaoSupport
implements DeploymentProjectDao
-
Field Summary
Fields inherited from class org.springframework.dao.support.DaoSupport
logger -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlong@NotNull MutableDeploymentProject@NotNull MutableVersionNamingSchemevoiddelete(MutableDeploymentProjectItem deploymentProjectItem) Delete DeploymentProjectItemvoiddelete(MutableDeploymentProject deploymentProject) Delete DeploymentProject and related DeploymentProjectItemsvoiddelete(MutableVersionNamingScheme versionNamingScheme) Delete the version naming SchemebooleandoesArtifactProjectItemExist(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 artifactDefinitionId) findIdsOfDeploymentProjectsReferencingArtifact(long artifactId) findIdsOfDeploymentProjectsRelatedToArtifactDefinition(long artifactDefinitionId) @NotNull List<MutableDeploymentProject> @NotNull List<MutableDeploymentProject> getAllDeploymentProjects(int firstResult, int maxResults) @Nullable MutableDeploymentProjectItemgetArtifactProjectItem(long deploymentProjectId, long artifactId) Get DeploymentProjectItem by DB id of the DeploymentProject and ArtifactDefinitiongetDeploymentProject(long deploymentProjectId) Get DeploymentProject by DB id@Nullable MutableDeploymentProjectgetDeploymentProject(@NotNull DeploymentKey key) Get DeploymentProject by keyint@Nullable MutableDeploymentProjectgetDeploymentProjectForEnvironment(long environmentId) Get DeploymentProject associated with Environment@Nullable MutableDeploymentProjectgetDeploymentProjectForVersion(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 BambooEntityOidgetMaxDeploymentProjectOid(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 MutableVersionNamingSchemegetVersionNamingSchemeForProject(long deploymentProjectId) Get the version naming configuration for a specific projectbooleanisDeploymentProjectNameConflicting(@NotNull String name) Deployment Project Names need to be unique within the system.voidsave(@NotNull MutableDeploymentProject deploymentProject) Save DeploymentProjectvoidsave(MutableDeploymentProjectItem deploymentProjectItem) Save DeploymentProjectItemvoidsave(MutableVersionNamingScheme versionNamingScheme) Save the version naming SchemeMethods inherited from class org.springframework.orm.hibernate5.support.HibernateDaoSupport
checkDaoConfig, createHibernateTemplate, currentSession, getHibernateTemplate, getSessionFactory, setHibernateTemplate, setSessionFactoryMethods inherited from class org.springframework.dao.support.DaoSupport
afterPropertiesSet, initDao
-
Constructor Details
-
DeploymentProjectDaoImpl
public DeploymentProjectDaoImpl()
-
-
Method Details
-
countAllDeploymentProjects
public long countAllDeploymentProjects()- Specified by:
countAllDeploymentProjectsin interfaceDeploymentProjectDao- Returns:
- number of deployment projects in the system
-
getAllDeploymentProjects
- Specified by:
getAllDeploymentProjectsin interfaceDeploymentProjectDao- Returns:
- list of all DeploymentProjects
-
getAllDeploymentProjects
@NotNull public @NotNull List<MutableDeploymentProject> getAllDeploymentProjects(int firstResult, int maxResults) - Specified by:
getAllDeploymentProjectsin interfaceDeploymentProjectDao- Returns:
- paginated list of deployment projects,
firstResultstarts from 0
-
getDeploymentProjectsRelatedToPlan
@NotNull public @NotNull List<MutableDeploymentProject> getDeploymentProjectsRelatedToPlan(@NotNull @NotNull PlanKey planKey) Description copied from interface:DeploymentProjectDaoGet 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:
getDeploymentProjectsRelatedToPlanin interfaceDeploymentProjectDao- Parameters:
planKey- of the linked Plan
-
getDeploymentProjectsRelatedToPlans
@NotNull public @NotNull List<MutableDeploymentProject> getDeploymentProjectsRelatedToPlans(@NotNull @NotNull Set<PlanKey> planKeyFamily) Description copied from interface:DeploymentProjectDaoGet DeploymentProjects linked to Plan identified with any of plan keys.- Specified by:
getDeploymentProjectsRelatedToPlansin 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 artifactDefinitionId) - Specified by:
findDeploymentProjectsRelatedToArtifactin interfaceDeploymentProjectDao
-
findIdsOfDeploymentProjectsRelatedToArtifactDefinition
@NotNull public @NotNull List<Long> findIdsOfDeploymentProjectsRelatedToArtifactDefinition(long artifactDefinitionId) - Specified by:
findIdsOfDeploymentProjectsRelatedToArtifactDefinitionin interfaceDeploymentProjectDao- Returns:
- ids of the deployment projects related to an artifact
-
save
Description copied from interface:DeploymentProjectDaoSave DeploymentProject- Specified by:
savein interfaceDeploymentProjectDao
-
getDeploymentProject
Description copied from interface:DeploymentProjectDaoGet DeploymentProject by DB id- Specified by:
getDeploymentProjectin interfaceDeploymentProjectDao
-
getDeploymentProject
@Nullable public @Nullable MutableDeploymentProject getDeploymentProject(@NotNull @NotNull DeploymentKey key) Description copied from interface:DeploymentProjectDaoGet DeploymentProject by key- Specified by:
getDeploymentProjectin interfaceDeploymentProjectDao
-
getDeploymentProjectForEnvironment
@Nullable public @Nullable MutableDeploymentProject getDeploymentProjectForEnvironment(long environmentId) Description copied from interface:DeploymentProjectDaoGet DeploymentProject associated with Environment- Specified by:
getDeploymentProjectForEnvironmentin interfaceDeploymentProjectDao- Parameters:
environmentId- Environment id
-
getDeploymentProjectForVersion
Description copied from interface:DeploymentProjectDaoGet DeploymentProject associated with Version- Specified by:
getDeploymentProjectForVersionin interfaceDeploymentProjectDao- Parameters:
versionId- Version id
-
isDeploymentProjectNameConflicting
Description copied from interface:DeploymentProjectDaoDeployment Project Names need to be unique within the system. This method checks if a name is already being used- Specified by:
isDeploymentProjectNameConflictingin interfaceDeploymentProjectDao- Parameters:
name- to check- Returns:
- true if the name is already being used, otherwise false.
-
findDeploymentProjectByOid
- Specified by:
findDeploymentProjectByOidin interfaceDeploymentProjectDao
-
findDeploymentProjectByName
- Specified by:
findDeploymentProjectByNamein interfaceDeploymentProjectDao
-
getProjectItems
@NotNull public @NotNull List<MutableDeploymentProjectItem> getProjectItems(long deploymentProjectId) Description copied from interface:DeploymentProjectDaoGet list of DeploymentProject items- Specified by:
getProjectItemsin interfaceDeploymentProjectDao
-
getProjectItem
Description copied from interface:DeploymentProjectDaoGet DeploymentProjectItem by DB id- Specified by:
getProjectItemin interfaceDeploymentProjectDao
-
getArtifactProjectItem
@Nullable public @Nullable MutableDeploymentProjectItem getArtifactProjectItem(long deploymentProjectId, long artifactId) Description copied from interface:DeploymentProjectDaoGet DeploymentProjectItem by DB id of the DeploymentProject and ArtifactDefinition- Specified by:
getArtifactProjectItemin interfaceDeploymentProjectDao
-
doesArtifactProjectItemExist
public boolean doesArtifactProjectItemExist(long deploymentProjectId, long artifactId) Description copied from interface:DeploymentProjectDaoCheck for existence of DeploymentProjectItem by DB id of the DeploymentProject and ArtifactDefinition- Specified by:
doesArtifactProjectItemExistin interfaceDeploymentProjectDao
-
save
Description copied from interface:DeploymentProjectDaoSave DeploymentProjectItem- Specified by:
savein interfaceDeploymentProjectDao
-
delete
Description copied from interface:DeploymentProjectDaoDelete DeploymentProjectItem- Specified by:
deletein interfaceDeploymentProjectDao
-
delete
Description copied from interface:DeploymentProjectDaoDelete DeploymentProject and related DeploymentProjectItems- Specified by:
deletein interfaceDeploymentProjectDao
-
getVersionNamingSchemeForProject
@Nullable public @Nullable MutableVersionNamingScheme getVersionNamingSchemeForProject(long deploymentProjectId) Description copied from interface:DeploymentProjectDaoGet the version naming configuration for a specific project- Specified by:
getVersionNamingSchemeForProjectin interfaceDeploymentProjectDao- Parameters:
deploymentProjectId- of the project
-
save
Description copied from interface:DeploymentProjectDaoSave the version naming Scheme- Specified by:
savein interfaceDeploymentProjectDao- Parameters:
versionNamingScheme- to save
-
delete
Description copied from interface:DeploymentProjectDaoDelete the version naming Scheme- Specified by:
deletein interfaceDeploymentProjectDao- Parameters:
versionNamingScheme- to delete
-
getDeploymentProjectCount
public int getDeploymentProjectCount()- Specified by:
getDeploymentProjectCountin interfaceDeploymentProjectDao- Returns:
- number of all deployment projects
-
getDeploymentProjectsReferencingArtifact
Description copied from interface:DeploymentProjectDaoGet all deployment projects that contain a version that uses specified artifact- Specified by:
getDeploymentProjectsReferencingArtifactin interfaceDeploymentProjectDao- Parameters:
artifactId-- Returns:
-
findIdsOfDeploymentProjectsReferencingArtifact
- Specified by:
findIdsOfDeploymentProjectsReferencingArtifactin interfaceDeploymentProjectDao- Returns:
- ids of the deployment projects that reference an artifact
-
getMaxDeploymentProjectOid
- Specified by:
getMaxDeploymentProjectOidin interfaceDeploymentProjectDao
-
createNewDeploymentProjectInstance
- Specified by:
createNewDeploymentProjectInstancein interfaceDeploymentProjectDao
-
createNewVersionNamingSchemeInstance
- Specified by:
createNewVersionNamingSchemeInstancein interfaceDeploymentProjectDao
-
findDeploymentProjectsInOtherStates
@NotNull public @NotNull Collection<Long> findDeploymentProjectsInOtherStates(VcsLocationBambooSpecsState specsState) - Specified by:
findDeploymentProjectsInOtherStatesin interfaceDeploymentProjectDao
-
findSpecsStateIdsReferencedByDeployments
- Specified by:
findSpecsStateIdsReferencedByDeploymentsin interfaceDeploymentProjectDao
-
getPaginatedDeploymentsWithEnvironments
public List<Pair<MutableDeploymentProject,MutableEnvironment>> getPaginatedDeploymentsWithEnvironments(int start, int limit, String filter) Description copied from interface:DeploymentProjectDaoRetrieves paginated list of pairs of MutableDeploymentProject and MutableEnvironment ordered byInternalDeploymentProject.getName()andInternalEnvironment.getPosition()- Specified by:
getPaginatedDeploymentsWithEnvironmentsin interfaceDeploymentProjectDao- Parameters:
start-limit-filter-- 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:DeploymentProjectDaoRetrieves 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:
getPaginatedDeploymentsWithEnvironmentsOnlyIdsin interfaceDeploymentProjectDao- Parameters:
start-limit-filter-- Returns:
- list of pair (MutableDeploymentProject id, MutableEnvironment id)
-
findAllByIds
Description copied from interface:DeploymentProjectDaoReturns a list of Deployment Projects which id values are in the deploymentsIds collection- Specified by:
findAllByIdsin interfaceDeploymentProjectDao- Parameters:
ids- list of id values- Returns:
- list of Deployment Projects
-