brooklyn.location
Interface MachineProvisioningLocation<T extends MachineLocation>

All Superinterfaces:
Location, Rebindable<LocationMemento>, Serializable

public interface MachineProvisioningLocation<T extends MachineLocation>
extends Location

A location that is able to provision new machines within its location. This interface extends Location to add the ability to provision MachineLocations in this location.


Method Summary
 Map<String,Object> getProvisioningFlags(Collection<String> tags)
          Gets flags, suitable as an argument to obtain().
 T obtain(Map<String,? extends Object> flags)
          Obtain a machine in this location.
 void release(T machine)
          Release a previously-obtained machine.
 
Methods inherited from interface brooklyn.location.Location
containsLocation, findLocationProperty, getChildLocations, getId, getLocationProperties, getLocationProperty, getName, getParentLocation, hasLocationProperty, setParentLocation
 
Methods inherited from interface brooklyn.entity.rebind.Rebindable
getRebindSupport
 

Method Detail

obtain

T obtain(Map<String,? extends Object> flags)
                                 throws NoMachinesAvailableException
Obtain a machine in this location.

Parameters:
flags - Details of the desired machine (e.g. image, size, open ports, etc; some flag support is limited to selected providers). "callerContext" can be specified to have custom logging and error messages (useful if starting machines in parallel)
Returns:
a machine that is a child of this location.
Throws:
NoMachinesAvailableException - if there are no machines available in this location (or impls may return null, but that is discouraged)

release

void release(T machine)
Release a previously-obtained machine.

Parameters:
machine - a MachineLocation previously obtained from a call to #obtain()
Throws:
IllegalStateException - if the machine did not come from a call to #obtain() or it has already been released.

getProvisioningFlags

Map<String,Object> getProvisioningFlags(Collection<String> tags)
Gets flags, suitable as an argument to obtain(). The tags provided give hints about the machine required. The provisioning-location could be configured to understand those tags. For example, an AWS-location could be configured to understand that a particular entity type (e.g. "TomcatServer") requires a particular AMI in that region, so would return the required image id.

Parameters:
tags -
Returns:


Copyright © 2013. All Rights Reserved.