diff --git a/pom.xml b/pom.xml
index eea61f492c..82c2f235da 100644
--- a/pom.xml
+++ b/pom.xml
@@ -5,7 +5,7 @@
* The stream may become dead, or invalid, if either the query returns no match or the cursor returns the document at
* the "end" of the collection and then the application deletes that document.
@@ -37,11 +37,12 @@
*
* @author Mark Paluch
* @see Tailable Cursors
+ * @since 2.0
*/
@Retention(RetentionPolicy.RUNTIME)
@Target({ ElementType.METHOD, ElementType.ANNOTATION_TYPE })
@Documented
@QueryAnnotation
-public @interface InfiniteStream {
+public @interface Tailable {
}
diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/query/AbstractReactiveMongoQuery.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/query/AbstractReactiveMongoQuery.java
index 0a2b8e97a3..563cdd0ecf 100644
--- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/query/AbstractReactiveMongoQuery.java
+++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/query/AbstractReactiveMongoQuery.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2016 the original author or authors.
+ * Copyright 2016-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -130,7 +130,7 @@ private ReactiveMongoQueryExecution getExecutionToWrap(MongoParameterAccessor ac
return new DeleteExecution(operations, method);
} else if (method.isGeoNearQuery()) {
return new GeoNearExecution(operations, accessor, method.getReturnType());
- } else if (isInfiniteStream(method)) {
+ } else if (isTailable(method)) {
return new TailExecution(operations, accessor.getPageable());
} else if (method.isCollectionQuery()) {
return new CollectionExecution(operations, accessor.getPageable());
@@ -139,8 +139,8 @@ private ReactiveMongoQueryExecution getExecutionToWrap(MongoParameterAccessor ac
}
}
- private boolean isInfiniteStream(MongoQueryMethod method) {
- return method.getInfiniteStreamAnnotation() != null;
+ private boolean isTailable(MongoQueryMethod method) {
+ return method.getTailableAnnotation() != null;
}
Query applyQueryMetaAttributesWhenPresent(Query query) {
diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/query/MongoQueryMethod.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/query/MongoQueryMethod.java
index 55e4b4affd..8bdb42d40d 100644
--- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/query/MongoQueryMethod.java
+++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/query/MongoQueryMethod.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2011-2016 the original author or authors.
+ * Copyright 2011-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -29,9 +29,9 @@
import org.springframework.data.mapping.context.MappingContext;
import org.springframework.data.mongodb.core.mapping.MongoPersistentEntity;
import org.springframework.data.mongodb.core.mapping.MongoPersistentProperty;
-import org.springframework.data.mongodb.repository.InfiniteStream;
import org.springframework.data.mongodb.repository.Meta;
import org.springframework.data.mongodb.repository.Query;
+import org.springframework.data.mongodb.repository.Tailable;
import org.springframework.data.projection.ProjectionFactory;
import org.springframework.data.repository.core.RepositoryMetadata;
import org.springframework.data.repository.query.QueryMethod;
@@ -44,7 +44,7 @@
/**
* Mongo specific implementation of {@link QueryMethod}.
- *
+ *
* @author Oliver Gierke
* @author Christoph Strobl
* @author Mark Paluch
@@ -61,7 +61,7 @@ public class MongoQueryMethod extends QueryMethod {
/**
* Creates a new {@link MongoQueryMethod} from the given {@link Method}.
- *
+ *
* @param method must not be {@literal null}.
* @param metadata must not be {@literal null}.
* @param projectionFactory must not be {@literal null}.
@@ -89,7 +89,7 @@ protected MongoParameters createParameters(Method method) {
/**
* Returns whether the method has an annotated query.
- *
+ *
* @return
*/
public boolean hasAnnotatedQuery() {
@@ -99,7 +99,7 @@ public boolean hasAnnotatedQuery() {
/**
* Returns the query string declared in a {@link Query} annotation or {@literal null} if neither the annotation found
* nor the attribute was specified.
- *
+ *
* @return
*/
String getAnnotatedQuery() {
@@ -110,7 +110,7 @@ String getAnnotatedQuery() {
/**
* Returns the field specification to be used for the query.
- *
+ *
* @return
*/
String getFieldSpecification() {
@@ -119,7 +119,7 @@ String getFieldSpecification() {
return StringUtils.hasText(value) ? value : null;
}
- /*
+ /*
* (non-Javadoc)
* @see org.springframework.data.repository.query.QueryMethod#getEntityInformation()
*/
@@ -165,7 +165,7 @@ public MongoParameters getParameters() {
/**
* Returns whether the query is a geo near query.
- *
+ *
* @return
*/
public boolean isGeoNearQuery() {
@@ -192,7 +192,7 @@ private boolean isGeoNearQuery(Method method) {
/**
* Returns the {@link Query} annotation that is applied to the method or {@code null} if none available.
- *
+ *
* @return
*/
Query getQueryAnnotation() {
@@ -213,7 +213,7 @@ public boolean hasQueryMetaAttributes() {
/**
* Returns the {@link Meta} annotation that is applied to the method or {@code null} if not available.
- *
+ *
* @return
* @since 1.6
*/
@@ -222,18 +222,18 @@ Meta getMetaAnnotation() {
}
/**
- * Returns the {@link InfiniteStream} annotation that is applied to the method or {@code null} if not available.
+ * Returns the {@link Tailable} annotation that is applied to the method or {@code null} if not available.
*
* @return
* @since 2.0
*/
- InfiniteStream getInfiniteStreamAnnotation() {
- return AnnotatedElementUtils.findMergedAnnotation(method, InfiniteStream.class);
+ Tailable getTailableAnnotation() {
+ return AnnotatedElementUtils.findMergedAnnotation(method, Tailable.class);
}
/**
* Returns the {@link org.springframework.data.mongodb.core.query.Meta} attributes to be applied.
- *
+ *
* @return never {@literal null}.
* @since 1.6
*/
diff --git a/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/repository/ReactiveMongoRepositoryTests.java b/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/repository/ReactiveMongoRepositoryTests.java
index 602b1c2fe1..0a1833b61f 100644
--- a/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/repository/ReactiveMongoRepositoryTests.java
+++ b/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/repository/ReactiveMongoRepositoryTests.java
@@ -170,7 +170,7 @@ public void shouldFindByLastNameAndSort() {
}
@Test // DATAMONGO-1444
- public void shouldUseInfiniteStream() throws Exception {
+ public void shouldUseTailableCursor() throws Exception {
StepVerifier
.create(template.dropCollection(Capped.class) //
@@ -195,7 +195,7 @@ public void shouldUseInfiniteStream() throws Exception {
}
@Test // DATAMONGO-1444
- public void shouldUseInfiniteStreamWithProjection() throws Exception {
+ public void shouldUseTailableCursorWithProjection() throws Exception {
StepVerifier
.create(template.dropCollection(Capped.class) //
@@ -329,10 +329,10 @@ interface ReactivePersonRepository extends ReactiveMongoRepository