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.SensorNameConverter
AbstractEntityAdjunct.AdjunctTagSupport, AbstractEntityAdjunct.BasicSubscriptionSupport
BrooklynObject.RelationSupport<T extends BrooklynObject>, BrooklynObject.SubscriptionSupport, BrooklynObject.TagSupport
Configurable.ConfigurationSupport
BrooklynObjectInternal.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<<any>> |
SENSOR_NAME_CONVERTER |
MAP_MATCHING, SENSORS
SUPPRESS_DUPLICATES
HIGHLIGHT_NAME_LAST_ACTION, HIGHLIGHT_NAME_LAST_CONFIRMATION, HIGHLIGHT_NAME_LAST_VIOLATION, HIGHLIGHT_NAME_TRIGGERS
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, relations
config, configure, getAdjunctType, getConfig, getDisplayName, getEntity, getExecutionContext, getHighlights, getManagementContext, getUniqueTag, isDestroyed, isRunning, setDisplayName, setHighlights, subscriptions, tags, toString
addSearchPath, getCatalogItemId, getCatalogItemIdSearchPath, getId, init, rebind, setCatalogItemId, setCatalogItemIdAndSearchPath, setManagementContext, stackCatalogItemId
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
getHighlights, getUniqueTag, isDestroyed, isRunning
getCatalogItemId, getCatalogItemIdSearchPath, getDisplayName, subscriptions, tags
config, getConfig
addSearchPath, setCatalogItemId, setCatalogItemIdAndSearchPath, stackCatalogItemId
public static ConfigKey<<any>> 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 AbstractOnNetworkEnricher
public void destroy()
AbstractEntityAdjunct
destroy
in class AbstractEntityAdjunct