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

All Superinterfaces:
ElasticAgentTunnelPorts
All Known Implementing Classes:
ElasticAgentManagerImpl

public interface ElasticAgentManager
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.
 java.util.Set<com.atlassian.aws.ec2.EC2InstanceType> getAllowedInstanceTypes()
           
 java.lang.String getDefaultImageId()
          Retrieves the default image id shipped with this version of Bamboo
 java.util.List<java.lang.String> getElasticAgentLogs()
          Retrieve activity logs
 RemoteElasticAgent getElasticRemoteAgentByInstanceId(java.lang.String instanceId)
          Retrieve elastic instance of the given ID.
 java.util.List<RemoteElasticAgent> getElasticRemoteAgents()
          Retrieve a readonly list of any currently existing EC2 instances
 java.util.List<RemoteElasticAgent> getRequestedElasticRemoteAgents()
          Return the elastic instances which have been requested but not yet started up yet.
 int getTotalNumElasticRemoteAgents()
          Return how many license spots are currently being occupied by elastic instances (pending and running)
 boolean isElasticSupportEnabled()
           
 RemoteElasticAgent newElasticAgent(RemoteElasticAgentListener listener, com.atlassian.aws.AWSAccount awsAccount, com.atlassian.aws.ec2.EC2InstanceType instanceType)
           
 void registerElasticAgentStarted(RemoteElasticAgent agent)
          Tell the manager that the agent is up and running
 void registerElasticAgentStopped(RemoteElasticAgent agent)
          Remove and EC2 instance from the "currently Running map
 void setEC2Image(com.atlassian.aws.ec2.EC2Image image)
          Set the image to be used when creating new instances.
 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

RemoteElasticAgent newElasticAgent(RemoteElasticAgentListener listener,
                                   com.atlassian.aws.AWSAccount awsAccount,
                                   @NotNull
                                   com.atlassian.aws.ec2.EC2InstanceType instanceType)
                                   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.

getDefaultImageId

@Nullable
java.lang.String getDefaultImageId()
Retrieves the default image id shipped with this version of Bamboo

Returns:
the ami-id of bamboo's default image (as generated by bamboo)

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<RemoteElasticAgent> getElasticRemoteAgents()
Retrieve a readonly list of any currently existing EC2 instances

Returns:
List of RemoteElasticAgent

getRequestedElasticRemoteAgents

@NotNull
java.util.List<RemoteElasticAgent> getRequestedElasticRemoteAgents()
Return the elastic instances which have been requested but not yet started up yet.

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

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
RemoteElasticAgent 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
                                 RemoteElasticAgent agent)
Remove and EC2 instance from the "currently Running map

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

registerElasticAgentStarted

void registerElasticAgentStarted(@NotNull
                                 RemoteElasticAgent agent)
Tell the manager that the agent is up and running

Parameters:
agent - - 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

setEC2Image

void setEC2Image(com.atlassian.aws.ec2.EC2Image image)
Set the image to be used when creating new instances.

Parameters:
image - - image to be used

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.


Copyright © 2009 Atlassian Pty Ltd. All Rights Reserved.