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

java.lang.Object
  extended by com.atlassian.bamboo.agent.elastic.server.ElasticImageConfigurationManagerImpl
All Implemented Interfaces:
ElasticImageConfigurationAccessor, ElasticImageConfigurationManager

public class ElasticImageConfigurationManagerImpl
extends java.lang.Object
implements ElasticImageConfigurationManager


Field Summary
 
Fields inherited from interface com.atlassian.bamboo.agent.elastic.server.ElasticImageConfigurationManager
DEFAULT_AVAILABILITY_ZONE, IMAGE_CAPABILITIES_FILE
 
Constructor Summary
ElasticImageConfigurationManagerImpl(ElasticImageConfigurationDao elasticImageConfigurationDao, ResourceResolver resourceResolver, ElasticInstanceManager elasticInstanceManager, ElasticImageConfigurationAccessor elasticImageConfigurationAccessor, LocalAgentManager localAgentManager, ElasticInstanceScheduleManager elasticInstanceScheduleManager)
           
 
Method Summary
 void disableElasticImageSchedules(ElasticImageConfiguration elasticImageConfiguration)
          Disable all enabled Elastic Image Schedules associated with the Elastic Image Configuration
 java.util.List<ElasticImageConfiguration> getAllElasticImageConfigurations()
          Retrieves all elastic imagess that are stored in database
 int getBuildsCountForImageConfiguration(long id)
          Returns how many builds have been built against the given build configuration.
 int getElasticAgentCountForImageConfiguration(long id)
          How many elastic agents are associated with a specific image configuration.
 ElasticImageConfiguration getElasticImageConfigurationById(long configurationId)
          Retrieve an elastic image.
 ElasticImageConfiguration getElasticImageConfigurationByName(java.lang.String configurationName)
          Retrieve an elastic image by name.
 ElasticImageConfiguration getElasticImageConfigurationShippedWithBamboo()
          Retrieve an elastic image configuration shipped with Bamboo
 void populateDefaultCapabilitySet(CapabilitySet capabilitySet)
          Populates capability set with default capabilities from from ElasticImageConfigurationManager.IMAGE_CAPABILITIES_FILE.
 void removeElasticImageConfiguration(ElasticImageConfiguration elasticImageConfiguration)
          Delete an elastic image configuration.
 void saveElasticImageConfiguration(ElasticImageConfiguration elasticImageConfiguration)
          Save an elastic image configuration.
 void updateDefaultElasticImageConfiguration()
          Performs startup operations for setting up an elastic image, including retrieving capability information.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ElasticImageConfigurationManagerImpl

public ElasticImageConfigurationManagerImpl(ElasticImageConfigurationDao elasticImageConfigurationDao,
                                            ResourceResolver resourceResolver,
                                            ElasticInstanceManager elasticInstanceManager,
                                            ElasticImageConfigurationAccessor elasticImageConfigurationAccessor,
                                            LocalAgentManager localAgentManager,
                                            ElasticInstanceScheduleManager elasticInstanceScheduleManager)
Method Detail

getElasticImageConfigurationById

@Nullable
public ElasticImageConfiguration getElasticImageConfigurationById(long configurationId)
Description copied from interface: ElasticImageConfigurationAccessor
Retrieve an elastic image.

Specified by:
getElasticImageConfigurationById in interface ElasticImageConfigurationAccessor
Parameters:
configurationId - - id of the ElasticImageConfiguration to find
Returns:
ElasticImageConfiguration if exists null otherwise.

getElasticImageConfigurationByName

@Nullable
public ElasticImageConfiguration getElasticImageConfigurationByName(java.lang.String configurationName)
Description copied from interface: ElasticImageConfigurationAccessor
Retrieve an elastic image by name.

Specified by:
getElasticImageConfigurationByName in interface ElasticImageConfigurationAccessor
Parameters:
configurationName - - name of the ElasticImageConfiguration to find
Returns:
ElasticImageConfiguration if exists null otherwise.

getElasticImageConfigurationShippedWithBamboo

@Nullable
public ElasticImageConfiguration getElasticImageConfigurationShippedWithBamboo()
Description copied from interface: ElasticImageConfigurationAccessor
Retrieve an elastic image configuration shipped with Bamboo

Specified by:
getElasticImageConfigurationShippedWithBamboo in interface ElasticImageConfigurationAccessor
Returns:
ElasticImageConfiguration if exists null otherwise

getAllElasticImageConfigurations

@NotNull
public java.util.List<ElasticImageConfiguration> getAllElasticImageConfigurations()
Description copied from interface: ElasticImageConfigurationAccessor
Retrieves all elastic imagess that are stored in database

Specified by:
getAllElasticImageConfigurations in interface ElasticImageConfigurationAccessor
Returns:
List

saveElasticImageConfiguration

public void saveElasticImageConfiguration(@NotNull
                                          ElasticImageConfiguration elasticImageConfiguration)
Description copied from interface: ElasticImageConfigurationManager
Save an elastic image configuration.

Specified by:
saveElasticImageConfiguration in interface ElasticImageConfigurationManager
Parameters:
elasticImageConfiguration - Elastic Image Configuration to be saved.

getElasticAgentCountForImageConfiguration

public int getElasticAgentCountForImageConfiguration(long id)
Description copied from interface: ElasticImageConfigurationManager
How many elastic agents are associated with a specific image configuration.

Specified by:
getElasticAgentCountForImageConfiguration in interface ElasticImageConfigurationManager
Parameters:
id - of the image configuration
Returns:
count of the elastic agents.

getBuildsCountForImageConfiguration

public int getBuildsCountForImageConfiguration(long id)
Description copied from interface: ElasticImageConfigurationManager
Returns how many builds have been built against the given build configuration.

Specified by:
getBuildsCountForImageConfiguration in interface ElasticImageConfigurationManager
Parameters:
id - of the elastic image configuration
Returns:
count of build results.

removeElasticImageConfiguration

public void removeElasticImageConfiguration(@NotNull
                                            ElasticImageConfiguration elasticImageConfiguration)
                                     throws com.atlassian.aws.AWSException
Description copied from interface: ElasticImageConfigurationManager
Delete an elastic image configuration. That includes unscheduling and deleting related ElasticInstanceSchedule objects

Specified by:
removeElasticImageConfiguration in interface ElasticImageConfigurationManager
Parameters:
elasticImageConfiguration - Elastic Image Configuration to be deleted.
Throws:
com.atlassian.aws.AWSException

disableElasticImageSchedules

public void disableElasticImageSchedules(@NotNull
                                         ElasticImageConfiguration elasticImageConfiguration)
Description copied from interface: ElasticImageConfigurationManager
Disable all enabled Elastic Image Schedules associated with the Elastic Image Configuration

Specified by:
disableElasticImageSchedules in interface ElasticImageConfigurationManager

updateDefaultElasticImageConfiguration

public void updateDefaultElasticImageConfiguration()
                                            throws java.lang.Exception
Description copied from interface: ElasticImageConfigurationManager
Performs startup operations for setting up an elastic image, including retrieving capability information.

Specified by:
updateDefaultElasticImageConfiguration in interface ElasticImageConfigurationManager
Throws:
java.lang.Exception - if it can not find the default image information to setup

populateDefaultCapabilitySet

public void populateDefaultCapabilitySet(CapabilitySet capabilitySet)
Description copied from interface: ElasticImageConfigurationManager
Populates capability set with default capabilities from from ElasticImageConfigurationManager.IMAGE_CAPABILITIES_FILE. Will overwrite any existing capabilities.

Specified by:
populateDefaultCapabilitySet in interface ElasticImageConfigurationManager
Parameters:
capabilitySet - to populate with the defaults.


Copyright © 2011 Atlassian. All Rights Reserved.