Brooklyn

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

java.lang.Object
  groovy.lang.GroovyObjectSupport
      brooklyn.entity.basic.AbstractEntity
          brooklyn.entity.basic.SoftwareProcessImpl
              brooklyn.entity.proxy.AbstractControllerImpl
                  brooklyn.entity.proxy.nginx.NginxControllerImpl
All Implemented Interfaces:
NginxController

public class NginxControllerImpl
extends AbstractControllerImpl

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
 
Fields inherited from class AbstractControllerImpl
LOG, isActive, serverPoolAddresses, serverPoolMemberTrackerPolicy, serverPoolTargets, updateNeeded
 
Fields inherited from class SoftwareProcessImpl
sensorRegistry
 
Fields inherited from class AbstractEntity
LOG, POLICY_ADDED, POLICY_REMOVED, SENSOR_ADDED, SENSOR_REMOVED, _subscriptionTracker, attributesInternal, configsInternal, managementSupport, tempWorkings
 
Constructor Summary
NginxControllerImpl()

NginxControllerImpl(Entity parent)

NginxControllerImpl(java.util.Map properties)

NginxControllerImpl(java.util.Map properties, Entity parent)

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

void connectSensors()

protected void disconnectSensors()

void doExtraConfigurationDuringStart()

protected java.lang.Iterable findUrlMappings()

protected java.lang.String getCodeFor404()

protected java.lang.String getCodeForServerConfig()

java.lang.String getConfigFile()

java.lang.String getCurrentConfiguration()

java.lang.Class getDriverInterface()

java.lang.String getShortName()

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

installs SSL keys named as ID.

boolean isSticky()

protected void reconfigureService()

void reload()

void stop()

 
Methods inherited from class AbstractControllerImpl
addServerPoolMember, belongsInServerPool, bind, configure, connectSensors, getAddressOfEntity, getDomain, getPort, getPortNumberSensor, getProtocol, getRebindSupport, getRequiredOpenPorts, getUrl, inferProtocol, inferUrl, inferUrl, isActive, onManagementNoLongerMaster, onServerPoolMemberChanged, postRebind, postStart, preStart, preStop, reconfigureService, reload, removeServerPoolMember, resetServerPoolMemberTrackerPolicy, update
 
Methods inherited from class SoftwareProcessImpl
callRebindHooks, callStartHooks, checkModifiable, connectSensors, connectServiceUpIsRunning, disconnectSensors, disconnectServiceUpIsRunning, doInitDriver, getDriver, getLocalHostname, getMachineOrNull, getProvisioningFlags, getProvisioningLocation, getRequiredOpenPorts, newDriver, obtainProvisioningFlags, onManagementStarted, onManagementStarting, postDriverRestart, postDriverStart, postRebind, postRestart, postStart, preStart, preStop, rebind, restart, setProvisioningLocation, start, startInLocation, startInLocation, startInLocation, startInLocation, stop, stopInLocation, waitForEntityStart, waitForServiceUp, waitForServiceUp, waitForServiceUp
 
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

NginxControllerImpl

public NginxControllerImpl()


NginxControllerImpl

public NginxControllerImpl(Entity parent)


NginxControllerImpl

public NginxControllerImpl(java.util.Map properties)


NginxControllerImpl

public NginxControllerImpl(java.util.Map properties, Entity parent)


 
Method Detail

appendSslConfig

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


connectSensors

@Override
public void connectSensors()


disconnectSensors

@Override
protected void disconnectSensors()


doExtraConfigurationDuringStart

public void doExtraConfigurationDuringStart()


findUrlMappings

protected java.lang.Iterable findUrlMappings()


getCodeFor404

protected java.lang.String getCodeFor404()


getCodeForServerConfig

protected java.lang.String getCodeForServerConfig()


getConfigFile

public java.lang.String getConfigFile()


getCurrentConfiguration

@Description("Gets the current server configuration (by brooklyn recalculating what the config should be); does not affect the server")
public java.lang.String getCurrentConfiguration()


getDriverInterface

@Override
public java.lang.Class getDriverInterface()


getShortName

@Override
public java.lang.String getShortName()


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

public boolean isSticky()


reconfigureService

@Override
protected void reconfigureService()


reload

@Override
public void reload()


stop

@Override
public void stop()


 

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