Brooklyn

brooklyn.entity.proxy.nginx
[Groovy] Class UrlMapping

java.lang.Object
  groovy.lang.GroovyObjectSupport
      brooklyn.entity.basic.AbstractEntity
          brooklyn.entity.basic.AbstractGroup
              brooklyn.entity.proxy.nginx.UrlMapping

class UrlMapping
extends AbstractGroup

This is a group whose members will be made available to a load-balancer / URL forwarding service (such as nginx). Configuration requires a domain and some mechanism for finding members. The easiest way to find members is using a target whose children will be tracked, but alternative membership policies can also be used.


Field Summary
static BasicConfigKey DOMAIN

static BasicConfigKey LABEL

static BasicConfigKey PATH

static BasicConfigKey REWRITES

static BasicAttributeSensor ROOT_URL

static BasicConfigKey SSL_CONFIG

static BasicAttributeSensor TARGET_ADDRESSES

static BasicConfigKey TARGET_PARENT

 
Fields inherited from class AbstractEntity
LOG, SENSOR_ADDED, SENSOR_REMOVED, _subscriptionTracker, application, attributesInternal, configsInternal, execution, managementContext, managementData, subscription, tempWorkings
 
Property Summary
SubscriptionHandle subscriptionHandle

 
Constructor Summary
UrlMapping(java.util.Map props, Entity owner)

 
Method Summary
UrlMapping addRewrite(java.lang.String from, java.lang.String to)

adds a rewrite rule, must be called at config time.

UrlMapping addRewrite(UrlRewriteRule rule)

adds a rewrite rule, must be called at config time.

protected java.lang.String getAddressOfEntity(Entity s)

defines how address string, ie hostname:port, is constructed from a given entity.

java.lang.String getDomain()

java.lang.String getPath()

Entity getTarget()

java.lang.String getUniqueLabel()

void recompute()

protected void recomputeAddresses()

void setTarget(Entity target)

 
Methods inherited from class AbstractGroup
addMember, getCurrentSize, getMembers, hasMember, removeMember, setMembers, setMembers
 
Methods inherited from class AbstractEntity
addEnricher, addGroup, addOwnedChild, addPolicy, assertNotYetOwned, clearOwner, configure, configure, destroy, emit, emitInternal, firstLocation, getAllConfig, getApplication, getApplicationId, getAttribute, getAttributeByNameParts, getConfig, getConfig, getConfig, getConfig, getConfigMap, getEffector, getEnrichers, getEntityType, getExecutionContext, getGroups, getLocations, getManagementContext, getMutableEntityType, getOwnedChildren, getOwner, getPolicies, getSubscriptionContext, getSubscriptionTracker, hasEverBeenManaged, invalidate, invoke, invoke, invokeFromJava, invokeMethod, onManagementBecomingMaster, onManagementNoLongerMaster, refreshInheritedConfig, refreshInheritedConfigOfChildren, removeAllEnrichers, removeAllPolicies, removeAttribute, removeEnricher, removeOwnedChild, removePolicy, setApplication, setAttribute, setAttribute, setBeingManaged, setConfig, setConfig, setConfigEvenIfOwned, setConfigEvenIfOwned, setConfigIfValNonNull, setConfigIfValNonNull, setOwner, subscribe, subscribeToChildren, subscribeToMembers, toString, toStringFieldsToInclude, unsubscribe, unsubscribe
 
Methods inherited from class groovy.lang.GroovyObjectSupport
groovy.lang.GroovyObjectSupport#setProperty(java.lang.String, java.lang.Object), groovy.lang.GroovyObjectSupport#getProperty(java.lang.String), groovy.lang.GroovyObjectSupport#getMetaClass(), groovy.lang.GroovyObjectSupport#setMetaClass(groovy.lang.MetaClass), groovy.lang.GroovyObjectSupport#invokeMethod(java.lang.String, java.lang.Object), groovy.lang.GroovyObjectSupport#wait(), groovy.lang.GroovyObjectSupport#wait(long), groovy.lang.GroovyObjectSupport#wait(long, int), groovy.lang.GroovyObjectSupport#equals(java.lang.Object), groovy.lang.GroovyObjectSupport#toString(), groovy.lang.GroovyObjectSupport#hashCode(), groovy.lang.GroovyObjectSupport#getClass(), groovy.lang.GroovyObjectSupport#notify(), groovy.lang.GroovyObjectSupport#notifyAll()
 

Field Detail

DOMAIN

@SetFromFlag("domain")
public static final BasicConfigKey DOMAIN


LABEL

@SetFromFlag("label")
public static final BasicConfigKey LABEL


PATH

@SetFromFlag("path")
public static final BasicConfigKey PATH


REWRITES

@SetFromFlag("rewrites")
public static final BasicConfigKey REWRITES


ROOT_URL

public static final BasicAttributeSensor ROOT_URL


SSL_CONFIG

@SetFromFlag("ssl")
public static final BasicConfigKey SSL_CONFIG


TARGET_ADDRESSES

public static final BasicAttributeSensor TARGET_ADDRESSES


TARGET_PARENT

@SetFromFlag("target")
public static final BasicConfigKey TARGET_PARENT


 
Property Detail

subscriptionHandle

SubscriptionHandle subscriptionHandle


 
Constructor Detail

UrlMapping

UrlMapping(java.util.Map props, Entity owner)


 
Method Detail

addRewrite

UrlMapping addRewrite(java.lang.String from, java.lang.String to)
adds a rewrite rule, must be called at config time. see UrlRewriteRule for more info.


addRewrite

UrlMapping addRewrite(UrlRewriteRule rule)
adds a rewrite rule, must be called at config time. see UrlRewriteRule for more info.


getAddressOfEntity

protected java.lang.String getAddressOfEntity(Entity s)
defines how address string, ie hostname:port, is constructed from a given entity. returns null if not possible.

the default is to look at HOSTNAME and HTTPS_PORT or HTTP_PORT attribute sensors (depending on SSL_CONFIG being set with targetIsSsl).

this method is suitable (intended) for overriding if needed.


getDomain

java.lang.String getDomain()


getPath

java.lang.String getPath()


getTarget

Entity getTarget()


getUniqueLabel

java.lang.String getUniqueLabel()


recompute

void recompute()


recomputeAddresses

protected void recomputeAddresses()


setTarget

void setTarget(Entity target)


 

Brooklyn Multi-Cloud Application Management Platform
brooklyncentral.github.com. Apache License. © 2012.