* ============LICENSE_END=========================================================
  */
 
-package org.onap.sdnc.northbound.asdcapi;
+package org.onap.ccsdk.sli.northbound.asdcapi;
 
 import org.junit.Before;
 import org.junit.Test;
 
                <version>0.1.0-SNAPSHOT</version>
        </parent>
        <properties>
-               <sdc.client.version>1.1.7-SNAPSHOT</sdc.client.version>
+               <sdc.client.version>1.1.32-SNAPSHOT</sdc.client.version>
+        <sdc.tosca.version>1.1.34-SNAPSHOT</sdc.tosca.version>
                <fasterxml.jackson.version>2.9.0.pr1</fasterxml.jackson.version>
                <skip.SWM>true</skip.SWM>
                <ueb.listener.base>/opt/app/ueb-listener</ueb.listener.base>
                        <version>${sdc.client.version}</version>
                        <scope>compile</scope>
                </dependency>
+        <dependency>
+            <groupId>org.openecomp.sdc.sdc-tosca</groupId>
+            <artifactId>sdc-tosca</artifactId>
+            <version>${sdc.tosca.version}</version>
+            <scope>compile</scope>
+        </dependency>
                <dependency>
                        <groupId>org.slf4j</groupId>
                        <artifactId>slf4j-api</artifactId>
 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 
 import org.openecomp.sdc.tosca.parser.api.ISdcCsarHelper;
 import org.openecomp.sdc.tosca.parser.impl.SdcPropertyNames;
-import org.openecomp.sdc.toscaparser.api.Metadata;
 import org.openecomp.sdc.toscaparser.api.NodeTemplate;
+import org.openecomp.sdc.toscaparser.api.elements.Metadata;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 public class SdncARModel extends SdncBaseModel {
-       
+
        private static final Logger LOG = LoggerFactory
                        .getLogger(SdncARModel.class);
 
        public SdncARModel(ISdcCsarHelper sdcCsarHelper, NodeTemplate nodeTemplate) {
 
                super(sdcCsarHelper, nodeTemplate);
-               
+
                // extract metadata
-               Metadata metadata = nodeTemplate.getMetadata();
+               Metadata metadata = nodeTemplate.getMetaData();
                addParameter("type", extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_TYPE));
-               
+
                // extract properties
                //addParameter("role", extractValue (sdcCsarHelper, nodeTemplate, SdcPropertyNames.PROPERTY_NAME_ROLE));
                //addParameter("type", extractValue (nodeTemplate, SdcPropertyNames.PROPERTY_NAME_TYPE)); - wrong location, get from metadata
 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 import org.openecomp.sdc.tosca.parser.api.ISdcCsarHelper;
 import org.openecomp.sdc.tosca.parser.impl.SdcPropertyNames;
 import org.openecomp.sdc.toscaparser.api.Group;
-import org.openecomp.sdc.toscaparser.api.Metadata;
 import org.openecomp.sdc.toscaparser.api.NodeTemplate;
+import org.openecomp.sdc.toscaparser.api.elements.Metadata;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 public class SdncBaseModel {
-       
+
        private static final Logger LOG = LoggerFactory
                        .getLogger(SdncBaseModel.class);
-       
+
        protected String customizationUUID = null;
        protected String invariantUUID = null;
-       protected String model_yaml = null;     
-       protected String version = null;        
-       
+       protected String model_yaml = null;
+       protected String version = null;
+
        protected Map<String, String> params = null;
        protected ISdcCsarHelper sdcCsarHelper = null;
 
        public SdncBaseModel() {
-               
+
        }
-       
+
        public SdncBaseModel(ISdcCsarHelper sdcCsarHelper, Metadata metadata) {
 
                params = new HashMap<>();
                this.sdcCsarHelper = sdcCsarHelper;
-               
+
                // extract service metadata
                invariantUUID = extractValue(metadata, SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID);
                addParameter("invariant_uuid",invariantUUID);
                this.sdcCsarHelper = sdcCsarHelper;
 
                // extract nodeTemplate metadata
-               Metadata metadata = nodeTemplate.getMetadata();
+               Metadata metadata = nodeTemplate.getMetaData();
                customizationUUID = extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID);
                addParameter("invariant_uuid", extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID));
                addParameter("uuid", extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_UUID));
-               addParameter("version", extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_VERSION)); 
+               addParameter("version", extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_VERSION));
        }
 
        public SdncBaseModel(ISdcCsarHelper sdcCsarHelper, Group group) {
                Metadata metadata = group.getMetadata();
                //customizationUUID = extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_VFMODULECUSTOMIZATIONUUID); - returning null
                customizationUUID = extractValue (metadata, "vfModuleModelCustomizationUUID");
-               addParameter("invariant_uuid", extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_VFMODULEMODELINVARIANTUUID));                     
-               addParameter("uuid", extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_VFMODULEMODELUUID));                        
-               addParameter("version", extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_VFMODULEMODELVERSION));                  
+               addParameter("invariant_uuid", extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_VFMODULEMODELINVARIANTUUID));
+               addParameter("uuid", extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_VFMODULEMODELUUID));
+               addParameter("version", extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_VFMODULEMODELVERSION));
        }
 
        protected void addParameter (String name, String value) {
                        params.put(name, value);
                }
        }
-       
+
        public static void addIntParameter (String name, String value, Map<String, String> params) {
                if (value != null && !value.isEmpty()) {
                        params.put(name, value);
                }
        }
-       
+
        public static void addParameter (String name, String value, Map<String, String> params) {
                if (value != null && !value.isEmpty()) {
                        params.put(name, "\"" + value + "\"");
                }
        }
-       
+
        protected String extractValue (Metadata metadata, String name) {
                String value = sdcCsarHelper.getMetadataPropertyValue(metadata, name);
                if (value != null) {
                        return value;
                } else {
                        return "";
-               }       
+               }
        }
 
        public static String extractValue (ISdcCsarHelper sdcCsarHelper, Metadata metadata, String name) {
                        return value;
                } else {
                        return "";
-               }       
+               }
        }
 
        protected String extractValue (NodeTemplate nodeTemplate, String name) {
        public void setCustomizationUUID(String customizationUUID) {
                this.customizationUUID = customizationUUID;
        }
-       
+
        public String getSql(String tableName, String model_yaml) {
-               
+
                StringBuilder sb = new StringBuilder();
                sb.append("INSERT into " + tableName + " (customization_uuid, model_yaml, ");
-               
+
                int paramCount = 0;
                for (String paramKey :  params.keySet()) {
                        paramCount++;
                    sb.append(paramKey);
                    if (paramCount < params.size()) sb.append(", ");
                }
-               
+
                sb.append(") values (" + getCustomizationUUID() + ", \"" + model_yaml + "\", ");
 
                paramCount = 0;
                sb.append(");");
                return sb.toString();
        }
-       
+
        public static String getSql(String tableName, String keyName, String keyValue, String model_yaml, Map<String, String> params) {
-               
+
                StringBuilder sb = new StringBuilder();
                sb.append("INSERT into " + tableName + " (" + keyName + ", ");
-               
+
                int paramCount = 0;
                for (String paramKey :  params.keySet()) {
                        paramCount++;
                    sb.append(paramKey);
                    if (paramCount < params.size()) sb.append(", ");
                }
-               
+
                sb.append(") values (" + keyValue + ", ");
 
                paramCount = 0;
                sb.append(");");
                return sb.toString();
        }
-       
+
 }
 
 
 import org.openecomp.sdc.tosca.parser.api.ISdcCsarHelper;
 import org.openecomp.sdc.tosca.parser.impl.SdcPropertyNames;
-import org.openecomp.sdc.toscaparser.api.Metadata;
+import org.openecomp.sdc.toscaparser.api.elements.Metadata;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 
 import org.openecomp.sdc.tosca.parser.impl.SdcPropertyNames;
 import org.openecomp.sdc.tosca.parser.impl.SdcToscaParserFactory;
 import org.openecomp.sdc.toscaparser.api.Group;
-import org.openecomp.sdc.toscaparser.api.Metadata;
 import org.openecomp.sdc.toscaparser.api.NodeTemplate;
+import org.openecomp.sdc.toscaparser.api.elements.Metadata;
 import org.openecomp.sdc.utils.ArtifactTypeEnum;
 import org.openecomp.sdc.utils.DistributionActionResultEnum;
 import org.openecomp.sdc.utils.DistributionStatusEnum;
         File incomingDir = null;
         File archiveDir = null;
 
+        LOG.debug("IncomingDirName is {}", incomingDirName);
+
         // Process service level artifacts
         List<IArtifactInfo> artifactList = data.getServiceArtifacts();
 
     public void deployDownloadedFiles(File incomingDir, File archiveDir, INotificationData data) {
 
         if (incomingDir == null) {
+                   LOG.debug("incomingDir is null - using {}", config.getIncomingDir());
             incomingDir = new File(config.getIncomingDir());
 
             if (!incomingDir.exists()) {
                 incomingDir.mkdirs();
             }
 
+        } else {
+                       LOG.debug("incomingDir is not null - it is {}", incomingDir.getPath());
         }
 
         if (archiveDir == null) {
         }
 
         String curFileName = "";
+        LOG.debug("Scanning {} - {} for downloaded files", incomingDir.getPath(), incomingDir.toPath());
         try (DirectoryStream<Path> stream = Files.newDirectoryStream(incomingDir.toPath())) {
             for (Path file: stream) {
                 curFileName = file.toString();
                        sdcCsarHelper = factory.getSdcCsarHelper(spoolFile.getAbsolutePath());
                } catch (SdcToscaParserException e) {
                        LOG.error("Could not create SDC TOSCA Parser ", e);
-                       factory.close();
                        return;
                }
 
                        insertToscaData(serviceModel.getSql(model_yaml));
                } catch (IOException e) {
                        LOG.error("Could not insert Tosca YAML data into the SERVICE_MODEL table ", e);
-                       factory.close();
                        return;
                }
 
                                        //String extcp_subnetpool_id = "\"" + SdncBaseModel.extractValue(sdcCsarHelper, match.getLeft(), SdcPropertyNames.PROPERTY_NAME_SUBNETPOOLID) + "\""; // need path to subnetpoolid
 
                                        // extract values from the right "VFC" Node
-                                       String vfcCustomizationUuid = "\"" + SdncBaseModel.extractValue(sdcCsarHelper, match.getRight().getMetadata(), "customization_uuid") + "\"";
+                                       String vfcCustomizationUuid = "\"" + SdncBaseModel.extractValue(sdcCsarHelper, match.getRight().getMetaData(), "customization_uuid") + "\"";
                                        SdncBaseModel.addParameter("vm_type", SdncBaseModel.extractValue(sdcCsarHelper, match.getRight(), SdcPropertyNames.PROPERTY_NAME_VMTYPE), mappingParams);
                                        SdncBaseModel.addIntParameter("ipv4_count", SdncBaseModel.extractValue(sdcCsarHelper, match.getRight(), SdcPropertyNames.PROPERTY_NAME_NETWORKASSIGNMENTS_IPV4SUBNETDEFAULTASSIGNMENTS_MINSUBNETSCOUNT), mappingParams);
                                        SdncBaseModel.addIntParameter("ipv6_count", SdncBaseModel.extractValue(sdcCsarHelper, match.getRight(), SdcPropertyNames.PROPERTY_NAME_NETWORKASSIGNMENTS_IPV6SUBNETDEFAULTASSIGNMENTS_MINSUBNETSCOUNT), mappingParams);
 
                } // VF loop
 
-               // Close ASDC TOSCA Parser factory - we are done processing this distribution
-               factory.close();
+
 
                if ((artifact != null) && (data != null)) {
                        LOG.info("Update to SDN-C succeeded");
 
 import java.util.Properties;
 
 import org.openecomp.sdc.api.consumer.IConfiguration;
-import org.openecomp.sdc.utils.ArtifactTypeEnum;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
                        relevantArtifactTypes = new LinkedList<>();
 
                        for (String artifactType : artifactTypes) {
-                               try {
-                                       if (ArtifactTypeEnum.valueOf(artifactType) != null) {
-                                                       relevantArtifactTypes.add(artifactType);
-                                       } else {
-                                               LOG.warn("Skipping unrecognized artifact type {}", artifactType);
-                                       }
-                               } catch (Exception e) {
 
-                                       LOG.warn("Caught exception validating artifact type {}", artifactType, e);
-                               }
+                               relevantArtifactTypes.add(artifactType);
 
                        }
 
 
        @Override
        public boolean isFilterInEmptyResources() {
-               // TODO Auto-generated method stub
+               return false;
+       }
+
+       @Override
+       public Boolean isUseHttpsWithDmaap() {
                return false;
        }
 
 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 
 import org.openecomp.sdc.tosca.parser.api.ISdcCsarHelper;
 import org.openecomp.sdc.tosca.parser.impl.SdcPropertyNames;
-import org.openecomp.sdc.toscaparser.api.Metadata;
 import org.openecomp.sdc.toscaparser.api.NodeTemplate;
+import org.openecomp.sdc.toscaparser.api.elements.Metadata;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 public class SdncVFModel extends SdncBaseModel {
-       
+
        private static final Logger LOG = LoggerFactory
                        .getLogger(SdncVFModel.class);
 
                super(sdcCsarHelper, nodeTemplate);
 
                // extract metadata
-               Metadata metadata = nodeTemplate.getMetadata();
+               Metadata metadata = nodeTemplate.getMetaData();
                addParameter("name", extractValue(metadata, SdcPropertyNames.PROPERTY_NAME_NAME));
-               addParameter("vendor", extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_RESOURCEVENDOR)); 
-               addParameter("vendor_version", extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_RESOURCEVENDORRELEASE)); 
-               
+               addParameter("vendor", extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_RESOURCEVENDOR));
+               addParameter("vendor_version", extractValue (metadata, SdcPropertyNames.PROPERTY_NAME_RESOURCEVENDORRELEASE));
+
                // extract properties
                addParameter("ecomp_generated_naming", extractBooleanValue(nodeTemplate, SdcPropertyNames.PROPERTY_NAME_VNFECOMPNAMING_ECOMPGENERATEDNAMING));
                addParameter("naming_policy", extractValue(nodeTemplate, SdcPropertyNames.PROPERTY_NAME_VNFECOMPNAMING_NAMINGPOLICY));
 
 package org.onap.ccsdk.sli.northbound.uebclient;
 
-import static org.junit.Assert.*;
+import static org.mockito.Mockito.mock;
+
+import java.io.File;
+import java.nio.file.DirectoryStream;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.StandardCopyOption;
 
+import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 import org.openecomp.sdc.api.IDistributionClient;
 import org.openecomp.sdc.api.notification.INotificationData;
-
-import static org.mockito.Mockito.mock;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 public class TestSdncUebCallback {
+
+        private static final Logger LOG = LoggerFactory
+                   .getLogger(TestSdncUebCallback.class);
        SdncUebConfiguration config;
 
        @Before
                config = new SdncUebConfiguration("src/test/resources");
        }
 
+       @After
+       public void tearDown() throws Exception {
+               // Move anything in archive back to incoming
+        String curFileName = "";
+
+        Path incomingPath = new File(config.getIncomingDir()).toPath();
+        File archiveDir = new File(config.getArchiveDir());
+        try (DirectoryStream<Path> stream = Files.newDirectoryStream(archiveDir.toPath())) {
+            for (Path file: stream) {
+                       Files.move(file, incomingPath.resolve(file.getFileName()), StandardCopyOption.REPLACE_EXISTING);
+            }
+        } catch (Exception x) {
+            // IOException can never be thrown by the iteration.
+            // In this snippet, it can only be thrown by newDirectoryStream.
+            LOG.warn("Cannot replace spool file {}", curFileName, x);
+        }
+
+       }
+
        @Test
        public void test() {
 
 
--- /dev/null
+###
+# ============LICENSE_START=======================================================
+# openECOMP : SDN-C
+# ================================================================================
+# Copyright (C) 2017 AT&T Intellectual Property. All rights
+#                      reserved.
+# ================================================================================
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ============LICENSE_END=========================================================
+###
+
+log4j.rootLogger=DEBUG,CONSOLE
+
+# CONSOLE is set to be a ConsoleAppender using a PatternLayout.
+log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
+log4j.appender.CONSOLE.Threshold=DEBUG
+log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
+log4j.appender.CONSOLE.layout.ConversionPattern=%p %d{yyyy-MM-dd HH:mm:ss.SSS Z} %c{1} - %m%n
+
+
 
-org.openecomp.sdnc.uebclient.asdc-address=localhost:1234
-org.openecomp.sdnc.uebclient.consumer-group=ccsdk1
-org.openecomp.sdnc.uebclient.consumer-id=localhost_ccsdk1
-org.openecomp.sdnc.uebclient.environment-name=UNITTEST
-org.openecomp.sdnc.uebclient.password=123456
-org.openecomp.sdnc.uebclient.user=test
-org.openecomp.sdnc.uebclient.sdnc-user=test
-org.openecomp.sdnc.uebclient.sdnc-passwd=test
-org.openecomp.sdnc.uebclient.asdc-api-base-url=http://localhost:8282/restconf/operations/
-org.openecomp.sdnc.uebclient.asdc-api-namespace=org:onap:ccsdk
-org.openecomp.sdnc.uebclient.spool.incoming=src/test/resources/incoming
-org.openecomp.sdnc.uebclient.spool.archive=src/test/resources/archive
-org.openecomp.sdnc.uebclient.polling-interval=30
-org.openecomp.sdnc.uebclient.polling-timeout=15
-org.openecomp.sdnc.uebclient.relevant-artifact-types=YANG_XML,VF_LICENSE,TOSCA_TEMPLATE,TOSCA_CSAR,UCPE_LAYER_2_CONFIGURATION
-org.openecomp.sdnc.uebclient.activate-server-tls-auth=false
-org.openecomp.sdnc.uebclient.keystore-path=
-org.openecomp.sdnc.uebclient.keystore-password=
-org.openecomp.sdnc.uebclient.xslt-path-list=src/main/resources/removeNs.xslt,src/main/resources/normalizeTagNames.xslt
+org.onap.ccsdk.sli.northbound.uebclient.asdc-address=localhost:1234
+org.onap.ccsdk.sli.northbound.uebclient.consumer-group=ccsdk1
+org.onap.ccsdk.sli.northbound.uebclient.consumer-id=localhost_ccsdk1
+org.onap.ccsdk.sli.northbound.uebclient.environment-name=UNITTEST
+org.onap.ccsdk.sli.northbound.uebclient.password=123456
+org.onap.ccsdk.sli.northbound.uebclient.user=test
+org.onap.ccsdk.sli.northbound.uebclient.sdnc-user=test
+org.onap.ccsdk.sli.northbound.uebclient.sdnc-passwd=test
+org.onap.ccsdk.sli.northbound.uebclient.asdc-api-base-url=http://localhost:8282/restconf/operations/
+org.onap.ccsdk.sli.northbound.uebclient.asdc-api-namespace=org:onap:ccsdk
+org.onap.ccsdk.sli.northbound.uebclient.spool.incoming=src/test/resources/incoming
+org.onap.ccsdk.sli.northbound.uebclient.spool.archive=src/test/resources/archive
+org.onap.ccsdk.sli.northbound.uebclient.polling-interval=30
+org.onap.ccsdk.sli.northbound.uebclient.polling-timeout=15
+org.onap.ccsdk.sli.northbound.uebclient.relevant-artifact-types=YANG_XML,VF_LICENSE,TOSCA_TEMPLATE,TOSCA_CSAR,UCPE_LAYER_2_CONFIGURATION
+org.onap.ccsdk.sli.northbound.uebclient.activate-server-tls-auth=false
+org.onap.ccsdk.sli.northbound.uebclient.keystore-path=
+org.onap.ccsdk.sli.northbound.uebclient.keystore-password=
+org.onap.ccsdk.sli.northbound.uebclient.xslt-path-list=
\ No newline at end of file