public class ServerPoolLocation extends AbstractLocation implements MachineProvisioningLocation<MachineLocation>, DynamicLocation<ServerPool,ServerPoolLocation>
AbstractLocation.BasicSubscriptionSupportBrooklynObject.RelationSupport<T extends BrooklynObject>, BrooklynObject.SubscriptionSupport, BrooklynObject.TagSupportConfigurable.ConfigurationSupportBrooklynObjectInternal.ConfigurationSupportInternal, BrooklynObjectInternal.RelationSupportInternal<T extends BrooklynObject>, BrooklynObjectInternal.SubscriptionSupportInternal| Modifier and Type | Field and Description |
|---|---|
static ConfigKey<java.lang.String> |
LOCATION_NAME |
static ConfigKey<ServerPool> |
OWNER |
PARENT_LOCATION, TEMPORARY_LOCATIONMAX_SUB_LOCATIONSFINAL_SPEC, NAMED_SPEC_NAME, ORIGINAL_SPEC| Constructor and Description |
|---|
ServerPoolLocation() |
| Modifier and Type | Method and Description |
|---|---|
void |
deregister()
The complement of
DynamicLocation.register(), to deregister this location. |
ServerPool |
getOwner() |
java.util.Map<java.lang.String,java.lang.Object> |
getProvisioningFlags(java.util.Collection<java.lang.String> tags)
Gets flags, suitable as an argument to
MachineProvisioningLocation.obtain(Map). |
void |
init()
Called by framework (in new-style instances where spec was used) after configuring etc,
but before a reference to this instance is shared.
|
MachineProvisioningLocation<MachineLocation> |
newSubLocation(java.util.Map<?,?> newFlags)
Creates a new location of the same type, but with additional creation instructions in the form of flags,
e.g.
|
MachineLocation |
obtain(java.util.Map<?,?> flags)
Obtain a machine in this location.
|
void |
rebind()
Called by framework on rebind (in new-style instances):
after configuring, but
before the instance is managed, and
before adjuncts are attached to entities, and
before a reference to an object is shared.
|
LocationDefinition |
register()
An opportunity to register this location (e.g.
|
void |
release(MachineLocation machine)
Release a previously-obtained machine.
|
addChild, addExtension, config, configure, containsLocation, equals, getAllConfig, getAllConfigBag, getChildren, getConfig, getConfig, getDisplayName, getExtension, getHostGeoInfo, getLocalConfigBag, getParent, getRawLocalConfigBag, getRebindSupport, hasConfig, hasExtension, hashCode, isManaged, onManagementStarted, onManagementStopped, relations, removeChild, setConfig, setDisplayName, setHostGeoInfo, setManagementContext, setName, setParent, setParent, subscriptions, toMetadataRecord, toString, toVerboseStringgetCatalogItemId, getId, getManagementContext, setCatalogItemId, tagscontainsLocation, getAllConfig, getChildren, getConfig, getDisplayName, getExtension, getId, getParent, hasConfig, hasExtension, relations, setParent, toVerboseStringgetCatalogItemId, subscriptions, tagsconfig, getConfig, setConfiggetManagementContextsetCatalogItemIdpublic static final ConfigKey<ServerPool> OWNER
public static final ConfigKey<java.lang.String> LOCATION_NAME
public void init()
AbstractBrooklynObjectTo preserve backwards compatibility for if the instance is constructed directly, one can call the code below, but that means it will be called after references to this policy have been shared with other entities.
if (isLegacyConstruction()) {
init();
}
init in class AbstractBrooklynObjectpublic void rebind()
AbstractBrooklynObjectAbstractBrooklynObject.init() will not be called on rebind.
If you need to intercept behaviour after adjuncts are attached,
consider AbstractEntity.onManagementStarting()
(but probably worth raising a discussion on the mailing list!)
rebind in class AbstractBrooklynObjectpublic LocationDefinition register()
DynamicLocationLocationRegistry or the
catalog, so that it will be persisted).register in interface DynamicLocation<ServerPool,ServerPoolLocation>public void deregister()
DynamicLocationDynamicLocation.register(), to deregister this location.deregister in interface DynamicLocation<ServerPool,ServerPoolLocation>public ServerPool getOwner()
getOwner in interface DynamicLocation<ServerPool,ServerPoolLocation>public MachineLocation obtain(java.util.Map<?,?> flags) throws NoMachinesAvailableException
MachineProvisioningLocationobtain in interface MachineProvisioningLocation<MachineLocation>obtain in interface ProvisioningLocation<MachineLocation>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)NoMachinesAvailableException - if there are no machines available in this location (or impls may return null, but that is discouraged)public MachineProvisioningLocation<MachineLocation> newSubLocation(java.util.Map<?,?> newFlags)
MachineProvisioningLocationImplementers who wish to subclass this provisioning location for additional functionality in a specific cloud can use the relevant implementation of this method as a guide.
newSubLocation in interface MachineProvisioningLocation<MachineLocation>public void release(MachineLocation machine)
MachineProvisioningLocationrelease in interface MachineProvisioningLocation<MachineLocation>release in interface ProvisioningLocation<MachineLocation>machine - a MachineLocation previously obtained from a call to #obtain()public java.util.Map<java.lang.String,java.lang.Object> getProvisioningFlags(java.util.Collection<java.lang.String> tags)
MachineProvisioningLocationMachineProvisioningLocation.obtain(Map). 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.getProvisioningFlags in interface MachineProvisioningLocation<MachineLocation>