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
-
Field Summary
Fields inherited from class org.springframework.dao.support.DaoSupport
logger
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfindById
(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
Returns all elastic agents associated with a specific image configurationRetrieves a list of elastic agenst associated with the given elastic image configurationRetrieves 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) 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
Methods inherited from class org.springframework.dao.support.DaoSupport
afterPropertiesSet, initDao
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface bucket.core.persistence.ObjectDao
findAll, findAllSorted, refresh, remove, replicate, save, saveRaw
-
Constructor Details
-
ElasticImageConfigurationHibernateDao
public ElasticImageConfigurationHibernateDao()
-
-
Method Details
-
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
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
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
- Specified by:
getPersistentClass
in interfacebucket.core.persistence.ObjectDao
-
save
- Specified by:
save
in interfaceElasticImageConfigurationDao
-
remove
- 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
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.
-