Rename to health.config.enabled

More consistent with other health inidicator flags.
This commit is contained in:
Dave Syer
2015-05-27 10:06:35 +01:00
parent 4bae50676a
commit bb0aab0471
2 changed files with 41 additions and 22 deletions

View File

@@ -20,6 +20,7 @@ import org.springframework.boot.actuate.health.HealthIndicator;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@@ -53,7 +54,7 @@ public class ConfigClientAutoConfiguration {
@Configuration
@ConditionalOnClass(HealthIndicator.class)
@ConditionalOnBean(ConfigServicePropertySourceLocator.class)
@ConditionalOnProperty(value = "spring.cloud.config.health.enabled", matchIfMissing = true)
@ConditionalOnProperty(value = "health.config.enabled", matchIfMissing = true)
protected static class ConfigServerHealthIndicatorConfiguration {
@Bean
@@ -63,4 +64,20 @@ public class ConfigClientAutoConfiguration {
}
}
@ConfigurationProperties("health.config")
public static class Health {
/**
* Flag to inidicate that the config server health indicator should be installed.
*/
boolean enabled;
public boolean isEnabled() {
return enabled;
}
public void setEnabled(boolean enabled) {
this.enabled = enabled;
}
}
}

View File

@@ -49,20 +49,37 @@ public class ConfigClientProperties {
@Value("${spring.application.name:application}")
private String name;
/**
* The label name to use to pull remote configuration properties. The default is set
* on the server (generally "master" for a git based server).
*/
private String label;
/**
* The username to use (HTTP Basic) when contacting the remote server.
*/
private String username;
/**
* The password to use (HTTP Basic) when contacting the remote server.
*/
private String password;
/**
* The URI of the remote server (default http://localhost:8888).
*/
private String uri = "http://localhost:8888";
/**
* Discovery properties.
*/
private Discovery discovery = new Discovery();
/**
* Flag to indicate that failure to connect to the server is fatal (default false).
*/
private boolean failFast = false;
private Health health = new Health();
private ConfigClientProperties() {
}
@@ -219,10 +236,6 @@ public class ConfigClientProperties {
}
}
public Health getHealth() {
return health;
}
public ConfigClientProperties override(
org.springframework.core.env.Environment environment) {
@@ -241,25 +254,14 @@ public class ConfigClientProperties {
}
return override;
}
public static class Health {
private boolean enabled = true;
public boolean isEnabled() {
return enabled;
}
public void setEnabled(boolean enabled) {
this.enabled = enabled;
}
}
@Override
public String toString() {
return "ConfigClientProperties [enabled=" + enabled + ", profile=" + profile
+ ", name=" + name + ", label=" + (label==null?"":label) + ", username=" + username
+ ", password=" + password + ", uri=" + uri + ", discovery.enabled="
+ discovery.enabled + ", failFast=" + failFast + "]";
+ ", name=" + name + ", label=" + (label == null ? "" : label)
+ ", username=" + username + ", password=" + password + ", uri=" + uri
+ ", discovery.enabled=" + discovery.enabled + ", failFast=" + failFast
+ "]";
}
}