Brooklyn

brooklyn.entity.dns
[Java] Class AbstractGeoDnsServiceImpl

java.lang.Object
  brooklyn.entity.basic.AbstractEntity
      brooklyn.entity.dns.AbstractGeoDnsServiceImpl
All Implemented Interfaces:
AbstractGeoDnsService

public abstract class AbstractGeoDnsServiceImpl
extends AbstractEntity

Field Summary
protected java.util.Set entitiesWithoutGeoInfo

protected java.util.Set entitiesWithoutHostname

protected Group targetEntityProvider

protected java.util.Map targetHosts

protected AbstractMembershipTrackingPolicy tracker

 
Fields inherited from class AbstractEntity
CHILD_ADDED, CHILD_REMOVED, EFFECTOR_ADDED, EFFECTOR_CHANGED, EFFECTOR_REMOVED, POLICY_ADDED, POLICY_REMOVED, SENSOR_ADDED, SENSOR_REMOVED, _subscriptionTracker, managementSupport, tempWorkings
 
Constructor Summary
AbstractGeoDnsServiceImpl()

 
Method Summary
protected boolean addTargetHost(Entity entity)

Adds this host, if it is absent or if its hostname has changed.

void destroy()

protected void endTracker()

java.lang.String getHostname()

java.util.Map getTargetHosts()

protected HostGeoInfo inferHostGeoInfo(java.lang.String hostname, java.lang.String ip)

protected java.lang.String inferHostname(Entity entity)

protected java.lang.String inferIp(Entity entity)

void onManagementBecomingMaster()

void onManagementNoLongerMaster()

protected void reconfigureService(java.util.Collection targetHosts)

protected void refreshGroupMembership()

protected boolean removeTargetHost(Entity e, boolean doUpdate)

remove if host removed

void setServiceState(Lifecycle state)

void setTargetEntityProvider(Group entityProvider)

should set up so these hosts are targeted, and setServiceState appropriately

protected void startTracker()

protected void update()

 
Methods inherited from class AbstractEntity
addChild, addChild, addEnricher, addEnricher, addGroup, addLocations, addPolicy, addPolicy, clearLocations, clearParent, configure, configure, configure, configure, configure, configure, destroy, emit, emitInternal, equals, finalize, firstLocation, getAllAttributes, getAllConfig, getAllConfigBag, getApplication, getApplicationId, getAttribute, getAttributeByNameParts, getChildren, getConfig, getConfig, getConfig, getConfig, getConfigMap, getConfigRaw, getConfigRaw, getCreationTime, getDisplayName, getEffector, getEnrichers, getEntityManager, getEntityType, getEntityTypeName, getExecutionContext, getGroups, getIconUrl, getId, getLocalConfigBag, getLocations, getManagementContext, getManagementSupport, getMutableEntityType, getParent, getPolicies, getProxy, getProxyIfAvailable, getRebindSupport, getSubscriptionContext, getSubscriptionTracker, hashCode, init, invalidateReferences, invoke, invoke, invoke, isLegacyConstruction, onManagementBecomingMaster, onManagementNoLongerMaster, onManagementStarted, onManagementStarting, onManagementStopped, refreshInheritedConfig, removeAllEnrichers, removeAllPolicies, removeAttribute, removeChild, removeEnricher, removeLocations, removePolicy, setApplication, setAttribute, setAttribute, setAttributeWithoutPublishing, setConfig, setConfig, setConfig, setConfig, setConfig, setConfig, setConfigEvenIfOwned, setConfigEvenIfOwned, setConfigIfValNonNull, setConfigIfValNonNull, setDefaultDisplayName, setDisplayName, setManagementContext, setParent, setProxy, subscribe, subscribeToChildren, subscribeToMembers, toMetadataRecord, toString, toStringHelper, unsubscribe, unsubscribe
 

Field Detail

entitiesWithoutGeoInfo

protected java.util.Set entitiesWithoutGeoInfo


entitiesWithoutHostname

protected java.util.Set entitiesWithoutHostname


targetEntityProvider

@SetFromFlag
protected Group targetEntityProvider


targetHosts

protected java.util.Map targetHosts


tracker

protected AbstractMembershipTrackingPolicy tracker


 
Constructor Detail

AbstractGeoDnsServiceImpl

public AbstractGeoDnsServiceImpl()


 
Method Detail

addTargetHost

protected boolean addTargetHost(Entity entity)
Adds this host, if it is absent or if its hostname has changed.

For whether to use hostname or ip, see config and attributes AbstractGeoDnsService#USE_HOSTNAMES#USE_HOSTNAMES, Attributes#HOSTNAME#HOSTNAME and Attributes#ADDRESS#ADDRESS (via inferHostname(Entity) and inferIp(Entity). Note that the "hostname" could in fact be an IP address, if inferHostname(Entity) returns an IP!

TODO in a future release, we may change this to explicitly set the sensor(s) to look at on the entity, and be stricter about using them in order.

Returns:
true if host is added or changed


destroy

@java.lang.Overridepublic void setServiceState(Lifecycle state) {
public void destroy()


endTracker

protected void endTracker()


getHostname

@java.lang.Overridetry {
public java.lang.String getHostname()


getTargetHosts

@java.lang.Overridesuper.onManagementBecomingMaster();
public java.util.Map getTargetHosts()


inferHostGeoInfo

protected HostGeoInfo inferHostGeoInfo(java.lang.String hostname, java.lang.String ip)


inferHostname

protected java.lang.String inferHostname(Entity entity)


inferIp

protected java.lang.String inferIp(Entity entity)


onManagementBecomingMaster

@java.lang.OverrideendTracker();
public void onManagementBecomingMaster()


onManagementNoLongerMaster

@java.lang.Overridepublic void destroy() {
public void onManagementNoLongerMaster()


reconfigureService

protected void reconfigureService(java.util.Collection targetHosts)


refreshGroupMembership

protected void refreshGroupMembership()


removeTargetHost

protected boolean removeTargetHost(Entity e, boolean doUpdate)
remove if host removed


setServiceState

@java.lang.Override
public void setServiceState(Lifecycle state)


setTargetEntityProvider

@java.lang.Overrideprotected abstract void reconfigureService(Collection targetHosts);
public void setTargetEntityProvider(Group entityProvider)
should set up so these hosts are targeted, and setServiceState appropriately


startTracker

protected void startTracker()


update

protected void update()


 

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