diff --git a/driver-core/src/main/com/mongodb/connection/ClusterSettings.java b/driver-core/src/main/com/mongodb/connection/ClusterSettings.java index 4bf1b47c6c0..84a24bbd22b 100644 --- a/driver-core/src/main/com/mongodb/connection/ClusterSettings.java +++ b/driver-core/src/main/com/mongodb/connection/ClusterSettings.java @@ -151,10 +151,12 @@ public Builder srvHost(final String srvHost) { /** * Sets the maximum number of hosts to connect to when using SRV protocol. + * This setting is not used if {@link #getMode()} is {@link ClusterConnectionMode#LOAD_BALANCED}. * * @param srvMaxHosts the maximum number of hosts to connect to when using SRV protocol * @return this * @since 4.4 + * @see #getSrvMaxHosts() */ public Builder srvMaxHosts(final Integer srvMaxHosts) { this.srvMaxHosts = srvMaxHosts; @@ -168,8 +170,8 @@ public Builder srvMaxHosts(final Integer srvMaxHosts) { * The SRV resource record (RFC 2782) * service name, which is limited to 15 characters * (RFC 6335 section 5.1). - * If specified, it is combined with the single host name specified by - * {@link #getHosts()} as follows: {@code _srvServiceName._tcp.hostName}. The combined string is an SRV resource record + * It is combined with the host name specified by + * {@link #getSrvHost()} as follows: {@code _srvServiceName._tcp.hostName}. The combined string is an SRV resource record * name (RFC 1035 section 2.3.1), which is limited to 255 * characters (RFC 1035 section 2.3.4). *

@@ -177,6 +179,7 @@ public Builder srvMaxHosts(final Integer srvMaxHosts) { * @param srvServiceName the SRV service name * @return this * @since 4.5 + * @see #getSrvServiceName() */ public Builder srvServiceName(final String srvServiceName) { this.srvServiceName = notNull("srvServiceName", srvServiceName); @@ -219,6 +222,7 @@ public Builder mode(final ClusterConnectionMode mode) { /** * Sets the required replica set name for the cluster. + * This setting is not used if {@link #getMode()} is {@link ClusterConnectionMode#LOAD_BALANCED}. * * @param requiredReplicaSetName the required replica set name. * @return this @@ -231,9 +235,11 @@ public Builder requiredReplicaSetName(@Nullable final String requiredReplicaSetN /** * Sets the required cluster type for the cluster. + * This setting is not used if {@link #getMode()} is {@link ClusterConnectionMode#LOAD_BALANCED}. * * @param requiredClusterType the required cluster type * @return this + * @see #getRequiredClusterType() */ public Builder requiredClusterType(final ClusterType requiredClusterType) { this.requiredClusterType = notNull("requiredClusterType", requiredClusterType); @@ -384,9 +390,11 @@ public String getSrvHost() { /** * Gets the maximum number of hosts to connect to when using SRV protocol. + * This setting is not used if {@link #getMode()} is {@link ClusterConnectionMode#LOAD_BALANCED}. * * @return the maximum number of hosts to connect to when using SRV protocol. Defaults to null. * @since 4.4 + * @see Builder#srvMaxHosts(Integer) */ @Nullable public Integer getSrvMaxHosts() { @@ -400,14 +408,15 @@ public Integer getSrvMaxHosts() { * The SRV resource record (RFC 2782) * service name, which is limited to 15 characters * (RFC 6335 section 5.1). - * If specified, it is combined with the single host name specified by - * {@link #getHosts()} as follows: {@code _srvServiceName._tcp.hostName}. The combined string is an SRV resource record + * It is combined with the host name specified by + * {@link #getSrvHost()} as follows: {@code _srvServiceName._tcp.hostName}. The combined string is an SRV resource record * name (RFC 1035 section 2.3.1), which is limited to 255 * characters (RFC 1035 section 2.3.4). *

* * @return the SRV service name, which defaults to {@code "mongodb"} * @since 4.5 + * @see Builder#srvServiceName(String) */ public String getSrvServiceName() { return srvServiceName; @@ -433,8 +442,10 @@ public ClusterConnectionMode getMode() { /** * Gets the required cluster type + * This setting is not used if {@link #getMode()} is {@link ClusterConnectionMode#LOAD_BALANCED}. * * @return the required cluster type + * @see Builder#requiredClusterType(ClusterType) */ public ClusterType getRequiredClusterType() { return requiredClusterType; @@ -442,6 +453,7 @@ public ClusterType getRequiredClusterType() { /** * Gets the required replica set name. + * This setting is not used if {@link #getMode()} is {@link ClusterConnectionMode#LOAD_BALANCED}. * * @return the required replica set name * @see Builder#requiredReplicaSetName(String)