log.warn("No spring.application.name found, defaulting to 'application'"); System.setProperty(DeploymentContext.ContextKey.appId.getKey(), appName);
@Override public int hashCode() { int result = contextKey.hashCode(); result = 31 * result + contextValue.hashCode(); result = 31 * result + propertyName.hashCode(); result = 31 * result + propertyValue.hashCode(); return result; } }
DeploymentContext.ContextKey contextKey = item.containsKey(contextKeyAttributeName.get()) ? DeploymentContext.ContextKey.valueOf(item.get(contextKeyAttributeName.get()).getS()) : null; String contextVal = item.containsKey(contextValueAttributeName.get()) ? item.get(contextValueAttributeName.get()).getS() : null; String key = keyVal + ";" + contextKey + ";" + contextVal;
System.setProperty(DeploymentContext.ContextKey.appId.getKey(), appName);
setValueInConfig(ContextKey.environment.getKey(), value); } else if (name.equals(DEPLOYMENT_DATACENTER_PROPERTY)) { ConfigurationBasedDeploymentContext.super.setDeploymentDatacenter(value); setValueInConfig(ContextKey.datacenter.getKey(), value); } else if (name.equals(DEPLOYMENT_STACK_PROPERTY)) { ConfigurationBasedDeploymentContext.super.setDeploymentStack(value); setValueInConfig(ContextKey.stack.getKey(), value); } else if (name.equals(DEPLOYMENT_APPLICATION_ID_PROPERTY)) { ConfigurationBasedDeploymentContext.super.setApplicationId(value); setValueInConfig(ContextKey.appId.getKey(), value); } else if (name.equals(DEPLOYMENT_REGION_PROPERTY)) { ConfigurationBasedDeploymentContext.super.setDeploymentRegion(value); setValueInConfig(ContextKey.region.getKey(), value); } else if (name.equals(DEPLOYMENT_SERVER_ID_PROPERTY)) { ConfigurationBasedDeploymentContext.super.setDeploymentServerId(value); setValueInConfig(ContextKey.serverId.getKey(), value);
setValueInConfig(ContextKey.environment.getKey(), value); } else if (name.equals(DEPLOYMENT_DATACENTER_PROPERTY)) { ConfigurationBasedDeploymentContext.super.setDeploymentDatacenter(value); setValueInConfig(ContextKey.datacenter.getKey(), value); } else if (name.equals(DEPLOYMENT_STACK_PROPERTY)) { ConfigurationBasedDeploymentContext.super.setDeploymentStack(value); setValueInConfig(ContextKey.stack.getKey(), value); } else if (name.equals(DEPLOYMENT_APPLICATION_ID_PROPERTY)) { ConfigurationBasedDeploymentContext.super.setApplicationId(value); setValueInConfig(ContextKey.appId.getKey(), value); } else if (name.equals(DEPLOYMENT_REGION_PROPERTY)) { ConfigurationBasedDeploymentContext.super.setDeploymentRegion(value); setValueInConfig(ContextKey.region.getKey(), value); } else if (name.equals(DEPLOYMENT_SERVER_ID_PROPERTY)) { ConfigurationBasedDeploymentContext.super.setDeploymentServerId(value); setValueInConfig(ContextKey.serverId.getKey(), value);
/** * 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(). */ @Override public String getDeploymentStack() { String value = getValueFromConfig(DeploymentContext.ContextKey.stack.getKey()); if (value != null) { return value; } else { value = getValueFromConfig(DEPLOYMENT_STACK_PROPERTY); } if (value != null) { return value; } else { return super.getDeploymentStack(); } }
/** * 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(). */ @Override public String getApplicationId() { String value = getValueFromConfig(DeploymentContext.ContextKey.appId.getKey()); if (value != null) { return value; } else { value = getValueFromConfig(DEPLOYMENT_APPLICATION_ID_PROPERTY); } if (value != null) { return value; } else { return super.getApplicationId(); } }
/** * 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(). */ @Override public String getDeploymentServerId() { String value = getValueFromConfig(DeploymentContext.ContextKey.serverId.getKey()); if (value != null) { return value; } else { value = getValueFromConfig(DEPLOYMENT_SERVER_ID_PROPERTY); } if (value != null) { return value; } else { return super.getDeploymentServerId(); } }
/** * 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(). */ @Override public String getDeploymentEnvironment() { String value = getValueFromConfig(DeploymentContext.ContextKey.environment.getKey()); if (value != null) { return value; } else { value = getValueFromConfig(DEPLOYMENT_ENVIRONMENT_PROPERTY); if (value != null) { return value; } else { return super.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(). */ @Override public String getDeploymentEnvironment() { String value = getValueFromConfig(DeploymentContext.ContextKey.environment.getKey()); if (value != null) { return value; } else { value = getValueFromConfig(DEPLOYMENT_ENVIRONMENT_PROPERTY); if (value != null) { return value; } else { return super.getDeploymentEnvironment(); } } }
/** * 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(). */ @Override public String getApplicationId() { String value = getValueFromConfig(DeploymentContext.ContextKey.appId.getKey()); if (value != null) { return value; } else { value = getValueFromConfig(DEPLOYMENT_APPLICATION_ID_PROPERTY); } if (value != null) { return value; } else { return super.getApplicationId(); } }
/** * 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(). */ @Override public String getDeploymentStack() { String value = getValueFromConfig(DeploymentContext.ContextKey.stack.getKey()); if (value != null) { return value; } else { value = getValueFromConfig(DEPLOYMENT_STACK_PROPERTY); } if (value != null) { return value; } else { return super.getDeploymentStack(); } }
/** * 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(). */ @Override public String getDeploymentServerId() { String value = getValueFromConfig(DeploymentContext.ContextKey.serverId.getKey()); if (value != null) { return value; } else { value = getValueFromConfig(DEPLOYMENT_SERVER_ID_PROPERTY); } if (value != null) { return value; } else { return super.getDeploymentServerId(); } }
/** * 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(). */ @Override public String getDeploymentRegion() { String value = getValueFromConfig(DeploymentContext.ContextKey.region.getKey()); if (value != null) { return value; } else { value = getValueFromConfig(DEPLOYMENT_REGION_PROPERTY); } if (value != null) { return value; } else { return super.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(). */ @Override public String getDeploymentRegion() { String value = getValueFromConfig(DeploymentContext.ContextKey.region.getKey()); if (value != null) { return value; } else { value = getValueFromConfig(DEPLOYMENT_REGION_PROPERTY); } if (value != null) { return value; } else { return super.getDeploymentRegion(); } }
/** * 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(). */ @Override public String getDeploymentDatacenter() { String value = getValueFromConfig(DeploymentContext.ContextKey.datacenter.getKey()); if (value != null) { return value; } else { value = getValueFromConfig(DEPLOYMENT_DATACENTER_PROPERTY); } if (value != null) { return value; } else { return super.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(). */ @Override public String getDeploymentDatacenter() { String value = getValueFromConfig(DeploymentContext.ContextKey.datacenter.getKey()); if (value != null) { return value; } else { value = getValueFromConfig(DEPLOYMENT_DATACENTER_PROPERTY); } if (value != null) { return value; } else { return super.getDeploymentDatacenter(); } }
@Override public void setDeploymentRegion(String region) { override.setProperty(ContextKey.region.getKey(), region); }
@Override public String getDeploymentRegion() { return config.getString(ContextKey.region.getKey(), ""); }