From cfcf8392324de91b2ce08ed31b328fc93b377b22 Mon Sep 17 00:00:00 2001 From: Oliver Gierke Date: Thu, 13 Oct 2011 20:27:03 +0200 Subject: [PATCH] DATADOC-297 - Pruned irrelevant sub modules. Removed CouchDB module as well as the generic document one. Renamed document-parent into mongodb-parent. Adapted poms accordingly. --- pom.xml | 7 +- spring-data-couchdb/pom.xml | 156 --------- .../CouchServerResourceUsageException.java | 34 -- .../document/couchdb/CouchUsageException.java | 34 -- .../couchdb/DocumentExistsException.java | 34 -- .../DocumentRetrievalFailureException.java | 35 -- ...UncategorizedCouchDataAccessException.java | 34 -- .../document/couchdb/admin/CouchAdmin.java | 64 ---- .../couchdb/admin/CouchAdminOperations.java | 34 -- .../data/document/couchdb/admin/DbInfo.java | 72 ---- .../couchdb/config/CouchJmxParser.java | 70 ---- .../couchdb/config/CouchNamespaceHandler.java | 43 --- .../couchdb/core/CouchOperations.java | 63 ---- .../document/couchdb/core/CouchTemplate.java | 143 -------- ...hDbMappingJacksonHttpMessageConverter.java | 315 ------------------ .../couchdb/monitor/AbstractMonitor.java | 41 --- .../document/couchdb/monitor/ServerInfo.java | 62 ---- .../couchdb/monitor/package-info.java | 4 - .../document/couchdb/support/CouchUtils.java | 81 ----- .../main/resources/META-INF/spring.handlers | 1 - .../main/resources/META-INF/spring.schemas | 2 - .../main/resources/META-INF/spring.tooling | 4 - .../couchdb/config/spring-couch-1.0.xsd | 33 -- .../data/document/couchdb/DummyDocument.java | 77 ----- .../data/document/couchdb/IsBodyEqual.java | 52 --- .../admin/CouchAdminIntegrationTests.java | 38 --- ...AbstractCouchTemplateIntegrationTests.java | 118 ------- .../document/couchdb/core/CouchConstants.java | 27 -- .../core/CouchTemplateIntegrationTests.java | 39 --- .../couchdb/core/CouchTemplateTests.java | 30 -- .../document/couchdb/monitor/JmxServer.java | 36 -- .../src/test/resources/log4j.properties | 13 - .../src/test/resources/server-jmx.xml | 24 -- spring-data-couchdb/template.mf | 24 -- spring-data-mongodb-cross-store/pom.xml | 5 +- spring-data-mongodb-log4j/pom.xml | 5 +- .../pom.xml | 14 +- spring-data-mongodb/pom.xml | 7 +- .../event/AbstractMongoEventListener.java | 1 - 39 files changed, 17 insertions(+), 1859 deletions(-) delete mode 100644 spring-data-couchdb/pom.xml delete mode 100644 spring-data-couchdb/src/main/java/org/springframework/data/document/couchdb/CouchServerResourceUsageException.java delete mode 100644 spring-data-couchdb/src/main/java/org/springframework/data/document/couchdb/CouchUsageException.java delete mode 100644 spring-data-couchdb/src/main/java/org/springframework/data/document/couchdb/DocumentExistsException.java delete mode 100644 spring-data-couchdb/src/main/java/org/springframework/data/document/couchdb/DocumentRetrievalFailureException.java delete mode 100644 spring-data-couchdb/src/main/java/org/springframework/data/document/couchdb/UncategorizedCouchDataAccessException.java delete mode 100644 spring-data-couchdb/src/main/java/org/springframework/data/document/couchdb/admin/CouchAdmin.java delete mode 100644 spring-data-couchdb/src/main/java/org/springframework/data/document/couchdb/admin/CouchAdminOperations.java delete mode 100644 spring-data-couchdb/src/main/java/org/springframework/data/document/couchdb/admin/DbInfo.java delete mode 100644 spring-data-couchdb/src/main/java/org/springframework/data/document/couchdb/config/CouchJmxParser.java delete mode 100644 spring-data-couchdb/src/main/java/org/springframework/data/document/couchdb/config/CouchNamespaceHandler.java delete mode 100644 spring-data-couchdb/src/main/java/org/springframework/data/document/couchdb/core/CouchOperations.java delete mode 100644 spring-data-couchdb/src/main/java/org/springframework/data/document/couchdb/core/CouchTemplate.java delete mode 100644 spring-data-couchdb/src/main/java/org/springframework/data/document/couchdb/core/support/CouchDbMappingJacksonHttpMessageConverter.java delete mode 100644 spring-data-couchdb/src/main/java/org/springframework/data/document/couchdb/monitor/AbstractMonitor.java delete mode 100644 spring-data-couchdb/src/main/java/org/springframework/data/document/couchdb/monitor/ServerInfo.java delete mode 100644 spring-data-couchdb/src/main/java/org/springframework/data/document/couchdb/monitor/package-info.java delete mode 100644 spring-data-couchdb/src/main/java/org/springframework/data/document/couchdb/support/CouchUtils.java delete mode 100644 spring-data-couchdb/src/main/resources/META-INF/spring.handlers delete mode 100644 spring-data-couchdb/src/main/resources/META-INF/spring.schemas delete mode 100644 spring-data-couchdb/src/main/resources/META-INF/spring.tooling delete mode 100644 spring-data-couchdb/src/main/resources/org/springframework/data/document/couchdb/config/spring-couch-1.0.xsd delete mode 100644 spring-data-couchdb/src/test/java/org/springframework/data/document/couchdb/DummyDocument.java delete mode 100644 spring-data-couchdb/src/test/java/org/springframework/data/document/couchdb/IsBodyEqual.java delete mode 100644 spring-data-couchdb/src/test/java/org/springframework/data/document/couchdb/admin/CouchAdminIntegrationTests.java delete mode 100644 spring-data-couchdb/src/test/java/org/springframework/data/document/couchdb/core/AbstractCouchTemplateIntegrationTests.java delete mode 100644 spring-data-couchdb/src/test/java/org/springframework/data/document/couchdb/core/CouchConstants.java delete mode 100644 spring-data-couchdb/src/test/java/org/springframework/data/document/couchdb/core/CouchTemplateIntegrationTests.java delete mode 100644 spring-data-couchdb/src/test/java/org/springframework/data/document/couchdb/core/CouchTemplateTests.java delete mode 100644 spring-data-couchdb/src/test/java/org/springframework/data/document/couchdb/monitor/JmxServer.java delete mode 100644 spring-data-couchdb/src/test/resources/log4j.properties delete mode 100644 spring-data-couchdb/src/test/resources/server-jmx.xml delete mode 100644 spring-data-couchdb/template.mf rename {spring-data-document-parent => spring-data-mongodb-parent}/pom.xml (96%) diff --git a/pom.xml b/pom.xml index c430f0591..f7fc50be5 100644 --- a/pom.xml +++ b/pom.xml @@ -3,16 +3,15 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> 4.0.0 org.springframework.data - spring-data-document-dist - Spring Data Document Distribution + spring-data-mongo-dist + Spring Data MongoDB Distribution 1.0.0.BUILD-SNAPSHOT pom - spring-data-document-parent spring-data-mongodb spring-data-mongodb-cross-store spring-data-mongodb-log4j - + spring-data-mongodb-parent diff --git a/spring-data-couchdb/pom.xml b/spring-data-couchdb/pom.xml deleted file mode 100644 index 82a0d6b0a..000000000 --- a/spring-data-couchdb/pom.xml +++ /dev/null @@ -1,156 +0,0 @@ - - 4.0.0 - - org.springframework.data - spring-data-document-parent - 1.0.0.BUILD-SNAPSHOT - ../spring-data-document-parent/pom.xml - - spring-data-couchdb - jar - Spring Data CouchDB Support - - - - The Apache Software License, Version 2.0 - http://www.apache.org/licenses/LICENSE-2.0.txt - repo - - - - - - tareq.abedrabbo - Tareq Abedrabbo - tareq.abedrabbo@opencredo.com - OpenCredo - http://www.opencredo.org - - Project Admin - Developer - - +0 - - - tomas.lukosius - Tomas Lukosius - tomas.lukosius@opencredo.com - OpenCredo - http://www.opencredo.org - - Project Admin - Developer - - +0 - - - - - - - - org.springframework - spring-beans - - - org.springframework - spring-tx - - - - org.springframework - spring-test - test - - - - - org.springframework.data - spring-data-commons-core - - - - - javax.servlet - servlet-api - 2.5 - provided - - - org.springframework - spring-core - ${org.springframework.version} - - - org.springframework - spring-web - ${org.springframework.version} - - - org.springframework - spring-webmvc - ${org.springframework.version} - - - - - org.codehaus.jackson - jackson-core-asl - 1.6.1 - - - org.codehaus.jackson - jackson-mapper-asl - 1.6.1 - - - - javax.annotation - jsr250-api - true - - - - junit - junit - test - - - - org.hamcrest - hamcrest-all - 1.1 - test - - - - org.mockito - mockito-all - test - - - - junit - junit - - - - - com.google.code.jcouchdb - jcouchdb - 0.11.0-1 - - - - - - - - com.springsource.bundlor - com.springsource.bundlor.maven - - - - - diff --git a/spring-data-couchdb/src/main/java/org/springframework/data/document/couchdb/CouchServerResourceUsageException.java b/spring-data-couchdb/src/main/java/org/springframework/data/document/couchdb/CouchServerResourceUsageException.java deleted file mode 100644 index 8221a5151..000000000 --- a/spring-data-couchdb/src/main/java/org/springframework/data/document/couchdb/CouchServerResourceUsageException.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2011 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.data.document.couchdb; - -import org.springframework.dao.InvalidDataAccessResourceUsageException; -import org.springframework.web.client.HttpServerErrorException; - -public class CouchServerResourceUsageException extends InvalidDataAccessResourceUsageException { - - /** - * Create a new CouchServerResourceUsageException, - * wrapping an arbitrary HttpServerErrorException. - * - * @param cause the HttpServerErrorException thrown - */ - public CouchServerResourceUsageException(HttpServerErrorException cause) { - super(cause != null ? cause.getMessage() : null, cause); - } - -} - diff --git a/spring-data-couchdb/src/main/java/org/springframework/data/document/couchdb/CouchUsageException.java b/spring-data-couchdb/src/main/java/org/springframework/data/document/couchdb/CouchUsageException.java deleted file mode 100644 index 16dd54432..000000000 --- a/spring-data-couchdb/src/main/java/org/springframework/data/document/couchdb/CouchUsageException.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2011 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.data.document.couchdb; - -import org.springframework.dao.InvalidDataAccessApiUsageException; -import org.springframework.web.client.HttpClientErrorException; - -public class CouchUsageException extends InvalidDataAccessApiUsageException { - - /** - * Create a new CouchUsageException, - * wrapping an arbitrary HttpServerErrorException. - * - * @param cause the HttpServerErrorException thrown - */ - public CouchUsageException(HttpClientErrorException cause) { - super(cause != null ? cause.getMessage() : null, cause); - } - -} - diff --git a/spring-data-couchdb/src/main/java/org/springframework/data/document/couchdb/DocumentExistsException.java b/spring-data-couchdb/src/main/java/org/springframework/data/document/couchdb/DocumentExistsException.java deleted file mode 100644 index 69ec7c871..000000000 --- a/spring-data-couchdb/src/main/java/org/springframework/data/document/couchdb/DocumentExistsException.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2011 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.data.document.couchdb; - -import org.springframework.dao.DataIntegrityViolationException; -import org.springframework.web.client.HttpStatusCodeException; - -public class DocumentExistsException extends DataIntegrityViolationException { - - /** - * Create a new DocumentExistsException, - * wrapping an arbitrary HttpServerErrorException. - * - * @param cause the HttpServerErrorException thrown - */ - public DocumentExistsException(String documentId, HttpStatusCodeException cause) { - super(cause != null ? cause.getMessage() : null, cause); - } - -} - diff --git a/spring-data-couchdb/src/main/java/org/springframework/data/document/couchdb/DocumentRetrievalFailureException.java b/spring-data-couchdb/src/main/java/org/springframework/data/document/couchdb/DocumentRetrievalFailureException.java deleted file mode 100644 index b9359e538..000000000 --- a/spring-data-couchdb/src/main/java/org/springframework/data/document/couchdb/DocumentRetrievalFailureException.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2011 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.data.document.couchdb; - -import org.springframework.dao.DataRetrievalFailureException; - -public class DocumentRetrievalFailureException extends - DataRetrievalFailureException { - - private String documentPath; - - public DocumentRetrievalFailureException(String documentPath) { - super("Could not find document at path = " + documentPath); - this.documentPath = documentPath; - } - - public String getDocumentPath() { - return documentPath; - } - - -} diff --git a/spring-data-couchdb/src/main/java/org/springframework/data/document/couchdb/UncategorizedCouchDataAccessException.java b/spring-data-couchdb/src/main/java/org/springframework/data/document/couchdb/UncategorizedCouchDataAccessException.java deleted file mode 100644 index c4828c11b..000000000 --- a/spring-data-couchdb/src/main/java/org/springframework/data/document/couchdb/UncategorizedCouchDataAccessException.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2011 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.data.document.couchdb; - -import org.springframework.dao.UncategorizedDataAccessException; -import org.springframework.web.client.RestClientException; - -public class UncategorizedCouchDataAccessException extends UncategorizedDataAccessException { - - /** - * Create a new HibernateSystemException, - * wrapping an arbitrary HibernateException. - * - * @param cause the HibernateException thrown - */ - public UncategorizedCouchDataAccessException(RestClientException cause) { - super(cause != null ? cause.getMessage() : null, cause); - } - -} - diff --git a/spring-data-couchdb/src/main/java/org/springframework/data/document/couchdb/admin/CouchAdmin.java b/spring-data-couchdb/src/main/java/org/springframework/data/document/couchdb/admin/CouchAdmin.java deleted file mode 100644 index 0d1a3796b..000000000 --- a/spring-data-couchdb/src/main/java/org/springframework/data/document/couchdb/admin/CouchAdmin.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright 2011 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.data.document.couchdb.admin; - -import java.util.Arrays; -import java.util.List; -import java.util.Map; - -import org.springframework.data.document.couchdb.support.CouchUtils; -import org.springframework.util.StringUtils; -import org.springframework.web.client.RestOperations; -import org.springframework.web.client.RestTemplate; - -public class CouchAdmin implements CouchAdminOperations { - - private String databaseUrl; - private RestOperations restOperations = new RestTemplate(); - - public CouchAdmin(String databaseUrl) { - - if (!databaseUrl.trim().endsWith("/")) { - this.databaseUrl = databaseUrl.trim() + "/"; - } else { - this.databaseUrl = databaseUrl.trim(); - } - } - - public List listDatabases() { - String dbs = restOperations.getForObject(databaseUrl + "_all_dbs", String.class); - return Arrays.asList(StringUtils.commaDelimitedListToStringArray(dbs)); - } - - public void createDatabase(String dbName) { - org.springframework.util.Assert.hasText(dbName); - restOperations.put(databaseUrl + dbName, null); - - } - - public void deleteDatabase(String dbName) { - org.springframework.util.Assert.hasText(dbName); - restOperations.delete(CouchUtils.ensureTrailingSlash(databaseUrl + dbName)); - - } - - public DbInfo getDatabaseInfo(String dbName) { - String url = CouchUtils.ensureTrailingSlash(databaseUrl + dbName); - Map dbInfoMap = (Map) restOperations.getForObject(url, Map.class); - return new DbInfo(dbInfoMap); - } - -} \ No newline at end of file diff --git a/spring-data-couchdb/src/main/java/org/springframework/data/document/couchdb/admin/CouchAdminOperations.java b/spring-data-couchdb/src/main/java/org/springframework/data/document/couchdb/admin/CouchAdminOperations.java deleted file mode 100644 index 029e403ad..000000000 --- a/spring-data-couchdb/src/main/java/org/springframework/data/document/couchdb/admin/CouchAdminOperations.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2011 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.data.document.couchdb.admin; - -import java.util.List; - -public interface CouchAdminOperations { - - - // functionality for /_special - replication, logs, UUIDs - - List listDatabases(); - - void createDatabase(String name); - - void deleteDatabase(String name); - - DbInfo getDatabaseInfo(String name); - - -} diff --git a/spring-data-couchdb/src/main/java/org/springframework/data/document/couchdb/admin/DbInfo.java b/spring-data-couchdb/src/main/java/org/springframework/data/document/couchdb/admin/DbInfo.java deleted file mode 100644 index e65672f92..000000000 --- a/spring-data-couchdb/src/main/java/org/springframework/data/document/couchdb/admin/DbInfo.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright 2011 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.data.document.couchdb.admin; - -import java.util.Collections; -import java.util.Map; - -public class DbInfo { - - private Map dbInfoMap; - - public DbInfo(Map dbInfoMap) { - super(); - this.dbInfoMap = dbInfoMap; - } - - public boolean isCompactRunning() { - return (Boolean) this.dbInfoMap.get("compact_running"); - } - - public String getDbName() { - return (String) this.dbInfoMap.get("db_name"); - } - - public long getDiskFormatVersion() { - return (Long) this.dbInfoMap.get("disk_format_version"); - } - - public long getDiskSize() { - return (Long) this.dbInfoMap.get("disk_size"); - } - - public long getDocCount() { - return (Long) this.dbInfoMap.get("doc_count"); - } - - public long getDocDeleteCount() { - return (Long) this.dbInfoMap.get("doc_del_count"); - } - - public long getInstanceStartTime() { - return (Long) this.dbInfoMap.get("instance_start_time"); - } - - public long getPurgeSequence() { - return (Long) this.dbInfoMap.get("purge_seq"); - } - - public long getUpdateSequence() { - return (Long) this.dbInfoMap.get("update_seq"); - } - - public Map getDbInfoMap() { - return Collections.unmodifiableMap(dbInfoMap); - } - - -} diff --git a/spring-data-couchdb/src/main/java/org/springframework/data/document/couchdb/config/CouchJmxParser.java b/spring-data-couchdb/src/main/java/org/springframework/data/document/couchdb/config/CouchJmxParser.java deleted file mode 100644 index 539084541..000000000 --- a/spring-data-couchdb/src/main/java/org/springframework/data/document/couchdb/config/CouchJmxParser.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright 2011 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.data.document.couchdb.config; - -import org.springframework.beans.factory.config.BeanDefinition; -import org.springframework.beans.factory.parsing.BeanComponentDefinition; -import org.springframework.beans.factory.parsing.CompositeComponentDefinition; -import org.springframework.beans.factory.support.BeanDefinitionBuilder; -import org.springframework.beans.factory.xml.BeanDefinitionParser; -import org.springframework.beans.factory.xml.ParserContext; -import org.springframework.data.document.couchdb.monitor.ServerInfo; -import org.springframework.util.StringUtils; -import org.w3c.dom.Element; - -public class CouchJmxParser implements BeanDefinitionParser { - - public BeanDefinition parse(Element element, ParserContext parserContext) { - String databaseUrl = element.getAttribute("database-url"); - if (!StringUtils.hasText(databaseUrl)) { - databaseUrl = "http://localhost:5984"; - } - registerJmxComponents(databaseUrl, element, parserContext); - return null; - } - - protected void registerJmxComponents(String databaseUrl, Element element, ParserContext parserContext) { - Object eleSource = parserContext.extractSource(element); - - CompositeComponentDefinition compositeDef = new CompositeComponentDefinition(element.getTagName(), eleSource); - - /* - createBeanDefEntry(AssertMetrics.class, compositeDef, mongoRefName, eleSource, parserContext); - createBeanDefEntry(BackgroundFlushingMetrics.class, compositeDef, mongoRefName, eleSource, parserContext); - createBeanDefEntry(BtreeIndexCounters.class, compositeDef, mongoRefName, eleSource, parserContext); - createBeanDefEntry(ConnectionMetrics.class, compositeDef, mongoRefName, eleSource, parserContext); - createBeanDefEntry(GlobalLockMetrics.class, compositeDef, mongoRefName, eleSource, parserContext); - createBeanDefEntry(MemoryMetrics.class, compositeDef, mongoRefName, eleSource, parserContext); - createBeanDefEntry(OperationCounters.class, compositeDef, mongoRefName, eleSource, parserContext); - */ - createBeanDefEntry(ServerInfo.class, compositeDef, databaseUrl, eleSource, parserContext); - //createBeanDefEntry(MongoAdmin.class, compositeDef, mongoRefName, eleSource, parserContext); - - - parserContext.registerComponent(compositeDef); - - } - - protected void createBeanDefEntry(Class clazz, CompositeComponentDefinition compositeDef, String databaseUrl, Object eleSource, ParserContext parserContext) { - BeanDefinitionBuilder builder = BeanDefinitionBuilder.genericBeanDefinition(clazz); - builder.getRawBeanDefinition().setSource(eleSource); - builder.addConstructorArg(databaseUrl); - BeanDefinition assertDef = builder.getBeanDefinition(); - String assertName = parserContext.getReaderContext().registerWithGeneratedName(assertDef); - compositeDef.addNestedComponent(new BeanComponentDefinition(assertDef, assertName)); - } - -} diff --git a/spring-data-couchdb/src/main/java/org/springframework/data/document/couchdb/config/CouchNamespaceHandler.java b/spring-data-couchdb/src/main/java/org/springframework/data/document/couchdb/config/CouchNamespaceHandler.java deleted file mode 100644 index 7c7ed6d02..000000000 --- a/spring-data-couchdb/src/main/java/org/springframework/data/document/couchdb/config/CouchNamespaceHandler.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2011 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.data.document.couchdb.config; - -import org.springframework.beans.factory.xml.NamespaceHandlerSupport; - - -/** - * {@link org.springframework.beans.factory.xml.NamespaceHandler} for Couch DB - * based repositories. - * - * @author Oliver Gierke - */ -public class CouchNamespaceHandler extends NamespaceHandlerSupport { - - /* - * (non-Javadoc) - * - * @see org.springframework.beans.factory.xml.NamespaceHandler#init() - */ - public void init() { - - /* - registerBeanDefinitionParser("repositories", - new MongoRepositoryConfigDefinitionParser()); - */ - - registerBeanDefinitionParser("jmx", new CouchJmxParser()); - } -} diff --git a/spring-data-couchdb/src/main/java/org/springframework/data/document/couchdb/core/CouchOperations.java b/spring-data-couchdb/src/main/java/org/springframework/data/document/couchdb/core/CouchOperations.java deleted file mode 100644 index db46366d0..000000000 --- a/spring-data-couchdb/src/main/java/org/springframework/data/document/couchdb/core/CouchOperations.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright 2011 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.data.document.couchdb.core; - -import java.net.URI; - - -public interface CouchOperations { - - /** - * Reads a document from the database and maps it a Java object. - *

- * This method is intended to work when a default database - * is set on the CouchDbDocumentOperations instance. - * - * @param id the id of the CouchDB document to read - * @param targetClass the target type to map to - * @return the mapped object - */ - T findOne(String id, Class targetClass); - - /** - * Reads a document from the database and maps it a Java object. - * - * @param uri the full URI of the document to read - * @param targetClass the target type to map to - * @return the mapped object - */ - T findOne(URI uri, Class targetClass); - - - /** - * Maps a Java object to JSON and writes it to the database - *

- * This method is intended to work when a default database - * is set on the CouchDbDocumentOperations instance. - * - * @param id the id of the document to write - * @param document the object to write - */ - void save(String id, Object document); - - /** - * Maps a Java object to JSON and writes it to the database - * - * @param uri the full URI of the document to write - * @param document the object to write - */ - void save(URI uri, Object document); -} diff --git a/spring-data-couchdb/src/main/java/org/springframework/data/document/couchdb/core/CouchTemplate.java b/spring-data-couchdb/src/main/java/org/springframework/data/document/couchdb/core/CouchTemplate.java deleted file mode 100644 index a02e5b35f..000000000 --- a/spring-data-couchdb/src/main/java/org/springframework/data/document/couchdb/core/CouchTemplate.java +++ /dev/null @@ -1,143 +0,0 @@ -/* - * Copyright 2011 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.data.document.couchdb.core; - -import java.net.URI; -import java.util.Map; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.springframework.data.document.couchdb.CouchServerResourceUsageException; -import org.springframework.data.document.couchdb.CouchUsageException; -import org.springframework.data.document.couchdb.DocumentRetrievalFailureException; -import org.springframework.data.document.couchdb.UncategorizedCouchDataAccessException; -import org.springframework.data.document.couchdb.support.CouchUtils; -import org.springframework.http.*; -import org.springframework.util.Assert; -import org.springframework.web.client.*; - - -public class CouchTemplate implements CouchOperations { - - protected final Log logger = LogFactory.getLog(this.getClass()); - - private String defaultDocumentUrl; - - private RestOperations restOperations = new RestTemplate(); - - /** - * Constructs an instance of CouchDbDocumentTemplate with a default database - * - * @param defaultDatabaseUrl the default database to connect to - */ - public CouchTemplate(String defaultDatabaseUrl) { - Assert.hasText(defaultDatabaseUrl, "defaultDatabaseUrl must not be empty"); - defaultDocumentUrl = CouchUtils.addId(defaultDatabaseUrl); - } - - /** - * Constructs an instance of CouchDbDocumentTemplate with a default database - * - * @param defaultDatabaseUrl the default database to connect to - */ - public CouchTemplate(String defaultDatabaseUrl, RestOperations restOperations) { - this(defaultDatabaseUrl); - Assert.notNull(restOperations, "restOperations must not be null"); - this.restOperations = restOperations; - } - - - public T findOne(String id, Class targetClass) { - Assert.state(defaultDocumentUrl != null, "defaultDatabaseUrl must be set to use this method"); - try { - return restOperations.getForObject(defaultDocumentUrl, targetClass, id); - //TODO check this exception translation and centralize. - } catch (HttpClientErrorException clientError) { - if (clientError.getStatusCode() == HttpStatus.NOT_FOUND) { - throw new DocumentRetrievalFailureException(defaultDocumentUrl + "/" + id); - } - throw new CouchUsageException(clientError); - } catch (HttpServerErrorException serverError) { - throw new CouchServerResourceUsageException(serverError); - } catch (RestClientException otherError) { - throw new UncategorizedCouchDataAccessException(otherError); - } - } - - public T findOne(URI uri, Class targetClass) { - Assert.state(uri != null, "uri must be set to use this method"); - try { - return restOperations.getForObject(uri, targetClass); - //TODO check this exception translation and centralize. - } catch (HttpClientErrorException clientError) { - if (clientError.getStatusCode() == HttpStatus.NOT_FOUND) { - throw new DocumentRetrievalFailureException(uri.getPath()); - } - throw new CouchUsageException(clientError); - } catch (HttpServerErrorException serverError) { - throw new CouchServerResourceUsageException(serverError); - } catch (RestClientException otherError) { - throw new UncategorizedCouchDataAccessException(otherError); - } - } - - public void save(String id, Object document) { - Assert.notNull(document, "document must not be null for save"); - HttpEntity httpEntity = createHttpEntity(document); - try { - ResponseEntity response = restOperations.exchange(defaultDocumentUrl, HttpMethod.PUT, httpEntity, Map.class, id); - //TODO update the document revision id on the object from the returned value - //TODO better exception translation - } catch (RestClientException e) { - throw new UncategorizedCouchDataAccessException(e); - } - - } - - public void save(URI uri, Object document) { - Assert.notNull(document, "document must not be null for save"); - Assert.notNull(uri, "URI must not be null for save"); - HttpEntity httpEntity = createHttpEntity(document); - try { - ResponseEntity response = restOperations.exchange(uri, HttpMethod.PUT, httpEntity, Map.class); - //TODO update the document revision id on the object from the returned value - //TODO better exception translation - } catch (RestClientException e) { - throw new UncategorizedCouchDataAccessException(e); - } - - - } - - private HttpEntity createHttpEntity(Object document) { - - if (document instanceof HttpEntity) { - HttpEntity httpEntity = (HttpEntity) document; - Assert.isTrue(httpEntity.getHeaders().getContentType().equals(MediaType.APPLICATION_JSON), - "HttpEntity payload with non application/json content type found."); - return httpEntity; - } - - HttpHeaders httpHeaders = new HttpHeaders(); - httpHeaders.setContentType(MediaType.APPLICATION_JSON); - HttpEntity httpEntity = new HttpEntity(document, httpHeaders); - - return httpEntity; - } - - -} diff --git a/spring-data-couchdb/src/main/java/org/springframework/data/document/couchdb/core/support/CouchDbMappingJacksonHttpMessageConverter.java b/spring-data-couchdb/src/main/java/org/springframework/data/document/couchdb/core/support/CouchDbMappingJacksonHttpMessageConverter.java deleted file mode 100644 index 8d7f6b9f3..000000000 --- a/spring-data-couchdb/src/main/java/org/springframework/data/document/couchdb/core/support/CouchDbMappingJacksonHttpMessageConverter.java +++ /dev/null @@ -1,315 +0,0 @@ -/* - * Copyright 2011 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.data.document.couchdb.core.support; - -import java.io.IOException; -import java.nio.charset.Charset; -import java.util.*; - -import org.codehaus.jackson.*; -import org.codehaus.jackson.map.JsonMappingException; -import org.codehaus.jackson.map.ObjectMapper; -import org.codehaus.jackson.map.type.TypeFactory; -import org.codehaus.jackson.type.JavaType; -import org.springframework.http.HttpInputMessage; -import org.springframework.http.HttpOutputMessage; -import org.springframework.http.MediaType; -import org.springframework.http.converter.AbstractHttpMessageConverter; -import org.springframework.http.converter.HttpMessageNotReadableException; -import org.springframework.http.converter.HttpMessageNotWritableException; -import org.springframework.util.Assert; - -public class CouchDbMappingJacksonHttpMessageConverter extends - AbstractHttpMessageConverter { - - public static final Charset DEFAULT_CHARSET = Charset.forName("UTF-8"); - - private static final String ROWS_FIELD_NAME = "rows"; - private static final String VALUE_FIELD_NAME = "value"; - private static final String INCLUDED_DOC_FIELD_NAME = "doc"; - private static final String TOTAL_ROWS_FIELD_NAME = "total_rows"; - - private ObjectMapper objectMapper = new ObjectMapper(); - - private boolean prefixJson = false; - - /** - * Construct a new {@code BindingJacksonHttpMessageConverter}. - */ - public CouchDbMappingJacksonHttpMessageConverter() { - super(new MediaType("application", "json", DEFAULT_CHARSET)); - } - - /** - * Sets the {@code ObjectMapper} for this view. If not set, a default - * {@link ObjectMapper#ObjectMapper() ObjectMapper} is used. - *

- * Setting a custom-configured {@code ObjectMapper} is one way to take - * further control of the JSON serialization process. For example, an - * extended {@link org.codehaus.jackson.map.SerializerFactory} can be - * configured that provides custom serializers for specific types. The other - * option for refining the serialization process is to use Jackson's - * provided annotations on the types to be serialized, in which case a - * custom-configured ObjectMapper is unnecessary. - */ - public void setObjectMapper(ObjectMapper objectMapper) { - Assert.notNull(objectMapper, "'objectMapper' must not be null"); - this.objectMapper = objectMapper; - } - - /** - * Indicates whether the JSON output by this view should be prefixed with - * "{} &&". Default is false. - *

- * Prefixing the JSON string in this manner is used to help prevent JSON - * Hijacking. The prefix renders the string syntactically invalid as a - * script so that it cannot be hijacked. This prefix does not affect the - * evaluation of JSON, but if JSON validation is performed on the string, - * the prefix would need to be ignored. - */ - public void setPrefixJson(boolean prefixJson) { - this.prefixJson = prefixJson; - } - - @Override - public boolean canRead(Class clazz, MediaType mediaType) { - JavaType javaType = getJavaType(clazz); - return this.objectMapper.canDeserialize(javaType) && canRead(mediaType); - } - - /** - * Returns the Jackson {@link JavaType} for the specific class. - *

- *

- * Default implementation returns - * {@link TypeFactory#type(java.lang.reflect.Type)}, but this can be - * overridden in subclasses, to allow for custom generic collection - * handling. For instance: - *

- *

-   * protected JavaType getJavaType(Class<?> clazz) {
-   * if (List.class.isAssignableFrom(clazz)) {
-   * return TypeFactory.collectionType(ArrayList.class, MyBean.class);
-   * } else {
-   * return super.getJavaType(clazz);
-   * }
-   * }
-   * 
- * - * @param clazz the class to return the java type for - * @return the java type - */ - protected JavaType getJavaType(Class clazz) { - return TypeFactory.type(clazz); - } - - @Override - public boolean canWrite(Class clazz, MediaType mediaType) { - return this.objectMapper.canSerialize(clazz) && canWrite(mediaType); - } - - @Override - protected boolean supports(Class clazz) { - // should not be called, since we override canRead/Write instead - throw new UnsupportedOperationException(); - } - - @Override - protected Object readInternal(Class clazz, HttpInputMessage inputMessage) - throws IOException, HttpMessageNotReadableException { - JavaType javaType = getJavaType(clazz); - try { - return success(clazz, inputMessage); - - // return this.objectMapper.readValue(inputMessage.getBody(), - // javaType); - } catch (Exception ex) { - throw new HttpMessageNotReadableException("Could not read JSON: " - + ex.getMessage(), ex); - } - } - - private Object success(Class clazz, HttpInputMessage inputMessage) - throws JsonParseException, IOException { - - //Note, parsing code used from ektorp project - JsonParser jp = objectMapper.getJsonFactory().createJsonParser( - inputMessage.getBody()); - if (jp.nextToken() != JsonToken.START_OBJECT) { - throw new RuntimeException("Expected data to start with an Object"); - } - Map fields = readHeaderFields(jp); - - List result; - if (fields.containsKey(TOTAL_ROWS_FIELD_NAME)) { - int totalRows = fields.get(TOTAL_ROWS_FIELD_NAME); - if (totalRows == 0) { - return Collections.emptyList(); - } - result = new ArrayList(totalRows); - } else { - result = new ArrayList(); - } - - ParseState state = new ParseState(); - - Object first = parseFirstRow(jp, state, clazz); - if (first == null) { - return Collections.emptyList(); - } else { - result.add(first); - } - - while (jp.getCurrentToken() != null) { - skipToField(jp, state.docFieldName, state); - if (atEndOfRows(jp)) { - return result; - } - result.add(jp.readValueAs(clazz)); - endRow(jp, state); - } - return result; - } - - private Object parseFirstRow(JsonParser jp, ParseState state, Class clazz) - throws JsonParseException, IOException, JsonProcessingException, - JsonMappingException { - skipToField(jp, VALUE_FIELD_NAME, state); - JsonNode value = null; - if (atObjectStart(jp)) { - value = jp.readValueAsTree(); - jp.nextToken(); - if (isEndOfRow(jp)) { - state.docFieldName = VALUE_FIELD_NAME; - Object doc = objectMapper.readValue(value, clazz); - endRow(jp, state); - return doc; - } - } - skipToField(jp, INCLUDED_DOC_FIELD_NAME, state); - if (atObjectStart(jp)) { - state.docFieldName = INCLUDED_DOC_FIELD_NAME; - Object doc = jp.readValueAs(clazz); - endRow(jp, state); - return doc; - } - return null; - } - - - private boolean isEndOfRow(JsonParser jp) { - return jp.getCurrentToken() == JsonToken.END_OBJECT; - } - - private void endRow(JsonParser jp, ParseState state) throws IOException, JsonParseException { - state.inRow = false; - jp.nextToken(); - } - - private boolean atObjectStart(JsonParser jp) { - return jp.getCurrentToken() == JsonToken.START_OBJECT; - } - - private boolean atEndOfRows(JsonParser jp) { - return jp.getCurrentToken() != JsonToken.START_OBJECT; - } - - private void skipToField(JsonParser jp, String fieldName, ParseState state) throws JsonParseException, IOException { - String lastFieldName = null; - while (jp.getCurrentToken() != null) { - switch (jp.getCurrentToken()) { - case FIELD_NAME: - lastFieldName = jp.getCurrentName(); - jp.nextToken(); - break; - case START_OBJECT: - if (!state.inRow) { - state.inRow = true; - jp.nextToken(); - } else { - if (isInField(fieldName, lastFieldName)) { - return; - } else { - jp.skipChildren(); - } - } - break; - default: - if (isInField(fieldName, lastFieldName)) { - jp.nextToken(); - return; - } - jp.nextToken(); - break; - } - } - } - - private boolean isInField(String fieldName, String lastFieldName) { - return lastFieldName != null && lastFieldName.equals(fieldName); - } - - - private Map readHeaderFields(JsonParser jp) - throws JsonParseException, IOException { - Map map = new HashMap(); - jp.nextToken(); - String nextFieldName = jp.getCurrentName(); - while (!nextFieldName.equals(ROWS_FIELD_NAME)) { - jp.nextToken(); - map.put(nextFieldName, Integer.valueOf(jp.getIntValue())); - jp.nextToken(); - nextFieldName = jp.getCurrentName(); - } - return map; - } - - @Override - protected void writeInternal(Object o, HttpOutputMessage outputMessage) - throws IOException, HttpMessageNotWritableException { - - JsonEncoding encoding = getEncoding(outputMessage.getHeaders() - .getContentType()); - JsonGenerator jsonGenerator = this.objectMapper.getJsonFactory() - .createJsonGenerator(outputMessage.getBody(), encoding); - try { - if (this.prefixJson) { - jsonGenerator.writeRaw("{} && "); - } - this.objectMapper.writeValue(jsonGenerator, o); - } catch (JsonGenerationException ex) { - throw new HttpMessageNotWritableException("Could not write JSON: " - + ex.getMessage(), ex); - } - } - - private JsonEncoding getEncoding(MediaType contentType) { - if (contentType != null && contentType.getCharSet() != null) { - Charset charset = contentType.getCharSet(); - for (JsonEncoding encoding : JsonEncoding.values()) { - if (charset.name().equals(encoding.getJavaName())) { - return encoding; - } - } - } - return JsonEncoding.UTF8; - } - - private static class ParseState { - boolean inRow; - String docFieldName = ""; - } -} diff --git a/spring-data-couchdb/src/main/java/org/springframework/data/document/couchdb/monitor/AbstractMonitor.java b/spring-data-couchdb/src/main/java/org/springframework/data/document/couchdb/monitor/AbstractMonitor.java deleted file mode 100644 index 67e03ae41..000000000 --- a/spring-data-couchdb/src/main/java/org/springframework/data/document/couchdb/monitor/AbstractMonitor.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 2002-2011 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.data.document.couchdb.monitor; - -import org.springframework.web.client.RestTemplate; - -/** - * Base class to encapsulate common configuration settings when connecting to a CouchDB database - * - * @author Mark Pollack - */ -public abstract class AbstractMonitor { - - - protected RestTemplate restTemplate; - protected String databaseUrl; - - /** - * Gets the databaseUrl used to connect to CouchDB - * - * @return - */ - public String getDatabaseUrl() { - return this.databaseUrl; - } - - -} diff --git a/spring-data-couchdb/src/main/java/org/springframework/data/document/couchdb/monitor/ServerInfo.java b/spring-data-couchdb/src/main/java/org/springframework/data/document/couchdb/monitor/ServerInfo.java deleted file mode 100644 index d45546ab3..000000000 --- a/spring-data-couchdb/src/main/java/org/springframework/data/document/couchdb/monitor/ServerInfo.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright 2002-2011 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.data.document.couchdb.monitor; - -import java.net.InetAddress; -import java.net.UnknownHostException; -import java.util.Map; - -import org.springframework.jmx.export.annotation.ManagedOperation; -import org.springframework.jmx.export.annotation.ManagedResource; -import org.springframework.web.client.RestTemplate; - -/** - * Expose basic server information via JMX - * - * @author Mark Pollack - */ -@ManagedResource(description = "Server Information") -public class ServerInfo extends AbstractMonitor { - - - public ServerInfo(String databaseUrl) { - this.databaseUrl = databaseUrl; - this.restTemplate = new RestTemplate(); - } - - - @ManagedOperation(description = "Server host name") - public String getHostName() throws UnknownHostException { - return InetAddress.getLocalHost().getHostName(); - } - - - @ManagedOperation(description = "CouchDB Server Version") - public String getVersion() { - return (String) getRoot().get("version"); - } - - @ManagedOperation(description = "Message of the day") - public String getMotd() { - return (String) getRoot().get("greeting"); - } - - public Map getRoot() { - Map map = restTemplate.getForObject(getDatabaseUrl(), Map.class); - return map; - } - -} diff --git a/spring-data-couchdb/src/main/java/org/springframework/data/document/couchdb/monitor/package-info.java b/spring-data-couchdb/src/main/java/org/springframework/data/document/couchdb/monitor/package-info.java deleted file mode 100644 index 574efceb3..000000000 --- a/spring-data-couchdb/src/main/java/org/springframework/data/document/couchdb/monitor/package-info.java +++ /dev/null @@ -1,4 +0,0 @@ -/** - * CouchDB specific JMX monitoring support. - */ -package org.springframework.data.document.couchdb.monitor; diff --git a/spring-data-couchdb/src/main/java/org/springframework/data/document/couchdb/support/CouchUtils.java b/spring-data-couchdb/src/main/java/org/springframework/data/document/couchdb/support/CouchUtils.java deleted file mode 100644 index fb42d6486..000000000 --- a/spring-data-couchdb/src/main/java/org/springframework/data/document/couchdb/support/CouchUtils.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright 2010 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.data.document.couchdb.support; - -import org.springframework.dao.DataAccessException; - -/** - * Helper class featuring helper methods for internal CouchDB classes. - *

- *

Mainly intended for internal use within the framework. - * - * @author Thomas Risberg - * @author Tareq Abedrabbo - * @since 1.0 - */ -public abstract class CouchUtils { - - /** - * Convert the given runtime exception to an appropriate exception from the - * org.springframework.dao hierarchy. - * Return null if no translation is appropriate: any other exception may - * have resulted from user code, and should not be translated. - * - * @param ex runtime exception that occurred - * @return the corresponding DataAccessException instance, - * or null if the exception should not be translated - */ - public static DataAccessException translateCouchExceptionIfPossible(RuntimeException ex) { - - return null; - } - - /** - * Adds an id variable to a URL - * - * @param url the URL to modify - * @return the modified URL - */ - public static String addId(String url) { - return ensureTrailingSlash(url) + "{id}"; - } - - - /** - * Adds a 'changes since' variable to a URL - * - * @param url - * @return - */ - public static String addChangesSince(String url) { - return ensureTrailingSlash(url) + "_changes?since={seq}"; - } - - /** - * Ensures that a URL ends with a slash. - * - * @param url the URL to modify - * @return the modified URL - */ - public static String ensureTrailingSlash(String url) { - if (!url.endsWith("/")) { - url += "/"; - } - return url; - } - -} diff --git a/spring-data-couchdb/src/main/resources/META-INF/spring.handlers b/spring-data-couchdb/src/main/resources/META-INF/spring.handlers deleted file mode 100644 index e8486b631..000000000 --- a/spring-data-couchdb/src/main/resources/META-INF/spring.handlers +++ /dev/null @@ -1 +0,0 @@ -http\://www.springframework.org/schema/data/couch=org.springframework.data.document.couchdb.config.CouchNamespaceHandler diff --git a/spring-data-couchdb/src/main/resources/META-INF/spring.schemas b/spring-data-couchdb/src/main/resources/META-INF/spring.schemas deleted file mode 100644 index 7ca5ca1c2..000000000 --- a/spring-data-couchdb/src/main/resources/META-INF/spring.schemas +++ /dev/null @@ -1,2 +0,0 @@ -http\://www.springframework.org/schema/data/couch/spring-couch-1.0.xsd=org/springframework/data/document/couchdb/config/spring-couch-1.0.xsd -http\://www.springframework.org/schema/data/couch/spring-couch.xsd=org/springframework/data/document/couchdb/config/spring-couch-1.0.xsd diff --git a/spring-data-couchdb/src/main/resources/META-INF/spring.tooling b/spring-data-couchdb/src/main/resources/META-INF/spring.tooling deleted file mode 100644 index 5859f57de..000000000 --- a/spring-data-couchdb/src/main/resources/META-INF/spring.tooling +++ /dev/null @@ -1,4 +0,0 @@ -# Tooling related information for the Couch DB namespace -http\://www.springframework.org/schema/data/couch@name=Couch Namespace -http\://www.springframework.org/schema/data/couch@prefix=couch -http\://www.springframework.org/schema/data/couch@icon=org/springframework/jdbc/config/spring-jdbc.gif diff --git a/spring-data-couchdb/src/main/resources/org/springframework/data/document/couchdb/config/spring-couch-1.0.xsd b/spring-data-couchdb/src/main/resources/org/springframework/data/document/couchdb/config/spring-couch-1.0.xsd deleted file mode 100644 index ccf257511..000000000 --- a/spring-data-couchdb/src/main/resources/org/springframework/data/document/couchdb/config/spring-couch-1.0.xsd +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/spring-data-couchdb/src/test/java/org/springframework/data/document/couchdb/DummyDocument.java b/spring-data-couchdb/src/test/java/org/springframework/data/document/couchdb/DummyDocument.java deleted file mode 100644 index 43368f470..000000000 --- a/spring-data-couchdb/src/test/java/org/springframework/data/document/couchdb/DummyDocument.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright 2011 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.data.document.couchdb; - -import java.util.Date; - -import org.codehaus.jackson.annotate.JsonIgnoreProperties; - -/** - * @author Tareq Abedrabbo (tareq.abedrabbo@opencredo.com) - * @since 13/01/2011 - */ -@JsonIgnoreProperties(ignoreUnknown = true) -public class DummyDocument { - - private String message; - - private String timestamp = new Date().toString(); - - public DummyDocument() { - } - - public DummyDocument(String message) { - this.message = message; - } - - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - public String getTimestamp() { - return timestamp; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - - DummyDocument document = (DummyDocument) o; - - if (message != null ? !message.equals(document.message) : document.message != null) return false; - - return true; - } - - @Override - public int hashCode() { - return message != null ? message.hashCode() : 0; - } - - @Override - public String toString() { - return "DummyDocument{" + - "message='" + message + '\'' + - ", timestamp=" + timestamp + - '}'; - } -} diff --git a/spring-data-couchdb/src/test/java/org/springframework/data/document/couchdb/IsBodyEqual.java b/spring-data-couchdb/src/test/java/org/springframework/data/document/couchdb/IsBodyEqual.java deleted file mode 100644 index bb43591ab..000000000 --- a/spring-data-couchdb/src/test/java/org/springframework/data/document/couchdb/IsBodyEqual.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright 2011 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.data.document.couchdb; - -import org.hamcrest.Description; -import org.hamcrest.Factory; -import org.hamcrest.Matcher; -import org.hamcrest.TypeSafeMatcher; -import org.springframework.http.HttpEntity; - -/** - * Matches the content of the body of an HttpEntity. - * - * @author Tareq Abedrabbo - * @since 31/01/2011 - */ -public class IsBodyEqual extends TypeSafeMatcher { - - private Object object; - - public IsBodyEqual(Object object) { - this.object = object; - } - - @Override - public boolean matchesSafely(HttpEntity httpEntity) { - return httpEntity.getBody().equals(object); - } - - public void describeTo(Description description) { - description.appendText("body equals ").appendValue(object); - } - - @Factory - public static Matcher bodyEqual(Object object) { - return new IsBodyEqual(object); - } -} diff --git a/spring-data-couchdb/src/test/java/org/springframework/data/document/couchdb/admin/CouchAdminIntegrationTests.java b/spring-data-couchdb/src/test/java/org/springframework/data/document/couchdb/admin/CouchAdminIntegrationTests.java deleted file mode 100644 index 31d603083..000000000 --- a/spring-data-couchdb/src/test/java/org/springframework/data/document/couchdb/admin/CouchAdminIntegrationTests.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright 2011 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.data.document.couchdb.admin; - -import java.util.List; - -import junit.framework.Assert; -import org.junit.Ignore; -import org.junit.Test; -import org.springframework.data.document.couchdb.core.CouchConstants; - -public class CouchAdminIntegrationTests { - - @Test - @Ignore("until CI has couch server running") - public void dbLifecycle() { - - CouchAdmin admin = new CouchAdmin(CouchConstants.COUCHDB_URL); - admin.deleteDatabase("foo"); - List dbs = admin.listDatabases(); - admin.createDatabase("foo"); - List newDbs = admin.listDatabases(); - Assert.assertEquals(dbs.size() + 1, newDbs.size()); - } -} diff --git a/spring-data-couchdb/src/test/java/org/springframework/data/document/couchdb/core/AbstractCouchTemplateIntegrationTests.java b/spring-data-couchdb/src/test/java/org/springframework/data/document/couchdb/core/AbstractCouchTemplateIntegrationTests.java deleted file mode 100644 index 7d114e307..000000000 --- a/spring-data-couchdb/src/test/java/org/springframework/data/document/couchdb/core/AbstractCouchTemplateIntegrationTests.java +++ /dev/null @@ -1,118 +0,0 @@ -/* - * Copyright 2011 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.data.document.couchdb.core; - -import static org.junit.Assume.assumeNoException; -import static org.junit.Assume.assumeTrue; -import static org.springframework.http.HttpStatus.OK; - -import java.io.IOException; -import java.util.UUID; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.junit.Before; -import org.junit.BeforeClass; -import org.springframework.http.*; -import org.springframework.http.client.ClientHttpResponse; -import org.springframework.web.client.DefaultResponseErrorHandler; -import org.springframework.web.client.RestClientException; -import org.springframework.web.client.RestTemplate; - -/** - * Base class for CouchDB integration tests. Checks whether CouchDB is available before running each test, - * in which case the test is executed. If CouchDB is not available, tests are ignored. - * - * @author Tareq Abedrabbo (tareq.abedrabbo@opencredo.com) - * @since 13/01/2011 - */ - -public abstract class AbstractCouchTemplateIntegrationTests { - - - protected static final Log log = LogFactory.getLog(AbstractCouchTemplateIntegrationTests.class); - - protected static final RestTemplate restTemplate = new RestTemplate(); - - /** - * This methods ensures that the database is running. Otherwise, the test is ignored. - */ - @BeforeClass - public static void assumeDatabaseIsUpAndRunning() { - try { - ResponseEntity responseEntity = restTemplate.getForEntity(CouchConstants.COUCHDB_URL, String.class); - assumeTrue(responseEntity.getStatusCode().equals(OK)); - log.debug("CouchDB is running on " + CouchConstants.COUCHDB_URL + - " with status " + responseEntity.getStatusCode()); - } catch (RestClientException e) { - log.debug("CouchDB is not running on " + CouchConstants.COUCHDB_URL); - assumeNoException(e); - } - } - - @Before - public void setUpTestDatabase() throws Exception { - RestTemplate template = new RestTemplate(); - template.setErrorHandler(new DefaultResponseErrorHandler() { - @Override - public void handleError(ClientHttpResponse response) throws IOException { - // do nothing, error status will be handled in the switch statement - } - }); - ResponseEntity response = template.getForEntity(CouchConstants.TEST_DATABASE_URL, String.class); - HttpStatus statusCode = response.getStatusCode(); - switch (statusCode) { - case NOT_FOUND: - createNewTestDatabase(); - break; - case OK: - deleteExisitingTestDatabase(); - createNewTestDatabase(); - break; - default: - throw new IllegalStateException("Unsupported http status [" + statusCode + "]"); - } - } - - private void deleteExisitingTestDatabase() { - restTemplate.delete(CouchConstants.TEST_DATABASE_URL); - } - - private void createNewTestDatabase() { - restTemplate.put(CouchConstants.TEST_DATABASE_URL, null); - } - - /** - * Reads a CouchDB document and converts it to the expected type. - */ - protected T getDocument(String id, Class expectedType) { - String url = CouchConstants.TEST_DATABASE_URL + "{id}"; - return restTemplate.getForObject(url, expectedType, id); - } - - /** - * Writes a CouchDB document - */ - protected String putDocument(Object document) { - HttpHeaders headers = new HttpHeaders(); - headers.setContentType(MediaType.APPLICATION_JSON); - HttpEntity request = new HttpEntity(document, headers); - String id = UUID.randomUUID().toString(); - restTemplate.put(CouchConstants.TEST_DATABASE_URL + "{id}", request, id); - return id; - } -} diff --git a/spring-data-couchdb/src/test/java/org/springframework/data/document/couchdb/core/CouchConstants.java b/spring-data-couchdb/src/test/java/org/springframework/data/document/couchdb/core/CouchConstants.java deleted file mode 100644 index 1ae934684..000000000 --- a/spring-data-couchdb/src/test/java/org/springframework/data/document/couchdb/core/CouchConstants.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2011 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.data.document.couchdb.core; - -public abstract class CouchConstants { - - public static final String COUCHDB_URL = "http://127.0.0.1:5984/"; - public static final String TEST_DATABASE_URL = COUCHDB_URL + "si_couchdb_test/"; - - public CouchConstants() { - // TODO Auto-generated constructor stub - } - -} diff --git a/spring-data-couchdb/src/test/java/org/springframework/data/document/couchdb/core/CouchTemplateIntegrationTests.java b/spring-data-couchdb/src/test/java/org/springframework/data/document/couchdb/core/CouchTemplateIntegrationTests.java deleted file mode 100644 index 31302ea25..000000000 --- a/spring-data-couchdb/src/test/java/org/springframework/data/document/couchdb/core/CouchTemplateIntegrationTests.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright 2011 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.data.document.couchdb.core; - -import java.util.UUID; - -import junit.framework.Assert; -import org.junit.Ignore; -import org.junit.Test; -import org.springframework.data.document.couchdb.DummyDocument; - -public class CouchTemplateIntegrationTests extends AbstractCouchTemplateIntegrationTests { - - - @Test - @Ignore("until CI has couch server running") - public void saveAndFindTest() { - CouchTemplate template = new CouchTemplate(CouchConstants.TEST_DATABASE_URL); - DummyDocument document = new DummyDocument("hello"); - String id = UUID.randomUUID().toString(); - template.save(id, document); - DummyDocument foundDocument = template.findOne(id, DummyDocument.class); - Assert.assertEquals(document.getMessage(), foundDocument.getMessage()); - } -} diff --git a/spring-data-couchdb/src/test/java/org/springframework/data/document/couchdb/core/CouchTemplateTests.java b/spring-data-couchdb/src/test/java/org/springframework/data/document/couchdb/core/CouchTemplateTests.java deleted file mode 100644 index da4afe30c..000000000 --- a/spring-data-couchdb/src/test/java/org/springframework/data/document/couchdb/core/CouchTemplateTests.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 2011 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.data.document.couchdb.core; - -import org.junit.Test; - -/** - * Unit tests for CouchTemplate with mocks - */ -public class CouchTemplateTests { - - @Test - public void foo() { - - } -} diff --git a/spring-data-couchdb/src/test/java/org/springframework/data/document/couchdb/monitor/JmxServer.java b/spring-data-couchdb/src/test/java/org/springframework/data/document/couchdb/monitor/JmxServer.java deleted file mode 100644 index e846ea8d2..000000000 --- a/spring-data-couchdb/src/test/java/org/springframework/data/document/couchdb/monitor/JmxServer.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2002-2010 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.data.document.couchdb.monitor; - -import org.springframework.context.support.ClassPathXmlApplicationContext; - -/** - * Server application to test JMX functionality. - * - * @author Mark Pollack - */ -public class JmxServer { - - public static void main(String[] args) { - new JmxServer().run(); - } - - public void run() { - new ClassPathXmlApplicationContext(new String[]{"server-jmx.xml"}); - } - -} diff --git a/spring-data-couchdb/src/test/resources/log4j.properties b/spring-data-couchdb/src/test/resources/log4j.properties deleted file mode 100644 index 6d5422d74..000000000 --- a/spring-data-couchdb/src/test/resources/log4j.properties +++ /dev/null @@ -1,13 +0,0 @@ -log4j.rootCategory=INFO, stdout - -log4j.appender.stdout=org.apache.log4j.ConsoleAppender -log4j.appender.stdout.layout=org.apache.log4j.PatternLayout -log4j.appender.stdout.layout.ConversionPattern=%d %p [%c] - <%m>%n - -log4j.category.org.apache.activemq=ERROR -log4j.category.org.springframework.batch=DEBUG -log4j.category.org.springframework.transaction=INFO - -log4j.category.org.hibernate.SQL=DEBUG -# for debugging datasource initialization -# log4j.category.test.jdbc=DEBUG diff --git a/spring-data-couchdb/src/test/resources/server-jmx.xml b/spring-data-couchdb/src/test/resources/server-jmx.xml deleted file mode 100644 index d5c9028d5..000000000 --- a/spring-data-couchdb/src/test/resources/server-jmx.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/spring-data-couchdb/template.mf b/spring-data-couchdb/template.mf deleted file mode 100644 index af4bc48ff..000000000 --- a/spring-data-couchdb/template.mf +++ /dev/null @@ -1,24 +0,0 @@ -Bundle-SymbolicName: org.springframework.data.couchdb -Bundle-Name: Spring Data Couch DB Support -Bundle-Vendor: SpringSource -Bundle-ManifestVersion: 2 -Import-Package: - sun.reflect;version="0";resolution:=optional -Import-Template: - org.springframework.beans.*;version="[3.0.0, 4.0.0)", - org.springframework.core.*;version="[3.0.0, 4.0.0)", - org.springframework.dao.*;version="[3.0.0, 4.0.0)", - org.springframework.http.*;version="[3.0.0, 4.0.0)", - org.springframework.web.*;version="[3.0.0, 4.0.0)", - org.springframework.util.*;version="[3.0.0, 4.0.0)", - org.springframework.context.*;version="[3.0.0, 4.0.0)", - org.springframework.jmx.*;version="[3.0.0, 4.0.0)", - org.springframework.remoting.*;version="[3.0.0, 4.0.0)", - org.springframework.data.core.*;version="[1.0.0, 2.0.0)", - org.springframework.data.document.*;version="[1.0.0, 2.0.0)", - org.codehaus.jackson.*;version="[1.0.0, 2.0.0)";resolution:=optional, - org.aopalliance.*;version="[1.0.0, 2.0.0)";resolution:=optional, - org.apache.commons.logging.*;version="[1.1.1, 2.0.0)", - org.w3c.dom.*;version="0" - - diff --git a/spring-data-mongodb-cross-store/pom.xml b/spring-data-mongodb-cross-store/pom.xml index 5124ffaa8..0e23f3672 100644 --- a/spring-data-mongodb-cross-store/pom.xml +++ b/spring-data-mongodb-cross-store/pom.xml @@ -3,12 +3,11 @@ 4.0.0 org.springframework.data - spring-data-document-parent + spring-data-mongodb-parent 1.0.0.BUILD-SNAPSHOT - ../spring-data-document-parent/pom.xml + ../spring-data-mongodb-parent/pom.xml spring-data-mongodb-cross-store - jar Spring Data MongoDB Cross-store Persistence Support diff --git a/spring-data-mongodb-log4j/pom.xml b/spring-data-mongodb-log4j/pom.xml index 46e7d0b93..148a55c17 100644 --- a/spring-data-mongodb-log4j/pom.xml +++ b/spring-data-mongodb-log4j/pom.xml @@ -4,12 +4,11 @@ 4.0.0 org.springframework.data - spring-data-document-parent + spring-data-mongodb-parent 1.0.0.BUILD-SNAPSHOT - ../spring-data-document-parent/pom.xml + ../spring-data-mongodb-parent/pom.xml spring-data-mongodb-log4j - jar Spring Data MongoDB Log4J Appender diff --git a/spring-data-document-parent/pom.xml b/spring-data-mongodb-parent/pom.xml similarity index 96% rename from spring-data-document-parent/pom.xml rename to spring-data-mongodb-parent/pom.xml index 57685a447..7601fec9f 100644 --- a/spring-data-document-parent/pom.xml +++ b/spring-data-mongodb-parent/pom.xml @@ -3,9 +3,9 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> 4.0.0 org.springframework.data - spring-data-document-parent - Spring Data Document Parent - http://www.springsource.org/spring-data/data-document + spring-data-mongodb-parent + Spring Data MongoDB Parent + http://www.springsource.org/spring-data/mongodb 1.0.0.BUILD-SNAPSHOT pom @@ -39,15 +39,15 @@ spring-site-staging - file:///${java.io.tmpdir}/spring-data/data-document/docs + file:///${java.io.tmpdir}/spring-data/mongodb/docs spring-milestone-staging - file:///${java.io.tmpdir}/spring-data/data-document/milestone + file:///${java.io.tmpdir}/spring-data/mongodb/milestone spring-snapshot-staging - file:///${java.io.tmpdir}/spring-data/data-document/snapshot + file:///${java.io.tmpdir}/spring-data/mongodb/snapshot @@ -63,7 +63,7 @@ static.springframework.org - scp://static.springframework.org/var/www/domains/springframework.org/static/htdocs/spring-data/data-document/docs/${project.version} + scp://static.springframework.org/var/www/domains/springframework.org/static/htdocs/spring-data/mongodb/docs/${project.version} diff --git a/spring-data-mongodb/pom.xml b/spring-data-mongodb/pom.xml index bfb23b22a..237f2c298 100644 --- a/spring-data-mongodb/pom.xml +++ b/spring-data-mongodb/pom.xml @@ -4,13 +4,12 @@ 4.0.0 org.springframework.data - spring-data-document-parent + spring-data-mongodb-parent 1.0.0.BUILD-SNAPSHOT - ../spring-data-document-parent/pom.xml + ../spring-data-mongodb-parent/pom.xml spring-data-mongodb - jar - Spring Data MongoDB Support + Spring Data MongoDB 2.6.5 diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/mapping/event/AbstractMongoEventListener.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/mapping/event/AbstractMongoEventListener.java index 69595d612..1e9945979 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/mapping/event/AbstractMongoEventListener.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/mapping/event/AbstractMongoEventListener.java @@ -45,7 +45,6 @@ public abstract class AbstractMongoEventListener implements ApplicationListen */ public void onApplicationEvent(MongoMappingEvent event) { - // Invoke domain type independent events if (event instanceof AfterLoadEvent) { AfterLoadEvent afterLoadEvent = (AfterLoadEvent) event;