org.jclouds.ec2.compute.strategy
Class EC2CreateNodesInGroupThenAddToSet

java.lang.Object
  extended by org.jclouds.ec2.compute.strategy.EC2CreateNodesInGroupThenAddToSet
All Implemented Interfaces:
CreateNodesInGroupThenAddToSet
Direct Known Subclasses:
AWSEC2CreateNodesInGroupThenAddToSet

@Singleton
public class EC2CreateNodesInGroupThenAddToSet
extends Object
implements CreateNodesInGroupThenAddToSet

creates futures that correlate to

Author:
Adrian Cole

Field Summary
static com.google.common.base.Function<RunningInstance,RegionAndName> instanceToRegionAndName
           
protected  Logger logger
           
 
Constructor Summary
protected EC2CreateNodesInGroupThenAddToSet(EC2Client client, com.google.common.cache.LoadingCache<RegionAndName,String> elasticIpCache, com.google.common.base.Predicate<AtomicReference<NodeMetadata>> nodeRunning, javax.inject.Provider<TemplateBuilder> templateBuilderProvider, CreateKeyPairAndSecurityGroupsAsNeededAndReturnRunOptions createKeyPairAndSecurityGroupsAsNeededAndReturncustomize, InstancePresent instancePresent, com.google.common.base.Function<RunningInstance,NodeMetadata> runningInstanceToNodeMetadata, com.google.common.cache.LoadingCache<RunningInstance,Credentials> instanceToCredentials, Map<String,Credentials> credentialStore, ComputeUtils utils)
           
 
Method Summary
protected  Iterable<String> allocateElasticIpsInRegion(int count, Template template)
           
protected  void assignElasticIpsToInstances(Iterable<String> ips, Iterable<? extends RunningInstance> startedInstances)
           
protected  Iterable<? extends RunningInstance> createKeyPairAndSecurityGroupsAsNeededThenRunInstances(String group, int count, Template template)
           
protected  Iterable<? extends RunningInstance> createNodesInRegionAndZone(String region, String zone, String group, int count, Template template, RunInstancesOptions instanceOptions)
           
 Map<?,Future<Void>> execute(String group, int count, Template template, Set<NodeMetadata> goodNodes, Map<NodeMetadata,Exception> badNodes, com.google.common.collect.Multimap<NodeMetadata,CustomizationResponse> customizationResponses)
           
protected  void populateCredentials(Iterable<? extends RunningInstance> started)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

@Named(value="jclouds.compute")
protected Logger logger

instanceToRegionAndName

public static com.google.common.base.Function<RunningInstance,RegionAndName> instanceToRegionAndName
Constructor Detail

EC2CreateNodesInGroupThenAddToSet

@Inject
protected EC2CreateNodesInGroupThenAddToSet(EC2Client client,
                                                   @Named(value="ELASTICIP")
                                                   com.google.common.cache.LoadingCache<RegionAndName,String> elasticIpCache,
                                                   @Named(value="NODE_RUNNING")
                                                   com.google.common.base.Predicate<AtomicReference<NodeMetadata>> nodeRunning,
                                                   javax.inject.Provider<TemplateBuilder> templateBuilderProvider,
                                                   CreateKeyPairAndSecurityGroupsAsNeededAndReturnRunOptions createKeyPairAndSecurityGroupsAsNeededAndReturncustomize,
                                                   InstancePresent instancePresent,
                                                   com.google.common.base.Function<RunningInstance,NodeMetadata> runningInstanceToNodeMetadata,
                                                   com.google.common.cache.LoadingCache<RunningInstance,Credentials> instanceToCredentials,
                                                   Map<String,Credentials> credentialStore,
                                                   ComputeUtils utils)
Method Detail

execute

public Map<?,Future<Void>> execute(String group,
                                   int count,
                                   Template template,
                                   Set<NodeMetadata> goodNodes,
                                   Map<NodeMetadata,Exception> badNodes,
                                   com.google.common.collect.Multimap<NodeMetadata,CustomizationResponse> customizationResponses)
Specified by:
execute in interface CreateNodesInGroupThenAddToSet

populateCredentials

protected void populateCredentials(Iterable<? extends RunningInstance> started)

allocateElasticIpsInRegion

protected Iterable<String> allocateElasticIpsInRegion(int count,
                                                      Template template)

assignElasticIpsToInstances

protected void assignElasticIpsToInstances(Iterable<String> ips,
                                           Iterable<? extends RunningInstance> startedInstances)

createKeyPairAndSecurityGroupsAsNeededThenRunInstances

protected Iterable<? extends RunningInstance> createKeyPairAndSecurityGroupsAsNeededThenRunInstances(String group,
                                                                                                     int count,
                                                                                                     Template template)

createNodesInRegionAndZone

protected Iterable<? extends RunningInstance> createNodesInRegionAndZone(String region,
                                                                         String zone,
                                                                         String group,
                                                                         int count,
                                                                         Template template,
                                                                         RunInstancesOptions instanceOptions)


Copyright © 2009-2012 jclouds. All Rights Reserved.