</dependency>
<!-- For SDC Controller -->
<dependency>
- <groupId>org.openecomp.sdc.sdc-distribution-client</groupId>
+ <groupId>org.onap.sdc.sdc-distribution-client</groupId>
<artifactId>sdc-distribution-client</artifactId>
- <version>1.2.2</version>
+ <version>1.3.0</version>
</dependency>
<dependency>
- <groupId>org.openecomp.sdc.sdc-tosca</groupId>
+ <groupId>org.onap.sdc.sdc-tosca</groupId>
<artifactId>sdc-tosca</artifactId>
- <version>1.2.2</version>
+ <version>1.3.3</version>
</dependency>
</dependencies>
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.
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;
}
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);
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 {
import org.onap.clamp.clds.sdc.controller.installer.CsarHandler;\r
import org.onap.clamp.clds.sdc.controller.installer.CsarInstaller;\r
import org.onap.clamp.clds.util.LoggingUtils;\r
-import org.openecomp.sdc.api.IDistributionClient;\r
-import org.openecomp.sdc.api.consumer.IDistributionStatusMessage;\r
-import org.openecomp.sdc.api.consumer.INotificationCallback;\r
-import org.openecomp.sdc.api.notification.IArtifactInfo;\r
-import org.openecomp.sdc.api.notification.INotificationData;\r
-import org.openecomp.sdc.api.results.IDistributionClientDownloadResult;\r
-import org.openecomp.sdc.api.results.IDistributionClientResult;\r
-import org.openecomp.sdc.impl.DistributionClientFactory;\r
-import org.openecomp.sdc.tosca.parser.exceptions.SdcToscaParserException;\r
-import org.openecomp.sdc.utils.DistributionActionResultEnum;\r
-import org.openecomp.sdc.utils.DistributionStatusEnum;\r
+import org.onap.sdc.api.IDistributionClient;\r
+import org.onap.sdc.api.consumer.IDistributionStatusMessage;\r
+import org.onap.sdc.api.consumer.INotificationCallback;\r
+import org.onap.sdc.api.notification.IArtifactInfo;\r
+import org.onap.sdc.api.notification.INotificationData;\r
+import org.onap.sdc.api.results.IDistributionClientDownloadResult;\r
+import org.onap.sdc.api.results.IDistributionClientResult;\r
+import org.onap.sdc.impl.DistributionClientFactory;\r
+import org.onap.sdc.tosca.parser.exceptions.SdcToscaParserException;\r
+import org.onap.sdc.utils.DistributionActionResultEnum;\r
+import org.onap.sdc.utils.DistributionStatusEnum;\r
\r
/**\r
* This class handles one sdc controller defined in the config.\r
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
{
"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"]
}
}
}
import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
assertEquals("consumerGroup", sdcConfig.getConsumerGroup());
assertEquals("consumerId", sdcConfig.getConsumerID());
assertEquals("environmentName", sdcConfig.getEnvironmentName());
- assertEquals("hostname", sdcConfig.getAsdcAddress());
+ assertEquals("hostname:8080", sdcConfig.getAsdcAddress());
assertEquals(10, sdcConfig.getPollingInterval());
assertEquals(30, sdcConfig.getPollingTimeout());
assertEquals(SdcSingleControllerConfiguration.SUPPORTED_ARTIFACT_TYPES_LIST.size(),
fail("Should have raised an exception");
}
- @Test(expected = SdcParametersException.class)
- public final void testAllRequiredParametersAddresses()
+ @Test
+ public final void testAllRequiredParametersEmptyEncrypted()
throws JsonParseException, JsonMappingException, IOException {
SdcSingleControllerConfiguration sdcConfig = loadControllerConfiguration(
- "clds/sdc-controller-config-bad-address.json", "sdc-controller1");
+ "clds/sdc-controller-config-empty-encrypted.json", "sdc-controller1");
sdcConfig.testAllRequiredParameters();
- fail("Should have raised an exception");
+ assertNull(sdcConfig.getKeyStorePassword());
}
@Test
import org.onap.clamp.clds.exception.sdc.controller.CsarHandlerException;
import org.onap.clamp.clds.exception.sdc.controller.SdcArtifactInstallerException;
import org.onap.clamp.clds.util.ResourceFileUtil;
-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.exceptions.SdcToscaParserException;
+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.exceptions.SdcToscaParserException;
public class CsarHandlerTest {
"consumerGroup": "NULL",
"consumerId": "consumerId",
"environmentName": "environmentName",
- "sdcAddress": "hostname",
+ "sdcAddress": "hostname:8080",
"password": "bb3871669d893c7fb8aaacda31b77b4f537E67A081C2726889548ED7BC4C2DE6",
"pollingInterval":10,
- "pollingTimeout":30
+ "pollingTimeout":30,
+ "messageBusAddresses":["localhost"]
}
"consumerGroup": "consumerGroup",
"consumerId": "consumerId",
"environmentName": "environmentName",
- "sdcAddress": "hostname",
+ "sdcAddress": "hostname:8080",
"password": "bb3871669d893c7fb8aaacda31b77b4f537E67A081C2726889548ED7BC4C2DE6",
"pollingInterval":10,
"pollingTimeout":30,
"consumerGroup": "consumerGroup",
"consumerId": "consumerId",
"environmentName": "environmentName",
- "sdcAddress": "hostname1",
+ "sdcAddress": "hostname1:8080",
"pollingInterval": 10,
"pollingTimeout": 30
}
"consumerGroup": "consumerGroup",
"consumerId": "consumerId",
"environmentName": "environmentName",
+ "sdcAddress": "hostname:8080",
"password": "bb3871669d893c7fb8aaacda31b77b4f537E67A081C2726889548ED7BC4C2DE6",
"pollingInterval":10,
"pollingTimeout":30,
"activateServerTLSAuth": true,
- "keyStorePassword":"bb3871669d893c7fb8aaacda31b77b4f537E67A081C2726889548ED7BC4C2DE6",
- "keyStorePath": "/test"
+ "keyStorePassword":"",
+ "keyStorePath": "/test",
+ "messageBusAddresses":["localhost"]
}