Skip to content

Commit a63e825

Browse files
authored
Do minor improvements to method docs in ClusterSettings (#1304)
1 parent cb6692f commit a63e825

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

driver-core/src/main/com/mongodb/connection/ClusterSettings.java

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,10 +151,12 @@ public Builder srvHost(final String srvHost) {
151151

152152
/**
153153
* 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}.
154155
*
155156
* @param srvMaxHosts the maximum number of hosts to connect to when using SRV protocol
156157
* @return this
157158
* @since 4.4
159+
* @see #getSrvMaxHosts()
158160
*/
159161
public Builder srvMaxHosts(final Integer srvMaxHosts) {
160162
this.srvMaxHosts = srvMaxHosts;
@@ -168,15 +170,16 @@ public Builder srvMaxHosts(final Integer srvMaxHosts) {
168170
* The SRV resource record (<a href="https://www.rfc-editor.org/rfc/rfc2782">RFC 2782</a>)
169171
* service name, which is limited to 15 characters
170172
* (<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
173175
* 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
174176
* characters (<a href="https://www.rfc-editor.org/rfc/rfc1035#section-2.3.4">RFC 1035 section 2.3.4</a>).
175177
* </p>
176178
*
177179
* @param srvServiceName the SRV service name
178180
* @return this
179181
* @since 4.5
182+
* @see #getSrvServiceName()
180183
*/
181184
public Builder srvServiceName(final String srvServiceName) {
182185
this.srvServiceName = notNull("srvServiceName", srvServiceName);
@@ -219,6 +222,7 @@ public Builder mode(final ClusterConnectionMode mode) {
219222

220223
/**
221224
* Sets the required replica set name for the cluster.
225+
* This setting is not used if {@link #getMode()} is {@link ClusterConnectionMode#LOAD_BALANCED}.
222226
*
223227
* @param requiredReplicaSetName the required replica set name.
224228
* @return this
@@ -231,9 +235,11 @@ public Builder requiredReplicaSetName(@Nullable final String requiredReplicaSetN
231235

232236
/**
233237
* Sets the required cluster type for the cluster.
238+
* This setting is not used if {@link #getMode()} is {@link ClusterConnectionMode#LOAD_BALANCED}.
234239
*
235240
* @param requiredClusterType the required cluster type
236241
* @return this
242+
* @see #getRequiredClusterType()
237243
*/
238244
public Builder requiredClusterType(final ClusterType requiredClusterType) {
239245
this.requiredClusterType = notNull("requiredClusterType", requiredClusterType);
@@ -384,9 +390,11 @@ public String getSrvHost() {
384390

385391
/**
386392
* 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}.
387394
*
388395
* @return the maximum number of hosts to connect to when using SRV protocol. Defaults to null.
389396
* @since 4.4
397+
* @see Builder#srvMaxHosts(Integer)
390398
*/
391399
@Nullable
392400
public Integer getSrvMaxHosts() {
@@ -400,14 +408,15 @@ public Integer getSrvMaxHosts() {
400408
* The SRV resource record (<a href="https://www.rfc-editor.org/rfc/rfc2782">RFC 2782</a>)
401409
* service name, which is limited to 15 characters
402410
* (<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
405413
* 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
406414
* characters (<a href="https://www.rfc-editor.org/rfc/rfc1035#section-2.3.4">RFC 1035 section 2.3.4</a>).
407415
* </p>
408416
*
409417
* @return the SRV service name, which defaults to {@code "mongodb"}
410418
* @since 4.5
419+
* @see Builder#srvServiceName(String)
411420
*/
412421
public String getSrvServiceName() {
413422
return srvServiceName;
@@ -433,15 +442,18 @@ public ClusterConnectionMode getMode() {
433442

434443
/**
435444
* Gets the required cluster type
445+
* This setting is not used if {@link #getMode()} is {@link ClusterConnectionMode#LOAD_BALANCED}.
436446
*
437447
* @return the required cluster type
448+
* @see Builder#requiredClusterType(ClusterType)
438449
*/
439450
public ClusterType getRequiredClusterType() {
440451
return requiredClusterType;
441452
}
442453

443454
/**
444455
* Gets the required replica set name.
456+
* This setting is not used if {@link #getMode()} is {@link ClusterConnectionMode#LOAD_BALANCED}.
445457
*
446458
* @return the required replica set name
447459
* @see Builder#requiredReplicaSetName(String)

0 commit comments

Comments
 (0)