com.atlassian.bamboo.agent.elastic.server
Class ElasticImageConfigurationHibernateDao

java.lang.Object
  extended by org.springframework.dao.support.DaoSupport
      extended by org.springframework.orm.hibernate.support.HibernateDaoSupport
          extended by com.atlassian.hibernate.HibernateObjectDao
              extended by com.atlassian.bamboo.persistence.BambooHibernateObjectDao
                  extended by 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
ElasticImageConfigurationHibernateDao()
           
 
Method Summary
 ElasticImageConfiguration findById(long id)
          Gets the object from its id
 java.util.List<ElasticImageConfiguration> getAll()
          Get all Elastic Image Configuration objects
 int getBuildCountForImageConfigurationId(long id)
          Get the number of elastic agents associated with a given image configuration
 int getElasticAgentCountForImageConfigurationId(long id)
          Returns all elastic agents associated with a specific image configuration
 java.util.List<ElasticAgentDefinition> getElasticAgentsForImageConfigurationId(long id)
          Retrieves a list of elastic agenst associated with the given elastic image configuration
 java.util.List<ElasticImageConfiguration> getElasticImageConfigurationByAmi(java.lang.String amiId)
          Retrieves a list of all elastic image configurations that use a specific image.
 ElasticImageConfiguration getElasticImageConfigurationByName(java.lang.String name)
          Finds an elastic configuration by name.
 java.lang.Class<ElasticImageConfigurationImpl> getPersistentClass()
           
 ElasticImageConfiguration getShippedWithBamboo()
           
 void remove(ElasticImageConfiguration elasticImageConfiguration)
           
 void save(ElasticImageConfiguration elasticImageConfiguration)
           
 
Methods inherited from class com.atlassian.bamboo.persistence.BambooHibernateObjectDao
executeCountQuery, executeReturnLong, findById
 
Methods inherited from class com.atlassian.hibernate.HibernateObjectDao
findAll, findAllSorted, findNamedQuery, findNamedQuery, findNamedQuery, findNamedQueryStringParam, findNamedQueryStringParam, findNamedQueryStringParam, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findSingleObject, getByClassId, index, refresh, reIndex, remove, replicate, save, saveRaw, setIndexer, unIndex, updateModificationData
 
Methods inherited from class org.springframework.orm.hibernate.support.HibernateDaoSupport
checkDaoConfig, convertHibernateAccessException, createHibernateTemplate, getHibernateTemplate, getSession, getSession, getSessionFactory, releaseSession, 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 Detail

ElasticImageConfigurationHibernateDao

public ElasticImageConfigurationHibernateDao()
Method Detail

getAll

@NotNull
public java.util.List<ElasticImageConfiguration> getAll()
Description copied from interface: ElasticImageConfigurationDao
Get all Elastic Image Configuration objects

Specified by:
getAll in interface ElasticImageConfigurationDao
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 interface ElasticImageConfigurationDao
Parameters:
id - for the image configuration
Returns:
count of the elastic agent associated with the given image configuration

getElasticAgentsForImageConfigurationId

public java.util.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 interface ElasticImageConfigurationDao
Parameters:
id - of the elasticImageConfiguration
Returns:
List

getElasticImageConfigurationByAmi

public java.util.List<ElasticImageConfiguration> getElasticImageConfigurationByAmi(java.lang.String amiId)
Retrieves a list of all elastic image configurations that use a specific image.

Specified by:
getElasticImageConfigurationByAmi in interface ElasticImageConfigurationDao
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 interface ElasticImageConfigurationDao
Parameters:
id - for the image configuration
Returns:
count of the builds associated with the given image configuration

getPersistentClass

public java.lang.Class<ElasticImageConfigurationImpl> getPersistentClass()
Specified by:
getPersistentClass in interface bucket.core.persistence.ObjectDao

save

public void save(@NotNull
                 ElasticImageConfiguration elasticImageConfiguration)
Specified by:
save in interface ElasticImageConfigurationDao

remove

public void remove(@NotNull
                   ElasticImageConfiguration elasticImageConfiguration)
Specified by:
remove in interface ElasticImageConfigurationDao

getShippedWithBamboo

@Nullable
public ElasticImageConfiguration getShippedWithBamboo()
Specified by:
getShippedWithBamboo in interface ElasticImageConfigurationDao

getElasticImageConfigurationByName

public ElasticImageConfiguration getElasticImageConfigurationByName(java.lang.String name)
Description copied from interface: ElasticImageConfigurationDao
Finds an elastic configuration by name.

Specified by:
getElasticImageConfigurationByName in interface ElasticImageConfigurationDao
Parameters:
name - to look for
Returns:
the elasticConfig 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 interface ElasticImageConfigurationDao
Specified by:
findById in interface BambooObjectDao
Overrides:
findById in class BambooHibernateObjectDao
Parameters:
id - Elastic Image Configuration's id
Returns:
A BambooObject. null if not found.


Copyright © 2010 Atlassian. All Rights Reserved.