Move code from spring-boot-actuator to spring-boot-elastichsearch
This commit is contained in:
committed by
Phillip Webb
parent
ee458e1909
commit
b7588f3ebd
@@ -21,13 +21,13 @@ import org.elasticsearch.client.RestClient;
|
||||
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
|
||||
import org.springframework.boot.actuate.autoconfigure.health.CompositeHealthContributorConfiguration;
|
||||
import org.springframework.boot.actuate.autoconfigure.health.ConditionalOnEnabledHealthIndicator;
|
||||
import org.springframework.boot.actuate.elasticsearch.ElasticsearchRestClientHealthIndicator;
|
||||
import org.springframework.boot.actuate.health.HealthContributor;
|
||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||
import org.springframework.boot.elasticsearch.actuate.health.ElasticsearchRestClientHealthIndicator;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
|
||||
/**
|
||||
@@ -39,7 +39,7 @@ import org.springframework.context.annotation.Bean;
|
||||
*/
|
||||
@AutoConfiguration(
|
||||
afterName = "org.springframework.boot.elasticsearch.autoconfigure.ElasticsearchRestClientAutoConfiguration")
|
||||
@ConditionalOnClass(RestClient.class)
|
||||
@ConditionalOnClass({ RestClient.class, ElasticsearchRestClientHealthIndicator.class })
|
||||
@ConditionalOnBean(RestClient.class)
|
||||
@ConditionalOnEnabledHealthIndicator("elasticsearch")
|
||||
public class ElasticsearchRestHealthContributorAutoConfiguration
|
||||
|
||||
@@ -20,10 +20,10 @@ import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.boot.actuate.autoconfigure.elasticsearch.ElasticsearchRestHealthContributorAutoConfiguration;
|
||||
import org.springframework.boot.actuate.autoconfigure.health.HealthContributorAutoConfiguration;
|
||||
import org.springframework.boot.actuate.elasticsearch.ElasticsearchRestClientHealthIndicator;
|
||||
import org.springframework.boot.autoconfigure.AutoConfigurations;
|
||||
import org.springframework.boot.data.elasticsearch.actuate.health.ElasticsearchReactiveHealthIndicator;
|
||||
import org.springframework.boot.data.elasticsearch.autoconfigure.ElasticsearchDataAutoConfiguration;
|
||||
import org.springframework.boot.elasticsearch.actuate.health.ElasticsearchRestClientHealthIndicator;
|
||||
import org.springframework.boot.elasticsearch.autoconfigure.ElasticsearchRestClientAutoConfiguration;
|
||||
import org.springframework.boot.elasticsearch.autoconfigure.ReactiveElasticsearchClientAutoConfiguration;
|
||||
import org.springframework.boot.test.context.runner.ApplicationContextRunner;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@@ -21,8 +21,8 @@ import org.elasticsearch.client.RestClientBuilder;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.boot.actuate.autoconfigure.health.HealthContributorAutoConfiguration;
|
||||
import org.springframework.boot.actuate.elasticsearch.ElasticsearchRestClientHealthIndicator;
|
||||
import org.springframework.boot.autoconfigure.AutoConfigurations;
|
||||
import org.springframework.boot.elasticsearch.actuate.health.ElasticsearchRestClientHealthIndicator;
|
||||
import org.springframework.boot.elasticsearch.autoconfigure.ElasticsearchRestClientAutoConfiguration;
|
||||
import org.springframework.boot.test.context.FilteredClassLoader;
|
||||
import org.springframework.boot.test.context.runner.ApplicationContextRunner;
|
||||
|
||||
@@ -61,7 +61,6 @@ dependencies {
|
||||
optional("org.eclipse.jetty:jetty-server") {
|
||||
exclude(group: "org.eclipse.jetty.toolchain", module: "jetty-jakarta-servlet-api")
|
||||
}
|
||||
optional("org.elasticsearch.client:elasticsearch-rest-client")
|
||||
optional("org.glassfish.jersey.core:jersey-server")
|
||||
optional("org.glassfish.jersey.containers:jersey-container-servlet-core")
|
||||
optional("org.hibernate.validator:hibernate-validator")
|
||||
|
||||
@@ -13,6 +13,7 @@ dependencies {
|
||||
api(project(":spring-boot-project:spring-boot"))
|
||||
api("org.elasticsearch.client:elasticsearch-rest-client")
|
||||
|
||||
optional(project(":spring-boot-project:spring-boot-actuator"))
|
||||
optional(project(":spring-boot-project:spring-boot-autoconfigure"))
|
||||
optional(project(":spring-boot-project:spring-boot-jsonb"))
|
||||
optional(project(":spring-boot-project:spring-boot-reactor"))
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2022 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.actuate.elasticsearch;
|
||||
package org.springframework.boot.elasticsearch.actuate.health;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
@@ -39,7 +39,7 @@ import org.springframework.util.StreamUtils;
|
||||
* @author Artsiom Yudovin
|
||||
* @author Brian Clozel
|
||||
* @author Filip Hrisafov
|
||||
* @since 2.7.0
|
||||
* @since 4.0.0
|
||||
*/
|
||||
public class ElasticsearchRestClientHealthIndicator extends AbstractHealthIndicator {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2019 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
@@ -15,6 +15,6 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* Actuator support for Elasticsearch.
|
||||
* Health integration for Elasticsearch.
|
||||
*/
|
||||
package org.springframework.boot.actuate.elasticsearch;
|
||||
package org.springframework.boot.elasticsearch.actuate.health;
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.actuate.elasticsearch;
|
||||
package org.springframework.boot.elasticsearch.actuate.health;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.IOException;
|
||||
Reference in New Issue
Block a user