com.netflix.config
Class ConfigurationBasedDeploymentContext

java.lang.Object
  extended by com.netflix.config.SimpleDeploymentContext
      extended by com.netflix.config.ConfigurationBasedDeploymentContext
All Implemented Interfaces:
DeploymentContext

public class ConfigurationBasedDeploymentContext
extends SimpleDeploymentContext

An implementation of DeploymentContext based on system wide configuration set with ConfigurationManager. All the getters will first consult corresponding property and return the value if set.


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.netflix.config.DeploymentContext
DeploymentContext.ContextKey
 
Field Summary
static java.lang.String DEPLOYMENT_APPLICATION_ID_PROPERTY
          Deprecated. 
static java.lang.String DEPLOYMENT_DATACENTER_PROPERTY
          Deprecated. 
static java.lang.String DEPLOYMENT_ENVIRONMENT_PROPERTY
          Deprecated. 
static java.lang.String DEPLOYMENT_REGION_PROPERTY
          Deprecated. 
static java.lang.String DEPLOYMENT_SERVER_ID_PROPERTY
          Deprecated. 
static java.lang.String DEPLOYMENT_STACK_PROPERTY
          Deprecated. 
 
Constructor Summary
ConfigurationBasedDeploymentContext()
           
 
Method Summary
 java.lang.String getApplicationId()
          Get the deployment environment.
 java.lang.String getDeploymentDatacenter()
          Get the deployment environment.
 java.lang.String getDeploymentEnvironment()
          Get the deployment environment.
 java.lang.String getDeploymentRegion()
          Get the deployment environment.
 java.lang.String getDeploymentServerId()
          Get the deployment environment.
 java.lang.String getDeploymentStack()
          Get the deployment environment.
 java.lang.String getValue(DeploymentContext.ContextKey key)
           
 void setApplicationId(java.lang.String value)
          Call super and also update the configuration to reflect the changes.
 void setDeploymentDatacenter(java.lang.String value)
          Call super and also update the configuration to reflect the changes.
 void setDeploymentEnvironment(java.lang.String value)
          Call super and also update the configuration to reflect the changes.
 void setDeploymentRegion(java.lang.String value)
          Call super and also update the configuration to reflect the changes.
 void setDeploymentServerId(java.lang.String value)
          Call super and also update the configuration to reflect the changes.
 void setDeploymentStack(java.lang.String value)
          Call super and also update the configuration to reflect the changes.
 
Methods inherited from class com.netflix.config.SimpleDeploymentContext
setValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEPLOYMENT_ENVIRONMENT_PROPERTY

@Deprecated
public static final java.lang.String DEPLOYMENT_ENVIRONMENT_PROPERTY
Deprecated. 
should use value from ContextKey#getKey() on ContextKey#environment as the property to set or get

See Also:
Constant Field Values

DEPLOYMENT_DATACENTER_PROPERTY

@Deprecated
public static final java.lang.String DEPLOYMENT_DATACENTER_PROPERTY
Deprecated. 
should use value from ContextKey#getKey() on ContextKey#datacenter as the property to set or get

See Also:
Constant Field Values

DEPLOYMENT_APPLICATION_ID_PROPERTY

@Deprecated
public static final java.lang.String DEPLOYMENT_APPLICATION_ID_PROPERTY
Deprecated. 
should use value from ContextKey#getKey() on ContextKey#appId as the property to set or get

See Also:
Constant Field Values

DEPLOYMENT_SERVER_ID_PROPERTY

@Deprecated
public static final java.lang.String DEPLOYMENT_SERVER_ID_PROPERTY
Deprecated. 
should use value from ContextKey#getKey() on ContextKey#serverId as the property to set or get

See Also:
Constant Field Values

DEPLOYMENT_STACK_PROPERTY

@Deprecated
public static final java.lang.String DEPLOYMENT_STACK_PROPERTY
Deprecated. 
should use value from ContextKey#getKey() on ContextKey#stack as the property to set or get

See Also:
Constant Field Values

DEPLOYMENT_REGION_PROPERTY

@Deprecated
public static final java.lang.String DEPLOYMENT_REGION_PROPERTY
Deprecated. 
should use value from ContextKey#getKey() on ContextKey#environment as the property to set or get

See Also:
Constant Field Values
Constructor Detail

ConfigurationBasedDeploymentContext

public ConfigurationBasedDeploymentContext()
Method Detail

getDeploymentEnvironment

public java.lang.String getDeploymentEnvironment()
Get the deployment environment. If property "archaius.deployment.environment" is set in the system wide configuration, it will return it. Otherwise, it will return super.getDeploymentEnvironment().

Specified by:
getDeploymentEnvironment in interface DeploymentContext
Overrides:
getDeploymentEnvironment in class SimpleDeploymentContext
Returns:
the deployment environment. For example "test", "dev", "prod".

setDeploymentEnvironment

public void setDeploymentEnvironment(java.lang.String value)
Call super and also update the configuration to reflect the changes.

Specified by:
setDeploymentEnvironment in interface DeploymentContext
Overrides:
setDeploymentEnvironment in class SimpleDeploymentContext
Parameters:
value -

getDeploymentDatacenter

public java.lang.String getDeploymentDatacenter()
Get the deployment environment. If property "archaius.deployment.datacenter" is set in the system wide configuration, it will return it. Otherwise, it will return super.getDeploymentDatacenter().

Specified by:
getDeploymentDatacenter in interface DeploymentContext
Overrides:
getDeploymentDatacenter in class SimpleDeploymentContext
Returns:
the name or ID of the data center.

setDeploymentDatacenter

public void setDeploymentDatacenter(java.lang.String value)
Call super and also update the configuration to reflect the changes.

Specified by:
setDeploymentDatacenter in interface DeploymentContext
Overrides:
setDeploymentDatacenter in class SimpleDeploymentContext
Parameters:
value -

getApplicationId

public java.lang.String getApplicationId()
Get the deployment environment. If property "archaius.deployment.applicationId" is set in the system wide configuration, it will return it. Otherwise, it will return super.getApplicationId().

Specified by:
getApplicationId in interface DeploymentContext
Overrides:
getApplicationId in class SimpleDeploymentContext

setApplicationId

public void setApplicationId(java.lang.String value)
Call super and also update the configuration to reflect the changes.

Specified by:
setApplicationId in interface DeploymentContext
Overrides:
setApplicationId in class SimpleDeploymentContext
Parameters:
value -

getDeploymentServerId

public java.lang.String getDeploymentServerId()
Get the deployment environment. If property "archaius.deployment.serverId" is set in the system wide configuration, it will return it. Otherwise, it will return super.getDeploymentServerId().

Specified by:
getDeploymentServerId in interface DeploymentContext
Overrides:
getDeploymentServerId in class SimpleDeploymentContext

setDeploymentServerId

public void setDeploymentServerId(java.lang.String value)
Call super and also update the configuration to reflect the changes.

Specified by:
setDeploymentServerId in interface DeploymentContext
Overrides:
setDeploymentServerId in class SimpleDeploymentContext
Parameters:
value -

getDeploymentStack

public java.lang.String getDeploymentStack()
Get the deployment environment. If property "archaius.deployment.stack" is set in the system wide configuration, it will return it. Otherwise, it will return super.getDeploymentStack().

Specified by:
getDeploymentStack in interface DeploymentContext
Overrides:
getDeploymentStack in class SimpleDeploymentContext
Returns:
a vertical stack name where this application is deployed. The stack name can be used to affect the application's behavior.

setDeploymentStack

public void setDeploymentStack(java.lang.String value)
Call super and also update the configuration to reflect the changes.

Specified by:
setDeploymentStack in interface DeploymentContext
Overrides:
setDeploymentStack in class SimpleDeploymentContext
Parameters:
value -

getDeploymentRegion

public java.lang.String getDeploymentRegion()
Get the deployment environment. If property "archaius.deployment.region" is set in the system wide configuration, it will return it. Otherwise, it will return super.getDeploymentRegion().

Specified by:
getDeploymentRegion in interface DeploymentContext
Overrides:
getDeploymentRegion in class SimpleDeploymentContext
Returns:
region of the deployment. In EC2, this could be Amazon region "us-east-1", "us-west-1", etc.

setDeploymentRegion

public void setDeploymentRegion(java.lang.String value)
Call super and also update the configuration to reflect the changes.

Specified by:
setDeploymentRegion in interface DeploymentContext
Overrides:
setDeploymentRegion in class SimpleDeploymentContext
Parameters:
value -

getValue

public java.lang.String getValue(DeploymentContext.ContextKey key)
Specified by:
getValue in interface DeploymentContext
Overrides:
getValue in class SimpleDeploymentContext