@@ -39,14 +39,13 @@ protected LDConfig(Builder builder) {
3939 /**
4040 * A <a href="http://en.wikipedia.org/wiki/Builder_pattern">builder</a> that helps construct {@link com.launchdarkly.client.LDConfig} objects. Builder
4141 * calls can be chained, enabling the following pattern:
42- * <p>
42+ *
4343 * <pre>
4444 * LDConfig config = new LDConfig.Builder()
4545 * .connectTimeout(3)
4646 * .socketTimeout(3)
4747 * .build()
4848 * </pre>
49- * </p>
5049 *
5150 */
5251 public static class Builder {
@@ -75,22 +74,56 @@ public Builder baseURI(URI baseURI) {
7574 /**
7675 * Set the connection timeout in seconds for the configuration. This is the time allowed for the underlying HTTP client to connect
7776 * to the LaunchDarkly server. The default is 2 seconds.
77+ *
78+ * <p>Both this method and {@link #connectTimeoutMillis(int) connectTimeoutMillis} affect the same property internally.</p>
79+ *
7880 * @param connectTimeout the connection timeout in seconds
7981 * @return the builder
8082 */
8183 public Builder connectTimeout (int connectTimeout ) {
82- this .connectTimeout = connectTimeout ;
84+ this .connectTimeout = connectTimeout * 1000 ;
8385 return this ;
8486 }
8587
8688 /**
8789 * Set the socket timeout in seconds for the configuration. This is the number of seconds between successive packets that the
8890 * client will tolerate before flagging an error. The default is 10 seconds.
91+ *
92+ * <p>Both this method and {@link #socketTimeoutMillis(int) socketTimeoutMillis} affect the same property internally.</p>
93+ *
8994 * @param socketTimeout the socket timeout in seconds
9095 * @return the builder
9196 */
9297 public Builder socketTimeout (int socketTimeout ) {
93- this .socketTimeout = socketTimeout ;
98+ this .socketTimeout = socketTimeout * 1000 ;
99+ return this ;
100+ }
101+
102+ /**
103+ * Set the connection timeout in milliseconds for the configuration. This is the time allowed for the underlying HTTP client to connect
104+ * to the LaunchDarkly server. The default is 2000 ms.
105+ *
106+ * <p>Both this method and {@link #connectTimeout(int) connectTimeout} affect the same property internally.</p>
107+ *
108+ * @param connectTimeoutMillis the connection timeout in milliseconds
109+ * @return the builder
110+ */
111+ public Builder connectTimeoutMillis (int connectTimeoutMillis ) {
112+ this .connectTimeout = connectTimeoutMillis ;
113+ return this ;
114+ }
115+
116+ /**
117+ * Set the socket timeout in milliseconds for the configuration. This is the number of milliseconds between successive packets that the
118+ * client will tolerate before flagging an error. The default is 10,000 milliseconds.
119+ *
120+ * <p>Both this method and {@link #socketTimeout(int) socketTimeout} affect the same property internally.</p>
121+ *
122+ * @param socketTimeoutMillis the socket timeout in milliseconds
123+ * @return the builder
124+ */
125+ public Builder socketTimeoutMillis (int socketTimeoutMillis ) {
126+ this .socketTimeout = socketTimeoutMillis ;
94127 return this ;
95128 }
96129
0 commit comments