@@ -196,24 +196,58 @@ default Future<HttpClientRequest> request(HttpMethod method, String requestURI)
196196 Future <WebSocket > webSocketAbs (String url , MultiMap headers , WebsocketVersion version , List <String > subProtocols );
197197
198198 /**
199- * Update the client SSL options.
199+ * <p>Update the client with new SSL {@code options}, the update happens if the options object is valid and different
200+ * from the existing options object.
200201 *
201- * Update only happens if the SSL options is valid .
202+ * <p>The boolean succeeded future result indicates whether the update occurred .
202203 *
203204 * @param options the new SSL options
204205 * @return a future signaling the update success
205206 */
206- Future <Void > updateSSLOptions (SSLOptions options );
207+ default Future <Boolean > updateSSLOptions (SSLOptions options ) {
208+ return updateSSLOptions (options , false );
209+ }
210+
211+ /**
212+ * Like {@link #updateSSLOptions(SSLOptions)} but supplying a handler that will be called when the update
213+ * happened (or has failed).
214+ *
215+ * @param options the new SSL options
216+ * @param handler the update handler
217+ */
218+ default void updateSSLOptions (SSLOptions options , Handler <AsyncResult <Boolean >> handler ) {
219+ Future <Boolean > fut = updateSSLOptions (options );
220+ if (handler != null ) {
221+ fut .onComplete (handler );
222+ }
223+ }
224+
225+ /**
226+ * <p>Update the client with new SSL {@code options}, the update happens if the options object is valid and different
227+ * from the existing options object.
228+ *
229+ * <p>The {@code options} object is compared using its {@code equals} method against the existing options to prevent
230+ * an update when the objects are equals since loading options can be costly, this can happen for share TCP servers.
231+ * When object are equals, setting {@code force} to {@code true} forces the update.
232+ *
233+ * <p>The boolean succeeded future result indicates whether the update occurred.
234+ *
235+ * @param options the new SSL options
236+ * @param force force the update when options are equals
237+ * @return a future signaling the update success
238+ */
239+ Future <Boolean > updateSSLOptions (SSLOptions options , boolean force );
207240
208241 /**
209242 * Like {@link #updateSSLOptions(SSLOptions)} but supplying a handler that will be called when the update
210243 * happened (or has failed).
211244 *
212245 * @param options the new SSL options
246+ * @param force force the update when options are equals
213247 * @param handler the update handler
214248 */
215- default void updateSSLOptions (SSLOptions options , Handler <AsyncResult <Void >> handler ) {
216- Future <Void > fut = updateSSLOptions (options );
249+ default void updateSSLOptions (SSLOptions options , boolean force , Handler <AsyncResult <Boolean >> handler ) {
250+ Future <Boolean > fut = updateSSLOptions (options , force );
217251 if (handler != null ) {
218252 fut .onComplete (handler );
219253 }
0 commit comments