diff options
author | 2017-06-09 02:39:56 +0300 | |
---|---|---|
committer | 2017-06-09 02:39:56 +0300 | |
commit | 280f8015d06af1f41a3ef12e8300801c7a5e0d54 (patch) | |
tree | 9c1d3978c04cd28068f02073038c936bb49ca9e0 /openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/main/java/org/openecomp/core/nosqldb | |
parent | fd3821dad11780d33c5373d74c957c442489945e (diff) |
[SDC-29] Amdocs OnBoard 1707 initial commit.
Change-Id: Ie4d12a3f574008b792899b368a0902a8b46b5370
Signed-off-by: AviZi <avi.ziv@amdocs.com>
Diffstat (limited to 'openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/main/java/org/openecomp/core/nosqldb')
3 files changed, 14 insertions, 10 deletions
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/main/java/org/openecomp/core/nosqldb/impl/cassandra/CassandraNoSqlDbFactoryImpl.java b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/main/java/org/openecomp/core/nosqldb/impl/cassandra/CassandraNoSqlDbFactoryImpl.java index 2922925171..134d341d05 100644 --- a/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/main/java/org/openecomp/core/nosqldb/impl/cassandra/CassandraNoSqlDbFactoryImpl.java +++ b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/main/java/org/openecomp/core/nosqldb/impl/cassandra/CassandraNoSqlDbFactoryImpl.java @@ -20,6 +20,7 @@ package org.openecomp.core.nosqldb.impl.cassandra; + import com.datastax.driver.core.Session; import org.openecomp.core.nosqldb.api.NoSqlDb; import org.openecomp.core.nosqldb.factory.NoSqlDbFactory; diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/main/java/org/openecomp/core/nosqldb/impl/cassandra/CassandraSessionFactory.java b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/main/java/org/openecomp/core/nosqldb/impl/cassandra/CassandraSessionFactory.java index 1b98f095b5..4863e3df0f 100644 --- a/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/main/java/org/openecomp/core/nosqldb/impl/cassandra/CassandraSessionFactory.java +++ b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/main/java/org/openecomp/core/nosqldb/impl/cassandra/CassandraSessionFactory.java @@ -25,7 +25,6 @@ import com.google.common.base.Optional; import com.datastax.driver.core.Cluster; import com.datastax.driver.core.SSLOptions; import com.datastax.driver.core.Session; - import org.openecomp.core.nosqldb.util.CassandraUtils; import java.io.FileInputStream; @@ -56,6 +55,8 @@ public class CassandraSessionFactory { for (String address : addresses) { builder.addContactPoint(address); } + + //Check if ssl Boolean isSsl = CassandraUtils.isSsl(); if (isSsl) { builder.withSSL(getSslOptions().get()); @@ -69,7 +70,6 @@ public class CassandraSessionFactory { if (isAuthenticate) { builder.withCredentials(CassandraUtils.getUser(), CassandraUtils.getPassword()); } - Cluster cluster = builder.build(); String keyStore = CassandraUtils.getKeySpace(); return cluster.connect(keyStore); @@ -84,8 +84,9 @@ public class CassandraSessionFactory { try { context = getSslContext(truststorePath.get(), truststorePassword.get()); } catch (UnrecoverableKeyException | KeyManagementException - | NoSuchAlgorithmException | KeyStoreException | CertificateException | IOException e0) { - throw new RuntimeException(e0); + | NoSuchAlgorithmException | KeyStoreException | CertificateException + | IOException exception) { + throw new RuntimeException(exception); } String[] css = new String[]{"TLS_RSA_WITH_AES_128_CBC_SHA"}; return Optional.of(new SSLOptions(context, css)); @@ -109,8 +110,8 @@ public class CassandraSessionFactory { tmf.init(ts); ctx.init(null, tmf.getTrustManagers(), new SecureRandom()); - } catch (Exception e0) { - e0.printStackTrace(); + } catch (Exception exception) { + exception.printStackTrace(); } finally { tsf.close(); @@ -121,4 +122,6 @@ public class CassandraSessionFactory { private static class ReferenceHolder { private static final Session CASSANDRA = newCassandraSession(); } + + } diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/main/java/org/openecomp/core/nosqldb/util/ConfigurationManager.java b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/main/java/org/openecomp/core/nosqldb/util/ConfigurationManager.java index a1c0b528fb..44623ff91b 100644 --- a/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/main/java/org/openecomp/core/nosqldb/util/ConfigurationManager.java +++ b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/main/java/org/openecomp/core/nosqldb/util/ConfigurationManager.java @@ -97,9 +97,9 @@ public class ConfigurationManager { if (addresses != null) { return addresses.split(","); } - List locAddresses = (ArrayList) cassandraConfiguration.get(cassandraHostsKey); + List lsAddresses = (ArrayList) cassandraConfiguration.get(cassandraHostsKey); String[] addressesArray; - addressesArray = (String[]) locAddresses.toArray(new String[locAddresses.size()]); + addressesArray = (String[]) lsAddresses.toArray(new String[lsAddresses.size()]); return addressesArray; } @@ -226,8 +226,8 @@ public class ConfigurationManager { InputStream is = null; try { is = new FileInputStream(file); - } catch (FileNotFoundException e0) { - e0.printStackTrace(); + } catch (FileNotFoundException exception) { + exception.printStackTrace(); } return is; } |