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

java.lang.Object
  extended by com.atlassian.bamboo.agent.elastic.server.ElasticFunctionalityFacadeImpl
All Implemented Interfaces:
ElasticFunctionalityFacade

public class ElasticFunctionalityFacadeImpl
extends java.lang.Object
implements ElasticFunctionalityFacade


Field Summary
 
Fields inherited from interface com.atlassian.bamboo.agent.elastic.server.ElasticFunctionalityFacade
DEFAULT_ALLOWED_AGENTS, ELASTIC_BAMBOO_SECURITY_GROUP
 
Constructor Summary
ElasticFunctionalityFacadeImpl()
           
 
Method Summary
 void addElasticLogEntry(java.lang.String logEntry)
           
 void adjustElasticInstanceNumbers(ElasticInstanceSchedule instanceSchedule)
          Given the ElasticInstanceSchedule startup or bring down the correct number of agents
protected  void attemptShutdownInstances(java.util.Collection<RemoteElasticInstance> instances, int agentsToShutdown, ElasticImageConfiguration elasticImageConfiguration)
           
 int getMaxConcurrentInstances()
           
 java.lang.String getPkFileLocation()
           
 boolean isElasticSupportEnabled()
           
 boolean isElasticSupportPossible(ErrorCollection errorCollection)
           
 void recheckElasticSupportEnabledFlag()
           
 void setApplicationConfig(com.atlassian.config.ApplicationConfiguration applicationConfig)
           
 void setAwsAccountBean(AwsAccountBean awsAccountBean)
           
 void setBambooLicenseManager(BambooLicenseManager bambooLicenseManager)
           
 void setElasticAccountBean(ElasticAccountBean elasticAccountBean)
           
 void setElasticAgentManager(ElasticInstanceManager elasticInstanceManager)
           
 void setElasticImageConfigurationAccessor(ElasticImageConfigurationAccessor elasticImageConfigurationAccessor)
           
 void setElasticSupportEnabled(boolean elasticSupportEnabled)
          Enable/disable Elastic Bamboo functionality
 void setLocalAgentManager(LocalAgentManager localAgentManager)
           
 void setRemoteAgentManager(RemoteAgentManager remoteAgentManager)
           
 void setStopBuildManager(StopBuildManager stopBuildManager)
           
 void setTextProvider(com.opensymphony.xwork.TextProvider textProvider)
           
 void shutdownAllInstances()
           
 void shutdownInstance(RemoteElasticInstance elasticInstance)
           
 void shutdownInstance(java.lang.String instanceId)
           
 void startupAgents(java.util.Collection<ElasticImageConfiguration> elasticImageConfigurations)
          Starts the given number of agents
 void updateAgentPendingStatus(java.lang.String instanceId)
          Set the agent pending status to true for the given instance id
 boolean validateAgentCreation(int numAgentsRequired, ErrorCollection errorCollection)
          Validates whether the requested number of agents can be created and adds any errors to the error collection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ElasticFunctionalityFacadeImpl

public ElasticFunctionalityFacadeImpl()
Method Detail

recheckElasticSupportEnabledFlag

public void recheckElasticSupportEnabledFlag()
Specified by:
recheckElasticSupportEnabledFlag in interface ElasticFunctionalityFacade

shutdownInstance

public void shutdownInstance(@NotNull
                             RemoteElasticInstance elasticInstance)
Specified by:
shutdownInstance in interface ElasticFunctionalityFacade

shutdownInstance

public void shutdownInstance(java.lang.String instanceId)
                      throws com.atlassian.aws.AWSException
Specified by:
shutdownInstance in interface ElasticFunctionalityFacade
Throws:
com.atlassian.aws.AWSException

shutdownAllInstances

public void shutdownAllInstances()
Specified by:
shutdownAllInstances in interface ElasticFunctionalityFacade

startupAgents

public void startupAgents(java.util.Collection<ElasticImageConfiguration> elasticImageConfigurations)
                   throws com.atlassian.aws.AWSException
Starts the given number of agents

Specified by:
startupAgents in interface ElasticFunctionalityFacade
Throws:
com.atlassian.aws.AWSException

isElasticSupportEnabled

public boolean isElasticSupportEnabled()
Specified by:
isElasticSupportEnabled in interface ElasticFunctionalityFacade
Returns:
true, if elastic support is turned on

isElasticSupportPossible

public boolean isElasticSupportPossible(@NotNull
                                        ErrorCollection errorCollection)
Specified by:
isElasticSupportPossible in interface ElasticFunctionalityFacade
Returns:
true, if all preconditions for turning elastic support on are met

setElasticSupportEnabled

public void setElasticSupportEnabled(boolean elasticSupportEnabled)
Description copied from interface: ElasticFunctionalityFacade
Enable/disable Elastic Bamboo functionality

Specified by:
setElasticSupportEnabled in interface ElasticFunctionalityFacade
Parameters:
elasticSupportEnabled - Specifies if Elastc Baboo shall be enabled or disabled.

validateAgentCreation

public boolean validateAgentCreation(int numAgentsRequired,
                                     ErrorCollection errorCollection)
Description copied from interface: ElasticFunctionalityFacade
Validates whether the requested number of agents can be created and adds any errors to the error collection.

Specified by:
validateAgentCreation in interface ElasticFunctionalityFacade
Parameters:
numAgentsRequired - - number of agents to be created
errorCollection - - error collection to add any validation errors to.

updateAgentPendingStatus

public void updateAgentPendingStatus(@NotNull
                                     java.lang.String instanceId)
Description copied from interface: ElasticFunctionalityFacade
Set the agent pending status to true for the given instance id

Specified by:
updateAgentPendingStatus in interface ElasticFunctionalityFacade

addElasticLogEntry

public void addElasticLogEntry(java.lang.String logEntry)
Specified by:
addElasticLogEntry in interface ElasticFunctionalityFacade

adjustElasticInstanceNumbers

public void adjustElasticInstanceNumbers(@NotNull
                                         ElasticInstanceSchedule instanceSchedule)
                                  throws com.atlassian.aws.AWSException
Description copied from interface: ElasticFunctionalityFacade
Given the ElasticInstanceSchedule startup or bring down the correct number of agents

Specified by:
adjustElasticInstanceNumbers in interface ElasticFunctionalityFacade
Throws:
com.atlassian.aws.AWSException

attemptShutdownInstances

protected void attemptShutdownInstances(java.util.Collection<RemoteElasticInstance> instances,
                                        int agentsToShutdown,
                                        ElasticImageConfiguration elasticImageConfiguration)

getMaxConcurrentInstances

public int getMaxConcurrentInstances()
Specified by:
getMaxConcurrentInstances in interface ElasticFunctionalityFacade
Returns:
max number of elastic instances allowed for this instance. It's based on license restrictions.

getPkFileLocation

@NotNull
public java.lang.String getPkFileLocation()
Specified by:
getPkFileLocation in interface ElasticFunctionalityFacade

setLocalAgentManager

public void setLocalAgentManager(LocalAgentManager localAgentManager)

setElasticAgentManager

public void setElasticAgentManager(ElasticInstanceManager elasticInstanceManager)

setBambooLicenseManager

public void setBambooLicenseManager(BambooLicenseManager bambooLicenseManager)

setElasticImageConfigurationAccessor

public void setElasticImageConfigurationAccessor(ElasticImageConfigurationAccessor elasticImageConfigurationAccessor)

setRemoteAgentManager

public void setRemoteAgentManager(RemoteAgentManager remoteAgentManager)

setTextProvider

public void setTextProvider(com.opensymphony.xwork.TextProvider textProvider)

setApplicationConfig

public void setApplicationConfig(com.atlassian.config.ApplicationConfiguration applicationConfig)

setStopBuildManager

public void setStopBuildManager(StopBuildManager stopBuildManager)

setElasticAccountBean

public void setElasticAccountBean(ElasticAccountBean elasticAccountBean)

setAwsAccountBean

public void setAwsAccountBean(AwsAccountBean awsAccountBean)


Copyright © 2011 Atlassian. All Rights Reserved.