@@ -306,7 +306,7 @@ public int getConnectTimeout() {
306
306
*
307
307
* <p>Default is 0 and means no timeout.</p>
308
308
*
309
- * @return the socket timeout
309
+ * @return the socket timeout, in milliseconds
310
310
*/
311
311
public int getSocketTimeout () {
312
312
return socketTimeout ;
@@ -939,7 +939,7 @@ public Builder threadsAllowedToBlockForConnectionMultiplier(final int threadsAll
939
939
* <p> A value of 0 means that it will timeout immediately if no server is available. A negative value means to wait
940
940
* indefinitely.</p>
941
941
*
942
- * @param serverSelectionTimeout the server selection timeout
942
+ * @param serverSelectionTimeout the server selection timeout, in milliseconds
943
943
* @return {@code this}
944
944
* @see com.mongodb.MongoClientOptions#getServerSelectionTimeout()
945
945
*/
@@ -951,7 +951,7 @@ public Builder serverSelectionTimeout(final int serverSelectionTimeout) {
951
951
/**
952
952
* Sets the maximum time that a thread will block waiting for a connection.
953
953
*
954
- * @param maxWaitTime the maximum wait time
954
+ * @param maxWaitTime the maximum wait time, in milliseconds
955
955
* @return {@code this}
956
956
* @see MongoClientOptions#getMaxWaitTime()
957
957
*/
@@ -963,9 +963,9 @@ public Builder maxWaitTime(final int maxWaitTime) {
963
963
/**
964
964
* Sets the maximum idle time for a pooled connection.
965
965
*
966
- * @param maxConnectionIdleTime the maximum idle time
966
+ * @param maxConnectionIdleTime the maximum idle time, in milliseconds, which must be > 0
967
967
* @return {@code this}
968
- * @throws IllegalArgumentException if {@code aMaxConnectionIdleTime < 0}
968
+ * @throws IllegalArgumentException if {@code maxConnectionIdleTime <= 0}
969
969
* @see com.mongodb.MongoClientOptions#getMaxConnectionIdleTime()
970
970
* @since 2.12
971
971
*/
@@ -977,9 +977,9 @@ public Builder maxConnectionIdleTime(final int maxConnectionIdleTime) {
977
977
/**
978
978
* Sets the maximum life time for a pooled connection.
979
979
*
980
- * @param maxConnectionLifeTime the maximum life time
980
+ * @param maxConnectionLifeTime the maximum life time, in milliseconds, which must be > 0
981
981
* @return {@code this}
982
- * @throws IllegalArgumentException if {@code aMaxConnectionIdleTime < 0}
982
+ * @throws IllegalArgumentException if {@code maxConnectionLifeTime <= 0}
983
983
* @see com.mongodb.MongoClientOptions#getMaxConnectionIdleTime()
984
984
* @since 2.12
985
985
*/
@@ -992,7 +992,8 @@ public Builder maxConnectionLifeTime(final int maxConnectionLifeTime) {
992
992
/**
993
993
* Sets the connection timeout.
994
994
*
995
- * @param connectTimeout the connection timeout
995
+ * @param connectTimeout the connection timeout, in milliseconds, which must be > 0
996
+ * @throws IllegalArgumentException if {@code connectTimeout <= 0}
996
997
* @return {@code this}
997
998
* @see com.mongodb.MongoClientOptions#getConnectTimeout()
998
999
*/
@@ -1005,7 +1006,7 @@ public Builder connectTimeout(final int connectTimeout) {
1005
1006
/**
1006
1007
* Sets the socket timeout.
1007
1008
*
1008
- * @param socketTimeout the socket timeout
1009
+ * @param socketTimeout the socket timeout, in milliseconds
1009
1010
* @return {@code this}
1010
1011
* @see com.mongodb.MongoClientOptions#getSocketTimeout()
1011
1012
*/
@@ -1239,6 +1240,7 @@ public Builder dbEncoderFactory(final DBEncoderFactory dbEncoderFactory) {
1239
1240
*
1240
1241
* @param heartbeatFrequency the heartbeat frequency for the cluster, in milliseconds, which must be > 0
1241
1242
* @return {@code this}
1243
+ * @throws IllegalArgumentException if heartbeatFrequency is not > 0
1242
1244
* @see MongoClientOptions#getHeartbeatFrequency()
1243
1245
* @since 2.12
1244
1246
*/
@@ -1254,6 +1256,7 @@ public Builder heartbeatFrequency(final int heartbeatFrequency) {
1254
1256
*
1255
1257
* @param minHeartbeatFrequency the minimum heartbeat frequency, in milliseconds, which must be > 0
1256
1258
* @return {@code this}
1259
+ * @throws IllegalArgumentException if {@code minHeartbeatFrequency <= 0}
1257
1260
* @see MongoClientOptions#getMinHeartbeatFrequency()
1258
1261
* @since 2.13
1259
1262
*/
@@ -1266,7 +1269,7 @@ public Builder minHeartbeatFrequency(final int minHeartbeatFrequency) {
1266
1269
/**
1267
1270
* Sets the connect timeout for connections used for the cluster heartbeat.
1268
1271
*
1269
- * @param connectTimeout the connection timeout
1272
+ * @param connectTimeout the connection timeout, in milliseconds
1270
1273
* @return {@code this}
1271
1274
* @see MongoClientOptions#getHeartbeatConnectTimeout()
1272
1275
* @since 2.12
@@ -1279,7 +1282,7 @@ public Builder heartbeatConnectTimeout(final int connectTimeout) {
1279
1282
/**
1280
1283
* Sets the socket timeout for connections used for the cluster heartbeat.
1281
1284
*
1282
- * @param socketTimeout the socket timeout
1285
+ * @param socketTimeout the socket timeout, in milliseconds
1283
1286
* @return {@code this}
1284
1287
* @see MongoClientOptions#getHeartbeatSocketTimeout()
1285
1288
* @since 2.12
@@ -1292,9 +1295,9 @@ public Builder heartbeatSocketTimeout(final int socketTimeout) {
1292
1295
/**
1293
1296
* Sets the local threshold.
1294
1297
*
1295
- * @param localThreshold the acceptable latency difference, in milliseconds
1298
+ * @param localThreshold the acceptable latency difference, in milliseconds, which must be >= 0
1296
1299
* @return {@code this}
1297
- * @throws IllegalArgumentException if acceptableLatencyDifference < 0
1300
+ * @throws IllegalArgumentException if {@code localThreshold < 0}
1298
1301
* @see com.mongodb.MongoClientOptions#getLocalThreshold()
1299
1302
* @since 2.13.0
1300
1303
*/
0 commit comments