Move code from spring-boot-actuator to spring-boot-couchbase

This commit is contained in:
Andy Wilkinson
2025-05-09 11:28:13 +01:00
committed by Phillip Webb
parent ec0370bc2e
commit 0c55d5beb8
12 changed files with 25 additions and 25 deletions

View File

@@ -21,13 +21,13 @@ import com.couchbase.client.java.Cluster;
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.couchbase.CouchbaseHealthIndicator;
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.couchbase.actuate.health.CouchbaseHealthIndicator;
import org.springframework.context.annotation.Bean;
/**
@@ -41,7 +41,7 @@ import org.springframework.context.annotation.Bean;
*/
@AutoConfiguration(after = CouchbaseReactiveHealthContributorAutoConfiguration.class,
afterName = "org.springframework.boot.couchbase.autoconfigure.CouchbaseAutoConfiguration")
@ConditionalOnClass(Cluster.class)
@ConditionalOnClass({ Cluster.class, CouchbaseHealthIndicator.class })
@ConditionalOnBean(Cluster.class)
@ConditionalOnEnabledHealthIndicator("couchbase")
public class CouchbaseHealthContributorAutoConfiguration

View File

@@ -22,13 +22,13 @@ import reactor.core.publisher.Flux;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.boot.actuate.autoconfigure.health.CompositeReactiveHealthContributorConfiguration;
import org.springframework.boot.actuate.autoconfigure.health.ConditionalOnEnabledHealthIndicator;
import org.springframework.boot.actuate.couchbase.CouchbaseReactiveHealthIndicator;
import org.springframework.boot.actuate.health.ReactiveHealthContributor;
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.couchbase.actuate.health.CouchbaseReactiveHealthIndicator;
import org.springframework.context.annotation.Bean;
/**
@@ -40,7 +40,7 @@ import org.springframework.context.annotation.Bean;
* @since 2.1.0
*/
@AutoConfiguration(afterName = "org.springframework.boot.couchbase.autoconfigure.CouchbaseAutoConfiguration")
@ConditionalOnClass({ Cluster.class, Flux.class })
@ConditionalOnClass({ Cluster.class, Flux.class, CouchbaseReactiveHealthIndicator.class })
@ConditionalOnBean(Cluster.class)
@ConditionalOnEnabledHealthIndicator("couchbase")
public class CouchbaseReactiveHealthContributorAutoConfiguration

View File

@@ -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.
@@ -20,9 +20,9 @@ import com.couchbase.client.java.Cluster;
import org.junit.jupiter.api.Test;
import org.springframework.boot.actuate.autoconfigure.health.HealthContributorAutoConfiguration;
import org.springframework.boot.actuate.couchbase.CouchbaseHealthIndicator;
import org.springframework.boot.actuate.couchbase.CouchbaseReactiveHealthIndicator;
import org.springframework.boot.autoconfigure.AutoConfigurations;
import org.springframework.boot.couchbase.actuate.health.CouchbaseHealthIndicator;
import org.springframework.boot.couchbase.actuate.health.CouchbaseReactiveHealthIndicator;
import org.springframework.boot.test.context.runner.ApplicationContextRunner;
import static org.assertj.core.api.Assertions.assertThat;

View File

@@ -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.
@@ -20,9 +20,9 @@ import com.couchbase.client.java.Cluster;
import org.junit.jupiter.api.Test;
import org.springframework.boot.actuate.autoconfigure.health.HealthContributorAutoConfiguration;
import org.springframework.boot.actuate.couchbase.CouchbaseHealthIndicator;
import org.springframework.boot.actuate.couchbase.CouchbaseReactiveHealthIndicator;
import org.springframework.boot.autoconfigure.AutoConfigurations;
import org.springframework.boot.couchbase.actuate.health.CouchbaseHealthIndicator;
import org.springframework.boot.couchbase.actuate.health.CouchbaseReactiveHealthIndicator;
import org.springframework.boot.test.context.runner.ApplicationContextRunner;
import static org.assertj.core.api.Assertions.assertThat;

View File

@@ -81,7 +81,6 @@ dependencies {
optional("org.springframework:spring-web")
optional("org.springframework:spring-webmvc")
optional("org.springframework.graphql:spring-graphql")
optional("org.springframework.data:spring-data-couchbase")
optional("org.springframework.data:spring-data-elasticsearch")
optional("org.springframework.data:spring-data-ldap")
optional("org.springframework.data:spring-data-mongodb")

View File

@@ -13,6 +13,7 @@ dependencies {
api(project(":spring-boot-project:spring-boot"))
api("com.couchbase.client:java-client")
optional(project(":spring-boot-project:spring-boot-actuator"))
optional(project(":spring-boot-project:spring-boot-autoconfigure"))
optional(project(":spring-boot-project:spring-boot-jackson"))

View File

@@ -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.
@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.actuate.couchbase;
package org.springframework.boot.couchbase.actuate.health;
import java.util.Collection;
import java.util.HashMap;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.actuate.couchbase;
package org.springframework.boot.couchbase.actuate.health;
import com.couchbase.client.core.diagnostics.DiagnosticsResult;
import com.couchbase.client.java.Cluster;
@@ -29,7 +29,7 @@ import org.springframework.util.Assert;
*
* @author Eddú Meléndez
* @author Stephane Nicoll
* @since 2.0.0
* @since 4.0.0
*/
public class CouchbaseHealthIndicator extends AbstractHealthIndicator {

View File

@@ -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.couchbase;
package org.springframework.boot.couchbase.actuate.health;
import com.couchbase.client.java.Cluster;
import reactor.core.publisher.Mono;
@@ -28,7 +28,7 @@ import org.springframework.boot.actuate.health.ReactiveHealthIndicator;
*
* @author Mikalai Lushchytski
* @author Stephane Nicoll
* @since 2.1.0
* @since 4.0.0
*/
public class CouchbaseReactiveHealthIndicator extends AbstractReactiveHealthIndicator {

View File

@@ -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 Couchbase.
* Health integration for Couchbase.
*/
package org.springframework.boot.actuate.couchbase;
package org.springframework.boot.couchbase.actuate.health;

View File

@@ -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.couchbase;
package org.springframework.boot.couchbase.actuate.health;
import java.util.Arrays;
import java.util.Collections;

View File

@@ -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.couchbase;
package org.springframework.boot.couchbase.actuate.health;
import java.time.Duration;
import java.util.Arrays;