2121
2222import javax .net .ssl .SSLContext ;
2323import javax .net .ssl .SSLException ;
24- import javax .net .ssl .TrustManager ;
2524
2625import okhttp3 .OkHttpClient ;
2726import org .slf4j .Logger ;
@@ -213,7 +212,7 @@ private DatabaseClientFactory() {
213212 * @return a new client for making database requests
214213 */
215214 static public DatabaseClient newClient (String host , int port ) {
216- return newClient (host , port , null , null , null , null , null , null , null );
215+ return newClient (host , port , null , null , null , null , null , null );
217216 }
218217
219218 /**
@@ -227,7 +226,7 @@ static public DatabaseClient newClient(String host, int port) {
227226 * @return a new client for making database requests
228227 */
229228 static public DatabaseClient newClient (String host , int port , String database ) {
230- return newClient (host , port , database , null , null , null , null , null , null );
229+ return newClient (host , port , database , null , null , null , null , null );
231230 }
232231
233232 /**
@@ -241,7 +240,7 @@ static public DatabaseClient newClient(String host, int port, String database) {
241240 * @return a new client for making database requests
242241 */
243242 static public DatabaseClient newClient (String host , int port , String user , String password , Authentication type ) {
244- return newClient (host , port , null , user , password , type , null , null , null );
243+ return newClient (host , port , null , user , password , type , null , null );
245244 }
246245 /**
247246 * Creates a client to access the database by means of a REST server.
@@ -255,7 +254,7 @@ static public DatabaseClient newClient(String host, int port, String user, Strin
255254 * @return a new client for making database requests
256255 */
257256 static public DatabaseClient newClient (String host , int port , String database , String user , String password , Authentication type ) {
258- return newClient (host , port , database , user , password , type , null , null , null );
257+ return newClient (host , port , database , user , password , type , null , null );
259258 }
260259 /**
261260 * Creates a client to access the database by means of a REST server.
@@ -267,26 +266,9 @@ static public DatabaseClient newClient(String host, int port, String database, S
267266 * @param type the type of authentication applied to the request
268267 * @param context the SSL context for authenticating with the server
269268 * @return a new client for making database requests
270- * @deprecated use {@link DatabaseClientFactory#newClient(String, int, String, String, Authentication, SSLContext, TrustManager)}}
271269 */
272270 static public DatabaseClient newClient (String host , int port , String user , String password , Authentication type , SSLContext context ) {
273- return newClient (host , port , null , user , password , type , context , null , SSLHostnameVerifier .COMMON );
274- }
275- /**
276- * Creates a client to access the database by means of a REST server.
277- *
278- * @param host the host with the REST server
279- * @param port the port for the REST server
280- * @param user the user with read, write, or administrative privileges
281- * @param password the password for the user
282- * @param type the type of authentication applied to the request
283- * @param context the SSL context for authenticating with the server
284- * @param trustManager the TrustManager object which is responsible for
285- * deciding if a credential should be trusted or not.
286- * @return a new client for making database requests
287- */
288- static public DatabaseClient newClient (String host , int port , String user , String password , Authentication type , SSLContext context , TrustManager trustManager ) {
289- return newClient (host , port , null , user , password , type , context , trustManager , SSLHostnameVerifier .COMMON );
271+ return newClient (host , port , null , user , password , type , context , SSLHostnameVerifier .COMMON );
290272 }
291273 /**
292274 * Creates a client to access the database by means of a REST server.
@@ -299,27 +281,9 @@ static public DatabaseClient newClient(String host, int port, String user, Strin
299281 * @param type the type of authentication applied to the request
300282 * @param context the SSL context for authenticating with the server
301283 * @return a new client for making database requests
302- * @deprecated use {@link DatabaseClientFactory#newClient(String, int, String, String, String, Authentication, SSLContext, TrustManager)}}
303284 */
304285 static public DatabaseClient newClient (String host , int port , String database , String user , String password , Authentication type , SSLContext context ) {
305- return newClient (host , port , database , user , password , type , context , null , SSLHostnameVerifier .COMMON );
306- }
307- /**
308- * Creates a client to access the database by means of a REST server.
309- *
310- * @param host the host with the REST server
311- * @param port the port for the REST server
312- * @param database the database to access (default: configured database for the REST server)
313- * @param user the user with read, write, or administrative privileges
314- * @param password the password for the user
315- * @param type the type of authentication applied to the request
316- * @param context the SSL context for authenticating with the server
317- * @param trustManager the TrustManager object which is responsible for
318- * deciding if a credential should be trusted or not.
319- * @return a new client for making database requests
320- */
321- static public DatabaseClient newClient (String host , int port , String database , String user , String password , Authentication type , SSLContext context , TrustManager trustManager ) {
322- return newClient (host , port , database , user , password , type , context , trustManager , SSLHostnameVerifier .COMMON );
286+ return newClient (host , port , database , user , password , type , context , SSLHostnameVerifier .COMMON );
323287 }
324288 /**
325289 * Creates a client to access the database by means of a REST server.
@@ -332,29 +296,9 @@ static public DatabaseClient newClient(String host, int port, String database, S
332296 * @param context the SSL context for authenticating with the server
333297 * @param verifier a callback for checking hostnames
334298 * @return a new client for making database requests
335- * @deprecated use {@link DatabaseClientFactory#newClient(String, int, String, String, Authentication, SSLContext, TrustManager, SSLHostnameVerifier)}
336299 */
337300 static public DatabaseClient newClient (String host , int port , String user , String password , Authentication type , SSLContext context , SSLHostnameVerifier verifier ) {
338- DatabaseClientImpl client = newClientImpl (host , port , null , user , password , type , context , null , verifier );
339- client .setHandleRegistry (getHandleRegistry ().copy ());
340- return client ;
341- }
342- /**
343- * Creates a client to access the database by means of a REST server.
344- *
345- * @param host the host with the REST server
346- * @param port the port for the REST server
347- * @param user the user with read, write, or administrative privileges
348- * @param password the password for the user
349- * @param type the type of authentication applied to the request
350- * @param context the SSL context for authenticating with the server
351- * @param trustManager the TrustManager object which is responsible for
352- * deciding if a credential should be trusted or not.
353- * @param verifier a callback for checking hostnames
354- * @return a new client for making database requests
355- */
356- static public DatabaseClient newClient (String host , int port , String user , String password , Authentication type , SSLContext context , TrustManager trustManager , SSLHostnameVerifier verifier ) {
357- DatabaseClientImpl client = newClientImpl (host , port , null , user , password , type , context , trustManager , verifier );
301+ DatabaseClientImpl client = newClientImpl (host , port , null , user , password , type , context , verifier );
358302 client .setHandleRegistry (getHandleRegistry ().copy ());
359303 return client ;
360304 }
@@ -370,34 +314,13 @@ static public DatabaseClient newClient(String host, int port, String user, Strin
370314 * @param context the SSL context for authenticating with the server
371315 * @param verifier a callback for checking hostnames
372316 * @return a new client for making database requests
373- * @deprecated use {@link DatabaseClientFactory#newClient(String, int, String, String, String, Authentication, SSLContext, TrustManager, SSLHostnameVerifier)}}
374317 */
375318 static public DatabaseClient newClient (String host , int port , String database , String user , String password , Authentication type , SSLContext context , SSLHostnameVerifier verifier ) {
376- DatabaseClientImpl client = newClientImpl (host , port , database , user , password , type , context , null , verifier );
377- client .setHandleRegistry (getHandleRegistry ().copy ());
378- return client ;
379- }
380- /**
381- * Creates a client to access the database by means of a REST server.
382- *
383- * @param host the host with the REST server
384- * @param port the port for the REST server
385- * @param database the database to access (default: configured database for the REST server)
386- * @param user the user with read, write, or administrative privileges
387- * @param password the password for the user
388- * @param type the type of authentication applied to the request
389- * @param context the SSL context for authenticating with the server
390- * @param trustManager the TrustManager object which is responsible for
391- * deciding if a credential should be trusted or not.
392- * @param verifier a callback for checking hostnames
393- * @return a new client for making database requests
394- */
395- static public DatabaseClient newClient (String host , int port , String database , String user , String password , Authentication type , SSLContext context , TrustManager trustManager , SSLHostnameVerifier verifier ) {
396- DatabaseClientImpl client = newClientImpl (host , port , database , user , password , type , context , trustManager , verifier );
319+ DatabaseClientImpl client = newClientImpl (host , port , database , user , password , type , context , verifier );
397320 client .setHandleRegistry (getHandleRegistry ().copy ());
398321 return client ;
399322 }
400- static private DatabaseClientImpl newClientImpl (String host , int port , String database , String user , String password , Authentication type , SSLContext context , TrustManager trustManager , SSLHostnameVerifier verifier ) {
323+ static private DatabaseClientImpl newClientImpl (String host , int port , String database , String user , String password , Authentication type , SSLContext context , SSLHostnameVerifier verifier ) {
401324 logger .debug ("Creating new database client for server at " +host +":" +port );
402325 OkHttpServices services = new OkHttpServices ();
403326 services .connect (host , port , database , user , password , type , context , verifier );
@@ -498,7 +421,6 @@ static public class Bean implements Serializable {
498421
499422 transient private SSLContext context ;
500423 transient private SSLHostnameVerifier verifier ;
501- transient private TrustManager trustManager ;
502424
503425 /**
504426 * Zero-argument constructor for bean applications. Other
@@ -613,22 +535,6 @@ public SSLContext getContext() {
613535 public void setContext (SSLContext context ) {
614536 this .context = context ;
615537 }
616- /**
617- * Returns the TrustManager for SSL clients created with a
618- * DatabaseClientFactory.Bean object.
619- * @return the TrustManager
620- */
621- public TrustManager getTrustManager () {
622- return trustManager ;
623- }
624- /**
625- * Specifies the TrustManager for clients created with a
626- * DatabaseClientFactory.Bean object that authenticate with SSL.
627- * @param trustManager the TrustManager
628- */
629- public void setTrustManager (TrustManager trustManager ) {
630- this .trustManager = trustManager ;
631- }
632538 /**
633539 * Returns the host verifier for clients created with a
634540 * DatabaseClientFactory.Bean object.
@@ -680,7 +586,7 @@ public void registerDefaultHandles() {
680586 * @return a new client for making database requests
681587 */
682588 public DatabaseClient newClient () {
683- DatabaseClientImpl client = newClientImpl (host , port , database , user , password , authentication , context , trustManager , verifier );
589+ DatabaseClientImpl client = newClientImpl (host , port , database , user , password , authentication , context , verifier );
684590 client .setHandleRegistry (getHandleRegistry ().copy ());
685591
686592 return client ;
0 commit comments