summaryrefslogtreecommitdiffstats
path: root/sdnr
diff options
context:
space:
mode:
authorMichael Dürre <michael.duerre@highstreet-technologies.com>2020-05-27 13:34:01 +0200
committerMichael Dürre <michael.duerre@highstreet-technologies.com>2020-05-27 13:34:14 +0200
commitc2abf2b68dcd53d40762783ae713d08268a69348 (patch)
tree7d6196b5cf275b77c7b01e82fee954ee82b65f08 /sdnr
parent450fc8501f8f8506a816ab693a0a2e2cc005af16 (diff)
fix trustall feature for dbclient
forward property forwarding to dbclient Issue-ID: SDNC-1200 Signed-off-by: Michael Dürre <michael.duerre@highstreet-technologies.com> Change-Id: I43355834a65cc69a56710592521b5acc1dae6500
Diffstat (limited to 'sdnr')
-rw-r--r--sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/data/ElasticSearchDataProvider.java8
-rw-r--r--sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/impl/DataProviderServiceImpl.java2
2 files changed, 6 insertions, 4 deletions
diff --git a/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/data/ElasticSearchDataProvider.java b/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/data/ElasticSearchDataProvider.java
index 6b5fa2ade..4fa0a57cc 100644
--- a/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/data/ElasticSearchDataProvider.java
+++ b/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/data/ElasticSearchDataProvider.java
@@ -79,6 +79,8 @@ public class ElasticSearchDataProvider /*extends BaseStatusProvider /* implement
private static final String EXCEPTION_UNABLE_TO_UPDATE_IN_DATABASE = "unable to update data in database";
private static final String EXCEPTION_UNABLE_TO_REMOVE_FROM_DATABASE = "unable to remove data from database";
+ private static final boolean DEFAULT_TRUSTALLCERTS = false;
+
private final HtDatabaseClient dbClient;
private final DataObjectAcessor<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.faultcurrent.list.output.Data> eventRWFaultCurrent;
private final DataObjectAcessor<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.faultlog.list.output.Data> eventRWFaultLog;
@@ -98,13 +100,13 @@ public class ElasticSearchDataProvider /*extends BaseStatusProvider /* implement
return this.dbClient;
}
public ElasticSearchDataProvider(HostInfo[] hosts) throws Exception {
- this(hosts,null,null);
+ this(hosts,null,null,DEFAULT_TRUSTALLCERTS);
}
- public ElasticSearchDataProvider(HostInfo[] hosts,String authUsername,String authPassword) throws Exception {
+ public ElasticSearchDataProvider(HostInfo[] hosts,String authUsername,String authPassword, boolean trustAllCerts) throws Exception {
super();
LOG.info("Start {}", this.getClass().getName());
- this.dbClient = new HtDatabaseClient(hosts,authUsername,authPassword);
+ this.dbClient = new HtDatabaseClient(hosts,authUsername,authPassword,trustAllCerts);
this.mediatorserverRW = new DataObjectAcessor<>(dbClient, Entity.MediatorServer,
org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.read.mediator.server.list.output.Data.class);
this.mediatorserverRW.setWriteInterface(MediatorServerEntity.class);
diff --git a/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/impl/DataProviderServiceImpl.java b/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/impl/DataProviderServiceImpl.java
index b286f695b..2f3b7ee80 100644
--- a/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/impl/DataProviderServiceImpl.java
+++ b/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/impl/DataProviderServiceImpl.java
@@ -111,7 +111,7 @@ public class DataProviderServiceImpl implements DataProviderService, AutoCloseab
DataProviderServiceImpl(final RpcProviderService rpcProviderService,MsServlet mediatorServerServlet) throws Exception {
this.configuration = new ConfigurationFileRepresentation(CONFIGURATIONFILE);
this.esConfig = new EsConfig(configuration);
- this.dataProvider = new ElasticSearchDataProvider(esConfig.getHosts(),esConfig.getBasicAuthUsername(),esConfig.getBasicAuthPassword());
+ this.dataProvider = new ElasticSearchDataProvider(esConfig.getHosts(),esConfig.getBasicAuthUsername(),esConfig.getBasicAuthPassword(),esConfig.trustAllCerts());
this.dataProvider.waitForYellowDatabaseStatus(DATABASE_TIMEOUT_MS,TimeUnit.MILLISECONDS);
this.mediatorServerDataProvider = new MediatorServerDataProvider(esConfig.getHosts(),esConfig.getBasicAuthUsername(),esConfig.getBasicAuthPassword());
mediatorServerServlet.setDataProvider(this.mediatorServerDataProvider);