Rename @ConfigurationProperties attributes
Rename `name` to `prefix` and `path` to `locations`.
This commit is contained in:
@@ -26,7 +26,7 @@ import org.springframework.util.StringUtils;
|
||||
*
|
||||
* @author Christian Dupuis
|
||||
*/
|
||||
@ConfigurationProperties(name = "endpoints.jmx")
|
||||
@ConfigurationProperties(prefix = "endpoints.jmx")
|
||||
public class EndpointMBeanExportProperties {
|
||||
|
||||
private String domain;
|
||||
|
||||
@@ -27,7 +27,7 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
* @author Christian Dupuis
|
||||
* @author Dave Syer
|
||||
*/
|
||||
@ConfigurationProperties(name = "jolokia")
|
||||
@ConfigurationProperties(prefix = "jolokia")
|
||||
public class JolokiaProperties {
|
||||
|
||||
private Map<String, String> config = new HashMap<String, String>();
|
||||
|
||||
@@ -32,7 +32,7 @@ import org.springframework.util.ClassUtils;
|
||||
* @author Dave Syer
|
||||
* @see ServerProperties
|
||||
*/
|
||||
@ConfigurationProperties(name = "management", ignoreUnknownFields = false)
|
||||
@ConfigurationProperties(prefix = "management", ignoreUnknownFields = false)
|
||||
public class ManagementServerProperties implements SecurityPrequisite {
|
||||
|
||||
private static final String SECURITY_CHECK_CLASS = "org.springframework.security.config.http.SessionCreationPolicy";
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013 the original author or authors.
|
||||
* Copyright 2013-2014 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -36,7 +36,7 @@ import org.springframework.util.StringUtils;
|
||||
* @author Christian Dupuis
|
||||
* @author Phillip Webb
|
||||
*/
|
||||
@ConfigurationProperties(name = "shell", ignoreUnknownFields = true)
|
||||
@ConfigurationProperties(prefix = "shell", ignoreUnknownFields = true)
|
||||
public class ShellProperties {
|
||||
|
||||
private static Log logger = LogFactory.getLog(ShellProperties.class);
|
||||
@@ -279,7 +279,7 @@ public class ShellProperties {
|
||||
/**
|
||||
* Auth specific properties for JAAS authentication
|
||||
*/
|
||||
@ConfigurationProperties(name = "shell.auth.jaas", ignoreUnknownFields = false)
|
||||
@ConfigurationProperties(prefix = "shell.auth.jaas", ignoreUnknownFields = false)
|
||||
public static class JaasAuthenticationProperties extends
|
||||
CrshShellAuthenticationProperties {
|
||||
|
||||
@@ -305,7 +305,7 @@ public class ShellProperties {
|
||||
/**
|
||||
* Auth specific properties for key authentication
|
||||
*/
|
||||
@ConfigurationProperties(name = "shell.auth.key", ignoreUnknownFields = false)
|
||||
@ConfigurationProperties(prefix = "shell.auth.key", ignoreUnknownFields = false)
|
||||
public static class KeyAuthenticationProperties extends
|
||||
CrshShellAuthenticationProperties {
|
||||
|
||||
@@ -333,7 +333,7 @@ public class ShellProperties {
|
||||
/**
|
||||
* Auth specific properties for simple authentication
|
||||
*/
|
||||
@ConfigurationProperties(name = "shell.auth.simple", ignoreUnknownFields = false)
|
||||
@ConfigurationProperties(prefix = "shell.auth.simple", ignoreUnknownFields = false)
|
||||
public static class SimpleAuthenticationProperties extends
|
||||
CrshShellAuthenticationProperties {
|
||||
|
||||
@@ -402,7 +402,7 @@ public class ShellProperties {
|
||||
/**
|
||||
* Auth specific properties for Spring authentication
|
||||
*/
|
||||
@ConfigurationProperties(name = "shell.auth.spring", ignoreUnknownFields = false)
|
||||
@ConfigurationProperties(prefix = "shell.auth.spring", ignoreUnknownFields = false)
|
||||
public static class SpringAuthenticationProperties extends
|
||||
CrshShellAuthenticationProperties {
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2013 the original author or authors.
|
||||
* Copyright 2012-2014 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -43,7 +43,7 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
* @author Phillip Webb
|
||||
* @author Dave Syer
|
||||
*/
|
||||
@ConfigurationProperties(name = "endpoints.autoconfig", ignoreUnknownFields = false)
|
||||
@ConfigurationProperties(prefix = "endpoints.autoconfig", ignoreUnknownFields = false)
|
||||
public class AutoConfigurationReportEndpoint extends AbstractEndpoint<Report> {
|
||||
|
||||
@Autowired
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2013 the original author or authors.
|
||||
* Copyright 2012-2014 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -35,7 +35,7 @@ import org.springframework.core.env.Environment;
|
||||
*
|
||||
* @author Dave Syer
|
||||
*/
|
||||
@ConfigurationProperties(name = "endpoints.beans", ignoreUnknownFields = false)
|
||||
@ConfigurationProperties(prefix = "endpoints.beans", ignoreUnknownFields = false)
|
||||
public class BeansEndpoint extends AbstractEndpoint<List<Object>> implements
|
||||
ApplicationContextAware {
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ import com.fasterxml.jackson.databind.ser.impl.SimpleFilterProvider;
|
||||
*
|
||||
* @author Christian Dupuis
|
||||
*/
|
||||
@ConfigurationProperties(name = "endpoints.configprops", ignoreUnknownFields = false)
|
||||
@ConfigurationProperties(prefix = "endpoints.configprops", ignoreUnknownFields = false)
|
||||
public class ConfigurationPropertiesReportEndpoint extends
|
||||
AbstractEndpoint<Map<String, Object>> implements ApplicationContextAware {
|
||||
|
||||
@@ -138,7 +138,7 @@ public class ConfigurationPropertiesReportEndpoint extends
|
||||
ConfigurationProperties annotation = AnnotationUtils.findAnnotation(
|
||||
bean.getClass(), ConfigurationProperties.class);
|
||||
return (StringUtils.hasLength(annotation.value()) ? annotation.value()
|
||||
: annotation.name());
|
||||
: annotation.prefix());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2013 the original author or authors.
|
||||
* Copyright 2012-2014 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -28,7 +28,7 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
*
|
||||
* @author Dave Syer
|
||||
*/
|
||||
@ConfigurationProperties(name = "endpoints.dump", ignoreUnknownFields = false)
|
||||
@ConfigurationProperties(prefix = "endpoints.dump", ignoreUnknownFields = false)
|
||||
public class DumpEndpoint extends AbstractEndpoint<List<ThreadInfo>> {
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2013 the original author or authors.
|
||||
* Copyright 2012-2014 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -33,7 +33,7 @@ import org.springframework.core.env.StandardEnvironment;
|
||||
* @author Dave Syer
|
||||
* @author Phillip Webb
|
||||
*/
|
||||
@ConfigurationProperties(name = "endpoints.env", ignoreUnknownFields = false)
|
||||
@ConfigurationProperties(prefix = "endpoints.env", ignoreUnknownFields = false)
|
||||
public class EnvironmentEndpoint extends AbstractEndpoint<Map<String, Object>> implements
|
||||
EnvironmentAware {
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2013 the original author or authors.
|
||||
* Copyright 2012-2014 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -25,7 +25,7 @@ import org.springframework.util.Assert;
|
||||
*
|
||||
* @author Dave Syer
|
||||
*/
|
||||
@ConfigurationProperties(name = "endpoints.health", ignoreUnknownFields = false)
|
||||
@ConfigurationProperties(prefix = "endpoints.health", ignoreUnknownFields = false)
|
||||
public class HealthEndpoint<T> extends AbstractEndpoint<T> {
|
||||
|
||||
private final HealthIndicator<? extends T> indicator;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2013 the original author or authors.
|
||||
* Copyright 2012-2014 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -28,7 +28,7 @@ import org.springframework.util.Assert;
|
||||
*
|
||||
* @author Dave Syer
|
||||
*/
|
||||
@ConfigurationProperties(name = "endpoints.info", ignoreUnknownFields = false)
|
||||
@ConfigurationProperties(prefix = "endpoints.info", ignoreUnknownFields = false)
|
||||
public class InfoEndpoint extends AbstractEndpoint<Map<String, Object>> {
|
||||
|
||||
private final Map<String, ? extends Object> info;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2013 the original author or authors.
|
||||
* Copyright 2012-2014 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -28,7 +28,7 @@ import org.springframework.util.Assert;
|
||||
*
|
||||
* @author Dave Syer
|
||||
*/
|
||||
@ConfigurationProperties(name = "endpoints.metrics", ignoreUnknownFields = false)
|
||||
@ConfigurationProperties(prefix = "endpoints.metrics", ignoreUnknownFields = false)
|
||||
public class MetricsEndpoint extends AbstractEndpoint<Map<String, Object>> {
|
||||
|
||||
private final PublicMetrics metrics;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2013 the original author or authors.
|
||||
* Copyright 2012-2014 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -31,7 +31,7 @@ import org.springframework.context.ConfigurableApplicationContext;
|
||||
* @author Dave Syer
|
||||
* @author Christian Dupuis
|
||||
*/
|
||||
@ConfigurationProperties(name = "endpoints.shutdown", ignoreUnknownFields = false)
|
||||
@ConfigurationProperties(prefix = "endpoints.shutdown", ignoreUnknownFields = false)
|
||||
public class ShutdownEndpoint extends AbstractEndpoint<Map<String, Object>> implements
|
||||
ApplicationContextAware {
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ import org.springframework.util.Assert;
|
||||
*
|
||||
* @author Dave Syer
|
||||
*/
|
||||
@ConfigurationProperties(name = "endpoints.trace", ignoreUnknownFields = false)
|
||||
@ConfigurationProperties(prefix = "endpoints.trace", ignoreUnknownFields = false)
|
||||
public class TraceEndpoint extends AbstractEndpoint<List<Trace>> {
|
||||
|
||||
private final TraceRepository repository;
|
||||
|
||||
@@ -42,7 +42,7 @@ import org.springframework.web.servlet.mvc.ServletWrappingController;
|
||||
*
|
||||
* @author Christian Dupuis
|
||||
*/
|
||||
@ConfigurationProperties(name = "endpoints.jolokia", ignoreUnknownFields = false)
|
||||
@ConfigurationProperties(prefix = "endpoints.jolokia", ignoreUnknownFields = false)
|
||||
public class JolokiaMvcEndpoint implements MvcEndpoint, InitializingBean,
|
||||
ApplicationContextAware, ServletContextAware {
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ import org.springframework.web.context.request.RequestContextHolder;
|
||||
*
|
||||
* @author Dave Syer
|
||||
*/
|
||||
@ConfigurationProperties(name = "error")
|
||||
@ConfigurationProperties(prefix = "error")
|
||||
public class ManagementErrorEndpoint implements MvcEndpoint {
|
||||
|
||||
private final ErrorController controller;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013 the original author or authors.
|
||||
* Copyright 2013-2014 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -86,7 +86,7 @@ public class ConfigurationPropertiesReportEndpointParentTests {
|
||||
|
||||
}
|
||||
|
||||
@ConfigurationProperties(name = "test")
|
||||
@ConfigurationProperties(prefix = "test")
|
||||
public static class TestProperties {
|
||||
|
||||
private String myTestProperty = "654321";
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013 the original author or authors.
|
||||
* Copyright 2013-2014 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -104,7 +104,7 @@ public class ConfigurationPropertiesReportEndpointTests extends
|
||||
|
||||
}
|
||||
|
||||
@ConfigurationProperties(name = "test")
|
||||
@ConfigurationProperties(prefix = "test")
|
||||
public static class TestProperties {
|
||||
|
||||
private String dbPassword = "123456";
|
||||
|
||||
Reference in New Issue
Block a user