summaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
authorDeterme, Sebastien (sd378r) <sd378r@intl.att.com>2018-04-06 11:48:07 +0200
committerDeterme, Sebastien (sd378r) <sd378r@intl.att.com>2018-04-06 11:48:07 +0200
commitdd2d790dd97ec4260531bc1fdce5766bf85797d8 (patch)
treee63b1e68ce28cc2a956d762e9321310558691542 /src/main
parente1f91b9e7de0b53e69cefdeebd0a0afc69ea2a5b (diff)
Update SDC library
Upgrade SDC library to latest and remove the message bus condition, it's now a mandatory parameter as well Issue-ID: CLAMP-149 Change-Id: I4c7ddcca6ac176380821bd8f1e4e3ef3d9fcea30 Signed-off-by: Determe, Sebastien (sd378r) <sd378r@intl.att.com>
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/org/onap/clamp/clds/config/sdc/SdcSingleControllerConfiguration.java14
-rw-r--r--src/main/java/org/onap/clamp/clds/sdc/controller/DistributionStatusMessage.java4
-rw-r--r--src/main/java/org/onap/clamp/clds/sdc/controller/SdcSingleController.java22
-rw-r--r--src/main/java/org/onap/clamp/clds/sdc/controller/installer/CsarHandler.java14
-rw-r--r--src/main/resources/clds/sdc-controllers-config.json30
5 files changed, 37 insertions, 47 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 e2aac55f..bc3d1b98 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
@@ -36,7 +36,7 @@ import java.util.List;
import org.apache.commons.codec.DecoderException;
import org.onap.clamp.clds.exception.sdc.controller.SdcParametersException;
import org.onap.clamp.clds.util.CryptoUtils;
-import org.openecomp.sdc.api.consumer.IConfiguration;
+import org.onap.sdc.api.consumer.IConfiguration;
/**
* This class maps the SDC config JSON for one controller.
@@ -129,8 +129,8 @@ public class SdcSingleControllerConfiguration implements IConfiguration {
private String getEncryptedStringConfig(String key) throws GeneralSecurityException, DecoderException {
if (jsonRootNode != null && jsonRootNode.get(key) != null) {
- String config = CryptoUtils.decrypt(jsonRootNode.get(key).asText());
- return config.isEmpty() ? null : config;
+ return jsonRootNode.get(key).asText().isEmpty() ? null
+ : CryptoUtils.decrypt(jsonRootNode.get(key).asText());
}
return null;
}
@@ -241,10 +241,10 @@ public class SdcSingleControllerConfiguration implements IConfiguration {
throw new SdcParametersException(ENVIRONMENT_NAME_ATTRIBUTE_NAME + errorMessageKeyNotFound);
}
if (this.getAsdcAddress() == null || this.getAsdcAddress().isEmpty()) {
- 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);
- }
+ throw new SdcParametersException(SDC_ADDRESS_ATTRIBUTE_NAME + errorMessageKeyNotFound);
+ }
+ if (this.getMsgBusAddress() == null || this.getMsgBusAddress().isEmpty()) {
+ throw new SdcParametersException(MESSAGE_BUS_ADDRESSES + errorMessageKeyNotFound);
}
if (this.getPassword() == null || this.getPassword().isEmpty()) {
throw new SdcParametersException(SDC_KEY_ATTRIBUTE_NAME + errorMessageKeyNotFound);
diff --git a/src/main/java/org/onap/clamp/clds/sdc/controller/DistributionStatusMessage.java b/src/main/java/org/onap/clamp/clds/sdc/controller/DistributionStatusMessage.java
index db5d271b..ca4f97b1 100644
--- a/src/main/java/org/onap/clamp/clds/sdc/controller/DistributionStatusMessage.java
+++ b/src/main/java/org/onap/clamp/clds/sdc/controller/DistributionStatusMessage.java
@@ -23,8 +23,8 @@
package org.onap.clamp.clds.sdc.controller;
-import org.openecomp.sdc.api.consumer.IDistributionStatusMessage;
-import org.openecomp.sdc.utils.DistributionStatusEnum;
+import org.onap.sdc.api.consumer.IDistributionStatusMessage;
+import org.onap.sdc.utils.DistributionStatusEnum;
public class DistributionStatusMessage implements IDistributionStatusMessage {
diff --git a/src/main/java/org/onap/clamp/clds/sdc/controller/SdcSingleController.java b/src/main/java/org/onap/clamp/clds/sdc/controller/SdcSingleController.java
index c02edbbf..2744ef7a 100644
--- a/src/main/java/org/onap/clamp/clds/sdc/controller/SdcSingleController.java
+++ b/src/main/java/org/onap/clamp/clds/sdc/controller/SdcSingleController.java
@@ -38,17 +38,17 @@ import org.onap.clamp.clds.exception.sdc.controller.SdcParametersException;
import org.onap.clamp.clds.sdc.controller.installer.CsarHandler;
import org.onap.clamp.clds.sdc.controller.installer.CsarInstaller;
import org.onap.clamp.clds.util.LoggingUtils;
-import org.openecomp.sdc.api.IDistributionClient;
-import org.openecomp.sdc.api.consumer.IDistributionStatusMessage;
-import org.openecomp.sdc.api.consumer.INotificationCallback;
-import org.openecomp.sdc.api.notification.IArtifactInfo;
-import org.openecomp.sdc.api.notification.INotificationData;
-import org.openecomp.sdc.api.results.IDistributionClientDownloadResult;
-import org.openecomp.sdc.api.results.IDistributionClientResult;
-import org.openecomp.sdc.impl.DistributionClientFactory;
-import org.openecomp.sdc.tosca.parser.exceptions.SdcToscaParserException;
-import org.openecomp.sdc.utils.DistributionActionResultEnum;
-import org.openecomp.sdc.utils.DistributionStatusEnum;
+import org.onap.sdc.api.IDistributionClient;
+import org.onap.sdc.api.consumer.IDistributionStatusMessage;
+import org.onap.sdc.api.consumer.INotificationCallback;
+import org.onap.sdc.api.notification.IArtifactInfo;
+import org.onap.sdc.api.notification.INotificationData;
+import org.onap.sdc.api.results.IDistributionClientDownloadResult;
+import org.onap.sdc.api.results.IDistributionClientResult;
+import org.onap.sdc.impl.DistributionClientFactory;
+import org.onap.sdc.tosca.parser.exceptions.SdcToscaParserException;
+import org.onap.sdc.utils.DistributionActionResultEnum;
+import org.onap.sdc.utils.DistributionStatusEnum;
/**
* This class handles one sdc controller defined in the config.
diff --git a/src/main/java/org/onap/clamp/clds/sdc/controller/installer/CsarHandler.java b/src/main/java/org/onap/clamp/clds/sdc/controller/installer/CsarHandler.java
index 97ab0586..2b83905a 100644
--- a/src/main/java/org/onap/clamp/clds/sdc/controller/installer/CsarHandler.java
+++ b/src/main/java/org/onap/clamp/clds/sdc/controller/installer/CsarHandler.java
@@ -41,13 +41,13 @@ import java.util.zip.ZipFile;
import org.onap.clamp.clds.exception.sdc.controller.CsarHandlerException;
import org.onap.clamp.clds.exception.sdc.controller.SdcArtifactInstallerException;
-import org.openecomp.sdc.api.notification.IArtifactInfo;
-import org.openecomp.sdc.api.notification.INotificationData;
-import org.openecomp.sdc.api.notification.IResourceInstance;
-import org.openecomp.sdc.api.results.IDistributionClientDownloadResult;
-import org.openecomp.sdc.tosca.parser.api.ISdcCsarHelper;
-import org.openecomp.sdc.tosca.parser.exceptions.SdcToscaParserException;
-import org.openecomp.sdc.tosca.parser.impl.SdcToscaParserFactory;
+import org.onap.sdc.api.notification.IArtifactInfo;
+import org.onap.sdc.api.notification.INotificationData;
+import org.onap.sdc.api.notification.IResourceInstance;
+import org.onap.sdc.api.results.IDistributionClientDownloadResult;
+import org.onap.sdc.tosca.parser.api.ISdcCsarHelper;
+import org.onap.sdc.tosca.parser.exceptions.SdcToscaParserException;
+import org.onap.sdc.tosca.parser.impl.SdcToscaParserFactory;
/**
* CsarDescriptor that will be used to deploy file in CLAMP file system. Some
diff --git a/src/main/resources/clds/sdc-controllers-config.json b/src/main/resources/clds/sdc-controllers-config.json
index bf1a758a..d18a161a 100644
--- a/src/main/resources/clds/sdc-controllers-config.json
+++ b/src/main/resources/clds/sdc-controllers-config.json
@@ -1,28 +1,18 @@
{
"sdc-connections":{
- "sdc-controller1":{
- "user": "User1",
+ "sdc-controller":{
+ "user": "clamp",
"consumerGroup": "consumerGroup1",
"consumerId": "consumerId1",
- "environmentName": "environmentName1",
- "sdcAddress": "sdc.api.simpledemo.onap.org:8080",
- "password": "bb3871669d893c7fb8aaacda31b77b4f537E67A081C2726889548ED7BC4C2DE6",
- "pollingInterval":10,
+ "environmentName": "AUTO",
+ "sdcAddress": "sdc.api.simpledemo.onap.org:8443",
+ "password": "b7acccda32b98c5bb7acccda32b98c5b05D511BD6D93626E90D18E9D24D9B78CD34C7EE8012F0A189A28763E82271E50A5D4EC10C7D93E06E0A2D27CAE66B981",
+ "pollingInterval":30,
"pollingTimeout":30,
- "messageBusAddresses":["localhost"]
-
- },
- "sdc-controller2":{
- "user": "User2",
- "consumerGroup": "consumerGroup2",
- "consumerId": "consumerId2",
- "environmentName": "environmentName2",
- "sdcAddress": "sdc.api.simpledemo.onap.org:8080",
- "password": "bb3871669d893c7fb8aaacda31b77b4f537E67A081C2726889548ED7BC4C2DE6",
- "pollingInterval":10,
- "pollingTimeout":30,
- "messageBusAddresses":["localhost"]
-
+ "activateServerTLSAuth":"false",
+ "keyStorePassword":"",
+ "keyStorePath":"",
+ "messageBusAddresses":["ueb.api.simpledemo.onap.org"]
}
}
}