Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do minor improvements to method docs in ClusterSettings #1304

Merged
merged 2 commits into from
Feb 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions driver-core/src/main/com/mongodb/connection/ClusterSettings.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -168,15 +170,16 @@ public Builder srvMaxHosts(final Integer srvMaxHosts) {
* The SRV resource record (<a href="https://www.rfc-editor.org/rfc/rfc2782">RFC 2782</a>)
* service name, which is limited to 15 characters
* (<a href="https://www.rfc-editor.org/rfc/rfc6335#section-5.1">RFC 6335 section 5.1</a>).
* 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 (<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
* characters (<a href="https://www.rfc-editor.org/rfc/rfc1035#section-2.3.4">RFC 1035 section 2.3.4</a>).
* </p>
*
* @param srvServiceName the SRV service name
* @return this
* @since 4.5
* @see #getSrvServiceName()
*/
public Builder srvServiceName(final String srvServiceName) {
this.srvServiceName = notNull("srvServiceName", srvServiceName);
Expand Down Expand Up @@ -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
Expand All @@ -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);
Expand Down Expand Up @@ -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() {
Expand All @@ -400,14 +408,15 @@ public Integer getSrvMaxHosts() {
* The SRV resource record (<a href="https://www.rfc-editor.org/rfc/rfc2782">RFC 2782</a>)
* service name, which is limited to 15 characters
* (<a href="https://www.rfc-editor.org/rfc/rfc6335#section-5.1">RFC 6335 section 5.1</a>).
* 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 (<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
* characters (<a href="https://www.rfc-editor.org/rfc/rfc1035#section-2.3.4">RFC 1035 section 2.3.4</a>).
* </p>
*
* @return the SRV service name, which defaults to {@code "mongodb"}
* @since 4.5
* @see Builder#srvServiceName(String)
*/
public String getSrvServiceName() {
return srvServiceName;
Expand All @@ -433,15 +442,18 @@ 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;
}

/**
* 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)
Expand Down