Skip to content

Commit 65e9d6a

Browse files
committed
Add property description
Set the field javadoc of many properties that are managed via configuration so that the "description" field is available in the meta-data. Closes spring-projectsgh-1808
1 parent 40a7445 commit 65e9d6a

File tree

48 files changed

+767
-31
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+767
-31
lines changed

spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/EndpointMBeanExportProperties.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,20 @@
3030
@ConfigurationProperties(prefix = "endpoints.jmx")
3131
public class EndpointMBeanExportProperties {
3232

33+
/**
34+
* JMX domain name. Initialized with the value of 'spring.jmx.default-domain' if set.
35+
*/
3336
@Value("${spring.jmx.default_domain:}")
3437
private String domain;
3538

39+
/**
40+
* Ensure that ObjectNames are modified in case of conflict.
41+
*/
3642
private boolean uniqueNames = false;
3743

44+
/**
45+
* Enable the JMX endpoints.
46+
*/
3847
private boolean enabled = true;
3948

4049
private Properties staticNames = new Properties();

spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/HealthIndicatorAutoConfigurationProperties.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@
2929
@ConfigurationProperties("management.health.status")
3030
public class HealthIndicatorAutoConfigurationProperties {
3131

32+
/**
33+
* Comma-separated list of health statuses in order of severity.
34+
*/
3235
private List<String> order = null;
3336

3437
public List<String> getOrder() {

spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/HealthMvcEndpointProperties.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@
3232
@ConfigurationProperties(prefix = "endpoints.health")
3333
public class HealthMvcEndpointProperties {
3434

35+
/**
36+
* Mapping of health statuses to HttpStatus codes. By default, registered
37+
* health statuses map to sensible defaults (i.e. UP maps to 200).
38+
*/
3539
private Map<String, HttpStatus> mapping = new HashMap<String, HttpStatus>();
3640

3741
public Map<String, HttpStatus> getMapping() {

spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/JolokiaProperties.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@
3030
@ConfigurationProperties(prefix = "jolokia")
3131
public class JolokiaProperties {
3232

33+
/**
34+
* Jolokia settings. These are traditionally set using servlet parameters, refer
35+
* to the documentation of Jolokia for more details.
36+
*/
3337
private Map<String, String> config = new HashMap<String, String>();
3438

3539
public Map<String, String> getConfig() {

spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/ManagementServerProperties.java

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,25 @@ public class ManagementServerProperties implements SecurityPrequisite {
5353
*/
5454
public static final int ACCESS_OVERRIDE_ORDER = ManagementServerProperties.BASIC_AUTH_ORDER - 1;
5555

56+
/**
57+
* Management endpoint HTTP port. Use the same port as the applicationby default.
58+
*/
5659
private Integer port;
5760

61+
/**
62+
* Network address that the management endpoints should bind to.
63+
*/
5864
private InetAddress address;
5965

66+
/**
67+
* Management endpoint context-path.
68+
*/
6069
@NotNull
6170
private String contextPath = "";
6271

72+
/**
73+
* Add the "X-Application-Context" HTTP header in each response.
74+
*/
6375
private boolean addApplicationContextHeader = true;
6476

6577
private final Security security = maybeCreateSecurity();
@@ -114,10 +126,19 @@ public void setAddApplicationContextHeader(boolean addApplicationContextHeader)
114126
*/
115127
public static class Security {
116128

129+
/**
130+
* Enable security.
131+
*/
117132
private boolean enabled = true;
118133

134+
/**
135+
* Role required to access the management endpoint.
136+
*/
119137
private String role = "ADMIN";
120138

139+
/**
140+
* Session creating policy to use (always, never, if_required, stateless).
141+
*/
121142
private SessionCreationPolicy sessions = SessionCreationPolicy.STATELESS;
122143

123144
public SessionCreationPolicy getSessions() {

spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/ShellProperties.java

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,22 +41,43 @@ public class ShellProperties {
4141

4242
private static Log logger = LogFactory.getLog(ShellProperties.class);
4343

44+
/**
45+
* Authentication type (can be "simple", "spring", "key" or "jaas"). Auto-detected
46+
* according to the environment (i.e. if Spring Security is available, "spring" is used by
47+
* default).
48+
*/
4449
private String auth = "simple";
4550

4651
private boolean defaultAuth = true;
4752

4853
@Autowired(required = false)
4954
private CrshShellProperties[] additionalProperties = new CrshShellProperties[] { new SimpleAuthenticationProperties() };
5055

56+
/**
57+
* Scan for changes and update the command if necessary (in seconds).
58+
*/
5159
private int commandRefreshInterval = -1;
5260

61+
/**
62+
* Patterns to use to look for commands.
63+
*/
5364
private String[] commandPathPatterns = new String[] { "classpath*:/commands/**",
5465
"classpath*:/crash/commands/**" };
5566

67+
/**
68+
* Patterns to use to look for configurations.
69+
*/
5670
private String[] configPathPatterns = new String[] { "classpath*:/crash/*" };
5771

72+
/**
73+
* Comma-separated list of commands to disable.
74+
*/
5875
private String[] disabledCommands = new String[] { "jpa*", "jdbc*", "jndi*" };
5976

77+
/**
78+
* Comma-separated list of plugins to disable. Certain plugins are disabled
79+
* by default based on the environment.
80+
*/
6081
private String[] disabledPlugins = new String[0];
6182

6283
private final Ssh ssh = new Ssh();
@@ -207,10 +228,19 @@ public static abstract class CrshShellAuthenticationProperties extends
207228
*/
208229
public static class Ssh extends CrshShellProperties {
209230

231+
/**
232+
* Enable CRaSH SSH support.
233+
*/
210234
private boolean enabled = true;
211235

236+
/**
237+
* Path to the SSH server key.
238+
*/
212239
private String keyPath;
213240

241+
/**
242+
* SSH port.
243+
*/
214244
private String port = "2000";
215245

216246
@Override
@@ -256,9 +286,15 @@ public String getPort() {
256286
*/
257287
public static class Telnet extends CrshShellProperties {
258288

289+
/**
290+
* Enable CRaSH telnet support. Enabled by default if the TelnetPlugin is available.
291+
*/
259292
private boolean enabled = ClassUtils.isPresent("org.crsh.telnet.TelnetPlugin",
260293
ClassUtils.getDefaultClassLoader());
261294

295+
/**
296+
* Telnet port.
297+
*/
262298
private String port = "5000";
263299

264300
@Override
@@ -294,6 +330,9 @@ public String getPort() {
294330
public static class JaasAuthenticationProperties extends
295331
CrshShellAuthenticationProperties {
296332

333+
/**
334+
* JAAS domain.
335+
*/
297336
private String domain = "my-domain";
298337

299338
@Override
@@ -320,6 +359,9 @@ public String getDomain() {
320359
public static class KeyAuthenticationProperties extends
321360
CrshShellAuthenticationProperties {
322361

362+
/**
363+
* Path to the authentication key. This should point to a valid ".pem" file.
364+
*/
323365
private String path;
324366

325367
@Override
@@ -374,8 +416,14 @@ public void setUser(User user) {
374416

375417
public static class User {
376418

419+
/**
420+
* Login user.
421+
*/
377422
private String name = "user";
378423

424+
/**
425+
* Login password.
426+
*/
379427
private String password = UUID.randomUUID().toString();
380428

381429
private boolean defaultPassword = true;
@@ -417,6 +465,9 @@ public void setPassword(String password) {
417465
public static class SpringAuthenticationProperties extends
418466
CrshShellAuthenticationProperties {
419467

468+
/**
469+
* Comma-separated list of required roles to login to the CRaSH console.
470+
*/
420471
private String[] roles = new String[] { "ADMIN" };
421472

422473
@Override

spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/AbstractEndpoint.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,22 @@
2727
*/
2828
public abstract class AbstractEndpoint<T> implements Endpoint<T> {
2929

30+
/**
31+
* Endpoint identifier. With HTTP monitoring the identifier
32+
* of the endpoint is mapped to a URL (e.g. 'foo' is mapped to '/foo').
33+
*/
3034
@NotNull
3135
@Pattern(regexp = "\\w+", message = "ID must only contains letters, numbers and '_'")
3236
private String id;
3337

38+
/**
39+
* Enable security on the endpoint.
40+
*/
3441
private boolean sensitive;
3542

43+
/**
44+
* Enable the endpoint.
45+
*/
3646
private boolean enabled = true;
3747

3848
public AbstractEndpoint(String id) {

spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/HealthEndpoint.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ public class HealthEndpoint extends AbstractEndpoint<Health> {
3737

3838
private final HealthIndicator healthIndicator;
3939

40+
/**
41+
* Time to live for cached result, in milliseconds.
42+
*/
4043
private long timeToLive = 1000;
4144

4245
/**

spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/Sanitizer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public Sanitizer() {
3838
}
3939

4040
/**
41-
* Set the keys that should be sanitize. Keys can be simple strings that the property
41+
* Keys that should be sanitized. Keys can be simple strings that the property
4242
* ends with or regex expressions.
4343
* @param keysToSanitize the keys to sanitize
4444
*/

spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/mvc/JolokiaMvcEndpoint.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,21 @@
4747
public class JolokiaMvcEndpoint implements MvcEndpoint, InitializingBean,
4848
ApplicationContextAware, ServletContextAware {
4949

50+
/**
51+
* Endpoint URL path.
52+
*/
5053
@NotNull
5154
@Pattern(regexp = "/[^/]*", message = "Path must start with /")
5255
private String path;
5356

57+
/**
58+
* Enable security on the endpoint.
59+
*/
5460
private boolean sensitive;
5561

62+
/**
63+
* Enable the endpoint.
64+
*/
5665
private boolean enabled = true;
5766

5867
private final ServletWrappingController controller = new ServletWrappingController();

0 commit comments

Comments
 (0)