Use the latest distribution client 07/18307/1
authorMichael Hwang <mhwang@research.att.com>
Tue, 10 Oct 2017 20:24:20 +0000 (16:24 -0400)
committerMichael Hwang <mhwang@research.att.com>
Wed, 11 Oct 2017 15:52:51 +0000 (11:52 -0400)
Also address Docker build issue

Issue-Id: DCAEGEN2-150
Change-Id: I2db297eed1c9c1c97cc440703cf4309fae8e8906
Signed-off-by: Michael Hwang <mhwang@research.att.com>
pom.xml
src/sch/asdc_client.clj
src/sch/core.clj
test/sch/parse_test.clj

diff --git a/pom.xml b/pom.xml
index 5552875..0157788 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -46,7 +46,7 @@
         <dependency>
             <groupId>org.openecomp.sdc.sdc-distribution-client</groupId>
             <artifactId>sdc-distribution-client</artifactId>
-            <version>1.1.0-SNAPSHOT</version>
+            <version>1.1.50</version>
         </dependency>
         <dependency>
             <groupId>com.taoensso</groupId>
                         <imageTag>latest</imageTag>
                     </imageTags>
                     <baseImage>java:8-jre</baseImage>
-                    <entryPoint>["java", "-jar", "/opt/${project.build.finalName}.jar", "prod", "http://consul:8500/v1/kv/service-change-handler?raw=true"]</entryPoint>
+                    <!-- NOTE: Couldn't figure out how to package the jar to be named: ${project.build.finalName}. This might be
+                            because of the clojure maven plugin -->
+                    <entryPoint>["java", "-jar", "/opt/servicechange-handler.jar", "prod", "http://consul:8500/v1/kv/service-change-handler?raw=true"]</entryPoint>
                     <!-- copy the service's jar file from target into the root directory of the image -->
                     <resources>
                         <resource>
                             <targetPath>/opt</targetPath>
                             <directory>${project.build.directory}</directory>
-                            <include>${project.build.finalName}.jar</include>
+                            <include>servicechange-handler.jar</include>
                         </resource>
                     </resources>
                     <serverId>${onap.nexus.dockerregistry.daily}</serverId>
index 702c571..a9742b3 100644 (file)
@@ -44,7 +44,7 @@
 
 (defn construct-service-path
   [service-uuid]
-  (str "/asdc/v1/catalog/services/" service-uuid "/metadata"))
+  (str "/sdc/v1/catalog/services/" service-uuid "/metadata"))
 
 
 (defn get-artifact!
index 8684576..a5e1998 100644 (file)
   [config]
   (let [config-asdc (:asdcDistributionClient config)]
     (proxy [IConfiguration] []
-      (getAsdcAddress [] (:asdcAddress config-asdc))
-      (getUser [] (:user config-asdc))
-      (getPassword [] (:password config-asdc))
-      (getPollingInterval [] (:pollingInterval config-asdc))
-      (getPollingTimeout [] (:pollingTimeout config-asdc))
+      (getAsdcAddress [] (str (:asdcAddress config-asdc)))
+      (getUser [] (str (:user config-asdc)))
+      (getPassword [] (str (:password config-asdc)))
+      (getPollingInterval [] (int (:pollingInterval config-asdc)))
+      (getPollingTimeout [] (int (:pollingTimeout config-asdc)))
       ; Note: The following didn't work
       ; (. Arrays asList (. ArtifactTypeEnum values))
       ; Also, cannot just use a narrow list of artifact types in order
       ; to handle the deletion scenario.
       (getRelevantArtifactTypes [] (java.util.ArrayList.
                                       (get-dcae-artifact-types)))
-      (getConsumerGroup [] (:consumerGroup config-asdc))
-      (getConsumerID [] (:consumerId config-asdc))
-      (getEnvironmentName [] (:environmentName config-asdc))
-      (getKeyStorePath [] (:keyStorePath config-asdc))
-      (getKeyStorePassword [] (:keyStorePassword config-asdc))
-      (activateServerTLSAuth [] (:activateServerTLSAuth config-asdc))
-      (isFilterInEmptyResources [] (:isFilterInEmptyResources config-asdc))
+      (getConsumerGroup [] (str (:consumerGroup config-asdc)))
+      (getConsumerID [] (str (:consumerId config-asdc)))
+      (getEnvironmentName [] (str (:environmentName config-asdc)))
+      (getKeyStorePath [] (str (:keyStorePath config-asdc)))
+      (getKeyStorePassword [] (str (:keyStorePassword config-asdc)))
+      (activateServerTLSAuth [] (boolean (:activateServerTLSAuth config-asdc)))
+      (isFilterInEmptyResources [] (boolean (:isFilterInEmptyResources config-asdc)))
+      (isUseHttpsWithDmaap [] (contains? config-asdc :useHttpsWithDmaap) (Boolean/valueOf(str (:useHttpsWithDmaap config-asdc))) true)
       )))
 
 (defn run-distribution-client!
index 06b5734..107f1a1 100644 (file)
@@ -46,7 +46,7 @@
                         :typeName "sample-blueprint",
                         :typeVersion 2,
                         :blueprintTemplate "Fake blueprint",
-                        :asdcServiceURL "/asdc/v1/catalog/services/9eaf59ee-2fe0-48a9-8d20-6f9b09ba807b/metadata"
+                        :asdcServiceURL "/sdc/v1/catalog/services/9eaf59ee-2fe0-48a9-8d20-6f9b09ba807b/metadata"
                         :serviceLocations ["CLLI1" "CLL2"] }
           ]