Skip to content

Commit c7cc628

Browse files
committed
provide missing configuration in DatabaseClientFactory.Bean #1020 -
Fixed the code.
1 parent 47225c2 commit c7cc628

File tree

1 file changed

+2
-41
lines changed

1 file changed

+2
-41
lines changed

marklogic-client-api/src/main/java/com/marklogic/client/DatabaseClientFactory.java

+2-41
Original file line numberDiff line numberDiff line change
@@ -1216,9 +1216,6 @@ static public class Bean implements Serializable {
12161216
private DatabaseClient.ConnectionType connectionType;
12171217
private HandleFactoryRegistry handleRegistry =
12181218
HandleFactoryRegistryImpl.newDefault();
1219-
private String certFile;
1220-
private String certPassword;
1221-
private X509TrustManager trustManager;
12221219

12231220
transient private SSLContext context;
12241221
transient private SSLHostnameVerifier verifier;
@@ -1233,18 +1230,6 @@ public Bean() {
12331230
super();
12341231
}
12351232

1236-
public Bean(String host, int port) {
1237-
this.host = host;
1238-
this.port = port;
1239-
}
1240-
1241-
public Bean(String host, int port, String username, String password) {
1242-
this.host = host;
1243-
this.port = port;
1244-
this.user = username;
1245-
this.password = password;
1246-
this.authentication = Authentication.DIGEST;
1247-
}
12481233

12491234
/**
12501235
* Returns the host for clients created with a
@@ -1457,29 +1442,6 @@ public DatabaseClient.ConnectionType getConnectionType() {
14571442
public void setConnectionType(DatabaseClient.ConnectionType connectionType) {
14581443
this.connectionType = connectionType;
14591444
}
1460-
public String getCertFile() {
1461-
return certFile;
1462-
}
1463-
1464-
public void setCertFile(String certFile) {
1465-
this.certFile = certFile;
1466-
}
1467-
1468-
public String getCertPassword() {
1469-
return certPassword;
1470-
}
1471-
1472-
public void setCertPassword(String certPassword) {
1473-
this.certPassword = certPassword;
1474-
}
1475-
1476-
public X509TrustManager getTrustManager() {
1477-
return trustManager;
1478-
}
1479-
1480-
public void setTrustManager(X509TrustManager trustManager) {
1481-
this.trustManager = trustManager;
1482-
}
14831445

14841446
/**
14851447
* Returns the registry for associating
@@ -1513,10 +1475,9 @@ public void registerDefaultHandles() {
15131475
* The client accesses the database by means of a REST server.
15141476
* @return a new client for making database requests
15151477
*/
1516-
public DatabaseClient newClient() {
1478+
public DatabaseClient newClient() {
15171479
DatabaseClientImpl client = (DatabaseClientImpl) DatabaseClientFactory.newClient(
1518-
host, port, database,
1519-
makeSecurityContext(user, password, authentication, context, verifier),
1480+
host, port, database, (securityContext!=null? securityContext:makeSecurityContext(user, password, authentication, context, verifier)),
15201481
connectionType);
15211482
client.setHandleRegistry(getHandleRegistry().copy());
15221483
return client;

0 commit comments

Comments
 (0)