aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java
diff options
context:
space:
mode:
authorDeterme, Sebastien (sd378r) <sd378r@intl.att.com>2018-04-03 16:57:38 +0200
committerDeterme, Sebastien (sd378r) <sd378r@intl.att.com>2018-04-03 16:57:38 +0200
commit78100b4cad47bfb6171af3f4d9b84f9fd42f95b7 (patch)
tree009f519ff388381a9cb1878a168ec6b6588f473a /src/main/java
parentad4027aaf03f8558e2c6bbbd4fe548b6b759f3b2 (diff)
New parameter Sdc controller
There is a need to have that new parameter (message bus addresses) if the sdcAddress is not present Issue-ID: CLAMP-149 Change-Id: I336e7af6784a70b0b65c9610fc2e69e40126bdc0 Signed-off-by: Determe, Sebastien (sd378r) <sd378r@intl.att.com>
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/org/onap/clamp/clds/config/sdc/SdcSingleControllerConfiguration.java17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/main/java/org/onap/clamp/clds/config/sdc/SdcSingleControllerConfiguration.java b/src/main/java/org/onap/clamp/clds/config/sdc/SdcSingleControllerConfiguration.java
index d8bd992e..e2aac55f 100644
--- a/src/main/java/org/onap/clamp/clds/config/sdc/SdcSingleControllerConfiguration.java
+++ b/src/main/java/org/onap/clamp/clds/config/sdc/SdcSingleControllerConfiguration.java
@@ -28,6 +28,7 @@ import com.att.eelf.configuration.EELFManager;
import com.fasterxml.jackson.databind.JsonNode;
import java.security.GeneralSecurityException;
+import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
@@ -65,6 +66,7 @@ public class SdcSingleControllerConfiguration implements IConfiguration {
public static final String ACTIVATE_SERVER_TLS_AUTH = "activateServerTLSAuth";
public static final String KEY_STORE_KEY = "keyStorePassword";
public static final String KEY_STORE_PATH = "keyStorePath";
+ public static final String MESSAGE_BUS_ADDRESSES = "messageBusAddresses";
private String errorMessageKeyNotFound;
/**
* Supported artifact types.
@@ -239,7 +241,10 @@ public class SdcSingleControllerConfiguration implements IConfiguration {
throw new SdcParametersException(ENVIRONMENT_NAME_ATTRIBUTE_NAME + errorMessageKeyNotFound);
}
if (this.getAsdcAddress() == null || this.getAsdcAddress().isEmpty()) {
- throw new SdcParametersException(SDC_ADDRESS_ATTRIBUTE_NAME + errorMessageKeyNotFound);
+ if (this.getMsgBusAddress() == null || this.getMsgBusAddress().isEmpty()) {
+ throw new SdcParametersException(SDC_ADDRESS_ATTRIBUTE_NAME + " and " + MESSAGE_BUS_ADDRESSES
+ + " are not set, one of them should be set for SDC client" + errorMessageKeyNotFound);
+ }
}
if (this.getPassword() == null || this.getPassword().isEmpty()) {
throw new SdcParametersException(SDC_KEY_ATTRIBUTE_NAME + errorMessageKeyNotFound);
@@ -265,11 +270,17 @@ public class SdcSingleControllerConfiguration implements IConfiguration {
*/
@Override
public boolean isFilterInEmptyResources() {
- return true;
+ return false;
}
@Override
public List<String> getMsgBusAddress() {
- return null;
+ List<String> addressesList = new ArrayList<>();
+ if (jsonRootNode != null && jsonRootNode.get(MESSAGE_BUS_ADDRESSES) != null) {
+ jsonRootNode.get(MESSAGE_BUS_ADDRESSES).forEach(k -> addressesList.add(k.asText()));
+ return addressesList;
+ } else {
+ return addressesList;
+ }
}
}