From b20262c1a712c2defb4cc7bd30368a6b8c394ab6 Mon Sep 17 00:00:00 2001 From: Dave Syer Date: Mon, 28 Apr 2014 12:21:58 +0100 Subject: [PATCH] Backout couchbase changes --- spring-boot-autoconfigure/pom.xml | 5 -- .../couchbase/CouchbaseAutoConfiguration.java | 70 ---------------- .../couchbase/CouchbaseProperties.java | 83 ------------------ ...ouchbaseRepositoriesAutoConfiguration.java | 44 ---------- ...aseRepositoriesAutoConfigureRegistrar.java | 55 ------------ .../main/resources/META-INF/spring.factories | 2 - ...aseRepositoriesAutoConfigurationTests.java | 82 ------------------ .../autoconfigure/data/couchbase/City.java | 84 ------------------- .../data/couchbase/CityRepository.java | 22 ----- spring-boot-dependencies/pom.xml | 12 --- spring-boot-starters/pom.xml | 1 - .../pom.xml | 30 ------- 12 files changed, 490 deletions(-) delete mode 100644 spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/couchbase/CouchbaseAutoConfiguration.java delete mode 100644 spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/couchbase/CouchbaseProperties.java delete mode 100644 spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/CouchbaseRepositoriesAutoConfiguration.java delete mode 100644 spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/CouchbaseRepositoriesAutoConfigureRegistrar.java delete mode 100644 spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/CouchbaseRepositoriesAutoConfigurationTests.java delete mode 100644 spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/couchbase/City.java delete mode 100644 spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/couchbase/CityRepository.java delete mode 100644 spring-boot-starters/spring-boot-starter-data-couchbase/pom.xml diff --git a/spring-boot-autoconfigure/pom.xml b/spring-boot-autoconfigure/pom.xml index 83397088da..18eb347285 100644 --- a/spring-boot-autoconfigure/pom.xml +++ b/spring-boot-autoconfigure/pom.xml @@ -136,11 +136,6 @@ spring-data-mongodb true - - org.springframework.data - spring-data-couchbase - true - org.springframework.data spring-data-redis diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/couchbase/CouchbaseAutoConfiguration.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/couchbase/CouchbaseAutoConfiguration.java deleted file mode 100644 index 9bb7d3651b..0000000000 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/couchbase/CouchbaseAutoConfiguration.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * 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. - * 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.autoconfigure.couchbase; - -import java.io.IOException; -import java.net.URISyntaxException; - -import javax.annotation.PreDestroy; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; -import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; -import org.springframework.boot.context.properties.EnableConfigurationProperties; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.data.couchbase.core.CouchbaseTemplate; -import org.springframework.data.couchbase.repository.config.EnableCouchbaseRepositories; - -import com.couchbase.client.CouchbaseClient; - -/** - * {@link EnableAutoConfiguration Auto-configuration} for Spring Data's Couchbase - * Repositories. - * - * @author Michael Nitschinger - * @since 1.1.0 - * @see CouchbaseProperties - * @see EnableCouchbaseRepositories - */ -@Configuration -@ConditionalOnClass({ CouchbaseClient.class, CouchbaseTemplate.class }) -@EnableConfigurationProperties(CouchbaseProperties.class) -public class CouchbaseAutoConfiguration { - - @Autowired - private CouchbaseProperties properties; - - @PreDestroy - public void close() throws URISyntaxException, IOException { - this.properties.closeClient(); - } - - @Bean - @ConditionalOnMissingBean(CouchbaseClient.class) - public CouchbaseClient couchbaseClient() throws URISyntaxException, IOException { - return this.properties.createClient(); - } - - @Bean - @ConditionalOnMissingBean(CouchbaseTemplate.class) - public CouchbaseTemplate couchbaseTemplate(CouchbaseClient couchbaseClient) { - return new CouchbaseTemplate(couchbaseClient); - } - -} diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/couchbase/CouchbaseProperties.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/couchbase/CouchbaseProperties.java deleted file mode 100644 index e8a23a43c2..0000000000 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/couchbase/CouchbaseProperties.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * 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. - * 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.autoconfigure.couchbase; - -import java.io.IOException; -import java.net.URI; -import java.net.URISyntaxException; -import java.util.Arrays; - -import org.springframework.boot.context.properties.ConfigurationProperties; - -import com.couchbase.client.CouchbaseClient; - -/** - * Couchbase properties. - * - * @author Michael Nitschinger - * @since 1.1.0 - */ -@ConfigurationProperties(prefix = "spring.data.couchbase") -public class CouchbaseProperties { - - private String host = "127.0.0.1"; - - private String bucket = "default"; - - private String password = ""; - - private CouchbaseClient client; - - public String getHost() { - return this.host; - } - - public void setHost(String host) { - this.host = host; - } - - public String getBucket() { - return this.bucket; - } - - public void setBucket(String bucket) { - this.bucket = bucket; - } - - public String getPassword() { - return this.password; - } - - public void setPassword(String password) { - this.password = password; - } - - public CouchbaseClient createClient() throws URISyntaxException, IOException { - if (this.client == null) { - this.client = new CouchbaseClient(Arrays.asList(new URI("http://" + getHost() - + ":8091/pools")), getBucket(), getPassword()); - } - return this.client; - } - - public void closeClient() { - if (this.client != null) { - this.client.shutdown(); - } - } - -} diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/CouchbaseRepositoriesAutoConfiguration.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/CouchbaseRepositoriesAutoConfiguration.java deleted file mode 100644 index dd3542ceba..0000000000 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/CouchbaseRepositoriesAutoConfiguration.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * 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. - * 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.autoconfigure.data; - -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; -import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; -import org.springframework.boot.autoconfigure.couchbase.CouchbaseProperties; -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Import; -import org.springframework.data.couchbase.repository.CouchbaseRepository; -import org.springframework.data.couchbase.repository.config.EnableCouchbaseRepositories; -import org.springframework.data.couchbase.repository.support.CouchbaseRepositoryFactoryBean; - -/** - * {@link EnableAutoConfiguration Auto-configuration} for Spring Data's Couchbase - * Repositories. - * - * @author Michael Nitschinger - * @since 1.1.0 - * @see CouchbaseProperties - * @see EnableCouchbaseRepositories - */ -@Configuration -@ConditionalOnClass({ CouchbaseRepository.class }) -@ConditionalOnMissingBean(CouchbaseRepositoryFactoryBean.class) -@Import(CouchbaseRepositoriesAutoConfigureRegistrar.class) -public class CouchbaseRepositoriesAutoConfiguration { - -} diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/CouchbaseRepositoriesAutoConfigureRegistrar.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/CouchbaseRepositoriesAutoConfigureRegistrar.java deleted file mode 100644 index f800cd79d2..0000000000 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/CouchbaseRepositoriesAutoConfigureRegistrar.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * 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. - * 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.autoconfigure.data; - -import java.lang.annotation.Annotation; - -import org.springframework.context.annotation.ImportBeanDefinitionRegistrar; -import org.springframework.data.couchbase.repository.config.CouchbaseRepositoryConfigurationExtension; -import org.springframework.data.couchbase.repository.config.EnableCouchbaseRepositories; -import org.springframework.data.repository.config.RepositoryConfigurationExtension; - -/** - * {@link ImportBeanDefinitionRegistrar} used to auto-configure Spring Data Couchbase - * Repositories. - * - * @author Michael Nitschinger - * @since 1.1.0 - */ -class CouchbaseRepositoriesAutoConfigureRegistrar extends - AbstractRepositoryConfigurationSourceSupport { - - @Override - protected Class getAnnotation() { - return EnableCouchbaseRepositories.class; - } - - @Override - protected Class getConfiguration() { - return EnableCouchbaseRepositoriesConfiguration.class; - } - - @Override - protected RepositoryConfigurationExtension getRepositoryConfigurationExtension() { - return new CouchbaseRepositoryConfigurationExtension(); - } - - @EnableCouchbaseRepositories - private static class EnableCouchbaseRepositoriesConfiguration { - } - -} diff --git a/spring-boot-autoconfigure/src/main/resources/META-INF/spring.factories b/spring-boot-autoconfigure/src/main/resources/META-INF/spring.factories index 0b74387da5..a0e0f5d762 100644 --- a/spring-boot-autoconfigure/src/main/resources/META-INF/spring.factories +++ b/spring-boot-autoconfigure/src/main/resources/META-INF/spring.factories @@ -13,8 +13,6 @@ org.springframework.boot.autoconfigure.data.JpaRepositoriesAutoConfiguration,\ org.springframework.boot.autoconfigure.data.MongoRepositoriesAutoConfiguration,\ org.springframework.boot.autoconfigure.hateoas.HypermediaAutoConfiguration,\ org.springframework.boot.autoconfigure.data.rest.RepositoryRestMvcAutoConfiguration,\ -org.springframework.boot.autoconfigure.couchbase.CouchbaseAutoConfiguration,\ -org.springframework.boot.autoconfigure.data.CouchbaseRepositoriesAutoConfiguration,\ org.springframework.boot.autoconfigure.redis.RedisAutoConfiguration,\ org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration,\ org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration,\ diff --git a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/CouchbaseRepositoriesAutoConfigurationTests.java b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/CouchbaseRepositoriesAutoConfigurationTests.java deleted file mode 100644 index 104247da08..0000000000 --- a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/CouchbaseRepositoriesAutoConfigurationTests.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * 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. - * 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.autoconfigure.data; - -import org.junit.Test; -import org.springframework.boot.autoconfigure.PropertyPlaceholderAutoConfiguration; -import org.springframework.boot.autoconfigure.TestAutoConfigurationPackage; -import org.springframework.boot.autoconfigure.couchbase.CouchbaseAutoConfiguration; -import org.springframework.boot.autoconfigure.data.couchbase.City; -import org.springframework.boot.autoconfigure.data.couchbase.CityRepository; -import org.springframework.context.annotation.AnnotationConfigApplicationContext; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; - -import com.couchbase.client.CouchbaseClient; - -import static org.junit.Assert.assertNotNull; -import static org.mockito.Mockito.mock; - -/** - * Tests for {@link CouchbaseRepositoriesAutoConfiguration}. - * - * @author Michael Nitschinger - */ -public class CouchbaseRepositoriesAutoConfigurationTests { - - private AnnotationConfigApplicationContext context; - - @Test - public void testDefaultRepositoryConfiguration() throws Exception { - this.context = new AnnotationConfigApplicationContext(); - this.context.register(TestConfiguration.class, CouchbaseAutoConfiguration.class, - CouchbaseRepositoriesAutoConfiguration.class, - PropertyPlaceholderAutoConfiguration.class); - this.context.refresh(); - assertNotNull(this.context.getBean(CityRepository.class)); - assertNotNull(this.context.getBean(CouchbaseClient.class)); - } - - @Test - public void testNoRepositoryConfiguration() throws Exception { - this.context = new AnnotationConfigApplicationContext(); - this.context.register(EmptyConfiguration.class, CouchbaseAutoConfiguration.class, - CouchbaseRepositoriesAutoConfiguration.class, - PropertyPlaceholderAutoConfiguration.class); - this.context.refresh(); - assertNotNull(this.context.getBean(CouchbaseClient.class)); - } - - @Configuration - @TestAutoConfigurationPackage(City.class) - protected static class TestConfiguration { - @Bean - public CouchbaseClient clientMock() { - return mock(CouchbaseClient.class); - } - } - - @Configuration - @TestAutoConfigurationPackage(CouchbaseRepositoriesAutoConfigurationTests.class) - protected static class EmptyConfiguration { - @Bean - public CouchbaseClient clientMock() { - return mock(CouchbaseClient.class); - } - } - -} diff --git a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/couchbase/City.java b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/couchbase/City.java deleted file mode 100644 index 9d203b68ff..0000000000 --- a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/couchbase/City.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * 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. - * 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.autoconfigure.data.couchbase; - -import java.io.Serializable; - -import org.springframework.data.annotation.Id; -import org.springframework.data.couchbase.core.mapping.Document; - -@Document -public class City implements Serializable { - - @Id - private String id; - - private String name; - - private String state; - - private String country; - - private String map; - - public City(String id, String name, String country) { - this.id = id; - this.name = name; - this.country = country; - } - - public String getId() { - return this.id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return this.name; - } - - public void setName(String name) { - this.name = name; - } - - public String getState() { - return this.state; - } - - public void setState(String state) { - this.state = state; - } - - public String getCountry() { - return this.country; - } - - public void setCountry(String country) { - this.country = country; - } - - public String getMap() { - return this.map; - } - - public void setMap(String map) { - this.map = map; - } - -} diff --git a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/couchbase/CityRepository.java b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/couchbase/CityRepository.java deleted file mode 100644 index 455c4986df..0000000000 --- a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/couchbase/CityRepository.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright 2012-2013 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.autoconfigure.data.couchbase; - -import org.springframework.data.couchbase.repository.CouchbaseRepository; - -public interface CityRepository extends CouchbaseRepository { -} diff --git a/spring-boot-dependencies/pom.xml b/spring-boot-dependencies/pom.xml index 56af195d2b..9db570e7af 100644 --- a/spring-boot-dependencies/pom.xml +++ b/spring-boot-dependencies/pom.xml @@ -48,7 +48,6 @@ 5.7.0 1.7.4 3.0.2 - 1.3.2 1.4 1.6 1.3.0-beta14 @@ -87,7 +86,6 @@ 4.0.3.RELEASE 3.0.2.RELEASE 2.2.6.RELEASE - 1.0.0.RELEASE 1.3.3.RELEASE 1.1.1.RELEASE Codd-SR2 @@ -131,11 +129,6 @@ metrics-servlets ${codahale-metrics.version} - - com.couchbase.client - couchbase-client - ${couchbase.version} - com.fasterxml.jackson.core jackson-databind @@ -582,11 +575,6 @@ spring-batch-core ${spring-batch.version} - - org.springframework.data - spring-data-couchbase - ${spring-data-couchbase.version} - org.springframework.data spring-data-gemfire diff --git a/spring-boot-starters/pom.xml b/spring-boot-starters/pom.xml index 93acdf3bf8..c31308c2ed 100644 --- a/spring-boot-starters/pom.xml +++ b/spring-boot-starters/pom.xml @@ -24,7 +24,6 @@ spring-boot-starter-amqp spring-boot-starter-aop spring-boot-starter-batch - spring-boot-starter-data-couchbase spring-boot-starter-data-gemfire spring-boot-starter-data-jpa spring-boot-starter-data-mongodb diff --git a/spring-boot-starters/spring-boot-starter-data-couchbase/pom.xml b/spring-boot-starters/spring-boot-starter-data-couchbase/pom.xml deleted file mode 100644 index 77a2eef3bd..0000000000 --- a/spring-boot-starters/spring-boot-starter-data-couchbase/pom.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-starters - 1.1.0.BUILD-SNAPSHOT - - spring-boot-starter-data-couchbase - jar - - ${basedir}/../.. - - - - ${project.groupId} - spring-boot-starter - ${project.version} - - - org.springframework.data - spring-data-couchbase - - - com.couchbase.client - couchbase-client - - -