/** * Takes the settings from the given {@code ConnectionString} and applies them to the builder * * @param connectionString the connection string containing details of how to connect to MongoDB * @return this * @see com.mongodb.ConnectionString#getConnectTimeout() * @see com.mongodb.ConnectionString#getSocketTimeout() */ public Builder applyConnectionString(final ConnectionString connectionString) { Integer connectTimeout = connectionString.getConnectTimeout(); if (connectTimeout != null) { this.connectTimeout(connectTimeout, MILLISECONDS); } Integer socketTimeout = connectionString.getSocketTimeout(); if (socketTimeout != null) { this.readTimeout(socketTimeout, MILLISECONDS); } return this; }
builder.socketTimeout(socketTimeout); Integer connectTimeout = proxied.getConnectTimeout(); if (connectTimeout != null) { builder.connectTimeout(connectTimeout);
/** * Takes the settings from the given {@code ConnectionString} and applies them to the builder * * @param connectionString the connection string containing details of how to connect to MongoDB * @return this * @see com.mongodb.ConnectionString#getConnectTimeout() * @see com.mongodb.ConnectionString#getSocketTimeout() */ public Builder applyConnectionString(final ConnectionString connectionString) { Integer connectTimeout = connectionString.getConnectTimeout(); if (connectTimeout != null) { this.connectTimeout(connectTimeout, MILLISECONDS); } Integer socketTimeout = connectionString.getSocketTimeout(); if (socketTimeout != null) { this.readTimeout(socketTimeout, MILLISECONDS); } return this; }
builder.socketTimeout(socketTimeout); Integer connectTimeout = proxied.getConnectTimeout(); if (connectTimeout != null) { builder.connectTimeout(connectTimeout);