Brooklyn

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

java.lang.Object
  groovy.lang.GroovyObjectSupport
      brooklyn.entity.basic.AbstractEntity
          brooklyn.entity.basic.SoftwareProcessEntity
              brooklyn.entity.proxy.AbstractController
                  brooklyn.entity.proxy.nginx.NginxController

class NginxController
extends AbstractController

An entity that represents an Nginx proxy (e.g. for routing requests to servers in a cluster).

The default driver *builds* nginx from source (because binaries are not reliably available, esp not with sticky sessions). This requires gcc and other build tools installed. The code attempts to install them but inevitably this entity may be more finicky about the OS/image where it runs than others.

Paritcularly on OS X we require Xcode and command-line gcc installed and on the path.

See http for useful info/examples of configuring nginx.

https configuration is supported, with the certificates providable on a per-UrlMapping basis or a global basis. (not supported to define in both places.) per-Url is useful if different certificates are used for different server names, or different ports if that is supported. see more info on Ssl in ProxySslConfig.


Field Summary
static BasicConfigKey STICKY

static BasicConfigKey SUGGESTED_VERSION

 
Fields inherited from class AbstractController
DOMAIN_NAME, LOG, PORT_NUMBER_SENSOR, PROTOCOL, PROXY_HTTP_PORT, RELOAD, ROOT_URL, SERVER_POOL_TARGETS, SSL_CONFIG, TARGETS, isActive, serverPoolAddresses, serverPoolMemberTrackerPolicy, serverPoolTargets, updateNeeded
 
Fields inherited from class SoftwareProcessEntity
ADDRESS, CUSTOMIZE_LATCH, HOSTNAME, INSTALL_LATCH, LAUNCH_LATCH, PROVISIONING_PROPERTIES, SERVICE_STATE, SHELL_ENVIRONMENT, START_LATCH, SUGGESTED_INSTALL_DIR, SUGGESTED_RUN_DIR, SUGGESTED_VERSION, sensorRegistry
 
Fields inherited from class AbstractEntity
LOG, SENSOR_ADDED, SENSOR_REMOVED, _subscriptionTracker, application, attributesInternal, configsInternal, execution, managementContext, managementData, subscription, tempWorkings
 
Property Summary
java.util.Set installedKeysCache

 
Constructor Summary
NginxController(Entity owner)

NginxController(java.util.Map properties)

NginxController(java.util.Map properties, Entity owner)

 
Method Summary
boolean appendSslConfig(java.lang.String id, java.lang.StringBuilder out, java.lang.String prefix, ProxySslConfig ssl, boolean sslBlock, boolean certificateBlock)

void connectSensors()

void doExtraConfigurationDuringStart()

protected java.lang.Iterable findUrlMappings()

java.lang.String getConfigFile()

java.lang.Class getDriverInterface()

protected void installSslKeys(java.lang.String id, ProxySslConfig ssl)

installs SSL keys named as ID.

boolean isSticky()

void onManagementBecomingMaster()

protected void reconfigureService()

void reload()

void stop()

void verifyConfig(ProxySslConfig proxySslConfig)

 
Methods inherited from class AbstractController
addServerPoolMember, belongsInServerPool, bind, configure, getAddressOfEntity, getDomain, getPort, getPortNumberSensor, getProtocol, getRequiredOpenPorts, getUrl, inferProtocol, inferUrl, isActive, onServerPoolMemberChanged, postStart, preStart, preStop, reconfigureService, reload, removeServerPoolMember, reset, update
 
Methods inherited from class SoftwareProcessEntity
checkAllSensorsConnected, checkModifiable, connectSensors, getDriver, getLocalHostname, getProvisioningFlags, getProvisioningLocation, getRequiredOpenPorts, initDriver, newDriver, obtainProvisioningFlags, postActivation, postStart, preStart, preStop, removeFirstMatchingLocation, removeFirstMatchingLocation, restart, setProvisioningLocation, start, startInLocation, startInLocation, startInLocation, stop, stopInLocation, waitForEntityStart, waitForServiceUp, waitForServiceUp
 
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

STICKY

@SetFromFlag("sticky")
public static final BasicConfigKey STICKY


SUGGESTED_VERSION

@SetFromFlag("version")
public static final BasicConfigKey SUGGESTED_VERSION


 
Property Detail

installedKeysCache

java.util.Set installedKeysCache


 
Constructor Detail

NginxController

NginxController(Entity owner)


NginxController

NginxController(java.util.Map properties)


NginxController

NginxController(java.util.Map properties, Entity owner)


 
Method Detail

appendSslConfig

boolean appendSslConfig(java.lang.String id, java.lang.StringBuilder out, java.lang.String prefix, ProxySslConfig ssl, boolean sslBlock, boolean certificateBlock)


connectSensors

@Override
void connectSensors()


doExtraConfigurationDuringStart

void doExtraConfigurationDuringStart()


findUrlMappings

protected java.lang.Iterable findUrlMappings()


getConfigFile

java.lang.String getConfigFile()


getDriverInterface

@Override
java.lang.Class getDriverInterface()


installSslKeys

protected void installSslKeys(java.lang.String id, ProxySslConfig ssl)
installs SSL keys named as ID.{crt,key} where nginx can find them; currently skips re-installs (does not support changing)


isSticky

boolean isSticky()


onManagementBecomingMaster

void onManagementBecomingMaster()


reconfigureService

@Override
protected void reconfigureService()


reload

@Override
void reload()


stop

@Override
void stop()


verifyConfig

void verifyConfig(ProxySslConfig proxySslConfig)


 

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