public interface JcloudsLocationCustomizer
Users are strongly encouraged to sub-class BasicJcloudsLocationCustomizer
,
to give some protection against this API changing in future releases.
Customizers can be instantiated on-demand, so the postRelease(JcloudsMachineLocation)
and postRelease(JcloudsMachineLocation)
methods may not be called on the same instance
as was used in provisioning. This is always true after a Brooklyn restart, and may be true at
other times depending how the customizer has been wired in.
However the customize functions will be called sequentially on the same instance during provisioning, unless Brooklyn is stopped (or fails over to a high-availability standby), in which case VM provisioning would abort anyway.
Modifier and Type | Method and Description |
---|---|
void |
customize(JcloudsLocation location,
org.jclouds.compute.ComputeService computeService,
JcloudsMachineLocation machine)
Override to configure the given machine once it has been created and started by Jclouds.
|
void |
customize(JcloudsLocation location,
org.jclouds.compute.ComputeService computeService,
org.jclouds.compute.domain.Template template)
Override to configure a subclass of this with the built template, or to configure the built
template's
TemplateOptions . |
void |
customize(JcloudsLocation location,
org.jclouds.compute.ComputeService computeService,
org.jclouds.compute.domain.TemplateBuilder templateBuilder)
Override to configure
templateBuilder
before it is built and immutable. |
void |
customize(JcloudsLocation location,
org.jclouds.compute.ComputeService computeService,
org.jclouds.compute.options.TemplateOptions templateOptions)
Override to configure the
TemplateOptions that will
be used by JcloudsLocation to obtain machines. |
void |
customize(JcloudsLocation location,
org.jclouds.compute.domain.NodeMetadata node,
ConfigBag setup)
Override to configure the
NodeMetadata , and ConfigBag that will be used when
connecting to the machine. |
void |
postRelease(JcloudsMachineLocation machine)
Override to handle machine-related cleanup after Jclouds is called to release (destroy) the machine.
|
void |
postReleaseOnObtainError(JcloudsLocation location,
JcloudsMachineLocation machineLocation,
java.lang.Exception cause)
Override to handle cleanup after failure to obtain a machine.
|
void |
preRelease(JcloudsMachineLocation machine)
Override to handle machine-related cleanup before Jclouds is called to release (destroy) the machine.
|
void |
preReleaseOnObtainError(JcloudsLocation location,
JcloudsMachineLocation machineLocation,
java.lang.Exception cause)
Override to handle cleanup after failure to obtain a machine.
|
void customize(JcloudsLocation location, org.jclouds.compute.ComputeService computeService, org.jclouds.compute.domain.TemplateBuilder templateBuilder)
templateBuilder
before it is built and immutable.void customize(JcloudsLocation location, org.jclouds.compute.ComputeService computeService, org.jclouds.compute.domain.Template template)
TemplateOptions
.
This method will be called before customize(JcloudsLocation, ComputeService, TemplateOptions)
.
void customize(JcloudsLocation location, org.jclouds.compute.ComputeService computeService, org.jclouds.compute.options.TemplateOptions templateOptions)
TemplateOptions
that will
be used by JcloudsLocation
to obtain machines.void customize(JcloudsLocation location, org.jclouds.compute.domain.NodeMetadata node, ConfigBag setup)
NodeMetadata
, and ConfigBag
that will be used when
connecting to the machine.void customize(JcloudsLocation location, org.jclouds.compute.ComputeService computeService, JcloudsMachineLocation machine)
If CloudLocationConfig.WAIT_FOR_SSHABLE
is true the machine is guaranteed to be
SSHable when this method is called.
void preRelease(JcloudsMachineLocation machine)
void postRelease(JcloudsMachineLocation machine)
void preReleaseOnObtainError(JcloudsLocation location, @Nullable JcloudsMachineLocation machineLocation, java.lang.Exception cause)
InterruptedException
in which case return as quickly as possible.void postReleaseOnObtainError(JcloudsLocation location, @Nullable JcloudsMachineLocation machineLocation, java.lang.Exception cause)
Override to handle cleanup after failure to obtain a machine. Called after releasing the locations' underlying node.
Could be called as a result of an InterruptedException
in which case return as quickly as possible.
Will be skipped if CloudLocationConfig.DESTROY_ON_FAILURE
is set to false
.