@Beta public class OnPublicNetworkEnricher extends AbstractOnNetworkEnricher
PortForwardManager). This can be used with sensors of type URI, HostAndPort
or plain integer port values. The port-mappings is retrieved by looking up the entity's machine
and the private port, in the PortForwardManager's recorded port-mappings.
For example, to configure each Tomcat node to publish its mapped uri, and to use that sensor
in Nginx for the target servers:
services:
- type: cluster
id: cluster
brooklyn.config:
memberSpec:
$brooklyn:entitySpec:
type: org.apache.brooklyn.entity.webapp.tomcat.TomcatServer
brooklyn.enrichers:
- type: org.apache.brooklyn.core.network.OnPublicNetworkEnricher
brooklyn.config:
sensor: main.uri
- type: org.apache.brooklyn.entity.proxy.nginx.NginxController
brooklyn.config:
member.sensor.hostandport: $brooklyn:sensor("main.uri.mapped.public")
serverPool: cluster
AbstractOnNetworkEnricher.SensorNameConverterAbstractEntityAdjunct.AdjunctTagSupport, AbstractEntityAdjunct.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<AttributeSensor<java.lang.String>> |
ADDRESS_SENSOR |
static ConfigKey<PortForwardManager> |
PORT_FORWARD_MANAGER |
static ConfigKey<com.google.common.base.Function<? super java.lang.String,java.lang.String>> |
SENSOR_NAME_CONVERTER |
MAP_MATCHING, SENSORSSUPPRESS_DUPLICATES| Constructor and Description |
|---|
OnPublicNetworkEnricher() |
| Modifier and Type | Method and Description |
|---|---|
void |
destroy()
Unsubscribes and clears all managed subscriptions; is called by the owning entity when a policy is removed
and should always be called by any subclasses overriding this method
|
void |
setEntity(EntityLocal entity) |
getEnricherType, getRebindSupport, relationsconfig, configure, getAdjunctType, getConfig, getDisplayName, getEntity, getUniqueTag, isDestroyed, isRunning, setConfig, setDisplayName, subscribe, subscribeToChildren, subscribeToMembers, subscriptions, tags, toString, unsubscribe, unsubscribegetCatalogItemId, getId, getManagementContext, init, rebind, setCatalogItemId, setManagementContextequals, getClass, hashCode, notify, notifyAll, wait, wait, waitgetUniqueTag, isDestroyed, isRunninggetCatalogItemId, getDisplayName, subscriptions, tagsconfig, getConfig, setConfigsetCatalogItemIdpublic static ConfigKey<com.google.common.base.Function<? super java.lang.String,java.lang.String>> SENSOR_NAME_CONVERTER
public static final ConfigKey<PortForwardManager> PORT_FORWARD_MANAGER
public static final ConfigKey<AttributeSensor<java.lang.String>> ADDRESS_SENSOR
public void setEntity(EntityLocal entity)
setEntity in class AbstractOnNetworkEnricherpublic void destroy()
AbstractEntityAdjunctdestroy in class AbstractEntityAdjunct