aboutsummaryrefslogtreecommitdiffstats
path: root/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib
diff options
context:
space:
mode:
authorTal Gitelman <tal.gitelman@att.com>2019-03-28 11:00:54 +0200
committerTal Gitelman <tal.gitelman@att.com>2019-04-04 16:33:03 +0300
commitc4d387d216e72911f80c1ebee91b73aba191b91b (patch)
treec12066b7a213d34ca7c84375fb4bb2d6f0b23138 /openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib
parentac3aca69dbeae29c9aeca2053adc7aedbb75e149 (diff)
Make Cassandra port configurable.
SDC-BE & Onboarding - BE. Reviewer: Evgenia A & Areli F. Change-Id: Iaf86d647b0560764ef65d9148c85bffaf934992d Issue-ID: SDC-2077 Signed-off-by: Tal Gitelman <tal.gitelman@att.com>
Diffstat (limited to 'openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib')
-rw-r--r--openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-core/src/main/java/org/openecomp/core/zusammen/impl/CassandraConnectionInitializer.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-core/src/main/java/org/openecomp/core/zusammen/impl/CassandraConnectionInitializer.java b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-core/src/main/java/org/openecomp/core/zusammen/impl/CassandraConnectionInitializer.java
index 7944999a70..05c7a1a72a 100644
--- a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-core/src/main/java/org/openecomp/core/zusammen/impl/CassandraConnectionInitializer.java
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-core/src/main/java/org/openecomp/core/zusammen/impl/CassandraConnectionInitializer.java
@@ -26,7 +26,9 @@ public class CassandraConnectionInitializer {
private static final String DATA_CENTER_PROPERTY_NAME = CASSANDRA_PREFIX + "datacenter";
private static final String CONSISTENCY_LEVEL_PROPERTY_NAME =
CASSANDRA_PREFIX + "consistency.level";
+ private static final String CASSANDRA_RECONNECT_TIMEOUT = CASSANDRA_PREFIX + "reconnection.delay";
private static final String NODES_PROPERTY_NAME = CASSANDRA_PREFIX + "nodes";
+ private static final String CASSANDRA_PORT_PROPERTY_NAME = CASSANDRA_PREFIX + "port";
private static final String AUTHENTICATE_PROPERTY_NAME = CASSANDRA_PREFIX + "authenticate";
private static final String SSL_PROPERTY_NAME = CASSANDRA_PREFIX + "ssl";
private static final String TRUSTSTORE_PROPERTY_NAME = CASSANDRA_PREFIX + "truststore";
@@ -50,16 +52,18 @@ public class CassandraConnectionInitializer {
static {
setSystemProperty(NODES_PROPERTY_NAME, () ->
StringUtils.join(CassandraUtils.getAddresses(), ','));
+ setSystemProperty(CASSANDRA_PORT_PROPERTY_NAME, () -> Integer.toString(CassandraUtils.getCassandraPort()));
setBooleanSystemProperty(AUTHENTICATE_PROPERTY_NAME, CassandraUtils::isAuthenticate);
setBooleanSystemProperty(SSL_PROPERTY_NAME, CassandraUtils::isSsl);
- setSystemProperty(TRUSTSTORE_PROPERTY_NAME, CassandraUtils::getTruststore);
- setSystemProperty(TRUSTSTORE_PASSWORD_PROPERTY_NAME, CassandraUtils::getTruststorePassword);
+ setNullableSystemProperty(TRUSTSTORE_PROPERTY_NAME, CassandraUtils::getTruststore);
+ setNullableSystemProperty(TRUSTSTORE_PASSWORD_PROPERTY_NAME, CassandraUtils::getTruststorePassword);
setSystemProperty(USER_PROPERTY_NAME, CassandraUtils::getUser);
setSystemProperty(PASSWORD_PROPERTY_NAME, CassandraUtils::getPassword);
setSystemProperty(KEYSPACE_PROPERTY_NAME, () -> ZUSAMMEN);
setNullableSystemProperty(DATA_CENTER_PROPERTY_NAME, CassandraUtils::getLocalDataCenter);
setNullableSystemProperty(CONSISTENCY_LEVEL_PROPERTY_NAME,
CassandraUtils::getConsistencyLevel);
+ setSystemProperty(CASSANDRA_RECONNECT_TIMEOUT, () -> Long.toString(CassandraUtils.getReconnectTimeout()));
}
private DeferredInitializer() { }