com.atlassian.bamboo.agent.elastic.server
Interface ElasticInstanceManager

All Superinterfaces:
ElasticAgentTunnelPorts
All Known Implementing Classes:
ElasticInstanceManagerImpl

public interface ElasticInstanceManager
extends ElasticAgentTunnelPorts


Field Summary
static com.atlassian.aws.ec2.EC2InstanceType DEFAULT_INSTANCE_TYPE
           
 
Method Summary
 void addElasticLogEntry(java.lang.String logEntry)
          Add a line to the elastic activity logs
 void ensureLoginKeyPairExists(com.atlassian.aws.AWSAccount awsAccount)
          Ensures that a key pair, named "elasticbamboo", has been defined in the configured AWS account.
 com.google.common.collect.SetMultimap<ElasticImageConfiguration,RemoteElasticInstance> getAllElasticAgentsAsMap()
          Returns all elastic instances in a SetMultimap, keyed by the ElasticImageConfiguration
 java.util.List<RemoteElasticInstance> getAllElasticRemoteAgents()
          Returns all elastic instances.
 java.util.Set<com.atlassian.aws.ec2.EC2InstanceType> getAllowedInstanceTypes()
           
 java.lang.String getDefaultImageId()
           
 java.util.List<java.lang.String> getElasticAgentLogs()
          Retrieve activity logs
 RemoteElasticInstance getElasticRemoteAgentByInstanceId(java.lang.String instanceId)
          Retrieve elastic instance of the given ID.
 java.util.List<RemoteElasticInstance> getElasticRemoteAgents()
          Retrieve a readonly list of any currently existing EC2 instances
 java.util.List<RemoteElasticInstance> getElasticRemoteAgentsByConfiguration(ElasticImageConfiguration elasticImageConfiguration)
           
 java.util.List<RemoteElasticInstance> getElasticRemoteAgentsByConfiguration(long id)
           
 java.util.List<RemoteElasticInstance> getInstancesWithStartingAgents()
          Returns those elastic instances that have already started but their agents have not yet connected to the bamboo server.
 java.util.List<RemoteElasticInstance> getRequestedElasticRemoteAgents()
          Returns the elastic instances which have been requested but not yet identified.
 java.util.List<RemoteElasticInstance> getStartingElasticInstances()
          Return the elastic instances which have been identified but not started up yet, i.e.
 int getTotalNumElasticRemoteAgents()
          Return how many license spots are currently being occupied by elastic instances (pending and running)
 boolean isElasticSupportEnabled()
           
 RemoteElasticInstance newElasticAgent(RemoteElasticInstanceListener listener, com.atlassian.aws.AWSAccount awsAccount, LocalAgentManager localAgentManager, ElasticImageConfiguration elasticImageConfiguration)
           
 void onInstanceIdentified(RemoteElasticInstance remoteElasticInstance)
          Tell the manager that the instance is up and running
 void registerElasticAgentStarted(RemoteElasticInstance instance)
          Deprecated. since 3.1 onInstanceIdentified provides the same functionality
 void registerElasticAgentStopped(RemoteElasticInstance instance)
          Remove and EC2 instance from the "currently Running map
 boolean validateAwsCredentials(java.lang.String awsAccessID, java.lang.String awsSecretKey, ErrorCollection errorCollection)
          Validate a set of supplied AWS credentials.
 
Methods inherited from interface com.atlassian.bamboo.agent.elastic.tunnel.ElasticAgentTunnelPorts
getHTTPProxyPort, getJMSProxyPort, getTunnelPort
 

Field Detail

DEFAULT_INSTANCE_TYPE

static final com.atlassian.aws.ec2.EC2InstanceType DEFAULT_INSTANCE_TYPE
Method Detail

newElasticAgent

RemoteElasticInstance newElasticAgent(RemoteElasticInstanceListener listener,
                                      com.atlassian.aws.AWSAccount awsAccount,
                                      LocalAgentManager localAgentManager,
                                      ElasticImageConfiguration elasticImageConfiguration)
                                      throws java.security.NoSuchAlgorithmException,
                                             java.security.KeyManagementException,
                                             java.io.IOException,
                                             java.security.cert.CertificateException,
                                             java.security.UnrecoverableKeyException,
                                             java.security.KeyStoreException
Throws:
java.security.NoSuchAlgorithmException
java.security.KeyManagementException
java.io.IOException
java.security.cert.CertificateException
java.security.UnrecoverableKeyException
java.security.KeyStoreException

ensureLoginKeyPairExists

void ensureLoginKeyPairExists(com.atlassian.aws.AWSAccount awsAccount)
                              throws com.atlassian.aws.AWSException

Ensures that a key pair, named "elasticbamboo", has been defined in the configured AWS account.

Parameters:
awsAccount - that should contain the key pair
Throws:
com.atlassian.aws.AWSException - if there is a problem communicating with EC2.

validateAwsCredentials

boolean validateAwsCredentials(java.lang.String awsAccessID,
                               java.lang.String awsSecretKey,
                               ErrorCollection errorCollection)

Validate a set of supplied AWS credentials.

Parameters:
awsAccessID - The Access ID of the Amazon Web Services Account
awsSecretKey - The Secret Key of the Amazon Web Services Account
errorCollection - An ErrorCollection to which validation errors should be added, or null if validation errors are not required.
Returns:
true if the supplied credentials are successfully validated; false otherwise.

getElasticRemoteAgents

@NotNull
java.util.List<RemoteElasticInstance> getElasticRemoteAgents()
Retrieve a readonly list of any currently existing EC2 instances

Returns:
List of RemoteElasticInstance

getRequestedElasticRemoteAgents

@NotNull
java.util.List<RemoteElasticInstance> getRequestedElasticRemoteAgents()
Returns the elastic instances which have been requested but not yet identified.

Returns:
List of elastic instances which have been requested but not yet started up yet..

getStartingElasticInstances

@NotNull
java.util.List<RemoteElasticInstance> getStartingElasticInstances()
Return the elastic instances which have been identified but not started up yet, i.e. those instances that are IDENTIFIED pending to move to RUNNING state. The list does not include those instances that have been requested but not yet identified.

Returns:
List of elastic instances which have been requested and identified but not yet started up yet..

getAllElasticRemoteAgents

java.util.List<RemoteElasticInstance> getAllElasticRemoteAgents()
Returns all elastic instances. It includes requested agents as well as active agents

Returns:

getInstancesWithStartingAgents

@NotNull
java.util.List<RemoteElasticInstance> getInstancesWithStartingAgents()
Returns those elastic instances that have already started but their agents have not yet connected to the bamboo server. Once the elastic instance is started it launches a bamboo agents that connects to the bamboo server. There is a period of time when the instance has already started (and therefore it is not returned by getRequestedElasticRemoteAgents()) but the agent on the instance has not yet connected to the bamboo server. Elastic instances in such state are returned by this method and the list is a subset of the list returned by getElasticRemoteAgents().

Returns:
List of RemoteElasticInstance

getAllElasticAgentsAsMap

com.google.common.collect.SetMultimap<ElasticImageConfiguration,RemoteElasticInstance> getAllElasticAgentsAsMap()
Returns all elastic instances in a SetMultimap, keyed by the ElasticImageConfiguration

Returns:

getTotalNumElasticRemoteAgents

int getTotalNumElasticRemoteAgents()
Return how many license spots are currently being occupied by elastic instances (pending and running)

Returns:
Number of license slots currently occupied by elastic instances (pending and running).

getElasticRemoteAgentByInstanceId

@Nullable
RemoteElasticInstance getElasticRemoteAgentByInstanceId(java.lang.String instanceId)
Retrieve elastic instance of the given ID.

Parameters:
instanceId - of the instance
Returns:
the elastic remote agent specific to the provided instance id

registerElasticAgentStopped

void registerElasticAgentStopped(@NotNull
                                 RemoteElasticInstance instance)
Remove and EC2 instance from the "currently Running map

Parameters:
instance - - the one to be deleted from the map

onInstanceIdentified

void onInstanceIdentified(@NotNull
                          RemoteElasticInstance remoteElasticInstance)
Tell the manager that the instance is up and running

Parameters:
instance - the instance identified

registerElasticAgentStarted

@Deprecated
void registerElasticAgentStarted(@NotNull
                                            RemoteElasticInstance instance)
Deprecated. since 3.1 onInstanceIdentified provides the same functionality

Tell the manager that the agent is up and running

Parameters:
instance - - the agent that is running

addElasticLogEntry

void addElasticLogEntry(java.lang.String logEntry)
Add a line to the elastic activity logs

Parameters:
logEntry - - the line you want added to the logs

getElasticAgentLogs

java.util.List<java.lang.String> getElasticAgentLogs()
Retrieve activity logs

Returns:
a copy of the current elastic agent logs

isElasticSupportEnabled

boolean isElasticSupportEnabled()
Returns:
true, if elastic support is turned on

getAllowedInstanceTypes

@NotNull
java.util.Set<com.atlassian.aws.ec2.EC2InstanceType> getAllowedInstanceTypes()
Returns:
Set of allowed instance types.

getElasticRemoteAgentsByConfiguration

@NotNull
java.util.List<RemoteElasticInstance> getElasticRemoteAgentsByConfiguration(ElasticImageConfiguration elasticImageConfiguration)

getElasticRemoteAgentsByConfiguration

@NotNull
java.util.List<RemoteElasticInstance> getElasticRemoteAgentsByConfiguration(long id)

getDefaultImageId

@Nullable
java.lang.String getDefaultImageId()


Copyright © 2011 Atlassian. All Rights Reserved.