Create and store Dependency model from Tosca

Updated asdc listerner bundle to create dependency model from tosca
artifact reveived from SDC.This dependency model will be in JSON
format and will be stored to ASDC_ARTIFACT table as new artifact.
Also ASDC_REFERENCE table  will be updated to with new artifact
details.
This commit also include bug fix for MDSALStore to handle all http
code for successful rest calls

Issue ID: APPC-32
Change-Id: Iaef6cdee67475917968a4bcdec131cd1bc4c4f41
Signed-off-by: Masal, Sushil (sm588m) <sushil.masal@amdocs.com>
diff --git a/appc-dg/appc-dg-shared/appc-dg-dependency-model/pom.xml b/appc-dg/appc-dg-shared/appc-dg-dependency-model/pom.xml
index 52a3d5f..b4fa2d4 100644
--- a/appc-dg/appc-dg-shared/appc-dg-dependency-model/pom.xml
+++ b/appc-dg/appc-dg-shared/appc-dg-dependency-model/pom.xml
@@ -14,6 +14,8 @@
 
   <properties>
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+    <jackson-yaml-version>2.8.1</jackson-yaml-version>
+    <snakeyaml.version>1.15</snakeyaml.version>
   </properties>
 
   <dependencies>
@@ -51,7 +53,7 @@
       <groupId>org.yaml</groupId>
       <artifactId>snakeyaml</artifactId>
       <version>${snakeyaml.version}</version>
-    </dependency>    
+    </dependency>
     <dependency>
       <groupId>commons-io</groupId>
       <artifactId>commons-io</artifactId>
diff --git a/appc-dg/appc-dg-shared/appc-dg-mdsal-store/src/main/java/org/openecomp/appc/mdsal/impl/Constants.java b/appc-dg/appc-dg-shared/appc-dg-mdsal-store/src/main/java/org/openecomp/appc/mdsal/impl/Constants.java
index 711ec1d..949f6ff 100644
--- a/appc-dg/appc-dg-shared/appc-dg-mdsal-store/src/main/java/org/openecomp/appc/mdsal/impl/Constants.java
+++ b/appc-dg/appc-dg-shared/appc-dg-mdsal-store/src/main/java/org/openecomp/appc/mdsal/impl/Constants.java
@@ -26,7 +26,7 @@
 /**
  * This class contains the definitions of all constant values used in the appc-dg-mdsal-store
  * These properties are used for creating osgi bundle zip file. It also defines contents for Blueprint.xml file of bundle
-*/
+ */
 public class Constants {
 
     private Constants(){}
@@ -79,7 +79,6 @@
      * Base URL for config actions exposed by RESTCONF API
      */
 
-    public static final String CONFIG_URL = "https://localhost:8443/restconf/config";
     public static final String CONFIG_URL_DEFAULT = "https://localhost:8443/restconf/config";
 
     public static final String CONFIG_URL_PROPERTY = "appc.LCM.provider.url";
diff --git a/appc-dg/appc-dg-shared/appc-dg-mdsal-store/src/main/java/org/openecomp/appc/mdsal/operation/ConfigOperation.java b/appc-dg/appc-dg-shared/appc-dg-mdsal-store/src/main/java/org/openecomp/appc/mdsal/operation/ConfigOperation.java
index dbb8246..5c5a1bb 100644
--- a/appc-dg/appc-dg-shared/appc-dg-mdsal-store/src/main/java/org/openecomp/appc/mdsal/operation/ConfigOperation.java
+++ b/appc-dg/appc-dg-shared/appc-dg-mdsal-store/src/main/java/org/openecomp/appc/mdsal/operation/ConfigOperation.java
@@ -67,7 +67,7 @@
 
 /**
  * Provides method to store configuration to MD-SAL store. It also exposes doPut operation which can be used to invoke REST Put operation.
-*/
+ */
 public class ConfigOperation {
     private static final EELFLogger LOG = EELFManager.getInstance().getLogger(ConfigOperation.class);
 
@@ -100,7 +100,7 @@
         int httpCode;
         String respBody ;
         try {
-            String path = requestFormatter.buildPath(url, module, containerName, subModules);
+            String path = requestFormatter.buildPath(module, containerName, subModules);
             LOG.debug("Configuration Path : " + path);
             URL serviceUrl = new URL(url.getProtocol(), url.getHost(), url.getPort(), path);
             HttpResponse response = doPut(serviceUrl , configJson);
@@ -111,22 +111,25 @@
             throw new APPCException(e);
         }
 
-        if (httpCode != 200 ) {
+        if (httpCode < 200 || httpCode >= 300 ) {
             try {
+                LOG.debug("Config operation Error response code: " + httpCode);
                 ArrayList<String> errorMessage = new ArrayList<>();
                 JsonNode responseJson = toJsonNodeFromJsonString(respBody);
                 if(responseJson!=null && responseJson.get("errors")!=null) {
                     JsonNode errors = responseJson.get("errors").get("error");
-                for (Iterator<JsonNode> i = errors.elements();i.hasNext();){
-                    JsonNode error = i.next();
-                    errorMessage.add(error.get("error-message").textValue());
+                    for (Iterator<JsonNode> i = errors.elements();i.hasNext();){
+                        JsonNode error = i.next();
+                        errorMessage.add(error.get("error-message").textValue());
+                    }
                 }
-                }
-                throw new APPCException("Failed to load config JSON to MD SAL store. Error Message:" + errorMessage.toString());
+                throw new APPCException("Failed to load config JSON to MD SAL store. Error code:" + httpCode +" Error Message:" + errorMessage.toString());
             } catch (Exception e) {
-                LOG.error("Error while loading config JSON to MD SAL store. "+e.getMessage(), e);
-                throw new APPCException("Error while loading config JSON to MD SAL store. "+ e.getMessage(),e);
+                LOG.error("Error while loading config JSON to MD SAL store. Error code:" + httpCode +" Error Message:" + e.getMessage(), e);
+                throw new APPCException("Error while loading config JSON to MD SAL store. Error code:" + httpCode +" Error Message:" + e.getMessage(),e);
             }
+        }else{
+            LOG.debug("Config operation successful. Response code: " + httpCode);
         }
     }
 
diff --git a/appc-dg/appc-dg-shared/appc-dg-mdsal-store/src/main/java/org/openecomp/appc/mdsal/operation/ConfigOperationRequestFormatter.java b/appc-dg/appc-dg-shared/appc-dg-mdsal-store/src/main/java/org/openecomp/appc/mdsal/operation/ConfigOperationRequestFormatter.java
index 94e120f..26e7669 100644
--- a/appc-dg/appc-dg-shared/appc-dg-mdsal-store/src/main/java/org/openecomp/appc/mdsal/operation/ConfigOperationRequestFormatter.java
+++ b/appc-dg/appc-dg-shared/appc-dg-mdsal-store/src/main/java/org/openecomp/appc/mdsal/operation/ConfigOperationRequestFormatter.java
@@ -34,13 +34,12 @@
 public class ConfigOperationRequestFormatter {
     /**
      *  Build a request url path for config actions
-     * @param url - base url
      * @param module - yang module name
      * @param containerName - yang container name
      * @param subModules - sub module /container  names as string in varargs ( String ) format
      * @return - resultant path in String format
      */
-    public String buildPath(URL url,String module, String containerName , String... subModules ) {
+    public String buildPath(String module, String containerName , String... subModules ) {
 
         StringBuilder path = new StringBuilder( Constants.CONFIG_PATH + Constants.URL_BACKSLASH + module + ":"+containerName + Constants.URL_BACKSLASH);
         if(subModules.length >0){