@@ -151,10 +151,12 @@ public Builder srvHost(final String srvHost) {
151
151
152
152
/**
153
153
* Sets the maximum number of hosts to connect to when using SRV protocol.
154
+ * This setting is not used if {@link #getMode()} is {@link ClusterConnectionMode#LOAD_BALANCED}.
154
155
*
155
156
* @param srvMaxHosts the maximum number of hosts to connect to when using SRV protocol
156
157
* @return this
157
158
* @since 4.4
159
+ * @see #getSrvMaxHosts()
158
160
*/
159
161
public Builder srvMaxHosts (final Integer srvMaxHosts ) {
160
162
this .srvMaxHosts = srvMaxHosts ;
@@ -168,15 +170,16 @@ public Builder srvMaxHosts(final Integer srvMaxHosts) {
168
170
* The SRV resource record (<a href="https://www.rfc-editor.org/rfc/rfc2782">RFC 2782</a>)
169
171
* service name, which is limited to 15 characters
170
172
* (<a href="https://www.rfc-editor.org/rfc/rfc6335#section-5.1">RFC 6335 section 5.1</a>).
171
- * If specified, it is combined with the single host name specified by
172
- * {@link #getHosts ()} as follows: {@code _srvServiceName._tcp.hostName}. The combined string is an SRV resource record
173
+ * It is combined with the host name specified by
174
+ * {@link #getSrvHost ()} as follows: {@code _srvServiceName._tcp.hostName}. The combined string is an SRV resource record
173
175
* name (<a href="https://www.rfc-editor.org/rfc/rfc1035#section-2.3.1">RFC 1035 section 2.3.1</a>), which is limited to 255
174
176
* characters (<a href="https://www.rfc-editor.org/rfc/rfc1035#section-2.3.4">RFC 1035 section 2.3.4</a>).
175
177
* </p>
176
178
*
177
179
* @param srvServiceName the SRV service name
178
180
* @return this
179
181
* @since 4.5
182
+ * @see #getSrvServiceName()
180
183
*/
181
184
public Builder srvServiceName (final String srvServiceName ) {
182
185
this .srvServiceName = notNull ("srvServiceName" , srvServiceName );
@@ -219,6 +222,7 @@ public Builder mode(final ClusterConnectionMode mode) {
219
222
220
223
/**
221
224
* Sets the required replica set name for the cluster.
225
+ * This setting is not used if {@link #getMode()} is {@link ClusterConnectionMode#LOAD_BALANCED}.
222
226
*
223
227
* @param requiredReplicaSetName the required replica set name.
224
228
* @return this
@@ -231,9 +235,11 @@ public Builder requiredReplicaSetName(@Nullable final String requiredReplicaSetN
231
235
232
236
/**
233
237
* Sets the required cluster type for the cluster.
238
+ * This setting is not used if {@link #getMode()} is {@link ClusterConnectionMode#LOAD_BALANCED}.
234
239
*
235
240
* @param requiredClusterType the required cluster type
236
241
* @return this
242
+ * @see #getRequiredClusterType()
237
243
*/
238
244
public Builder requiredClusterType (final ClusterType requiredClusterType ) {
239
245
this .requiredClusterType = notNull ("requiredClusterType" , requiredClusterType );
@@ -384,9 +390,11 @@ public String getSrvHost() {
384
390
385
391
/**
386
392
* Gets the maximum number of hosts to connect to when using SRV protocol.
393
+ * This setting is not used if {@link #getMode()} is {@link ClusterConnectionMode#LOAD_BALANCED}.
387
394
*
388
395
* @return the maximum number of hosts to connect to when using SRV protocol. Defaults to null.
389
396
* @since 4.4
397
+ * @see Builder#srvMaxHosts(Integer)
390
398
*/
391
399
@ Nullable
392
400
public Integer getSrvMaxHosts () {
@@ -400,14 +408,15 @@ public Integer getSrvMaxHosts() {
400
408
* The SRV resource record (<a href="https://www.rfc-editor.org/rfc/rfc2782">RFC 2782</a>)
401
409
* service name, which is limited to 15 characters
402
410
* (<a href="https://www.rfc-editor.org/rfc/rfc6335#section-5.1">RFC 6335 section 5.1</a>).
403
- * If specified, it is combined with the single host name specified by
404
- * {@link #getHosts ()} as follows: {@code _srvServiceName._tcp.hostName}. The combined string is an SRV resource record
411
+ * It is combined with the host name specified by
412
+ * {@link #getSrvHost ()} as follows: {@code _srvServiceName._tcp.hostName}. The combined string is an SRV resource record
405
413
* name (<a href="https://www.rfc-editor.org/rfc/rfc1035#section-2.3.1">RFC 1035 section 2.3.1</a>), which is limited to 255
406
414
* characters (<a href="https://www.rfc-editor.org/rfc/rfc1035#section-2.3.4">RFC 1035 section 2.3.4</a>).
407
415
* </p>
408
416
*
409
417
* @return the SRV service name, which defaults to {@code "mongodb"}
410
418
* @since 4.5
419
+ * @see Builder#srvServiceName(String)
411
420
*/
412
421
public String getSrvServiceName () {
413
422
return srvServiceName ;
@@ -433,15 +442,18 @@ public ClusterConnectionMode getMode() {
433
442
434
443
/**
435
444
* Gets the required cluster type
445
+ * This setting is not used if {@link #getMode()} is {@link ClusterConnectionMode#LOAD_BALANCED}.
436
446
*
437
447
* @return the required cluster type
448
+ * @see Builder#requiredClusterType(ClusterType)
438
449
*/
439
450
public ClusterType getRequiredClusterType () {
440
451
return requiredClusterType ;
441
452
}
442
453
443
454
/**
444
455
* Gets the required replica set name.
456
+ * This setting is not used if {@link #getMode()} is {@link ClusterConnectionMode#LOAD_BALANCED}.
445
457
*
446
458
* @return the required replica set name
447
459
* @see Builder#requiredReplicaSetName(String)
0 commit comments