Brooklyn

brooklyn.entity.proxy.nginx
[Java] Class UrlMappingImpl

java.lang.Object
  groovy.lang.GroovyObjectSupport
      brooklyn.entity.basic.AbstractEntity
          brooklyn.entity.basic.AbstractGroupImpl
              brooklyn.entity.proxy.nginx.UrlMappingImpl
All Implemented Interfaces:
UrlMapping

public class UrlMappingImpl
extends AbstractGroupImpl

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
 
Fields inherited from class AbstractEntity
LOG, POLICY_ADDED, POLICY_REMOVED, SENSOR_ADDED, SENSOR_REMOVED, _subscriptionTracker, attributesInternal, configsInternal, managementSupport, tempWorkings
 
Constructor Summary
UrlMappingImpl()

UrlMappingImpl(java.util.Map props, Entity parent)

 
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.

void discard()

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()

protected SubscriptionHandle getSubscriptionHandle()

Entity getTarget()

java.lang.String getUniqueLabel()

void onManagementStarting()

void recompute()

protected void recomputeAddresses()

void setTarget(Entity target)

 
Methods inherited from class AbstractGroupImpl
addMember, getCurrentSize, getMembers, hasMember, removeMember, setMembers, setMembers
 
Methods inherited from class AbstractEntity
addChild, addChild, addEnricher, addGroup, addLocations, addOwnedChild, addPolicy, assertNotYetOwned, clearOwner, clearParent, configure, configure, configure, configure, configure, createManagementSupport, destroy, emit, emitInternal, equals, finalize, firstLocation, getAllAttributes, getAllConfig, getApplication, getApplicationId, getAttribute, getAttributeByNameParts, getChildren, getChildrenReference, getConfig, getConfig, getConfig, getConfig, getConfigMap, getDisplayName, getEffector, getEnrichers, getEntityManager, getEntityType, getEntityTypeName, getExecutionContext, getGroups, getId, getLocations, getManagementContext, getManagementSupport, getMutableEntityType, getOwnedChildren, getOwnedChildrenReference, getOwner, getParent, getPolicies, getProxy, getProxyIfAvailable, getRebindSupport, getSubscriptionContext, getSubscriptionTracker, hasEverBeenManaged, hashCode, init, invalidateReferences, invoke, invoke, invokeFromJava, invokeMethod, isLegacyConstruction, onManagementBecomingMaster, onManagementNoLongerMaster, onManagementStarted, onManagementStarting, refreshInheritedConfig, refreshInheritedConfigOfChildren, removeAllEnrichers, removeAllPolicies, removeAttribute, removeChild, removeEnricher, removeLocations, removeOwnedChild, removePolicy, setApplication, setAttribute, setAttribute, setAttributeWithoutPublishing, setBeingManaged, setConfig, setConfig, setConfig, setConfig, setConfig, setConfig, setConfigEvenIfOwned, setConfigEvenIfOwned, setConfigIfValNonNull, setConfigIfValNonNull, setDisplayName, setManagementContext, setOwner, setParent, setProxy, subscribe, subscribeToChildren, subscribeToMembers, toString, toStringFieldsToInclude, toStringHelper, 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()
 

Constructor Detail

UrlMappingImpl

public UrlMappingImpl()


UrlMappingImpl

public UrlMappingImpl(java.util.Map props, Entity parent)


 
Method Detail

addRewrite

@Override
public 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

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


discard

@Override
public void discard()


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

@Override
public java.lang.String getDomain()


getPath

@Override
public java.lang.String getPath()


getSubscriptionHandle

protected SubscriptionHandle getSubscriptionHandle()


getTarget

@Override
public Entity getTarget()


getUniqueLabel

@Override
public java.lang.String getUniqueLabel()


onManagementStarting

@Override
public void onManagementStarting()


recompute

@Override
public void recompute()


recomputeAddresses

protected void recomputeAddresses()


setTarget

@Override
public void setTarget(Entity target)


 

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