public class DefaultConnectivityResolver extends BasicConfigurableObject implements ConnectivityResolver, EntityInitializer
ConnectivityResolver
. It exposes options to have JcloudsLocation
prefer to contact VMs on private addresses and can be injected on a
per-entity basis. For example:
services: - type: server location: the-same-private-network-as-brooklyn brooklyn.initializers: - type: org.apache.brooklyn.location.jclouds.DefaultConnectivityResolver brooklyn.config: mode: ONLY_PRIVATE - type: server location: another-cloud # implicit use of PREFER_PUBLIC.Would result in the first entity being managed on the instance's private address (and deployment failing if this was not possible) and the second being managed on its public address. Graceful fallback is possible by replacing ONLY_PRIVATE with PREFER_PRIVATE. There are PUBLIC variants of each of these.
DefaultConnectivityResolver is the default location network info customizer used by
JcloudsLocation
when JcloudsLocationConfig.CONNECTIVITY_RESOLVER
is unset.
When used as an EntityInitializer
the instance inserts itself into the entity's
provisioning properties under the JcloudsLocationConfig.CONNECTIVITY_RESOLVER
subkey.
This class is annotated @Beta and is likely to change in the future.
Modifier and Type | Class and Description |
---|---|
static class |
DefaultConnectivityResolver.NetworkMode |
BasicConfigurableObject.BasicConfigurationSupport
Configurable.ConfigurationSupport
Modifier and Type | Field and Description |
---|---|
static ConfigKey<java.lang.Boolean> |
CHECK_CREDENTIALS |
static ConfigKey<DefaultConnectivityResolver.NetworkMode> |
NETWORK_MODE |
static ConfigKey<java.lang.Boolean> |
PUBLISH_NETWORKS |
PRIVATE_ADDRESSES, PUBLIC_ADDRESSES
Constructor and Description |
---|
DefaultConnectivityResolver() |
DefaultConnectivityResolver(ConfigBag params) |
DefaultConnectivityResolver(java.util.Map<?,?> params) |
Modifier and Type | Method and Description |
---|---|
void |
apply(EntityLocal entity)
Sets the instance as the value of
JcloudsLocationConfig.CONNECTIVITY_RESOLVER
in entity's provisioning properties. |
ManagementAddressResolveResult |
resolve(JcloudsLocation location,
org.jclouds.compute.domain.NodeMetadata node,
ConfigBag config,
ConnectivityResolverOptions options)
Combines the given resolve options with the customiser's configuration to determine the
best address and credential pair for management.
|
java.lang.String |
toString() |
config, getBrooklynManagementContext, getConfig, getId, setManagementContext
public static final ConfigKey<DefaultConnectivityResolver.NetworkMode> NETWORK_MODE
public static final ConfigKey<java.lang.Boolean> CHECK_CREDENTIALS
public static final ConfigKey<java.lang.Boolean> PUBLISH_NETWORKS
public DefaultConnectivityResolver()
public DefaultConnectivityResolver(java.util.Map<?,?> params)
public DefaultConnectivityResolver(ConfigBag params)
public void apply(EntityLocal entity)
JcloudsLocationConfig.CONNECTIVITY_RESOLVER
in entity's provisioning properties.apply
in interface EntityInitializer
entity
- guaranteed to be the actual implementation instance,
thus guaranteed to be castable to EntityInternal which is often desired,
or to the type at hand (it is not even a proxy)public ManagementAddressResolveResult resolve(JcloudsLocation location, org.jclouds.compute.domain.NodeMetadata node, ConfigBag config, ConnectivityResolverOptions options)
resolve
in interface ConnectivityResolver
location
- The callernode
- The node the caller has createdconfig
- The configuration the caller used to create the nodeoptions
- Additional options the caller has chosen when creating the nodepublic java.lang.String toString()
toString
in class java.lang.Object