Skip to content

Commit 6b0c88b

Browse files
committed
Add documentation to GridFSBucket.
1 parent e168f53 commit 6b0c88b

File tree

3 files changed

+23
-0
lines changed

3 files changed

+23
-0
lines changed

driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/gridfs/GridFSBucket.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import com.mongodb.client.gridfs.model.GridFSUploadOptions;
2727
import com.mongodb.lang.Nullable;
2828
import com.mongodb.reactivestreams.client.ClientSession;
29+
import com.mongodb.reactivestreams.client.MongoDatabase;
2930
import org.bson.BsonValue;
3031
import org.bson.conversions.Bson;
3132
import org.bson.types.ObjectId;
@@ -102,9 +103,13 @@ public interface GridFSBucket {
102103
* <li>{@code > 0} The time limit to use for the full execution of an operation.</li>
103104
* </ul>
104105
*
106+
* <p>If not set, the timeout is inherited from whatever the
107+
* {@linkplain MongoDatabase#getTimeout MongoDatabase} was resolved to.
108+
*
105109
* @param timeUnit the time unit
106110
* @return the timeout in the given time unit
107111
* @since 4.x
112+
* @see #withTimeout
108113
*/
109114
@Alpha(Reason.CLIENT)
110115
@Nullable
@@ -152,6 +157,9 @@ public interface GridFSBucket {
152157
* <li>{@code > 0} The time limit to use for the full execution of an operation.</li>
153158
* </ul>
154159
*
160+
* <p>If not set, the timeout is inherited from whatever the
161+
* {@linkplain MongoDatabase#getTimeout MongoDatabase} was resolved to.
162+
*
155163
* @param timeout the timeout, which must be greater than or equal to 0
156164
* @param timeUnit the time unit
157165
* @return a new GridFSBucket instance with the set time limit for the full execution of an operation

driver-scala/src/main/scala/org/mongodb/scala/gridfs/GridFSBucket.scala

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,11 @@ case class GridFSBucket(private val wrapped: JGridFSBucket) {
120120
* - `0` means infinite timeout.
121121
* - `> 0` The time limit to use for the full execution of an operation.
122122
*
123+
* If not set, the timeout is inherited from whatever the
124+
* [[MongoDatabase.timeout MongoDatabase]] was resolved to.
125+
*
123126
* @return the optional timeout duration
127+
* @see [[withTimeout]]
124128
* @since 5.2
125129
*/
126130
@Alpha(Array(Reason.CLIENT))
@@ -168,8 +172,12 @@ case class GridFSBucket(private val wrapped: JGridFSBucket) {
168172
* - `0` means infinite timeout.
169173
* - `> 0` The time limit to use for the full execution of an operation.
170174
*
175+
* If not set, the timeout is inherited from whatever the
176+
* [[MongoDatabase.timeout MongoDatabase]] was resolved to.
177+
*
171178
* @param timeout the timeout, which must be greater than or equal to 0
172179
* @return a new GridFSBucket instance with the set time limit for operations
180+
* @see [[timeout]]
173181
* @since 5.2
174182
*/
175183
@Alpha(Array(Reason.CLIENT))

driver-sync/src/main/com/mongodb/client/gridfs/GridFSBucket.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,12 +104,16 @@ public interface GridFSBucket {
104104
* <li>{@code > 0} The time limit to use for the full execution of an operation.</li>
105105
* </ul>
106106
*
107+
* <p>If not set, the timeout is inherited from whatever the
108+
* {@linkplain MongoDatabase#getTimeout MongoDatabase} was resolved to.
109+
*
107110
* <p>Note: This timeout does not limit socket writes, therefore there is a possibility that the
108111
* operation might not be timed out when expected.
109112
*
110113
* @param timeUnit the time unit
111114
* @return the timeout in the given time unit
112115
* @since 5.2
116+
* @see #withTimeout
113117
*/
114118
@Alpha(Reason.CLIENT)
115119
@Nullable
@@ -158,6 +162,9 @@ public interface GridFSBucket {
158162
* <li>{@code > 0} The time limit to use for the full execution of an operation.</li>
159163
* </ul>
160164
*
165+
* <p>If not set, the timeout is inherited from whatever the
166+
* {@linkplain MongoDatabase#getTimeout MongoDatabase} was resolved to.
167+
*
161168
* <p>Note: This timeout does not limit socket writes, therefore there is a possibility that the
162169
* operation might not be timed out when expected.
163170
*

0 commit comments

Comments
 (0)