Class ElasticImageConfigurationHibernateDao
- java.lang.Object
-
- org.springframework.dao.support.DaoSupport
-
- org.springframework.orm.hibernate5.support.HibernateDaoSupport
-
- com.atlassian.bamboo.persistence.BambooHibernateObjectDao
-
- com.atlassian.bamboo.agent.elastic.server.ElasticImageConfigurationHibernateDao
-
- All Implemented Interfaces:
bucket.core.persistence.ObjectDao
,ElasticImageConfigurationDao
,BambooObjectDao
,org.springframework.beans.factory.InitializingBean
public class ElasticImageConfigurationHibernateDao extends BambooHibernateObjectDao implements ElasticImageConfigurationDao
-
-
Constructor Summary
Constructors Constructor Description ElasticImageConfigurationHibernateDao()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ElasticImageConfiguration
findById(long id)
Gets the object from its id@NotNull List<ElasticImageConfiguration>
getAll()
Get all Elastic Image Configuration objectsint
getBuildCountForImageConfigurationId(long id)
Get the number of elastic agents associated with a given image configurationint
getElasticAgentCountForImageConfigurationId(long id)
Returns all elastic agents associated with a specific image configurationList<ElasticAgentDefinition>
getElasticAgentsForImageConfigurationId(long id)
Retrieves a list of elastic agenst associated with the given elastic image configurationList<ElasticImageConfiguration>
getElasticImageConfigurationByAmi(String amiId)
Retrieves a list of all elastic image configurations that use a specific image.@NotNull List<ElasticImageConfiguration>
getElasticImageConfigurationsByName(String configurationName, com.atlassian.aws.ec2.awssdk.AwsSupportConstants.Region region)
Finds an elastic configuration by name in a given region.@NotNull List<ElasticImageConfiguration>
getImages(com.atlassian.aws.ec2.awssdk.AwsSupportConstants.Region region, com.atlassian.aws.ec2.awssdk.AwsSupportConstants.RootDeviceType rootDeviceType, com.atlassian.aws.ec2.awssdk.AwsSupportConstants.Architecture architecture, com.atlassian.aws.ec2.awssdk.AwsSupportConstants.Platform platform, @Nullable Boolean isShippedWithBamboo)
Class<ElasticImageConfigurationImpl>
getPersistentClass()
void
remove(@NotNull ElasticImageConfiguration elasticImageConfiguration)
void
save(@NotNull ElasticImageConfiguration elasticImageConfiguration)
-
Methods inherited from class com.atlassian.bamboo.persistence.BambooHibernateObjectDao
findAll, findAllSorted, findById, refresh, remove, replicate, save, saveRaw, updateModificationData
-
Methods inherited from class org.springframework.orm.hibernate5.support.HibernateDaoSupport
checkDaoConfig, createHibernateTemplate, currentSession, getHibernateTemplate, getSessionFactory, setHibernateTemplate, setSessionFactory
-
-
-
-
Method Detail
-
getAll
@NotNull public @NotNull List<ElasticImageConfiguration> getAll()
Description copied from interface:ElasticImageConfigurationDao
Get all Elastic Image Configuration objects- Specified by:
getAll
in interfaceElasticImageConfigurationDao
- Returns:
- Collection of Elastic Image Configuration objects (empty if none found)
-
getElasticAgentCountForImageConfigurationId
public int getElasticAgentCountForImageConfigurationId(long id)
Description copied from interface:ElasticImageConfigurationDao
Returns all elastic agents associated with a specific image configuration- Specified by:
getElasticAgentCountForImageConfigurationId
in interfaceElasticImageConfigurationDao
- Parameters:
id
- for the image configuration- Returns:
- count of the elastic agent associated with the given image configuration
-
getElasticAgentsForImageConfigurationId
public List<ElasticAgentDefinition> getElasticAgentsForImageConfigurationId(long id)
Description copied from interface:ElasticImageConfigurationDao
Retrieves a list of elastic agenst associated with the given elastic image configuration- Specified by:
getElasticAgentsForImageConfigurationId
in interfaceElasticImageConfigurationDao
- Parameters:
id
- of the elasticImageConfiguration
-
getElasticImageConfigurationByAmi
public List<ElasticImageConfiguration> getElasticImageConfigurationByAmi(String amiId)
Retrieves a list of all elastic image configurations that use a specific image.- Specified by:
getElasticImageConfigurationByAmi
in interfaceElasticImageConfigurationDao
- Parameters:
amiId
- to filter with- Returns:
- list of ElasticAgentDefinition objects that use the given amiID
-
getBuildCountForImageConfigurationId
public int getBuildCountForImageConfigurationId(long id)
Description copied from interface:ElasticImageConfigurationDao
Get the number of elastic agents associated with a given image configuration- Specified by:
getBuildCountForImageConfigurationId
in interfaceElasticImageConfigurationDao
- Parameters:
id
- for the image configuration- Returns:
- count of the builds associated with the given image configuration
-
getPersistentClass
public Class<ElasticImageConfigurationImpl> getPersistentClass()
- Specified by:
getPersistentClass
in interfacebucket.core.persistence.ObjectDao
-
save
public void save(@NotNull @NotNull ElasticImageConfiguration elasticImageConfiguration)
- Specified by:
save
in interfaceElasticImageConfigurationDao
-
remove
public void remove(@NotNull @NotNull ElasticImageConfiguration elasticImageConfiguration)
- Specified by:
remove
in interfaceElasticImageConfigurationDao
-
getImages
@NotNull public @NotNull List<ElasticImageConfiguration> getImages(@Nullable com.atlassian.aws.ec2.awssdk.AwsSupportConstants.Region region, @Nullable com.atlassian.aws.ec2.awssdk.AwsSupportConstants.RootDeviceType rootDeviceType, @Nullable com.atlassian.aws.ec2.awssdk.AwsSupportConstants.Architecture architecture, @Nullable com.atlassian.aws.ec2.awssdk.AwsSupportConstants.Platform platform, @Nullable @Nullable Boolean isShippedWithBamboo)
- Specified by:
getImages
in interfaceElasticImageConfigurationDao
-
getElasticImageConfigurationsByName
@NotNull public @NotNull List<ElasticImageConfiguration> getElasticImageConfigurationsByName(String configurationName, com.atlassian.aws.ec2.awssdk.AwsSupportConstants.Region region)
Description copied from interface:ElasticImageConfigurationDao
Finds an elastic configuration by name in a given region.- Specified by:
getElasticImageConfigurationsByName
in interfaceElasticImageConfigurationDao
- Parameters:
configurationName
- name to look forregion
- region to check- Returns:
- the elasticImageConfig with the given name.
-
findById
public ElasticImageConfiguration findById(long id)
Description copied from interface:BambooObjectDao
Gets the object from its id- Specified by:
findById
in interfaceBambooObjectDao
- Specified by:
findById
in interfaceElasticImageConfigurationDao
- Overrides:
findById
in classBambooHibernateObjectDao
- Parameters:
id
- Elastic Image Configuration's id- Returns:
- A
BambooObject
. null if not found.
-
-