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
-
-
Constructor Summary
Constructors Constructor Description DeploymentProjectDaoImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longcountAllDeploymentProjects()@NotNull MutableDeploymentProjectcreateNewDeploymentProjectInstance()@NotNull MutableVersionNamingSchemecreateNewVersionNamingSchemeInstance()voiddelete(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 ArtifactDefinitionList<MutableDeploymentProject>findAllByIds(@NotNull Collection<Long> ids)Returns a list of Deployment Projects which id values are in the deploymentsIds collection@Nullable MutableDeploymentProjectfindDeploymentProjectByName(String name)@Nullable MutableDeploymentProjectfindDeploymentProjectByOid(BambooEntityOid oid)@NotNull Collection<Long>findDeploymentProjectsInOtherStates(VcsLocationBambooSpecsState specsState)@NotNull List<MutableDeploymentProject>findDeploymentProjectsRelatedToArtifact(long artifactId)@NotNull Set<Long>findSpecsStateIdsReferencedByDeployments()@NotNull List<MutableDeploymentProject>getAllDeploymentProjects()@NotNull List<MutableDeploymentProject>getAllDeploymentProjects(int firstResult, int maxResults)@Nullable MutableDeploymentProjectItemgetArtifactProjectItem(long deploymentProjectId, long artifactId)Get DeploymentProjectItem by DB id of the DeploymentProject and ArtifactDefinitionMutableDeploymentProjectgetDeploymentProject(long deploymentProjectId)Get DeploymentProject by DB id@Nullable MutableDeploymentProjectgetDeploymentProject(@NotNull DeploymentKey key)Get DeploymentProject by keyintgetDeploymentProjectCount()@Nullable MutableDeploymentProjectgetDeploymentProjectForEnvironment(long environmentId)Get DeploymentProject associated with Environment@Nullable MutableDeploymentProjectgetDeploymentProjectForVersion(long versionId)Get DeploymentProject associated with VersionList<MutableDeploymentProject>getDeploymentProjectsReferencingArtifact(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)List<Pair<MutableDeploymentProject,MutableEnvironment>>getPaginatedDeploymentsWithEnvironments(int start, int limit, String filter)Retrieves paginated list of pairs of MutableDeploymentProject and MutableEnvironment ordered byInternalDeploymentProject.getName()andInternalEnvironment.getPosition()List<Pair<Long,Long>>getPaginatedDeploymentsWithEnvironmentsOnlyIds(int start, int limit, String filter)Retrieves paginated list of pairs of MutableDeploymentProject.id and MutableEnvironment.id ordered byInternalDeploymentProject.getName()andInternalEnvironment.getPosition().MutableDeploymentProjectItemgetProjectItem(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.voidremoveAbstractProjectItems()voidsave(@NotNull MutableDeploymentProject deploymentProject)Save DeploymentProjectvoidsave(MutableDeploymentProjectItem deploymentProjectItem)Save DeploymentProjectItemvoidsave(MutableVersionNamingScheme versionNamingScheme)Save the version naming Scheme-
Methods inherited from class com.atlassian.bamboo.persistence3.StatelessSessionHibernateDaoSupport
getCacheAwareHibernateTemplate
-
-
-
-
Method Detail
-
countAllDeploymentProjects
public long countAllDeploymentProjects()
- Specified by:
countAllDeploymentProjectsin interfaceDeploymentProjectDao- Returns:
- number of deployment projects in the system
-
getAllDeploymentProjects
@NotNull public @NotNull List<MutableDeploymentProject> 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 artifactId)
- Specified by:
findDeploymentProjectsRelatedToArtifactin interfaceDeploymentProjectDao
-
save
public void save(@NotNull @NotNull MutableDeploymentProject deploymentProject)Description copied from interface:DeploymentProjectDaoSave DeploymentProject- Specified by:
savein interfaceDeploymentProjectDao
-
getDeploymentProject
public MutableDeploymentProject getDeploymentProject(long deploymentProjectId)
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
@Nullable public @Nullable MutableDeploymentProject getDeploymentProjectForVersion(long versionId)
Description copied from interface:DeploymentProjectDaoGet DeploymentProject associated with Version- Specified by:
getDeploymentProjectForVersionin interfaceDeploymentProjectDao- Parameters:
versionId- Version id
-
isDeploymentProjectNameConflicting
public boolean isDeploymentProjectNameConflicting(@NotNull @NotNull String name)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
@Nullable public @Nullable MutableDeploymentProject findDeploymentProjectByOid(BambooEntityOid oid)
- Specified by:
findDeploymentProjectByOidin interfaceDeploymentProjectDao
-
findDeploymentProjectByName
@Nullable public @Nullable MutableDeploymentProject findDeploymentProjectByName(String name)
- 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
public MutableDeploymentProjectItem getProjectItem(long deploymentProjectItemId)
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
public void save(MutableDeploymentProjectItem deploymentProjectItem)
Description copied from interface:DeploymentProjectDaoSave DeploymentProjectItem- Specified by:
savein interfaceDeploymentProjectDao
-
delete
public void delete(MutableDeploymentProjectItem deploymentProjectItem)
Description copied from interface:DeploymentProjectDaoDelete DeploymentProjectItem- Specified by:
deletein interfaceDeploymentProjectDao
-
delete
public void delete(MutableDeploymentProject deploymentProject)
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
public void save(MutableVersionNamingScheme versionNamingScheme)
Description copied from interface:DeploymentProjectDaoSave the version naming Scheme- Specified by:
savein interfaceDeploymentProjectDao- Parameters:
versionNamingScheme- to save
-
delete
public void delete(MutableVersionNamingScheme versionNamingScheme)
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
public List<MutableDeploymentProject> getDeploymentProjectsReferencingArtifact(long artifactId)
Description copied from interface:DeploymentProjectDaoGet all deployment projects that contain a version that uses specified artifact- Specified by:
getDeploymentProjectsReferencingArtifactin interfaceDeploymentProjectDao- Returns:
-
getMaxDeploymentProjectOid
@NotNull public @NotNull BambooEntityOid getMaxDeploymentProjectOid(int serverKey)
- Specified by:
getMaxDeploymentProjectOidin interfaceDeploymentProjectDao
-
createNewDeploymentProjectInstance
@NotNull public @NotNull MutableDeploymentProject createNewDeploymentProjectInstance()
- Specified by:
createNewDeploymentProjectInstancein interfaceDeploymentProjectDao
-
createNewVersionNamingSchemeInstance
@NotNull public @NotNull MutableVersionNamingScheme createNewVersionNamingSchemeInstance()
- Specified by:
createNewVersionNamingSchemeInstancein interfaceDeploymentProjectDao
-
findDeploymentProjectsInOtherStates
@NotNull public @NotNull Collection<Long> findDeploymentProjectsInOtherStates(VcsLocationBambooSpecsState specsState)
- Specified by:
findDeploymentProjectsInOtherStatesin interfaceDeploymentProjectDao
-
findSpecsStateIdsReferencedByDeployments
@NotNull public @NotNull Set<Long> findSpecsStateIdsReferencedByDeployments()
- Specified by:
findSpecsStateIdsReferencedByDeploymentsin interfaceDeploymentProjectDao
-
removeAbstractProjectItems
public void removeAbstractProjectItems()
- Specified by:
removeAbstractProjectItemsin 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- 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- Returns:
- list of pair (MutableDeploymentProject id, MutableEnvironment id)
-
findAllByIds
public List<MutableDeploymentProject> findAllByIds(@NotNull @NotNull Collection<Long> ids)
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
-
-