From 74b552826b175904ecf050e1c46032c8b71dfcae Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Wed, 16 Aug 2017 13:41:32 +0200 Subject: [PATCH] Remove EndpointProperties `EndpointProperties` is a left over of the infrastructure in 1.x and is no longer used. Besides the `endpoints.enabled` property is now `endpoints.all.enabled`. Closes gh-10016 --- .../actuate/endpoint/EndpointProperties.java | 64 ------------------- .../appendix-application-properties.adoc | 2 +- .../asciidoc/production-ready-features.adoc | 6 +- 3 files changed, 4 insertions(+), 68 deletions(-) delete mode 100644 spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/EndpointProperties.java diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/EndpointProperties.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/EndpointProperties.java deleted file mode 100644 index 1c09a4928d..0000000000 --- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/EndpointProperties.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright 2012-2017 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.boot.actuate.endpoint; - -import org.springframework.boot.context.properties.ConfigurationProperties; -import org.springframework.core.env.Environment; - -/** - * Global endpoint properties. - * - * @author Phillip Webb - * @since 1.3.0 - */ -@ConfigurationProperties(prefix = "endpoints") -public class EndpointProperties { - - private static final String ENDPOINTS_ENABLED_PROPERTY = "endpoints.enabled"; - - /** - * Enable endpoints. - */ - private Boolean enabled = true; - - public Boolean getEnabled() { - return this.enabled; - } - - public void setEnabled(Boolean enabled) { - this.enabled = enabled; - } - - /** - * Determine if an endpoint is enabled based on its specific property and taking into - * account the global default. - * @param environment the Spring environment or {@code null}. - * @param enabled the endpoint property or {@code null} - * @return if the endpoint is enabled - */ - public static boolean isEnabled(Environment environment, Boolean enabled) { - if (enabled != null) { - return enabled; - } - if (environment != null - && environment.containsProperty(ENDPOINTS_ENABLED_PROPERTY)) { - return environment.getProperty(ENDPOINTS_ENABLED_PROPERTY, Boolean.class); - } - return true; - } - -} diff --git a/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc b/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc index 0a6d0dd07e..868eed9ea2 100644 --- a/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc +++ b/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc @@ -1083,7 +1083,7 @@ content into your application; rather pick only the properties that you need. # ---------------------------------------- # ENDPOINTS ({sc-spring-boot-actuator}/endpoint/AbstractEndpoint.{sc-ext}[AbstractEndpoint] subclasses) - endpoints.enabled=true # Enable endpoints. + endpoints.all.enabled=true # Enable all endpoints. endpoints.auditevents.enabled= # Enable the endpoint. endpoints.autoconfig.enabled= # Enable the endpoint. endpoints.beans.enabled= # Enable the endpoint. diff --git a/spring-boot-docs/src/main/asciidoc/production-ready-features.adoc b/spring-boot-docs/src/main/asciidoc/production-ready-features.adoc index c12b1d6c91..3112acc608 100644 --- a/spring-boot-docs/src/main/asciidoc/production-ready-features.adoc +++ b/spring-boot-docs/src/main/asciidoc/production-ready-features.adoc @@ -208,12 +208,12 @@ NOTE: The prefix ‟`endpoints` + `.` + `name`” is used to uniquely identify t that is being configured. By default, all endpoints except for `shutdown` are enabled. If you prefer to -specifically "`opt-in`" endpoint enablement you can use the `endpoints.enabled` property. -For example, the following will disable _all_ endpoints except for `info`: +specifically "`opt-in`" endpoint enablement you can use the `endpoints.all.enabled` +property. For example, the following will disable _all_ endpoints except for `info`: [source,properties,indent=0] ---- - endpoints.enabled=false + endpoints.all.enabled=false endpoints.info.enabled=true ----